From 5d93cf4a7f01474d3ab4d4146607b419c933df82 Mon Sep 17 00:00:00 2001 From: bulatova_karina Date: Sun, 5 May 2024 16:59:47 +0400 Subject: [PATCH] =?UTF-8?q?=D0=B2=D1=80=D0=BE=D0=B4=D0=B5=20=D0=B7=D0=B0?= =?UTF-8?q?=D1=80=D0=B0=D0=B1=D0=BE=D1=82=D0=B0=D0=BB=D0=B0=20=D0=B2=D1=82?= =?UTF-8?q?=D0=BE=D1=80=D0=B0=D1=8F=20=D1=83=D1=81=D0=BB=D0=BE=D0=B6=D0=BD?= =?UTF-8?q?=D0=B5=D0=BD=D0=BA=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../BusinessLogics/ComponentLogic.cs | 2 +- .../BusinessLogics/ComputerLogic.cs | 49 +----------- .../BusinessLogics/OrderLogic.cs | 72 ------------------ .../BusinessLogics/ShopLogic.cs | 68 ----------------- .../StoragesContracts/IComponentStorage.cs | 2 +- .../StoragesContracts/IComputerStorage.cs | 2 +- .../StoragesContracts/IOrderStorage.cs | 30 -------- .../DataFileSingleton.cs | 75 ------------------- .../Implements/ComponentStorage.cs | 45 ++++++----- .../Implements/ComputerStorage.cs | 46 +++++++----- .../Implements/OrderStorage.cs | 51 +------------ .../Implements/ShopStorage.cs | 56 -------------- .../Models/Component.cs | 13 ++-- .../Models/Computer.cs | 25 ++++--- .../ComputersShopFileImplement/Models/Shop.cs | 53 ------------- .../DataListSingleton.cs | 25 ------- .../Implements/ComponentStorage.cs | 2 +- .../Implements/ComputerStorage.cs | 2 +- .../Implements/OrderStorage.cs | 39 ---------- .../Implements/ShopStorage.cs | 55 -------------- .../ComputersShopListImplement/Models/Shop.cs | 35 --------- .../ComputersShopView/FormMain.Designer.cs | 15 ++-- .../ComputersShopView/FormShops.Designer.cs | 14 ++-- ComputersShop/ComputersShopView/Program.cs | 2 +- 24 files changed, 101 insertions(+), 677 deletions(-) diff --git a/ComputersShop/ComputersShopBusinessLogic/BusinessLogics/ComponentLogic.cs b/ComputersShop/ComputersShopBusinessLogic/BusinessLogics/ComponentLogic.cs index 37626aa..d8ce116 100644 --- a/ComputersShop/ComputersShopBusinessLogic/BusinessLogics/ComponentLogic.cs +++ b/ComputersShop/ComputersShopBusinessLogic/BusinessLogics/ComponentLogic.cs @@ -24,7 +24,7 @@ namespace ComputersShopBusinessLogic.BusinessLogics public List? ReadList(ComponentSearchModel? model) { _logger.LogInformation("ReadList. ComponentName:{ComponentName}. Id:{Id}", model?.ComponentName, model?.Id); - var list = model == null ? _componentStorage.GetFullList() : _componentStorage.GetFiltredList(model); + var list = model == null ? _componentStorage.GetFullList() : _componentStorage.GetFilteredList(model); if (list == null) { _logger.LogWarning("ReadList return null list"); diff --git a/ComputersShop/ComputersShopBusinessLogic/BusinessLogics/ComputerLogic.cs b/ComputersShop/ComputersShopBusinessLogic/BusinessLogics/ComputerLogic.cs index 3c77dda..b50fc43 100644 --- a/ComputersShop/ComputersShopBusinessLogic/BusinessLogics/ComputerLogic.cs +++ b/ComputersShop/ComputersShopBusinessLogic/BusinessLogics/ComputerLogic.cs @@ -15,33 +15,17 @@ namespace ComputersShopBusinessLogic.BusinessLogics public class ComputerLogic : IComputerLogic { private readonly ILogger _logger; - - /// - /// Взаимодействие с хранилищем изделий - /// private readonly IComputerStorage _computerStorage; - - /// - /// Конструктор - /// - /// - /// public ComputerLogic(ILogger logger, IComputerStorage computerStorage) { _logger = logger; _computerStorage = computerStorage; } - - /// - /// Получение списка - /// - /// - /// public List? ReadList(ComputerSearchModel? model) { _logger.LogInformation("ReadList. ComputerName:{ComputerName}.Id:{ Id}", model?.ComputerName, model?.Id); - var list = model == null ? _computerStorage.GetFullList() : _computerStorage.GetFiltredList(model); + var list = model == null ? _computerStorage.GetFullList() : _computerStorage.GetFilteredList(model); if (list == null) { _logger.LogWarning("ReadList return null list"); @@ -51,13 +35,6 @@ namespace ComputersShopBusinessLogic.BusinessLogics _logger.LogInformation("ReadList. Count:{Count}", list.Count); return list; } - - /// - /// Получение отдельной записи - /// - /// - /// - /// public ComputerViewModel? ReadElement(ComputerSearchModel model) { if (model == null) @@ -77,12 +54,6 @@ namespace ComputersShopBusinessLogic.BusinessLogics _logger.LogInformation("ReadElement find. Id:{Id}", element.Id); return element; } - - /// - /// Создание записи - /// - /// - /// public bool Create(ComputerBindingModel model) { CheckModel(model); @@ -94,12 +65,6 @@ namespace ComputersShopBusinessLogic.BusinessLogics } return true; } - - /// - /// Изменение записи - /// - /// - /// public bool Update(ComputerBindingModel model) { CheckModel(model); @@ -111,12 +76,6 @@ namespace ComputersShopBusinessLogic.BusinessLogics } return true; } - - /// - /// Удаление записи - /// - /// - /// public bool Delete(ComputerBindingModel model) { CheckModel(model, false); @@ -129,12 +88,6 @@ namespace ComputersShopBusinessLogic.BusinessLogics } return true; } - - /// - /// Проверка модели изделия - /// - /// - /// private void CheckModel(ComputerBindingModel model, bool withParams = true) { if (model == null) diff --git a/ComputersShop/ComputersShopBusinessLogic/BusinessLogics/OrderLogic.cs b/ComputersShop/ComputersShopBusinessLogic/BusinessLogics/OrderLogic.cs index 37e534f..1027921 100644 --- a/ComputersShop/ComputersShopBusinessLogic/BusinessLogics/OrderLogic.cs +++ b/ComputersShop/ComputersShopBusinessLogic/BusinessLogics/OrderLogic.cs @@ -17,32 +17,10 @@ namespace ComputersShopBusinessLogic.BusinessLogics public class OrderLogic : IOrderLogic { private readonly ILogger _logger; - - /// - /// Взаимодействие с хранилищем заказов - /// private readonly IOrderStorage _orderStorage; - - /// - /// Взаимодействие с хранилищем магазинов - /// private IShopStorage _shopStorage; - - /// - /// Бизнес-логика магазинов - /// private IShopLogic _shopLogic; - - /// - /// Взаимодействие с хранилищем изделий - /// private IComputerStorage _computerStorage; - - /// - /// Конструктор - /// - /// - /// public OrderLogic(ILogger logger, IOrderStorage orderStorage, IShopStorage shopStorage, IShopLogic shopLogic, IComputerStorage computerStorage) { _logger = logger; @@ -51,12 +29,6 @@ namespace ComputersShopBusinessLogic.BusinessLogics _shopLogic = shopLogic; _computerStorage = computerStorage; } - - /// - /// Получение списка - /// - /// - /// public List? ReadList(OrderSearchModel? model) { _logger.LogInformation("ReadList. Order.Id:{ Id}", model?.Id); @@ -71,12 +43,6 @@ namespace ComputersShopBusinessLogic.BusinessLogics _logger.LogInformation("ReadList. Count:{Count}", list.Count); return list; } - - /// - /// Создание заказа - /// - /// - /// public bool CreateOrder(OrderBindingModel model) { CheckModel(model); @@ -95,42 +61,18 @@ namespace ComputersShopBusinessLogic.BusinessLogics } return true; } - - /// - /// Смена статуса заказа (Выполняется) - /// - /// - /// public bool TakeOrderInWork(OrderBindingModel model) { return StatusUpdate(model, OrderStatus.Выполняется); } - - /// - /// Смена статуса заказа (Выдан) - /// - /// - /// public bool FinishOrder(OrderBindingModel model) { return StatusUpdate(model, OrderStatus.Выдан); } - - /// - /// Смена статуса заказа (Готов) - /// - /// - /// public bool DeliveryOrder(OrderBindingModel model) { return StatusUpdate(model, OrderStatus.Готов); } - - /// - /// Проверка модели заказа - /// - /// - /// private void CheckModel(OrderBindingModel model, bool withParams = true) { if (model == null) @@ -155,13 +97,6 @@ namespace ComputersShopBusinessLogic.BusinessLogics } _logger.LogInformation("Order. OrderID:{Id}.Sum:{ Sum}. ComputerId: { ComputerId}", model.Id, model.Sum, model.ComputerId); } - - /// - /// Смена статуса заказа - /// - /// - /// - /// private bool StatusUpdate(OrderBindingModel model, OrderStatus newStatus) { var element = _orderStorage.GetElement(new OrderSearchModel @@ -211,13 +146,6 @@ namespace ComputersShopBusinessLogic.BusinessLogics } return true; } - - /// - /// Проверка заказа - /// - /// - /// - /// public bool CheckSupply(IComputerModel model, int count) { if (count <= 0) diff --git a/ComputersShop/ComputersShopBusinessLogic/BusinessLogics/ShopLogic.cs b/ComputersShop/ComputersShopBusinessLogic/BusinessLogics/ShopLogic.cs index cf5f308..f5eba06 100644 --- a/ComputersShop/ComputersShopBusinessLogic/BusinessLogics/ShopLogic.cs +++ b/ComputersShop/ComputersShopBusinessLogic/BusinessLogics/ShopLogic.cs @@ -16,28 +16,12 @@ namespace ComputersShopBusinessLogic.BusinessLogics public class ShopLogic : IShopLogic { private readonly ILogger _logger; - - /// - /// Взаимодействие с хранилищем магазинов - /// private readonly IShopStorage _shopStorage; - - /// - /// Конструктор - /// - /// - /// public ShopLogic(ILogger logger, IShopStorage shopStorage) { _logger = logger; _shopStorage = shopStorage; } - - /// - /// Получение списка - /// - /// - /// public List? ReadList(ShopSearchModel? model) { _logger.LogInformation("ReadList. ShopName:{ShopName}.Id:{ Id}", model?.ShopName, model?.Id); @@ -52,13 +36,6 @@ namespace ComputersShopBusinessLogic.BusinessLogics _logger.LogInformation("ReadList. Count:{Count}", list.Count); return list; } - - /// - /// Получение отдельной записи - /// - /// - /// - /// public ShopViewModel? ReadElement(ShopSearchModel model) { if (model == null) @@ -78,12 +55,6 @@ namespace ComputersShopBusinessLogic.BusinessLogics _logger.LogInformation("ReadElement find. Id:{Id}", element.Id); return element; } - - /// - /// Создание записи - /// - /// - /// public bool Create(ShopBindingModel model) { CheckModel(model); @@ -95,12 +66,6 @@ namespace ComputersShopBusinessLogic.BusinessLogics } return true; } - - /// - /// Изменение записи - /// - /// - /// public bool Update(ShopBindingModel model) { CheckModel(model); @@ -112,12 +77,6 @@ namespace ComputersShopBusinessLogic.BusinessLogics } return true; } - - /// - /// Удаление записи - /// - /// - /// public bool Delete(ShopBindingModel model) { CheckModel(model, false); @@ -130,16 +89,6 @@ namespace ComputersShopBusinessLogic.BusinessLogics } return true; } - - /// - /// Добавление изделия в магазин - /// - /// - /// - /// - /// - /// - /// public bool AddComputerInShop(ShopSearchModel model, IComputerModel computer, int count) { if (model == null) @@ -188,15 +137,6 @@ namespace ComputersShopBusinessLogic.BusinessLogics }); return true; } - - /// - /// Продажа изделий - /// - /// - /// - /// - /// - /// public bool SellComputers(IComputerModel computer, int count) { if (computer == null) @@ -216,14 +156,6 @@ namespace ComputersShopBusinessLogic.BusinessLogics _logger.LogInformation("Selling failed"); return false; } - - /// - /// Проверка модели магазина - /// - /// - /// - /// - /// private void CheckModel(ShopBindingModel model, bool withParams = true) { if (model == null) diff --git a/ComputersShop/ComputersShopContracts/StoragesContracts/IComponentStorage.cs b/ComputersShop/ComputersShopContracts/StoragesContracts/IComponentStorage.cs index d819f35..644ba85 100644 --- a/ComputersShop/ComputersShopContracts/StoragesContracts/IComponentStorage.cs +++ b/ComputersShop/ComputersShopContracts/StoragesContracts/IComponentStorage.cs @@ -13,7 +13,7 @@ namespace ComputersShopContracts.StoragesContracts public interface IComponentStorage { List GetFullList(); - List GetFiltredList(ComponentSearchModel model); + List GetFilteredList(ComponentSearchModel model); ComponentViewModel? GetElement(ComponentSearchModel model); ComponentViewModel? Insert(ComponentBindingModel model); ComponentViewModel? Update(ComponentBindingModel model); diff --git a/ComputersShop/ComputersShopContracts/StoragesContracts/IComputerStorage.cs b/ComputersShop/ComputersShopContracts/StoragesContracts/IComputerStorage.cs index 2dcf346..fd22441 100644 --- a/ComputersShop/ComputersShopContracts/StoragesContracts/IComputerStorage.cs +++ b/ComputersShop/ComputersShopContracts/StoragesContracts/IComputerStorage.cs @@ -13,7 +13,7 @@ namespace ComputersShopContracts.StoragesContracts public interface IComputerStorage { List GetFullList(); - List GetFiltredList(ComputerSearchModel model); + List GetFilteredList(ComputerSearchModel model); ComputerViewModel? GetElement(ComputerSearchModel model); ComputerViewModel? Insert(ComputerBindingModel model); ComputerViewModel? Update(ComputerBindingModel model); diff --git a/ComputersShop/ComputersShopContracts/StoragesContracts/IOrderStorage.cs b/ComputersShop/ComputersShopContracts/StoragesContracts/IOrderStorage.cs index 7b156ec..67d7e47 100644 --- a/ComputersShop/ComputersShopContracts/StoragesContracts/IOrderStorage.cs +++ b/ComputersShop/ComputersShopContracts/StoragesContracts/IOrderStorage.cs @@ -12,40 +12,10 @@ namespace ComputersShopContracts.StoragesContracts public interface IOrderStorage { List GetFullList(); - - /// - /// Получение фильтрованного списка - /// - /// - /// List GetFilteredList(OrderSearchModel model); - - /// - /// Получение элемента - /// - /// - /// OrderViewModel? GetElement(OrderSearchModel model); - - /// - /// Добавление элемента - /// - /// - /// OrderViewModel? Insert(OrderBindingModel model); - - /// - /// Редактирование элемента - /// - /// - /// OrderViewModel? Update(OrderBindingModel model); - - /// - /// Удаление элемента - /// - /// - /// OrderViewModel? Delete(OrderBindingModel model); } } \ No newline at end of file diff --git a/ComputersShop/ComputersShopFileImplement/DataFileSingleton.cs b/ComputersShop/ComputersShopFileImplement/DataFileSingleton.cs index 72d3979..83a47b4 100644 --- a/ComputersShop/ComputersShopFileImplement/DataFileSingleton.cs +++ b/ComputersShop/ComputersShopFileImplement/DataFileSingleton.cs @@ -12,50 +12,14 @@ namespace ComputersShopFileImplement internal class DataFileSingleton { private static DataFileSingleton? _instance; - - /// - /// Название файла для хранения информации о компонентах - /// private readonly string ComponentFileName = "Component.xml"; - - /// - /// Название файла для хранения информации о заказах - /// private readonly string OrderFileName = "Order.xml"; - - /// - /// Название файла для хранения информации о изделиях - /// private readonly string ComputerFileName = "Computer.xml"; - - /// - /// Название файла для хранения информации о магазинах - /// private readonly string ShopFileName = "Shop.xml"; - - /// - /// Список классов-моделей компонентов - /// public List Components { get; set; } - - /// - /// Список классов-моделей заказов - /// public List Orders { get; set; } - - /// - /// Список классов-моделей изделий - /// public List Computers { get; set; } - - /// - /// Список классов-моделей магазина - /// public List Shops { get; set; } - - /// - /// Конструктор - /// private DataFileSingleton() { Components = LoadData(ComponentFileName, "Component", x => Component.Create(x)!)!; @@ -63,11 +27,6 @@ namespace ComputersShopFileImplement Orders = LoadData(OrderFileName, "Order", x => Order.Create(x)!)!; Shops = LoadData(ShopFileName, "Shop", x => Shop.Create(x)!)!; } - - /// - /// Получить ссылку на класс - /// - /// public static DataFileSingleton GetInstance() { if (_instance == null) @@ -76,35 +35,10 @@ namespace ComputersShopFileImplement } return _instance; } - - /// - /// Сохранение компонентов - /// public void SaveComponents() => SaveData(Components, ComponentFileName, "Components", x => x.GetXElement); - - /// - /// Сохранение изделий - /// public void SaveComputers() => SaveData(Computers, ComputerFileName, "Computers", x => x.GetXElement); - - /// - /// Сохранение заказов - /// public void SaveOrders() => SaveData(Orders, OrderFileName, "Orders", x => x.GetXElement); - - /// - /// Сохранение магазинов - /// public void SaveShops() => SaveData(Shops, ShopFileName, "Shops", x => x.GetXElement); - - /// - /// Метод для загрузки данных из xml-файла - /// - /// - /// - /// - /// - /// private static List? LoadData(string filename, string xmlNodeName, Func selectFunction) { if (File.Exists(filename)) @@ -113,15 +47,6 @@ namespace ComputersShopFileImplement } return new List(); } - - /// - /// Метод для сохранения данных в xml-файл - /// - /// - /// - /// - /// - /// private static void SaveData(List data, string filename, string xmlNodeName, Func selectFunction) { if (data != null) diff --git a/ComputersShop/ComputersShopFileImplement/Implements/ComponentStorage.cs b/ComputersShop/ComputersShopFileImplement/Implements/ComponentStorage.cs index f4613e8..a18d710 100644 --- a/ComputersShop/ComputersShopFileImplement/Implements/ComponentStorage.cs +++ b/ComputersShop/ComputersShopFileImplement/Implements/ComponentStorage.cs @@ -14,67 +14,76 @@ namespace ComputersShopFileImplement.Implements { public class ComponentStorage : IComponentStorage { - private readonly DataFileSingleton source; + private readonly DataFileSingleton _source; public ComponentStorage() { - source = DataFileSingleton.GetInstance(); + _source = DataFileSingleton.GetInstance(); } public List GetFullList() { - return source.Components.Select(x => x.GetViewModel).ToList(); + return _source.Components + .Select(x => x.GetViewModel) + .ToList(); } - public List GetFiltredList(ComponentSearchModel model) + public List GetFilteredList(ComponentSearchModel model) { if (string.IsNullOrEmpty(model.ComponentName)) { return new(); } - return source.Components + + return _source.Components .Where(x => x.ComponentName.Contains(model.ComponentName)) .Select(x => x.GetViewModel) .ToList(); } public ComponentViewModel? GetElement(ComponentSearchModel model) { - if (!string.IsNullOrEmpty(model.ComponentName) && !model.Id.HasValue) + if (string.IsNullOrEmpty(model.ComponentName) && !model.Id.HasValue) { return null; } - return source.Components - .FirstOrDefault(x => (!string.IsNullOrEmpty(model.ComponentName) && - x.ComponentName == model.ComponentName) || (model.Id.HasValue && - x.Id == model.Id))?.GetViewModel; + + return _source.Components + .FirstOrDefault(x => + (!string.IsNullOrEmpty(model.ComponentName) && + x.ComponentName == model.ComponentName) || + (model.Id.HasValue && x.Id == model.Id)) + ?.GetViewModel; } public ComponentViewModel? Insert(ComponentBindingModel model) { - model.Id = source.Components.Count > 0 ? source.Components.Max(x => x.Id) + 1 : 1; + model.Id = _source.Components.Count > 0 ? _source.Components.Max(x => x.Id) + 1 : 1; + var newComponent = Component.Create(model); if (newComponent == null) { return null; } - source.Components.Add(newComponent); - source.SaveComponents(); + + _source.Components.Add(newComponent); + _source.SaveComponents(); return newComponent.GetViewModel; } public ComponentViewModel? Update(ComponentBindingModel model) { - var component = source.Components.FirstOrDefault(x => x.Id == model.Id); + var component = _source.Components.FirstOrDefault(x => x.Id == model.Id); if (component == null) { return null; } + component.Update(model); - source.SaveComponents(); + _source.SaveComponents(); return component.GetViewModel; } public ComponentViewModel? Delete(ComponentBindingModel model) { - var element = source.Components.FirstOrDefault(x => x.Id == model.Id); + var element = _source.Components.FirstOrDefault(x => x.Id == model.Id); if (element != null) { - source.Components.Remove(element); - source.SaveComponents(); + _source.Components.Remove(element); + _source.SaveComponents(); return element.GetViewModel; } return null; diff --git a/ComputersShop/ComputersShopFileImplement/Implements/ComputerStorage.cs b/ComputersShop/ComputersShopFileImplement/Implements/ComputerStorage.cs index c8278ac..e5eb667 100644 --- a/ComputersShop/ComputersShopFileImplement/Implements/ComputerStorage.cs +++ b/ComputersShop/ComputersShopFileImplement/Implements/ComputerStorage.cs @@ -1,6 +1,7 @@ using System; using System.Collections.Generic; using System.Linq; +using System.Numerics; using System.Text; using System.Threading.Tasks; using ComputersShopContracts.BindingModels; @@ -13,67 +14,76 @@ namespace ComputersShopFileImplement.Implements { public class ComputerStorage : IComputerStorage { - private readonly DataFileSingleton source; + private readonly DataFileSingleton _source; public ComputerStorage() { - source = DataFileSingleton.GetInstance(); + _source = DataFileSingleton.GetInstance(); } public List GetFullList() { - return source.Computers.Select(x => x.GetViewModel).ToList(); + return _source.Computers + .Select(x => x.GetViewModel) + .ToList(); } - public List GetFiltredList(ComputerSearchModel model) + public List GetFilteredList(ComputerSearchModel model) { if (string.IsNullOrEmpty(model.ComputerName)) { return new(); } - return source.Computers + + return _source.Computers .Where(x => x.ComputerName.Contains(model.ComputerName)) .Select(x => x.GetViewModel) .ToList(); } public ComputerViewModel? GetElement(ComputerSearchModel model) { - if (!string.IsNullOrEmpty(model.ComputerName) && !model.Id.HasValue) + if (string.IsNullOrEmpty(model.ComputerName) && !model.Id.HasValue) { return null; } - return source.Computers - .FirstOrDefault(x => (!string.IsNullOrEmpty(model.ComputerName) && - x.ComputerName == model.ComputerName) || (model.Id.HasValue && - x.Id == model.Id))?.GetViewModel; + + return _source.Computers + .FirstOrDefault(x => + (!string.IsNullOrEmpty(model.ComputerName) && + x.ComputerName == model.ComputerName) || + (model.Id.HasValue && x.Id == model.Id)) + ?.GetViewModel; } public ComputerViewModel? Insert(ComputerBindingModel model) { - model.Id = source.Computers.Count > 0 ? source.Components.Max(x => x.Id) + 1 : 1; + model.Id = _source.Computers.Count > 0 ? _source.Computers.Max(x => x.Id) + 1 : 1; + var newComputer = Computer.Create(model); if (newComputer == null) { return null; } - source.Computers.Add(newComputer); - source.SaveComputers(); + + _source.Computers.Add(newComputer); + _source.SaveComputers(); return newComputer.GetViewModel; } public ComputerViewModel? Update(ComputerBindingModel model) { - var computer = source.Computers.FirstOrDefault(x => x.Id == model.Id); + var computer = _source.Computers.FirstOrDefault(x => x.Id == model.Id); if (computer == null) { return null; } + computer.Update(model); - source.SaveComputers(); + _source.SaveComputers(); return computer.GetViewModel; } public ComputerViewModel? Delete(ComputerBindingModel model) { - var element = source.Computers.FirstOrDefault(x => x.Id == model.Id); + var element = _source.Computers.FirstOrDefault(x => x.Id == model.Id); if (element != null) { - source.Computers.Remove(element); - source.SaveComputers(); + _source.Computers.Remove(element); + _source.SaveComputers(); return element.GetViewModel; } return null; diff --git a/ComputersShop/ComputersShopFileImplement/Implements/OrderStorage.cs b/ComputersShop/ComputersShopFileImplement/Implements/OrderStorage.cs index 5e187e9..9be75ba 100644 --- a/ComputersShop/ComputersShopFileImplement/Implements/OrderStorage.cs +++ b/ComputersShop/ComputersShopFileImplement/Implements/OrderStorage.cs @@ -14,31 +14,16 @@ namespace ComputersShopFileImplement.Implements public class OrderStorage : IOrderStorage { private readonly DataFileSingleton _source; - - /// - /// Конструктор - /// public OrderStorage() { _source = DataFileSingleton.GetInstance(); } - - /// - /// Получение полного списка - /// - /// public List GetFullList() { return _source.Orders .Select(x => GetViewModel(x)) .ToList(); } - - /// - /// Получение фильтрованного списка - /// - /// - /// public List GetFilteredList(OrderSearchModel model) { if (!model.Id.HasValue) @@ -51,12 +36,6 @@ namespace ComputersShopFileImplement.Implements .Select(x => GetViewModel(x)) .ToList(); } - - /// - /// Получение элемента - /// - /// - /// public OrderViewModel? GetElement(OrderSearchModel model) { if (!model.Id.HasValue) @@ -67,12 +46,6 @@ namespace ComputersShopFileImplement.Implements return GetViewModel(_source.Orders .FirstOrDefault(x => (model.Id.HasValue && x.Id == model.Id))); } - - /// - /// Добавление элемента - /// - /// - /// public OrderViewModel? Insert(OrderBindingModel model) { model.Id = _source.Orders.Count > 0 ? _source.Orders.Max(x => x.Id) + 1 : 1; @@ -87,12 +60,6 @@ namespace ComputersShopFileImplement.Implements _source.SaveOrders(); return GetViewModel(newOrder); } - - /// - /// Редактирование элемента - /// - /// - /// public OrderViewModel? Update(OrderBindingModel model) { var order = _source.Orders.FirstOrDefault(x => x.Id == model.Id); @@ -105,12 +72,6 @@ namespace ComputersShopFileImplement.Implements _source.SaveOrders(); return GetViewModel(order); } - - /// - /// Удаление элемента - /// - /// - /// public OrderViewModel? Delete(OrderBindingModel model) { var element = _source.Orders.FirstOrDefault(x => x.Id == model.Id); @@ -122,19 +83,13 @@ namespace ComputersShopFileImplement.Implements } return null; } - - /// - /// Получение модели заказа - /// - /// - /// private OrderViewModel GetViewModel(Order order) { var viewModel = order.GetViewModel; - var computer = _source.Computers.FirstOrDefault(x => x.Id == order.ComputerId); - if (computer != null) + var plane = _source.Computers.FirstOrDefault(x => x.Id == order.ComputerId); + if (plane != null) { - viewModel.ComputerName = computer.ComputerName; + viewModel.ComputerName = plane.ComputerName; } return viewModel; } diff --git a/ComputersShop/ComputersShopFileImplement/Implements/ShopStorage.cs b/ComputersShop/ComputersShopFileImplement/Implements/ShopStorage.cs index ebd3b0e..2595569 100644 --- a/ComputersShop/ComputersShopFileImplement/Implements/ShopStorage.cs +++ b/ComputersShop/ComputersShopFileImplement/Implements/ShopStorage.cs @@ -14,35 +14,17 @@ namespace ComputersShopFileImplement.Implements { public class ShopStorage : IShopStorage { - /// - /// Хранилище - /// private readonly DataFileSingleton _source; - - /// - /// Конструктор - /// public ShopStorage() { _source = DataFileSingleton.GetInstance(); } - - /// - /// Получение полного списка - /// - /// public List GetFullList() { return _source.Shops .Select(x => x.GetViewModel) .ToList(); } - - /// - /// Получение фильтрованного списка - /// - /// - /// public List GetFilteredList(ShopSearchModel model) { if (string.IsNullOrEmpty(model.ShopName)) @@ -55,12 +37,6 @@ namespace ComputersShopFileImplement.Implements .Select(x => x.GetViewModel) .ToList(); } - - /// - /// Получение элемента - /// - /// - /// public ShopViewModel? GetElement(ShopSearchModel model) { if (string.IsNullOrEmpty(model.ShopName) && !model.Id.HasValue) @@ -75,12 +51,6 @@ namespace ComputersShopFileImplement.Implements (model.Id.HasValue && x.Id == model.Id)) ?.GetViewModel; } - - /// - /// Добавление элемента - /// - /// - /// public ShopViewModel? Insert(ShopBindingModel model) { model.Id = _source.Shops.Count > 0 ? _source.Shops.Max(x => x.Id) + 1 : 1; @@ -95,12 +65,6 @@ namespace ComputersShopFileImplement.Implements _source.SaveShops(); return newShop.GetViewModel; } - - /// - /// Редактирование элемента - /// - /// - /// public ShopViewModel? Update(ShopBindingModel model) { var shop = _source.Shops.FirstOrDefault(x => x.Id == model.Id); @@ -113,12 +77,6 @@ namespace ComputersShopFileImplement.Implements _source.SaveShops(); return shop.GetViewModel; } - - /// - /// Удаление элемента - /// - /// - /// public ShopViewModel? Delete(ShopBindingModel model) { var element = _source.Shops.FirstOrDefault(x => x.Id == model.Id); @@ -130,13 +88,6 @@ namespace ComputersShopFileImplement.Implements } return null; } - - /// - /// Продажа изделий - /// - /// - /// - /// public bool SellComputers(IComputerModel model, int count) { var computer = _source.Computers.FirstOrDefault(x => x.Id == model.Id); @@ -174,13 +125,6 @@ namespace ComputersShopFileImplement.Implements _source.SaveShops(); return true; } - - /// - /// Проверка наличия в нужном количестве - /// - /// - /// - /// public bool CheckCount(IComputerModel model, int count) { int store = _source.Shops diff --git a/ComputersShop/ComputersShopFileImplement/Models/Component.cs b/ComputersShop/ComputersShopFileImplement/Models/Component.cs index 52a5e3c..73271e5 100644 --- a/ComputersShop/ComputersShopFileImplement/Models/Component.cs +++ b/ComputersShop/ComputersShopFileImplement/Models/Component.cs @@ -16,12 +16,13 @@ namespace ComputersShopFileImplement.Models public int Id { get; private set; } public string ComponentName { get; private set; } = string.Empty; public double Cost { get; set; } - public static Component? Create(ComponentBindingModel model) + public static Component? Create(ComponentBindingModel? model) { if (model == null) { return null; } + return new Component() { Id = model.Id, @@ -35,6 +36,7 @@ namespace ComputersShopFileImplement.Models { return null; } + return new Component() { Id = Convert.ToInt32(element.Attribute("Id")!.Value), @@ -42,12 +44,13 @@ namespace ComputersShopFileImplement.Models Cost = Convert.ToDouble(element.Element("Cost")!.Value) }; } - public void Update(ComponentBindingModel model) + public void Update(ComponentBindingModel? model) { if (model == null) { return; } + ComponentName = model.ComponentName; Cost = model.Cost; } @@ -58,8 +61,8 @@ namespace ComputersShopFileImplement.Models Cost = Cost }; public XElement GetXElement => new("Component", - new XAttribute("Id", Id), - new XElement("ComponentName", ComponentName), - new XElement("Cost", Cost.ToString())); + new XAttribute("Id", Id), + new XElement("ComponentName", ComponentName), + new XElement("Cost", Cost.ToString())); } } diff --git a/ComputersShop/ComputersShopFileImplement/Models/Computer.cs b/ComputersShop/ComputersShopFileImplement/Models/Computer.cs index afaa4d9..8cb0cb3 100644 --- a/ComputersShop/ComputersShopFileImplement/Models/Computer.cs +++ b/ComputersShop/ComputersShopFileImplement/Models/Computer.cs @@ -7,6 +7,7 @@ using ComputersShopContracts.BindingModels; using ComputersShopContracts.ViewModels; using ComputersShopDataModels.Models; using System.Xml.Linq; +using System.Numerics; namespace ComputersShopFileImplement.Models { @@ -24,19 +25,18 @@ namespace ComputersShopFileImplement.Models if (_computerComponents == null) { var source = DataFileSingleton.GetInstance(); - _computerComponents = Components.ToDictionary(x => x.Key, y => - ((source.Components.FirstOrDefault(z => z.Id == y.Key) as IComponentModel)!, - y.Value)); + _computerComponents = Components.ToDictionary(x => x.Key, y => ((source.Components.FirstOrDefault(z => z.Id == y.Key) as IComponentModel)!, y.Value)); } return _computerComponents; } } - public static Computer? Create(ComputerBindingModel model) + public static Computer? Create(ComputerBindingModel? model) { if (model == null) { return null; } + return new Computer() { Id = model.Id, @@ -51,24 +51,23 @@ namespace ComputersShopFileImplement.Models { return null; } + return new Computer() { Id = Convert.ToInt32(element.Attribute("Id")!.Value), ComputerName = element.Element("ComputerName")!.Value, Price = Convert.ToDouble(element.Element("Price")!.Value), - Components = - element.Element("ComputerComponents")!.Elements("ComputerComponent") - .ToDictionary(x => - Convert.ToInt32(x.Element("Key")?.Value), x => - Convert.ToInt32(x.Element("Value")?.Value)) + Components = element.Element("ComputerComponents")!.Elements("ComputerComponent") + .ToDictionary(x => Convert.ToInt32(x.Element("Key")?.Value), x => Convert.ToInt32(x.Element("Value")?.Value)) }; } - public void Update(ComputerBindingModel model) + public void Update(ComputerBindingModel? model) { if (model == null) { return; } + ComputerName = model.ComputerName; Price = model.Price; Components = model.ComputerComponents.ToDictionary(x => x.Key, x => x.Value.Item2); @@ -86,8 +85,10 @@ namespace ComputersShopFileImplement.Models new XElement("ComputerName", ComputerName), new XElement("Price", Price.ToString()), new XElement("ComputerComponents", Components.Select(x => - new XElement("ComputerComponent", new XElement("Key", x.Key), - new XElement("Value", x.Value))).ToArray())); + new XElement("ComputerComponent", + new XElement("Key", x.Key), + new XElement("Value", x.Value))) + .ToArray())); } } diff --git a/ComputersShop/ComputersShopFileImplement/Models/Shop.cs b/ComputersShop/ComputersShopFileImplement/Models/Shop.cs index a09d81f..cf5e85a 100644 --- a/ComputersShop/ComputersShopFileImplement/Models/Shop.cs +++ b/ComputersShop/ComputersShopFileImplement/Models/Shop.cs @@ -12,35 +12,11 @@ namespace ComputersShopFileImplement.Models { public class Shop : IShopModel { - /// - /// Идентификатор - /// public int Id { get; private set; } - - /// - /// Название магазина - /// public string ShopName { get; private set; } = string.Empty; - - /// - /// Адрес магазина - /// public string Address { get; private set; } = string.Empty; - - /// - /// Дата открытия магазина - /// public DateTime DateOpening { get; private set; } - - /// - /// Коллекция изделий магазина в виде - /// «идентификатор изделия – количество изделий» - /// public Dictionary Computers { get; private set; } = new(); - - /// - /// Коллекция изделий в магазине - /// private Dictionary? _shopComputers = null; public Dictionary ShopComputers { @@ -54,17 +30,7 @@ namespace ComputersShopFileImplement.Models return _shopComputers; } } - - /// - /// Максимальное количество изделий - /// public int MaxComputers { get; private set; } - - /// - /// Создание модели магазина из данных файла - /// - /// - /// public static Shop? Create(XElement element) { if (element == null) @@ -82,12 +48,6 @@ namespace ComputersShopFileImplement.Models MaxComputers = Convert.ToInt32(element.Element("MaxComputers")!.Value) }; } - - /// - /// Создание модели магазина - /// - /// - /// public static Shop? Create(ShopBindingModel? model) { if (model == null) @@ -105,11 +65,6 @@ namespace ComputersShopFileImplement.Models MaxComputers = model.MaxComputers }; } - - /// - /// Изменение модели магазина - /// - /// public void Update(ShopBindingModel? model) { if (model == null) @@ -124,10 +79,6 @@ namespace ComputersShopFileImplement.Models MaxComputers = model.MaxComputers; _shopComputers = null; } - - /// - /// Получение модели магазина - /// public ShopViewModel GetViewModel => new() { Id = Id, @@ -137,10 +88,6 @@ namespace ComputersShopFileImplement.Models ShopComputers = ShopComputers, MaxComputers = MaxComputers }; - - /// - /// Запись данных о модели магазина в файл - /// public XElement GetXElement => new("Shop", new XAttribute("Id", Id), new XElement("ShopName", ShopName), diff --git a/ComputersShop/ComputersShopListImplement/DataListSingleton.cs b/ComputersShop/ComputersShopListImplement/DataListSingleton.cs index 3b494bf..834470f 100644 --- a/ComputersShop/ComputersShopListImplement/DataListSingleton.cs +++ b/ComputersShop/ComputersShopListImplement/DataListSingleton.cs @@ -11,30 +11,10 @@ namespace AbstractShopListImplement public class DataListSingleton { private static DataListSingleton? _instance; - - /// - /// Список классов-моделей компонентов - /// public List Components { get; set; } - - /// - /// Список классов-моделей заказов - /// public List Orders { get; set; } - - /// - /// Список классов-моделей изделий - /// public List Computers { get; set; } - - /// - /// Список классов-моделей магазинов - /// public List Shops { get; set; } - - /// - /// Конструктор - /// private DataListSingleton() { Components = new List(); @@ -42,11 +22,6 @@ namespace AbstractShopListImplement Computers = new List(); Shops = new List(); } - - /// - /// Получить ссылку на класс - /// - /// public static DataListSingleton GetInstance() { if (_instance == null) diff --git a/ComputersShop/ComputersShopListImplement/Implements/ComponentStorage.cs b/ComputersShop/ComputersShopListImplement/Implements/ComponentStorage.cs index d9e9843..d2c1083 100644 --- a/ComputersShop/ComputersShopListImplement/Implements/ComponentStorage.cs +++ b/ComputersShop/ComputersShopListImplement/Implements/ComponentStorage.cs @@ -28,7 +28,7 @@ namespace ComputersShopListImplement.Implements } return result; } - public List GetFiltredList(ComponentSearchModel model) + public List GetFilteredList(ComponentSearchModel model) { var result = new List(); if (string.IsNullOrEmpty(model.ComponentName)) diff --git a/ComputersShop/ComputersShopListImplement/Implements/ComputerStorage.cs b/ComputersShop/ComputersShopListImplement/Implements/ComputerStorage.cs index df4ced8..ce9c38f 100644 --- a/ComputersShop/ComputersShopListImplement/Implements/ComputerStorage.cs +++ b/ComputersShop/ComputersShopListImplement/Implements/ComputerStorage.cs @@ -28,7 +28,7 @@ namespace ComputersShopListImplement.Implements } return result; } - public List GetFiltredList(ComputerSearchModel model) + public List GetFilteredList(ComputerSearchModel model) { var result = new List(); if (string.IsNullOrEmpty(model.ComputerName)) diff --git a/ComputersShop/ComputersShopListImplement/Implements/OrderStorage.cs b/ComputersShop/ComputersShopListImplement/Implements/OrderStorage.cs index 2b2be2d..a417571 100644 --- a/ComputersShop/ComputersShopListImplement/Implements/OrderStorage.cs +++ b/ComputersShop/ComputersShopListImplement/Implements/OrderStorage.cs @@ -15,19 +15,10 @@ namespace ComputersShopListImplement.Implements public class OrderStorage : IOrderStorage { private readonly DataListSingleton _source; - - /// - /// Конструктор - /// public OrderStorage() { _source = DataListSingleton.GetInstance(); } - - /// - /// Получение полного списка - /// - /// public List GetFullList() { var result = new List(); @@ -37,12 +28,6 @@ namespace ComputersShopListImplement.Implements } return result; } - - /// - /// Получение фильтрованного списка - /// - /// - /// public List GetFilteredList(OrderSearchModel model) { var result = new List(); @@ -60,12 +45,6 @@ namespace ComputersShopListImplement.Implements } return result; } - - /// - /// Получение элемента - /// - /// - /// public OrderViewModel? GetElement(OrderSearchModel model) { if (!model.Id.HasValue) @@ -82,12 +61,6 @@ namespace ComputersShopListImplement.Implements } return null; } - - /// - /// Добавление элемента - /// - /// - /// public OrderViewModel? Insert(OrderBindingModel model) { model.Id = 1; @@ -108,12 +81,6 @@ namespace ComputersShopListImplement.Implements _source.Orders.Add(newOrder); return newOrder.GetViewModel; } - - /// - /// Редактирование элемента - /// - /// - /// public OrderViewModel? Update(OrderBindingModel model) { foreach (var order in _source.Orders) @@ -126,12 +93,6 @@ namespace ComputersShopListImplement.Implements } return null; } - - /// - /// Удаление элемента - /// - /// - /// public OrderViewModel? Delete(OrderBindingModel model) { for (int i = 0; i < _source.Orders.Count; ++i) diff --git a/ComputersShop/ComputersShopListImplement/Implements/ShopStorage.cs b/ComputersShop/ComputersShopListImplement/Implements/ShopStorage.cs index 8eaadc0..a28d538 100644 --- a/ComputersShop/ComputersShopListImplement/Implements/ShopStorage.cs +++ b/ComputersShop/ComputersShopListImplement/Implements/ShopStorage.cs @@ -17,19 +17,10 @@ namespace ComputersShopListImplement.Implements public class ShopStorage : IShopStorage { private readonly DataListSingleton _source; - - /// - /// Конструктор - /// public ShopStorage() { _source = DataListSingleton.GetInstance(); } - - /// - /// Получение полного списка - /// - /// public List GetFullList() { var result = new List(); @@ -39,12 +30,6 @@ namespace ComputersShopListImplement.Implements } return result; } - - /// - /// Получение фильтрованного списка - /// - /// - /// public List GetFilteredList(ShopSearchModel model) { var result = new List(); @@ -62,12 +47,6 @@ namespace ComputersShopListImplement.Implements } return result; } - - /// - /// Получение элемента - /// - /// - /// public ShopViewModel? GetElement(ShopSearchModel model) { if (string.IsNullOrEmpty(model.ShopName) && !model.Id.HasValue) @@ -84,12 +63,6 @@ namespace ComputersShopListImplement.Implements } return null; } - - /// - /// Добавление элемента - /// - /// - /// public ShopViewModel? Insert(ShopBindingModel model) { model.Id = 1; @@ -110,12 +83,6 @@ namespace ComputersShopListImplement.Implements _source.Shops.Add(newShop); return newShop.GetViewModel; } - - /// - /// Редактирование элемента - /// - /// - /// public ShopViewModel? Update(ShopBindingModel model) { foreach (var shop in _source.Shops) @@ -128,12 +95,6 @@ namespace ComputersShopListImplement.Implements } return null; } - - /// - /// Удаление элемента - /// - /// - /// public ShopViewModel? Delete(ShopBindingModel model) { for (int i = 0; i < _source.Shops.Count; ++i) @@ -147,26 +108,10 @@ namespace ComputersShopListImplement.Implements } return null; } - - /// - /// Продажа изделий - /// - /// - /// - /// - /// public bool SellComputers(IComputerModel model, int count) { throw new NotImplementedException(); } - - /// - /// Проверка наличия в нужном количестве - /// - /// - /// - /// - /// public bool CheckCount(IComputerModel model, int count) { throw new NotImplementedException(); diff --git a/ComputersShop/ComputersShopListImplement/Models/Shop.cs b/ComputersShop/ComputersShopListImplement/Models/Shop.cs index 44c0c7e..759d5e6 100644 --- a/ComputersShop/ComputersShopListImplement/Models/Shop.cs +++ b/ComputersShop/ComputersShopListImplement/Models/Shop.cs @@ -13,41 +13,15 @@ namespace ComputersShopListImplement.Models public class Shop : IShopModel { public int Id { get; private set; } - - /// - /// Название магазина - /// public string ShopName { get; private set; } = string.Empty; - - /// - /// Адрес магазина - /// public string Address { get; private set; } = string.Empty; - - /// - /// Дата открытия магазина - /// public DateTime DateOpening { get; private set; } - - /// - /// Коллекция изделий в магазине - /// public Dictionary ShopComputers { get; private set; } = new Dictionary(); - - /// - /// Максимальное количество изделий - /// public int MaxComputers { get; private set; } - - /// - /// Создание модели магазина - /// - /// - /// public static Shop? Create(ShopBindingModel? model) { if (model == null) @@ -65,11 +39,6 @@ namespace ComputersShopListImplement.Models MaxComputers = model.MaxComputers }; } - - /// - /// Изменение модели магазина - /// - /// public void Update(ShopBindingModel? model) { if (model == null) @@ -83,10 +52,6 @@ namespace ComputersShopListImplement.Models ShopComputers = model.ShopComputers; MaxComputers = model.MaxComputers; } - - /// - /// Получение модели магазина - /// public ShopViewModel GetViewModel => new() { Id = Id, diff --git a/ComputersShop/ComputersShopView/FormMain.Designer.cs b/ComputersShop/ComputersShopView/FormMain.Designer.cs index a6f14b8..0c656bf 100644 --- a/ComputersShop/ComputersShopView/FormMain.Designer.cs +++ b/ComputersShop/ComputersShopView/FormMain.Designer.cs @@ -34,13 +34,13 @@ this.изделияToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.магазиныToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.поставкиToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.продажаИзделийToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.dataGridView = new System.Windows.Forms.DataGridView(); this.buttonCreateOrder = new System.Windows.Forms.Button(); this.buttonTakeOrderInWork = new System.Windows.Forms.Button(); this.buttonOrderReady = new System.Windows.Forms.Button(); this.buttonIssuedOrder = new System.Windows.Forms.Button(); this.buttonRef = new System.Windows.Forms.Button(); - this.продажаИзделийToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.menuStrip1.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.dataGridView)).BeginInit(); this.SuspendLayout(); @@ -96,6 +96,13 @@ this.поставкиToolStripMenuItem.Text = "Поставки"; this.поставкиToolStripMenuItem.Click += new System.EventHandler(this.ПоставкиToolStripMenuItem_Click); // + // продажаИзделийToolStripMenuItem + // + this.продажаИзделийToolStripMenuItem.Name = "продажаИзделийToolStripMenuItem"; + this.продажаИзделийToolStripMenuItem.Size = new System.Drawing.Size(224, 26); + this.продажаИзделийToolStripMenuItem.Text = "Продажа изделий"; + this.продажаИзделийToolStripMenuItem.Click += new System.EventHandler(this.ПродажаизделийToolStripMenuItem_Click); + // // dataGridView // this.dataGridView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) @@ -159,12 +166,6 @@ this.buttonRef.UseVisualStyleBackColor = true; this.buttonRef.Click += new System.EventHandler(this.ButtonRef_Click); // - // продажаИзделийToolStripMenuItem - // - this.продажаИзделийToolStripMenuItem.Name = "продажаИзделийToolStripMenuItem"; - this.продажаИзделийToolStripMenuItem.Size = new System.Drawing.Size(224, 26); - this.продажаИзделийToolStripMenuItem.Text = "Продажа изделий"; - // // FormMain // this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 20F); diff --git a/ComputersShop/ComputersShopView/FormShops.Designer.cs b/ComputersShop/ComputersShopView/FormShops.Designer.cs index e8fdfde..89b4bc9 100644 --- a/ComputersShop/ComputersShopView/FormShops.Designer.cs +++ b/ComputersShop/ComputersShopView/FormShops.Designer.cs @@ -39,16 +39,16 @@ // dataGridViewShops // this.dataGridViewShops.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; - this.dataGridViewShops.Location = new System.Drawing.Point(1, 0); + this.dataGridViewShops.Location = new System.Drawing.Point(3, 1); this.dataGridViewShops.Name = "dataGridViewShops"; this.dataGridViewShops.RowHeadersWidth = 51; this.dataGridViewShops.RowTemplate.Height = 29; - this.dataGridViewShops.Size = new System.Drawing.Size(415, 453); + this.dataGridViewShops.Size = new System.Drawing.Size(572, 453); this.dataGridViewShops.TabIndex = 0; // // buttonAdd // - this.buttonAdd.Location = new System.Drawing.Point(434, 39); + this.buttonAdd.Location = new System.Drawing.Point(605, 41); this.buttonAdd.Name = "buttonAdd"; this.buttonAdd.Size = new System.Drawing.Size(94, 29); this.buttonAdd.TabIndex = 1; @@ -58,7 +58,7 @@ // // buttonUpdate // - this.buttonUpdate.Location = new System.Drawing.Point(434, 94); + this.buttonUpdate.Location = new System.Drawing.Point(605, 96); this.buttonUpdate.Name = "buttonUpdate"; this.buttonUpdate.Size = new System.Drawing.Size(94, 29); this.buttonUpdate.TabIndex = 2; @@ -68,7 +68,7 @@ // // buttonDelete // - this.buttonDelete.Location = new System.Drawing.Point(434, 143); + this.buttonDelete.Location = new System.Drawing.Point(605, 145); this.buttonDelete.Name = "buttonDelete"; this.buttonDelete.Size = new System.Drawing.Size(94, 29); this.buttonDelete.TabIndex = 3; @@ -78,7 +78,7 @@ // // buttonRefresh // - this.buttonRefresh.Location = new System.Drawing.Point(434, 195); + this.buttonRefresh.Location = new System.Drawing.Point(605, 197); this.buttonRefresh.Name = "buttonRefresh"; this.buttonRefresh.Size = new System.Drawing.Size(94, 29); this.buttonRefresh.TabIndex = 4; @@ -90,7 +90,7 @@ // this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 20F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(554, 450); + this.ClientSize = new System.Drawing.Size(733, 450); this.Controls.Add(this.buttonRefresh); this.Controls.Add(this.buttonDelete); this.Controls.Add(this.buttonUpdate); diff --git a/ComputersShop/ComputersShopView/Program.cs b/ComputersShop/ComputersShopView/Program.cs index c0d885b..8071061 100644 --- a/ComputersShop/ComputersShopView/Program.cs +++ b/ComputersShop/ComputersShopView/Program.cs @@ -1,7 +1,7 @@ using ComputersShopBusinessLogic.BusinessLogics; using ComputersShopContracts.BusinessLogicsContracts; using ComputersShopContracts.StoragesContracts; -using ComputersShopListImplement.Implements; +using ComputersShopFileImplement.Implements; using ComputersShopView; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Logging;