From be4dd3804f6efde7b61e7de2f7665429d2d33461 Mon Sep 17 00:00:00 2001 From: "ns.potapov" Date: Mon, 11 Mar 2024 09:55:49 +0400 Subject: [PATCH 01/20] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=D0=B0=20=D0=BC=D0=BE=D0=B4=D0=B5=D0=BB=D1=8C=20?= =?UTF-8?q?=D0=BC=D0=B0=D0=B3=D0=B0=D0=B7=D0=B8=D0=BD=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../SecuritySystemDataModels/Models/IShopModel.cs | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 SecuritySystem/SecuritySystemDataModels/Models/IShopModel.cs diff --git a/SecuritySystem/SecuritySystemDataModels/Models/IShopModel.cs b/SecuritySystem/SecuritySystemDataModels/Models/IShopModel.cs new file mode 100644 index 0000000..da3eecc --- /dev/null +++ b/SecuritySystem/SecuritySystemDataModels/Models/IShopModel.cs @@ -0,0 +1,10 @@ +namespace SecuritySystemDataModels.Models +{ + public interface IShopModel : IId + { + string Name { get; } + string Address { get; } + DateTime OpeningDate { get; } + Dictionary ShopSecures { get; } + } +} From ab47cb9f2f27a23feab60faed15ba82053486698 Mon Sep 17 00:00:00 2001 From: "ns.potapov" Date: Mon, 11 Mar 2024 09:56:26 +0400 Subject: [PATCH 02/20] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=D0=B0=20binding=20=D0=BC=D0=BE=D0=B4=D0=B5=D0=BB?= =?UTF-8?q?=D1=8C=20=D0=BC=D0=B0=D0=B3=D0=B0=D0=B7=D0=B8=D0=BD=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../BindingModels/ShopBindingModel.cs | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 SecuritySystem/SecuritySystemContracts/BindingModels/ShopBindingModel.cs diff --git a/SecuritySystem/SecuritySystemContracts/BindingModels/ShopBindingModel.cs b/SecuritySystem/SecuritySystemContracts/BindingModels/ShopBindingModel.cs new file mode 100644 index 0000000..caeb197 --- /dev/null +++ b/SecuritySystem/SecuritySystemContracts/BindingModels/ShopBindingModel.cs @@ -0,0 +1,17 @@ +using SecuritySystemDataModels.Models; + +namespace SecuritySystemContracts.BindingModels +{ + public class ShopBindingModel : IShopModel + { + public int Id { get; set; } + + public string Name { get; set; } = string.Empty; + + public string Address { get; set; } = string.Empty; + + public DateTime OpeningDate { get; set; } + + public Dictionary ShopSecures { get; set; } = new(); + } +} From fa9fa932bfe9c25cab992091b2bbbe3cc7c0c751 Mon Sep 17 00:00:00 2001 From: "ns.potapov" Date: Mon, 11 Mar 2024 09:57:19 +0400 Subject: [PATCH 03/20] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=D0=B0=20search=20=D0=BC=D0=BE=D0=B4=D0=B5=D0=BB?= =?UTF-8?q?=D1=8C=20=D0=BC=D0=B0=D0=B3=D0=B0=D0=B7=D0=B8=D0=BD=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../SearchModels/ShopSearchModel.cs | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 SecuritySystem/SecuritySystemContracts/SearchModels/ShopSearchModel.cs diff --git a/SecuritySystem/SecuritySystemContracts/SearchModels/ShopSearchModel.cs b/SecuritySystem/SecuritySystemContracts/SearchModels/ShopSearchModel.cs new file mode 100644 index 0000000..103b5ef --- /dev/null +++ b/SecuritySystem/SecuritySystemContracts/SearchModels/ShopSearchModel.cs @@ -0,0 +1,8 @@ +namespace SecuritySystemContracts.SearchModels +{ + public class ShopSearchModel + { + public int? Id { get; set; } + public string? Name { get; set; } + } +} From 991ec196cc8054956f501f698588bdf58b473a3b Mon Sep 17 00:00:00 2001 From: "ns.potapov" Date: Mon, 11 Mar 2024 09:59:13 +0400 Subject: [PATCH 04/20] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=D0=B0=20view=20=D0=BC=D0=BE=D0=B4=D0=B5=D0=BB?= =?UTF-8?q?=D1=8C=20=D0=BC=D0=B0=D0=B3=D0=B0=D0=B7=D0=B8=D0=BD=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ViewModels/ShopViewModel.cs | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 SecuritySystem/SecuritySystemContracts/ViewModels/ShopViewModel.cs diff --git a/SecuritySystem/SecuritySystemContracts/ViewModels/ShopViewModel.cs b/SecuritySystem/SecuritySystemContracts/ViewModels/ShopViewModel.cs new file mode 100644 index 0000000..d6923fc --- /dev/null +++ b/SecuritySystem/SecuritySystemContracts/ViewModels/ShopViewModel.cs @@ -0,0 +1,17 @@ +using SecuritySystemDataModels.Models; +using System.ComponentModel; + +namespace SecuritySystemContracts.ViewModels +{ + public class ShopViewModel : IShopModel + { + public int Id { get; set; } + [DisplayName("Название")] + public string Name { get; set; } = string.Empty; + [DisplayName("Адрес")] + public string Address { get; set; } = string.Empty; + [DisplayName("Дата открытия")] + public DateTime OpeningDate { get; set; } + public Dictionary ShopSecures { get; set; } = new(); + } +} From 057693daef0e8f2ffb46dbd9a89deb4bacf34230 Mon Sep 17 00:00:00 2001 From: "ns.potapov" Date: Mon, 11 Mar 2024 10:00:45 +0400 Subject: [PATCH 05/20] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=20=D0=B8=D0=BD=D1=82=D0=B5=D1=80=D1=84=D0=B5=D0=B9?= =?UTF-8?q?=D1=81=20=D1=85=D1=80=D0=B0=D0=BD=D0=B5=D0=BD=D0=B8=D1=8F=20?= =?UTF-8?q?=D0=BC=D0=B0=D0=B3=D0=B0=D0=B7=D0=B8=D0=BD=D0=BE=D0=B2=20IShopS?= =?UTF-8?q?torage?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../StoragesContracts/IShopStorage.cs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 SecuritySystem/SecuritySystemContracts/StoragesContracts/IShopStorage.cs diff --git a/SecuritySystem/SecuritySystemContracts/StoragesContracts/IShopStorage.cs b/SecuritySystem/SecuritySystemContracts/StoragesContracts/IShopStorage.cs new file mode 100644 index 0000000..fcb9e2d --- /dev/null +++ b/SecuritySystem/SecuritySystemContracts/StoragesContracts/IShopStorage.cs @@ -0,0 +1,16 @@ +using SecuritySystemContracts.BindingModels; +using SecuritySystemContracts.SearchModels; +using SecuritySystemContracts.ViewModels; + +namespace SecuritySystemContracts.StoragesContracts +{ + public interface IShopStorage + { + ShopViewModel? GetElement(ShopSearchModel model); + List GetFullList(); + List GetFilteredList(ShopSearchModel model); + ShopViewModel? Insert(ShopBindingModel model); + ShopViewModel? Update(ShopBindingModel model); + ShopViewModel? Delete(ShopBindingModel model); + } +} From a0486f0392974ae28432aed101138a8493b23dca Mon Sep 17 00:00:00 2001 From: "ns.potapov" Date: Mon, 11 Mar 2024 10:02:40 +0400 Subject: [PATCH 06/20] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=D0=B0=20=D0=BC=D0=BE=D0=B4=D0=B5=D0=BB=D1=8C=20?= =?UTF-8?q?=D0=BC=D0=B0=D0=B3=D0=B0=D0=B7=D0=B8=D0=BD=D0=B0=20=D0=B2=20?= =?UTF-8?q?=D0=BF=D1=80=D0=BE=D0=B5=D0=BA=D1=82=20=D0=BF=D0=BE=20=D1=85?= =?UTF-8?q?=D1=80=D0=B0=D0=BD=D0=B5=D0=BD=D0=B8=D1=8E=20=D0=B4=D0=B0=D0=BD?= =?UTF-8?q?=D0=BD=D1=8B=D1=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Models/Shop.cs | 54 +++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 SecuritySystem/SecuritySystemListImplement/Models/Shop.cs diff --git a/SecuritySystem/SecuritySystemListImplement/Models/Shop.cs b/SecuritySystem/SecuritySystemListImplement/Models/Shop.cs new file mode 100644 index 0000000..dd5e4a5 --- /dev/null +++ b/SecuritySystem/SecuritySystemListImplement/Models/Shop.cs @@ -0,0 +1,54 @@ +using SecuritySystemContracts.BindingModels; +using SecuritySystemContracts.ViewModels; +using SecuritySystemDataModels.Models; + +namespace SecuritySystemListImplement.Models +{ + public class Shop : IShopModel + { + public int Id { get; private set; } + public string Name { get; private set; } = string.Empty; + public string Address { get; private set; } = string.Empty; + public DateTime OpeningDate { get; private set; } + public Dictionary ShopSecures { get; private set; } = new(); + + public static Shop? Create(ShopBindingModel model) + { + if (model == null) + { + return null; + } + + return new Shop() + { + Id = model.Id, + Name = model.Name, + Address = model.Address, + OpeningDate = model.OpeningDate, + ShopSecures = new() + }; + } + + public void Update(ShopBindingModel? model) + { + if (model == null) + { + return; + } + + Name = model.Name; + Address = model.Address; + OpeningDate = model.OpeningDate; + ShopSecures = model.ShopSecures; + } + + public ShopViewModel GetViewModel => new() + { + Id = Id, + Name = Name, + Address = Address, + OpeningDate = OpeningDate, + ShopSecures = ShopSecures + }; + } +} From 27799cb6a531b199f9146cfe44acd42105828b64 Mon Sep 17 00:00:00 2001 From: "ns.potapov" Date: Mon, 11 Mar 2024 10:04:58 +0400 Subject: [PATCH 07/20] =?UTF-8?q?=D0=A0=D0=B5=D0=B0=D0=BB=D0=B8=D0=B7?= =?UTF-8?q?=D0=BE=D0=B2=D0=B0=D0=BD=20=D0=B8=D0=BD=D1=82=D0=B5=D1=80=D1=84?= =?UTF-8?q?=D0=B5=D1=81=20=D1=85=D1=80=D0=B0=D0=BD=D0=B8=D0=BB=D0=B8=D1=89?= =?UTF-8?q?=D0=B0=20=D0=BC=D0=B0=D0=B3=D0=B0=D0=B7=D0=B8=D0=BD=D0=BE=D0=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../DataListSingleton.cs | 1 + .../Implements/ShopStorage.cs | 121 ++++++++++++++++++ 2 files changed, 122 insertions(+) create mode 100644 SecuritySystem/SecuritySystemListImplement/Implements/ShopStorage.cs diff --git a/SecuritySystem/SecuritySystemListImplement/DataListSingleton.cs b/SecuritySystem/SecuritySystemListImplement/DataListSingleton.cs index e173975..827b90c 100644 --- a/SecuritySystem/SecuritySystemListImplement/DataListSingleton.cs +++ b/SecuritySystem/SecuritySystemListImplement/DataListSingleton.cs @@ -8,6 +8,7 @@ namespace SecuritySystemListImplement public List Components { get; set; } public List Orders { get; set; } public List Secures { get; set; } + public List Shops { get; set; } private DataListSingleton() { Components = new List(); diff --git a/SecuritySystem/SecuritySystemListImplement/Implements/ShopStorage.cs b/SecuritySystem/SecuritySystemListImplement/Implements/ShopStorage.cs new file mode 100644 index 0000000..a46bcb6 --- /dev/null +++ b/SecuritySystem/SecuritySystemListImplement/Implements/ShopStorage.cs @@ -0,0 +1,121 @@ +using SecuritySystemContracts.BindingModels; +using SecuritySystemContracts.SearchModels; +using SecuritySystemContracts.StoragesContracts; +using SecuritySystemContracts.ViewModels; +using SecuritySystemListImplement.Models; + +namespace SecuritySystemListImplement.Implements +{ + public class ShopStorage : IShopStorage + { + private readonly DataListSingleton _source; + + public ShopStorage() + { + _source = DataListSingleton.GetInstance(); + } + + public ShopViewModel? GetElement(ShopSearchModel model) + { + if (string.IsNullOrEmpty(model.Name) && !model.Id.HasValue) + { + return null; + } + + foreach (var shop in _source.Shops) + { + if ((!string.IsNullOrEmpty(model.Name) && shop.Name == model.Name) || (model.Id.HasValue && shop.Id == model.Id)) + { + return shop.GetViewModel; + } + } + + return null; + } + + public List GetFilteredList(ShopSearchModel model) + { + var result = new List(); + + if (string.IsNullOrEmpty(model.Name)) + { + return result; + } + + foreach (var shop in _source.Shops) + { + if (shop.Name.Contains(model.Name)) + { + result.Add(shop.GetViewModel); + } + } + + return result; + } + + public List GetFullList() + { + var result = new List(); + + foreach (var shop in _source.Shops) + { + result.Add(shop.GetViewModel); + } + + return result; + } + + public ShopViewModel? Insert(ShopBindingModel model) + { + model.Id = 1; + + foreach (var shop in _source.Shops) + { + if (model.Id <= shop.Id) + { + model.Id = shop.Id + 1; + } + } + + var newShop = Shop.Create(model); + + if (newShop == null) + { + return null; + } + + _source.Shops.Add(newShop); + + return newShop.GetViewModel; + } + + public ShopViewModel? Update(ShopBindingModel model) + { + foreach (var shop in _source.Shops) + { + if (shop.Id == model.Id) + { + shop.Update(model); + return shop.GetViewModel; + } + } + + return null; + } + + public ShopViewModel? Delete(ShopBindingModel model) + { + for (int i = 0; i < _source.Shops.Count; ++i) + { + if (_source.Shops[i].Id == model.Id) + { + var element = _source.Shops[i]; + _source.Shops.RemoveAt(i); + return element.GetViewModel; + } + } + + return null; + } + } +} From 8543221b7d96fd4198bba2a32a4df5ccd4e39d14 Mon Sep 17 00:00:00 2001 From: "ns.potapov" Date: Mon, 11 Mar 2024 10:05:53 +0400 Subject: [PATCH 08/20] =?UTF-8?q?=D0=9F=D1=80=D0=B0=D0=B2=D0=BA=D0=B0=20?= =?UTF-8?q?=D0=B2=20=D0=BA=D0=BE=D0=BD=D1=81=D1=82=D1=80=D1=83=D0=BA=D1=82?= =?UTF-8?q?=D0=BE=D1=80=D0=B5=20DataListSingleton?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- SecuritySystem/SecuritySystemListImplement/DataListSingleton.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/SecuritySystem/SecuritySystemListImplement/DataListSingleton.cs b/SecuritySystem/SecuritySystemListImplement/DataListSingleton.cs index 827b90c..85dbcbf 100644 --- a/SecuritySystem/SecuritySystemListImplement/DataListSingleton.cs +++ b/SecuritySystem/SecuritySystemListImplement/DataListSingleton.cs @@ -14,6 +14,7 @@ namespace SecuritySystemListImplement Components = new List(); Orders = new List(); Secures = new List(); + Shops = new List(); } public static DataListSingleton GetInstance() { From f250827f9dfac8ed35d5977c537cd79506093ea7 Mon Sep 17 00:00:00 2001 From: "ns.potapov" Date: Mon, 11 Mar 2024 10:09:10 +0400 Subject: [PATCH 09/20] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=20=D0=BA=D0=BE=D0=BD=D1=82=D1=80=D0=B0=D0=BA=D1=82?= =?UTF-8?q?=20=D0=B1=D0=B8=D0=B7=D0=BD=D0=B5=D1=81-=D0=BB=D0=BE=D0=B3?= =?UTF-8?q?=D0=B8=D0=BA=D0=B8=20=D0=B4=D0=BB=D1=8F=20=D0=BC=D0=B0=D0=B3?= =?UTF-8?q?=D0=B0=D0=B7=D0=B8=D0=BD=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../BusinessLogicsContracts/IShopLogic.cs | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 SecuritySystem/SecuritySystemContracts/BusinessLogicsContracts/IShopLogic.cs diff --git a/SecuritySystem/SecuritySystemContracts/BusinessLogicsContracts/IShopLogic.cs b/SecuritySystem/SecuritySystemContracts/BusinessLogicsContracts/IShopLogic.cs new file mode 100644 index 0000000..44eb9d8 --- /dev/null +++ b/SecuritySystem/SecuritySystemContracts/BusinessLogicsContracts/IShopLogic.cs @@ -0,0 +1,17 @@ +using SecuritySystemContracts.BindingModels; +using SecuritySystemContracts.SearchModels; +using SecuritySystemContracts.ViewModels; +using SecuritySystemDataModels.Models; + +namespace SecuritySystemContracts.BusinessLogicsContracts +{ + public interface IShopLogic + { + ShopViewModel? ReadElement(ShopSearchModel model); + List? ReadList(ShopSearchModel? model); + bool Create(ShopBindingModel model); + bool Update(ShopBindingModel model); + bool Delete(ShopBindingModel model); + bool SupplySecures(ShopSearchModel model, ISecureModel secure, int count); + } +} From 4a86cc2840ab91d4d77fe97633f83ac4918eb391 Mon Sep 17 00:00:00 2001 From: "ns.potapov" Date: Mon, 11 Mar 2024 10:11:16 +0400 Subject: [PATCH 10/20] =?UTF-8?q?=D0=A0=D0=B5=D0=B0=D0=BB=D0=B8=D0=B7?= =?UTF-8?q?=D0=BE=D0=B2=D0=B0=D0=BD=D0=B0=20=D0=B1=D0=B8=D0=B7=D0=BD=D0=B5?= =?UTF-8?q?=D1=81-=D0=BB=D0=BE=D0=B3=D0=B8=D0=BA=D0=B0=20=D0=BC=D0=B0?= =?UTF-8?q?=D0=B3=D0=B0=D0=B7=D0=B8=D0=BD=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../BusinessLogics/ShopLogic.cs | 178 ++++++++++++++++++ 1 file changed, 178 insertions(+) create mode 100644 SecuritySystem/SecuritySystemBusinessLogic/BusinessLogics/ShopLogic.cs diff --git a/SecuritySystem/SecuritySystemBusinessLogic/BusinessLogics/ShopLogic.cs b/SecuritySystem/SecuritySystemBusinessLogic/BusinessLogics/ShopLogic.cs new file mode 100644 index 0000000..e4ecee5 --- /dev/null +++ b/SecuritySystem/SecuritySystemBusinessLogic/BusinessLogics/ShopLogic.cs @@ -0,0 +1,178 @@ +using Microsoft.Extensions.Logging; +using SecuritySystemContracts.BindingModels; +using SecuritySystemContracts.BusinessLogicsContracts; +using SecuritySystemContracts.SearchModels; +using SecuritySystemContracts.StoragesContracts; +using SecuritySystemContracts.ViewModels; +using SecuritySystemDataModels.Models; + +namespace SecuritySystemBusinessLogic.BusinessLogics +{ + public class ShopLogic : IShopLogic + { + private readonly ILogger _logger; + private readonly IShopStorage _shopStorage; + + public ShopLogic(ILogger logger, IShopStorage shopStorage) + { + _logger = logger; + _shopStorage = shopStorage; + } + + public ShopViewModel? ReadElement(ShopSearchModel model) + { + if (model == null) + { + throw new ArgumentNullException(nameof(model)); + } + + _logger.LogInformation("ReadElement. Shop Name:{0}, ID:{1}", model.Name, model.Id); + + var element = _shopStorage.GetElement(model); + if (element == null) + { + _logger.LogWarning("ReadElement. element not found"); + return null; + } + + _logger.LogInformation("ReadElement found. Id:{Id}", element.Id); + + return element; + } + + public List? ReadList(ShopSearchModel? model) + { + _logger.LogInformation("ReadList. Shop Name:{0}, ID:{1} ", model?.Name, model?.Id); + + var list = (model == null) ? _shopStorage.GetFullList() : _shopStorage.GetFilteredList(model); + + if (list == null) + { + _logger.LogWarning("ReadList return null list"); + return null; + } + + _logger.LogInformation("ReadList. Count:{Count}", list.Count); + + return list; + } + + public bool SupplySecures(ShopSearchModel model, ISecureModel secure, int count) + { + if (model == null) + { + throw new ArgumentNullException(nameof(model)); + } + + if (secure == null) + { + throw new ArgumentNullException(nameof(secure)); + } + + if (count <= 0) + { + throw new ArgumentNullException("Count of secures in supply must be more than 0", nameof(count)); + } + + var shopElement = _shopStorage.GetElement(model); + if (shopElement == null) + { + _logger.LogWarning("Required shop element not found in storage"); + return false; + } + + _logger.LogInformation("Shop element found. ID: {0}, Name: {1}", shopElement.Id, shopElement.Name); + + if (shopElement.ShopSecures.TryGetValue(secure.Id, out var sameSecure)) + { + shopElement.ShopSecures[secure.Id] = (secure, sameSecure.Item2 + count); + _logger.LogInformation("Same secure found by supply. Added {0} of {1} in {2} shop", count, secure.SecureName, shopElement.Name); + } + else + { + shopElement.ShopSecures[secure.Id] = (secure, count); + _logger.LogInformation("New secure added by supply. Added {0} of {1} in {2} shop", count, secure.SecureName, shopElement.Name); + } + + _shopStorage.Update(new() + { + Id = shopElement.Id, + Name = shopElement.Name, + Address = shopElement.Address, + OpeningDate = shopElement.OpeningDate, + ShopSecures = shopElement.ShopSecures + }); + + return true; + } + + public bool Create(ShopBindingModel model) + { + CheckModel(model); + + if (_shopStorage.Insert(model) == null) + { + _logger.LogWarning("Insert operation failed"); + return false; + } + + return true; + } + + public bool Update(ShopBindingModel model) + { + CheckModel(model); + + if (_shopStorage.Update(model) == null) + { + _logger.LogWarning("Update operation failed"); + return false; + } + + return true; + } + + public bool Delete(ShopBindingModel model) + { + CheckModel(model, false); + + if (_shopStorage.Delete(model) == null) + { + _logger.LogWarning("Delete operation failed"); + return false; + } + + return true; + } + + private void CheckModel(ShopBindingModel model, bool withParams = true) + { + if (model == null) + { + throw new ArgumentNullException(nameof(model)); + } + + if (!withParams) + { + return; + } + + if (string.IsNullOrEmpty(model.Name)) + { + throw new ArgumentNullException("Нет названия магазина!", nameof(model.Name)); + } + + _logger.LogInformation("Shop. Name: {0}, Address: {1}, ID: {2}", model.Name, model.Address, model.Id); + + var element = _shopStorage.GetElement(new ShopSearchModel + { + Name = model.Name + }); + + if (element != null && element.Id != model.Id) + { + throw new InvalidOperationException("Магазин с таким названием уже есть"); + } + } + } +} From 5e49f9700c752bdbcf326c221dd8929c1d2276e6 Mon Sep 17 00:00:00 2001 From: "ns.potapov" Date: Mon, 11 Mar 2024 10:17:49 +0400 Subject: [PATCH 11/20] =?UTF-8?q?=D0=A1=D0=BE=D0=B7=D0=B4=D0=B0=D0=BD?= =?UTF-8?q?=D1=8B=20=D1=88=D0=B0=D0=B1=D0=BB=D0=BE=D0=BD=D1=8B=20=D1=84?= =?UTF-8?q?=D0=BE=D1=80=D0=BC=20=D0=B4=D0=BB=D1=8F=20=D0=BC=D0=B3=D0=B0?= =?UTF-8?q?=D0=B7=D0=B8=D0=BD=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../SecuritySystemView/FormShop.Designer.cs | 39 ++++++ SecuritySystem/SecuritySystemView/FormShop.cs | 20 +++ .../SecuritySystemView/FormShop.resx | 120 ++++++++++++++++++ .../FormShopSupply.Designer.cs | 39 ++++++ .../SecuritySystemView/FormShopSupply.cs | 20 +++ .../SecuritySystemView/FormShopSupply.resx | 120 ++++++++++++++++++ .../SecuritySystemView/FormShops.Designer.cs | 39 ++++++ .../SecuritySystemView/FormShops.cs | 20 +++ .../SecuritySystemView/FormShops.resx | 120 ++++++++++++++++++ 9 files changed, 537 insertions(+) create mode 100644 SecuritySystem/SecuritySystemView/FormShop.Designer.cs create mode 100644 SecuritySystem/SecuritySystemView/FormShop.cs create mode 100644 SecuritySystem/SecuritySystemView/FormShop.resx create mode 100644 SecuritySystem/SecuritySystemView/FormShopSupply.Designer.cs create mode 100644 SecuritySystem/SecuritySystemView/FormShopSupply.cs create mode 100644 SecuritySystem/SecuritySystemView/FormShopSupply.resx create mode 100644 SecuritySystem/SecuritySystemView/FormShops.Designer.cs create mode 100644 SecuritySystem/SecuritySystemView/FormShops.cs create mode 100644 SecuritySystem/SecuritySystemView/FormShops.resx diff --git a/SecuritySystem/SecuritySystemView/FormShop.Designer.cs b/SecuritySystem/SecuritySystemView/FormShop.Designer.cs new file mode 100644 index 0000000..01ef94b --- /dev/null +++ b/SecuritySystem/SecuritySystemView/FormShop.Designer.cs @@ -0,0 +1,39 @@ +namespace SecuritySystemView +{ + partial class FormShop + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.components = new System.ComponentModel.Container(); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(800, 450); + this.Text = "FormShop"; + } + + #endregion + } +} \ No newline at end of file diff --git a/SecuritySystem/SecuritySystemView/FormShop.cs b/SecuritySystem/SecuritySystemView/FormShop.cs new file mode 100644 index 0000000..4d19325 --- /dev/null +++ b/SecuritySystem/SecuritySystemView/FormShop.cs @@ -0,0 +1,20 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Forms; + +namespace SecuritySystemView +{ + public partial class FormShop : Form + { + public FormShop() + { + InitializeComponent(); + } + } +} diff --git a/SecuritySystem/SecuritySystemView/FormShop.resx b/SecuritySystem/SecuritySystemView/FormShop.resx new file mode 100644 index 0000000..1af7de1 --- /dev/null +++ b/SecuritySystem/SecuritySystemView/FormShop.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/SecuritySystem/SecuritySystemView/FormShopSupply.Designer.cs b/SecuritySystem/SecuritySystemView/FormShopSupply.Designer.cs new file mode 100644 index 0000000..9a26ee8 --- /dev/null +++ b/SecuritySystem/SecuritySystemView/FormShopSupply.Designer.cs @@ -0,0 +1,39 @@ +namespace SecuritySystemView +{ + partial class FormShopSupply + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.components = new System.ComponentModel.Container(); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(800, 450); + this.Text = "FormShopSupply"; + } + + #endregion + } +} \ No newline at end of file diff --git a/SecuritySystem/SecuritySystemView/FormShopSupply.cs b/SecuritySystem/SecuritySystemView/FormShopSupply.cs new file mode 100644 index 0000000..463d314 --- /dev/null +++ b/SecuritySystem/SecuritySystemView/FormShopSupply.cs @@ -0,0 +1,20 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Forms; + +namespace SecuritySystemView +{ + public partial class FormShopSupply : Form + { + public FormShopSupply() + { + InitializeComponent(); + } + } +} diff --git a/SecuritySystem/SecuritySystemView/FormShopSupply.resx b/SecuritySystem/SecuritySystemView/FormShopSupply.resx new file mode 100644 index 0000000..1af7de1 --- /dev/null +++ b/SecuritySystem/SecuritySystemView/FormShopSupply.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/SecuritySystem/SecuritySystemView/FormShops.Designer.cs b/SecuritySystem/SecuritySystemView/FormShops.Designer.cs new file mode 100644 index 0000000..2f9db2d --- /dev/null +++ b/SecuritySystem/SecuritySystemView/FormShops.Designer.cs @@ -0,0 +1,39 @@ +namespace SecuritySystemView +{ + partial class FormShops + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.components = new System.ComponentModel.Container(); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(800, 450); + this.Text = "FormShops"; + } + + #endregion + } +} \ No newline at end of file diff --git a/SecuritySystem/SecuritySystemView/FormShops.cs b/SecuritySystem/SecuritySystemView/FormShops.cs new file mode 100644 index 0000000..903b4f9 --- /dev/null +++ b/SecuritySystem/SecuritySystemView/FormShops.cs @@ -0,0 +1,20 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Forms; + +namespace SecuritySystemView +{ + public partial class FormShops : Form + { + public FormShops() + { + InitializeComponent(); + } + } +} diff --git a/SecuritySystem/SecuritySystemView/FormShops.resx b/SecuritySystem/SecuritySystemView/FormShops.resx new file mode 100644 index 0000000..1af7de1 --- /dev/null +++ b/SecuritySystem/SecuritySystemView/FormShops.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file From 8c458b2c972ddb3493a76c4b8f8f849364fc0566 Mon Sep 17 00:00:00 2001 From: "ns.potapov" Date: Mon, 11 Mar 2024 10:30:07 +0400 Subject: [PATCH 12/20] =?UTF-8?q?=D0=A0=D0=B5=D0=B0=D0=BB=D0=B8=D0=B7?= =?UTF-8?q?=D0=BE=D0=B2=D0=B0=D0=BD=D0=B0=20=D1=84=D0=BE=D1=80=D0=BC=D0=B0?= =?UTF-8?q?=20=D1=81=D0=BE=20=D1=81=D0=BF=D0=B8=D1=81=D0=BA=D0=BE=D0=BC=20?= =?UTF-8?q?=D0=BC=D0=B0=D0=B3=D0=B0=D0=B7=D0=B8=D0=BD=D0=BE=D0=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../SecuritySystemView/FormShops.Designer.cs | 93 ++++++++++++++- .../SecuritySystemView/FormShops.cs | 111 ++++++++++++++++-- .../SecuritySystemView/FormShops.resx | 52 ++++---- 3 files changed, 216 insertions(+), 40 deletions(-) diff --git a/SecuritySystem/SecuritySystemView/FormShops.Designer.cs b/SecuritySystem/SecuritySystemView/FormShops.Designer.cs index 2f9db2d..245d09f 100644 --- a/SecuritySystem/SecuritySystemView/FormShops.Designer.cs +++ b/SecuritySystem/SecuritySystemView/FormShops.Designer.cs @@ -28,12 +28,97 @@ /// private void InitializeComponent() { - this.components = new System.ComponentModel.Container(); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(800, 450); - this.Text = "FormShops"; + dataGridView = new DataGridView(); + buttonRefresh = new Button(); + buttonDelete = new Button(); + buttonEdit = new Button(); + buttonAdd = new Button(); + ((System.ComponentModel.ISupportInitialize)dataGridView).BeginInit(); + SuspendLayout(); + // + // dataGridView + // + dataGridView.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.Fill; + dataGridView.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.AutoSize; + dataGridView.Dock = DockStyle.Left; + dataGridView.Location = new Point(0, 0); + dataGridView.MultiSelect = false; + dataGridView.Name = "dataGridView"; + dataGridView.ReadOnly = true; + dataGridView.RowHeadersVisible = false; + dataGridView.RowHeadersWidth = 51; + dataGridView.RowTemplate.Height = 29; + dataGridView.SelectionMode = DataGridViewSelectionMode.FullRowSelect; + dataGridView.Size = new Size(716, 406); + dataGridView.TabIndex = 1; + // + // buttonRefresh + // + buttonRefresh.Anchor = AnchorStyles.Top | AnchorStyles.Right; + buttonRefresh.Location = new Point(735, 261); + buttonRefresh.Name = "buttonRefresh"; + buttonRefresh.Size = new Size(94, 29); + buttonRefresh.TabIndex = 8; + buttonRefresh.Text = "Обновить"; + buttonRefresh.UseVisualStyleBackColor = true; + buttonRefresh.Click += buttonRefresh_Click; + // + // buttonDelete + // + buttonDelete.Anchor = AnchorStyles.Top | AnchorStyles.Right; + buttonDelete.Location = new Point(735, 213); + buttonDelete.Name = "buttonDelete"; + buttonDelete.Size = new Size(94, 29); + buttonDelete.TabIndex = 7; + buttonDelete.Text = "Удалить"; + buttonDelete.UseVisualStyleBackColor = true; + buttonDelete.Click += buttonDelete_Click; + // + // buttonEdit + // + buttonEdit.Anchor = AnchorStyles.Top | AnchorStyles.Right; + buttonEdit.Location = new Point(735, 163); + buttonEdit.Name = "buttonEdit"; + buttonEdit.Size = new Size(94, 29); + buttonEdit.TabIndex = 6; + buttonEdit.Text = "Изменить"; + buttonEdit.UseVisualStyleBackColor = true; + buttonEdit.Click += buttonEdit_Click; + // + // buttonAdd + // + buttonAdd.Anchor = AnchorStyles.Top | AnchorStyles.Right; + buttonAdd.Location = new Point(735, 111); + buttonAdd.Name = "buttonAdd"; + buttonAdd.Size = new Size(94, 29); + buttonAdd.TabIndex = 5; + buttonAdd.Text = "Добавить"; + buttonAdd.UseVisualStyleBackColor = true; + buttonAdd.Click += buttonAdd_Click; + // + // FormShops + // + AutoScaleDimensions = new SizeF(8F, 20F); + AutoScaleMode = AutoScaleMode.Font; + ClientSize = new Size(841, 406); + Controls.Add(buttonRefresh); + Controls.Add(buttonDelete); + Controls.Add(buttonEdit); + Controls.Add(buttonAdd); + Controls.Add(dataGridView); + Name = "FormShops"; + Text = "Список магазинов"; + Load += FormShops_Load; + ((System.ComponentModel.ISupportInitialize)dataGridView).EndInit(); + ResumeLayout(false); } #endregion + + private DataGridView dataGridView; + private Button buttonRefresh; + private Button buttonDelete; + private Button buttonEdit; + private Button buttonAdd; } } \ No newline at end of file diff --git a/SecuritySystem/SecuritySystemView/FormShops.cs b/SecuritySystem/SecuritySystemView/FormShops.cs index 903b4f9..4bff54b 100644 --- a/SecuritySystem/SecuritySystemView/FormShops.cs +++ b/SecuritySystem/SecuritySystemView/FormShops.cs @@ -1,20 +1,111 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Data; -using System.Drawing; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Windows.Forms; +using Microsoft.Extensions.Logging; +using SecuritySystemContracts.BindingModels; +using SecuritySystemContracts.BusinessLogicsContracts; namespace SecuritySystemView { public partial class FormShops : Form { - public FormShops() + private readonly ILogger _logger; + private readonly IShopLogic _logic; + + public FormShops(ILogger logger, IShopLogic logic) { InitializeComponent(); + _logger = logger; + _logic = logic; + } + + private void FormShops_Load(object sender, EventArgs e) + { + LoadData(); + } + + private void LoadData() + { + try + { + var list = _logic.ReadList(null); + + if (list != null) + { + dataGridView.DataSource = list; + dataGridView.Columns["Id"].Visible = false; + dataGridView.Columns["Name"].AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill; + dataGridView.Columns["ShopSecures"].Visible = false; + } + + _logger.LogInformation("Загрузка магазинов"); + + } + catch (Exception ex) + { + _logger.LogError(ex, "Ошибка загрузки магазинов"); + MessageBox.Show(ex.Message, "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error); + } + } + + private void buttonRefresh_Click(object sender, EventArgs e) + { + LoadData(); + } + + private void buttonAdd_Click(object sender, EventArgs e) + { + var service = Program.ServiceProvider?.GetService(typeof(FormShop)); + + if (service is FormShop form) + { + if (form.ShowDialog() == DialogResult.OK) + { + LoadData(); + } + } + } + + private void buttonEdit_Click(object sender, EventArgs e) + { + if (dataGridView.SelectedRows.Count == 1) + { + var service = Program.ServiceProvider?.GetService(typeof(FormShop)); + + if (service is FormShop form) + { + form.Id = Convert.ToInt32(dataGridView.SelectedRows[0].Cells["Id"].Value); + + if (form.ShowDialog() == DialogResult.OK) + { + LoadData(); + } + } + } + } + + private void buttonDelete_Click(object sender, EventArgs e) + { + if (dataGridView.SelectedRows.Count == 1) + { + if (MessageBox.Show("Удалить магазин?", "Подтверждение", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) + { + int id = Convert.ToInt32(dataGridView.SelectedRows[0].Cells["Id"].Value); + _logger.LogInformation("Удаление магазина"); + + try + { + if (!_logic.Delete(new ShopBindingModel { Id = id })) + { + throw new Exception("Ошибка при удалении. Дополнительная информация в логах."); + } + + LoadData(); + } + catch (Exception ex) + { + _logger.LogError(ex, "Ошибка удаления магазина"); + MessageBox.Show(ex.Message, "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error); + } + } + } } } } diff --git a/SecuritySystem/SecuritySystemView/FormShops.resx b/SecuritySystem/SecuritySystemView/FormShops.resx index 1af7de1..a395bff 100644 --- a/SecuritySystem/SecuritySystemView/FormShops.resx +++ b/SecuritySystem/SecuritySystemView/FormShops.resx @@ -1,24 +1,24 @@  - From 3513039044cc6eb6e0a12b0195697d717dc50bcb Mon Sep 17 00:00:00 2001 From: "ns.potapov" Date: Mon, 11 Mar 2024 10:41:40 +0400 Subject: [PATCH 13/20] =?UTF-8?q?=D0=A0=D0=B5=D1=81=D1=82=D1=80=D1=83?= =?UTF-8?q?=D0=BA=D1=82=D1=83=D1=80=D0=B8=D1=80=D0=BE=D0=B2=D0=B0=D0=BD=20?= =?UTF-8?q?=D0=BF=D1=80=D0=BE=D0=B5=D0=BA=D1=82=20=D1=81=20=D1=84=D0=BE?= =?UTF-8?q?=D1=80=D0=BC=D0=B0=D0=BC=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../{ => Component}/FormComponent.Designer.cs | 0 .../{ => Component}/FormComponent.cs | 0 .../{ => Component}/FormComponent.resx | 0 .../FormComponents.Designer.cs | 0 .../{ => Component}/FormComponents.cs | 0 .../{ => Component}/FormComponents.resx | 0 .../SecuritySystemView/FormShop.resx | 120 ------------------ .../{ => Order}/FormCreateOrder.Designer.cs | 0 .../{ => Order}/FormCreateOrder.cs | 0 .../{ => Order}/FormCreateOrder.resx | 0 .../{ => Secure}/FormSecure.Designer.cs | 0 .../{ => Secure}/FormSecure.cs | 0 .../{ => Secure}/FormSecure.resx | 0 .../FormSecureComponent.Designer.cs | 0 .../{ => Secure}/FormSecureComponent.cs | 0 .../{ => Secure}/FormSecureComponent.resx | 0 .../{ => Secure}/FormSecures.Designer.cs | 0 .../{ => Secure}/FormSecures.cs | 0 .../{ => Secure}/FormSecures.resx | 0 .../{ => Shop}/FormShop.Designer.cs | 14 +- .../SecuritySystemView/{ => Shop}/FormShop.cs | 0 .../{FormShops.resx => Shop/FormShop.resx} | 0 .../{ => Shop}/FormShopSupply.Designer.cs | 0 .../{ => Shop}/FormShopSupply.cs | 0 .../{ => Shop}/FormShopSupply.resx | 0 .../{ => Shop}/FormShops.Designer.cs | 0 .../{ => Shop}/FormShops.cs | 0 .../SecuritySystemView/Shop/FormShops.resx | 120 ++++++++++++++++++ 28 files changed, 130 insertions(+), 124 deletions(-) rename SecuritySystem/SecuritySystemView/{ => Component}/FormComponent.Designer.cs (100%) rename SecuritySystem/SecuritySystemView/{ => Component}/FormComponent.cs (100%) rename SecuritySystem/SecuritySystemView/{ => Component}/FormComponent.resx (100%) rename SecuritySystem/SecuritySystemView/{ => Component}/FormComponents.Designer.cs (100%) rename SecuritySystem/SecuritySystemView/{ => Component}/FormComponents.cs (100%) rename SecuritySystem/SecuritySystemView/{ => Component}/FormComponents.resx (100%) delete mode 100644 SecuritySystem/SecuritySystemView/FormShop.resx rename SecuritySystem/SecuritySystemView/{ => Order}/FormCreateOrder.Designer.cs (100%) rename SecuritySystem/SecuritySystemView/{ => Order}/FormCreateOrder.cs (100%) rename SecuritySystem/SecuritySystemView/{ => Order}/FormCreateOrder.resx (100%) rename SecuritySystem/SecuritySystemView/{ => Secure}/FormSecure.Designer.cs (100%) rename SecuritySystem/SecuritySystemView/{ => Secure}/FormSecure.cs (100%) rename SecuritySystem/SecuritySystemView/{ => Secure}/FormSecure.resx (100%) rename SecuritySystem/SecuritySystemView/{ => Secure}/FormSecureComponent.Designer.cs (100%) rename SecuritySystem/SecuritySystemView/{ => Secure}/FormSecureComponent.cs (100%) rename SecuritySystem/SecuritySystemView/{ => Secure}/FormSecureComponent.resx (100%) rename SecuritySystem/SecuritySystemView/{ => Secure}/FormSecures.Designer.cs (100%) rename SecuritySystem/SecuritySystemView/{ => Secure}/FormSecures.cs (100%) rename SecuritySystem/SecuritySystemView/{ => Secure}/FormSecures.resx (100%) rename SecuritySystem/SecuritySystemView/{ => Shop}/FormShop.Designer.cs (74%) rename SecuritySystem/SecuritySystemView/{ => Shop}/FormShop.cs (100%) rename SecuritySystem/SecuritySystemView/{FormShops.resx => Shop/FormShop.resx} (100%) rename SecuritySystem/SecuritySystemView/{ => Shop}/FormShopSupply.Designer.cs (100%) rename SecuritySystem/SecuritySystemView/{ => Shop}/FormShopSupply.cs (100%) rename SecuritySystem/SecuritySystemView/{ => Shop}/FormShopSupply.resx (100%) rename SecuritySystem/SecuritySystemView/{ => Shop}/FormShops.Designer.cs (100%) rename SecuritySystem/SecuritySystemView/{ => Shop}/FormShops.cs (100%) create mode 100644 SecuritySystem/SecuritySystemView/Shop/FormShops.resx diff --git a/SecuritySystem/SecuritySystemView/FormComponent.Designer.cs b/SecuritySystem/SecuritySystemView/Component/FormComponent.Designer.cs similarity index 100% rename from SecuritySystem/SecuritySystemView/FormComponent.Designer.cs rename to SecuritySystem/SecuritySystemView/Component/FormComponent.Designer.cs diff --git a/SecuritySystem/SecuritySystemView/FormComponent.cs b/SecuritySystem/SecuritySystemView/Component/FormComponent.cs similarity index 100% rename from SecuritySystem/SecuritySystemView/FormComponent.cs rename to SecuritySystem/SecuritySystemView/Component/FormComponent.cs diff --git a/SecuritySystem/SecuritySystemView/FormComponent.resx b/SecuritySystem/SecuritySystemView/Component/FormComponent.resx similarity index 100% rename from SecuritySystem/SecuritySystemView/FormComponent.resx rename to SecuritySystem/SecuritySystemView/Component/FormComponent.resx diff --git a/SecuritySystem/SecuritySystemView/FormComponents.Designer.cs b/SecuritySystem/SecuritySystemView/Component/FormComponents.Designer.cs similarity index 100% rename from SecuritySystem/SecuritySystemView/FormComponents.Designer.cs rename to SecuritySystem/SecuritySystemView/Component/FormComponents.Designer.cs diff --git a/SecuritySystem/SecuritySystemView/FormComponents.cs b/SecuritySystem/SecuritySystemView/Component/FormComponents.cs similarity index 100% rename from SecuritySystem/SecuritySystemView/FormComponents.cs rename to SecuritySystem/SecuritySystemView/Component/FormComponents.cs diff --git a/SecuritySystem/SecuritySystemView/FormComponents.resx b/SecuritySystem/SecuritySystemView/Component/FormComponents.resx similarity index 100% rename from SecuritySystem/SecuritySystemView/FormComponents.resx rename to SecuritySystem/SecuritySystemView/Component/FormComponents.resx diff --git a/SecuritySystem/SecuritySystemView/FormShop.resx b/SecuritySystem/SecuritySystemView/FormShop.resx deleted file mode 100644 index 1af7de1..0000000 --- a/SecuritySystem/SecuritySystemView/FormShop.resx +++ /dev/null @@ -1,120 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - \ No newline at end of file diff --git a/SecuritySystem/SecuritySystemView/FormCreateOrder.Designer.cs b/SecuritySystem/SecuritySystemView/Order/FormCreateOrder.Designer.cs similarity index 100% rename from SecuritySystem/SecuritySystemView/FormCreateOrder.Designer.cs rename to SecuritySystem/SecuritySystemView/Order/FormCreateOrder.Designer.cs diff --git a/SecuritySystem/SecuritySystemView/FormCreateOrder.cs b/SecuritySystem/SecuritySystemView/Order/FormCreateOrder.cs similarity index 100% rename from SecuritySystem/SecuritySystemView/FormCreateOrder.cs rename to SecuritySystem/SecuritySystemView/Order/FormCreateOrder.cs diff --git a/SecuritySystem/SecuritySystemView/FormCreateOrder.resx b/SecuritySystem/SecuritySystemView/Order/FormCreateOrder.resx similarity index 100% rename from SecuritySystem/SecuritySystemView/FormCreateOrder.resx rename to SecuritySystem/SecuritySystemView/Order/FormCreateOrder.resx diff --git a/SecuritySystem/SecuritySystemView/FormSecure.Designer.cs b/SecuritySystem/SecuritySystemView/Secure/FormSecure.Designer.cs similarity index 100% rename from SecuritySystem/SecuritySystemView/FormSecure.Designer.cs rename to SecuritySystem/SecuritySystemView/Secure/FormSecure.Designer.cs diff --git a/SecuritySystem/SecuritySystemView/FormSecure.cs b/SecuritySystem/SecuritySystemView/Secure/FormSecure.cs similarity index 100% rename from SecuritySystem/SecuritySystemView/FormSecure.cs rename to SecuritySystem/SecuritySystemView/Secure/FormSecure.cs diff --git a/SecuritySystem/SecuritySystemView/FormSecure.resx b/SecuritySystem/SecuritySystemView/Secure/FormSecure.resx similarity index 100% rename from SecuritySystem/SecuritySystemView/FormSecure.resx rename to SecuritySystem/SecuritySystemView/Secure/FormSecure.resx diff --git a/SecuritySystem/SecuritySystemView/FormSecureComponent.Designer.cs b/SecuritySystem/SecuritySystemView/Secure/FormSecureComponent.Designer.cs similarity index 100% rename from SecuritySystem/SecuritySystemView/FormSecureComponent.Designer.cs rename to SecuritySystem/SecuritySystemView/Secure/FormSecureComponent.Designer.cs diff --git a/SecuritySystem/SecuritySystemView/FormSecureComponent.cs b/SecuritySystem/SecuritySystemView/Secure/FormSecureComponent.cs similarity index 100% rename from SecuritySystem/SecuritySystemView/FormSecureComponent.cs rename to SecuritySystem/SecuritySystemView/Secure/FormSecureComponent.cs diff --git a/SecuritySystem/SecuritySystemView/FormSecureComponent.resx b/SecuritySystem/SecuritySystemView/Secure/FormSecureComponent.resx similarity index 100% rename from SecuritySystem/SecuritySystemView/FormSecureComponent.resx rename to SecuritySystem/SecuritySystemView/Secure/FormSecureComponent.resx diff --git a/SecuritySystem/SecuritySystemView/FormSecures.Designer.cs b/SecuritySystem/SecuritySystemView/Secure/FormSecures.Designer.cs similarity index 100% rename from SecuritySystem/SecuritySystemView/FormSecures.Designer.cs rename to SecuritySystem/SecuritySystemView/Secure/FormSecures.Designer.cs diff --git a/SecuritySystem/SecuritySystemView/FormSecures.cs b/SecuritySystem/SecuritySystemView/Secure/FormSecures.cs similarity index 100% rename from SecuritySystem/SecuritySystemView/FormSecures.cs rename to SecuritySystem/SecuritySystemView/Secure/FormSecures.cs diff --git a/SecuritySystem/SecuritySystemView/FormSecures.resx b/SecuritySystem/SecuritySystemView/Secure/FormSecures.resx similarity index 100% rename from SecuritySystem/SecuritySystemView/FormSecures.resx rename to SecuritySystem/SecuritySystemView/Secure/FormSecures.resx diff --git a/SecuritySystem/SecuritySystemView/FormShop.Designer.cs b/SecuritySystem/SecuritySystemView/Shop/FormShop.Designer.cs similarity index 74% rename from SecuritySystem/SecuritySystemView/FormShop.Designer.cs rename to SecuritySystem/SecuritySystemView/Shop/FormShop.Designer.cs index 01ef94b..c31db32 100644 --- a/SecuritySystem/SecuritySystemView/FormShop.Designer.cs +++ b/SecuritySystem/SecuritySystemView/Shop/FormShop.Designer.cs @@ -28,10 +28,16 @@ /// private void InitializeComponent() { - this.components = new System.ComponentModel.Container(); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(800, 450); - this.Text = "FormShop"; + SuspendLayout(); + // + // FormShop + // + AutoScaleDimensions = new SizeF(8F, 20F); + AutoScaleMode = AutoScaleMode.Font; + ClientSize = new Size(800, 450); + Name = "FormShop"; + Text = "Магазин"; + ResumeLayout(false); } #endregion diff --git a/SecuritySystem/SecuritySystemView/FormShop.cs b/SecuritySystem/SecuritySystemView/Shop/FormShop.cs similarity index 100% rename from SecuritySystem/SecuritySystemView/FormShop.cs rename to SecuritySystem/SecuritySystemView/Shop/FormShop.cs diff --git a/SecuritySystem/SecuritySystemView/FormShops.resx b/SecuritySystem/SecuritySystemView/Shop/FormShop.resx similarity index 100% rename from SecuritySystem/SecuritySystemView/FormShops.resx rename to SecuritySystem/SecuritySystemView/Shop/FormShop.resx diff --git a/SecuritySystem/SecuritySystemView/FormShopSupply.Designer.cs b/SecuritySystem/SecuritySystemView/Shop/FormShopSupply.Designer.cs similarity index 100% rename from SecuritySystem/SecuritySystemView/FormShopSupply.Designer.cs rename to SecuritySystem/SecuritySystemView/Shop/FormShopSupply.Designer.cs diff --git a/SecuritySystem/SecuritySystemView/FormShopSupply.cs b/SecuritySystem/SecuritySystemView/Shop/FormShopSupply.cs similarity index 100% rename from SecuritySystem/SecuritySystemView/FormShopSupply.cs rename to SecuritySystem/SecuritySystemView/Shop/FormShopSupply.cs diff --git a/SecuritySystem/SecuritySystemView/FormShopSupply.resx b/SecuritySystem/SecuritySystemView/Shop/FormShopSupply.resx similarity index 100% rename from SecuritySystem/SecuritySystemView/FormShopSupply.resx rename to SecuritySystem/SecuritySystemView/Shop/FormShopSupply.resx diff --git a/SecuritySystem/SecuritySystemView/FormShops.Designer.cs b/SecuritySystem/SecuritySystemView/Shop/FormShops.Designer.cs similarity index 100% rename from SecuritySystem/SecuritySystemView/FormShops.Designer.cs rename to SecuritySystem/SecuritySystemView/Shop/FormShops.Designer.cs diff --git a/SecuritySystem/SecuritySystemView/FormShops.cs b/SecuritySystem/SecuritySystemView/Shop/FormShops.cs similarity index 100% rename from SecuritySystem/SecuritySystemView/FormShops.cs rename to SecuritySystem/SecuritySystemView/Shop/FormShops.cs diff --git a/SecuritySystem/SecuritySystemView/Shop/FormShops.resx b/SecuritySystem/SecuritySystemView/Shop/FormShops.resx new file mode 100644 index 0000000..a395bff --- /dev/null +++ b/SecuritySystem/SecuritySystemView/Shop/FormShops.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file From 3bd74e082c5a569c7ec185047f53a6295424ad7f Mon Sep 17 00:00:00 2001 From: "ns.potapov" Date: Mon, 11 Mar 2024 10:44:55 +0400 Subject: [PATCH 14/20] =?UTF-8?q?=D0=9F=D1=80=D0=B0=D0=B2=D0=BA=D0=B0=20?= =?UTF-8?q?=D0=B3=D0=BB=D0=B0=D0=B2=D0=BD=D0=BE=D0=B9=20=D1=84=D0=BE=D1=80?= =?UTF-8?q?=D0=BC=D1=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../SecuritySystemView/FormMain.Designer.cs | 15 ++++++++++++--- SecuritySystem/SecuritySystemView/FormMain.cs | 9 +++++++++ .../SecuritySystemView/Shop/FormShops.Designer.cs | 2 +- 3 files changed, 22 insertions(+), 4 deletions(-) diff --git a/SecuritySystem/SecuritySystemView/FormMain.Designer.cs b/SecuritySystem/SecuritySystemView/FormMain.Designer.cs index 5ff6f2b..0d3fb3e 100644 --- a/SecuritySystem/SecuritySystemView/FormMain.Designer.cs +++ b/SecuritySystem/SecuritySystemView/FormMain.Designer.cs @@ -38,6 +38,7 @@ buttonOrderReady = new Button(); button4 = new Button(); buttonRefresh = new Button(); + магазиныToolStripMenuItem = new ToolStripMenuItem(); menuStrip.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)dataGridView).BeginInit(); SuspendLayout(); @@ -54,7 +55,7 @@ // // справочникиToolStripMenuItem // - справочникиToolStripMenuItem.DropDownItems.AddRange(new ToolStripItem[] { ComponentsToolStripMenuItem, SecuresToolStripMenuItem }); + справочникиToolStripMenuItem.DropDownItems.AddRange(new ToolStripItem[] { ComponentsToolStripMenuItem, SecuresToolStripMenuItem, магазиныToolStripMenuItem }); справочникиToolStripMenuItem.Name = "справочникиToolStripMenuItem"; справочникиToolStripMenuItem.Size = new Size(117, 24); справочникиToolStripMenuItem.Text = "Справочники"; @@ -62,14 +63,14 @@ // ComponentsToolStripMenuItem // ComponentsToolStripMenuItem.Name = "ComponentsToolStripMenuItem"; - ComponentsToolStripMenuItem.Size = new Size(182, 26); + ComponentsToolStripMenuItem.Size = new Size(224, 26); ComponentsToolStripMenuItem.Text = "Компоненты"; ComponentsToolStripMenuItem.Click += ComponentsToolStripMenuItem_Click; // // SecuresToolStripMenuItem // SecuresToolStripMenuItem.Name = "SecuresToolStripMenuItem"; - SecuresToolStripMenuItem.Size = new Size(182, 26); + SecuresToolStripMenuItem.Size = new Size(224, 26); SecuresToolStripMenuItem.Text = "Изделия"; SecuresToolStripMenuItem.Click += SecuresToolStripMenuItem_Click; // @@ -142,6 +143,13 @@ buttonRefresh.UseVisualStyleBackColor = true; buttonRefresh.Click += ButtonRefresh_Click; // + // магазиныToolStripMenuItem + // + магазиныToolStripMenuItem.Name = "магазиныToolStripMenuItem"; + магазиныToolStripMenuItem.Size = new Size(224, 26); + магазиныToolStripMenuItem.Text = "Магазины"; + магазиныToolStripMenuItem.Click += ShopsToolStripMenuItem_Click; + // // FormMain // AutoScaleDimensions = new SizeF(8F, 20F); @@ -177,5 +185,6 @@ private Button buttonOrderReady; private Button button4; private Button buttonRefresh; + private ToolStripMenuItem магазиныToolStripMenuItem; } } \ No newline at end of file diff --git a/SecuritySystem/SecuritySystemView/FormMain.cs b/SecuritySystem/SecuritySystemView/FormMain.cs index 2fed95c..a3d0dc1 100644 --- a/SecuritySystem/SecuritySystemView/FormMain.cs +++ b/SecuritySystem/SecuritySystemView/FormMain.cs @@ -136,5 +136,14 @@ namespace SecuritySystemView { LoadData(); } + + private void ShopsToolStripMenuItem_Click(object sender, EventArgs e) + { + var service = Program.ServiceProvider?.GetService(typeof(FormShops)); + if (service is FormShops form) + { + form.ShowDialog(); + } + } } } diff --git a/SecuritySystem/SecuritySystemView/Shop/FormShops.Designer.cs b/SecuritySystem/SecuritySystemView/Shop/FormShops.Designer.cs index 245d09f..e3588d0 100644 --- a/SecuritySystem/SecuritySystemView/Shop/FormShops.Designer.cs +++ b/SecuritySystem/SecuritySystemView/Shop/FormShops.Designer.cs @@ -107,7 +107,7 @@ Controls.Add(buttonAdd); Controls.Add(dataGridView); Name = "FormShops"; - Text = "Список магазинов"; + Text = "Магазины"; Load += FormShops_Load; ((System.ComponentModel.ISupportInitialize)dataGridView).EndInit(); ResumeLayout(false); From c194b362669a86384210518e56fd6a055edb4a00 Mon Sep 17 00:00:00 2001 From: "ns.potapov" Date: Mon, 11 Mar 2024 10:48:07 +0400 Subject: [PATCH 15/20] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=D1=8B=20=D0=BF=D1=83=D0=BD=D0=BA=D1=82=D1=8B=20?= =?UTF-8?q?=D0=BC=D0=B5=D0=BD=D1=8E=20=D0=BF=D1=80=D0=BE=20=D0=BC=D0=B0?= =?UTF-8?q?=D0=B3=D0=B0=D0=B7=D0=B8=D0=BD=D1=8B=20=D0=B2=20=D0=B3=D0=BB?= =?UTF-8?q?=D0=B0=D0=B2=D0=BD=D1=83=D1=8E=20=D1=84=D0=BE=D1=80=D0=BC=D1=83?= =?UTF-8?q?=20=D0=B8=20=D1=80=D0=B5=D0=B0=D0=BB=D0=B8=D0=B7=D0=BE=D0=B2?= =?UTF-8?q?=D0=B0=D0=BD=D0=B0=20=D0=BB=D0=BE=D0=B3=D0=B8=D0=BA=D0=B0=20?= =?UTF-8?q?=D0=B8=D1=85=20=D1=80=D0=B0=D0=B1=D0=BE=D1=82=D1=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../SecuritySystemView/FormMain.Designer.cs | 23 +++++++++++++------ SecuritySystem/SecuritySystemView/FormMain.cs | 9 ++++++++ 2 files changed, 25 insertions(+), 7 deletions(-) diff --git a/SecuritySystem/SecuritySystemView/FormMain.Designer.cs b/SecuritySystem/SecuritySystemView/FormMain.Designer.cs index 0d3fb3e..8177b93 100644 --- a/SecuritySystem/SecuritySystemView/FormMain.Designer.cs +++ b/SecuritySystem/SecuritySystemView/FormMain.Designer.cs @@ -32,13 +32,14 @@ справочникиToolStripMenuItem = new ToolStripMenuItem(); ComponentsToolStripMenuItem = new ToolStripMenuItem(); SecuresToolStripMenuItem = new ToolStripMenuItem(); + магазиныToolStripMenuItem = new ToolStripMenuItem(); dataGridView = new DataGridView(); buttonCreateOrder = new Button(); buttonTakeOrderInWork = new Button(); buttonOrderReady = new Button(); button4 = new Button(); buttonRefresh = new Button(); - магазиныToolStripMenuItem = new ToolStripMenuItem(); + пополнениеМагазинаToolStripMenuItem = new ToolStripMenuItem(); menuStrip.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)dataGridView).BeginInit(); SuspendLayout(); @@ -46,7 +47,7 @@ // menuStrip // menuStrip.ImageScalingSize = new Size(20, 20); - menuStrip.Items.AddRange(new ToolStripItem[] { справочникиToolStripMenuItem }); + menuStrip.Items.AddRange(new ToolStripItem[] { справочникиToolStripMenuItem, пополнениеМагазинаToolStripMenuItem }); menuStrip.Location = new Point(0, 0); menuStrip.Name = "menuStrip"; menuStrip.Size = new Size(1043, 28); @@ -74,6 +75,13 @@ SecuresToolStripMenuItem.Text = "Изделия"; SecuresToolStripMenuItem.Click += SecuresToolStripMenuItem_Click; // + // магазиныToolStripMenuItem + // + магазиныToolStripMenuItem.Name = "магазиныToolStripMenuItem"; + магазиныToolStripMenuItem.Size = new Size(224, 26); + магазиныToolStripMenuItem.Text = "Магазины"; + магазиныToolStripMenuItem.Click += ShopsToolStripMenuItem_Click; + // // dataGridView // dataGridView.Anchor = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right; @@ -143,12 +151,12 @@ buttonRefresh.UseVisualStyleBackColor = true; buttonRefresh.Click += ButtonRefresh_Click; // - // магазиныToolStripMenuItem + // пополнениеМагазинаToolStripMenuItem // - магазиныToolStripMenuItem.Name = "магазиныToolStripMenuItem"; - магазиныToolStripMenuItem.Size = new Size(224, 26); - магазиныToolStripMenuItem.Text = "Магазины"; - магазиныToolStripMenuItem.Click += ShopsToolStripMenuItem_Click; + пополнениеМагазинаToolStripMenuItem.Name = "пополнениеМагазинаToolStripMenuItem"; + пополнениеМагазинаToolStripMenuItem.Size = new Size(182, 24); + пополнениеМагазинаToolStripMenuItem.Text = "Пополнение магазина"; + пополнениеМагазинаToolStripMenuItem.Click += SupplyShopToolStripMenuItem_Click; // // FormMain // @@ -186,5 +194,6 @@ private Button button4; private Button buttonRefresh; private ToolStripMenuItem магазиныToolStripMenuItem; + private ToolStripMenuItem пополнениеМагазинаToolStripMenuItem; } } \ No newline at end of file diff --git a/SecuritySystem/SecuritySystemView/FormMain.cs b/SecuritySystem/SecuritySystemView/FormMain.cs index a3d0dc1..0e33e70 100644 --- a/SecuritySystem/SecuritySystemView/FormMain.cs +++ b/SecuritySystem/SecuritySystemView/FormMain.cs @@ -145,5 +145,14 @@ namespace SecuritySystemView form.ShowDialog(); } } + + private void SupplyShopToolStripMenuItem_Click(object sender, EventArgs e) + { + var service = Program.ServiceProvider?.GetService(typeof(FormShopSupply)); + if (service is FormShopSupply form) + { + form.ShowDialog(); + } + } } } From 1ec3a794932214dd7e509bca081adcefa1dfe21a Mon Sep 17 00:00:00 2001 From: "ns.potapov" Date: Mon, 11 Mar 2024 11:11:08 +0400 Subject: [PATCH 16/20] =?UTF-8?q?=D0=A0=D0=B5=D0=B0=D0=BB=D0=B8=D0=B7?= =?UTF-8?q?=D0=BE=D0=B2=D0=B0=D0=BD=D0=B0=20=D1=84=D0=BE=D1=80=D0=BC=D0=B0?= =?UTF-8?q?=20=D0=B4=D0=BB=D1=8F=20=D1=80=D0=B0=D0=B1=D0=BE=D1=82=D1=8B=20?= =?UTF-8?q?=D1=81=20=D0=BC=D0=B0=D0=B3=D0=B0=D0=B7=D0=B8=D0=BD=D0=BE=D0=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Shop/FormShop.Designer.cs | 148 +++++++++++++++++- .../SecuritySystemView/Shop/FormShop.cs | 125 +++++++++++++-- .../SecuritySystemView/Shop/FormShop.resx | 12 ++ 3 files changed, 274 insertions(+), 11 deletions(-) diff --git a/SecuritySystem/SecuritySystemView/Shop/FormShop.Designer.cs b/SecuritySystem/SecuritySystemView/Shop/FormShop.Designer.cs index c31db32..1c71dfa 100644 --- a/SecuritySystem/SecuritySystemView/Shop/FormShop.Designer.cs +++ b/SecuritySystem/SecuritySystemView/Shop/FormShop.Designer.cs @@ -28,18 +28,164 @@ /// private void InitializeComponent() { + labelName = new Label(); + labelAddress = new Label(); + labelOpeningDate = new Label(); + textBoxName = new TextBox(); + textBoxAddress = new TextBox(); + dateTimePickerOpeningDate = new DateTimePicker(); + dataGridView = new DataGridView(); + ColumnId = new DataGridViewTextBoxColumn(); + ColumnName = new DataGridViewTextBoxColumn(); + ColumnCount = new DataGridViewTextBoxColumn(); + colorDialog1 = new ColorDialog(); + buttonSave = new Button(); + buttonCancel = new Button(); + ((System.ComponentModel.ISupportInitialize)dataGridView).BeginInit(); SuspendLayout(); // + // labelName + // + labelName.AutoSize = true; + labelName.Location = new Point(12, 9); + labelName.Name = "labelName"; + labelName.Size = new Size(80, 20); + labelName.TabIndex = 0; + labelName.Text = "Название:"; + // + // labelAddress + // + labelAddress.AutoSize = true; + labelAddress.Location = new Point(12, 41); + labelAddress.Name = "labelAddress"; + labelAddress.Size = new Size(54, 20); + labelAddress.TabIndex = 1; + labelAddress.Text = "Адрес:"; + // + // labelOpeningDate + // + labelOpeningDate.AutoSize = true; + labelOpeningDate.Location = new Point(12, 75); + labelOpeningDate.Name = "labelOpeningDate"; + labelOpeningDate.Size = new Size(113, 20); + labelOpeningDate.TabIndex = 2; + labelOpeningDate.Text = "Дата открытия:"; + // + // textBoxName + // + textBoxName.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right; + textBoxName.Location = new Point(98, 6); + textBoxName.Name = "textBoxName"; + textBoxName.Size = new Size(562, 27); + textBoxName.TabIndex = 3; + // + // textBoxAddress + // + textBoxAddress.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right; + textBoxAddress.Location = new Point(98, 38); + textBoxAddress.Name = "textBoxAddress"; + textBoxAddress.Size = new Size(562, 27); + textBoxAddress.TabIndex = 4; + // + // dateTimePickerOpeningDate + // + dateTimePickerOpeningDate.Location = new Point(131, 71); + dateTimePickerOpeningDate.Name = "dateTimePickerOpeningDate"; + dateTimePickerOpeningDate.Size = new Size(185, 27); + dateTimePickerOpeningDate.TabIndex = 5; + // + // dataGridView + // + dataGridView.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right; + dataGridView.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.Fill; + dataGridView.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.AutoSize; + dataGridView.Columns.AddRange(new DataGridViewColumn[] { ColumnId, ColumnName, ColumnCount }); + dataGridView.Location = new Point(12, 104); + dataGridView.Name = "dataGridView"; + dataGridView.RowHeadersVisible = false; + dataGridView.RowHeadersWidth = 51; + dataGridView.RowTemplate.Height = 29; + dataGridView.SelectionMode = DataGridViewSelectionMode.FullRowSelect; + dataGridView.Size = new Size(517, 334); + dataGridView.TabIndex = 6; + // + // ColumnId + // + ColumnId.HeaderText = "Id"; + ColumnId.MinimumWidth = 6; + ColumnId.Name = "ColumnId"; + ColumnId.Visible = false; + // + // ColumnName + // + ColumnName.AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill; + ColumnName.HeaderText = "Изделие"; + ColumnName.MinimumWidth = 6; + ColumnName.Name = "ColumnName"; + // + // ColumnCount + // + ColumnCount.AutoSizeMode = DataGridViewAutoSizeColumnMode.ColumnHeader; + ColumnCount.HeaderText = "Количество"; + ColumnCount.MinimumWidth = 6; + ColumnCount.Name = "ColumnCount"; + ColumnCount.Width = 119; + // + // buttonSave + // + buttonSave.Anchor = AnchorStyles.Top | AnchorStyles.Right; + buttonSave.Location = new Point(549, 145); + buttonSave.Name = "buttonSave"; + buttonSave.Size = new Size(94, 29); + buttonSave.TabIndex = 7; + buttonSave.Text = "Сохранить"; + buttonSave.UseVisualStyleBackColor = true; + // + // buttonCancel + // + buttonCancel.Anchor = AnchorStyles.Top | AnchorStyles.Right; + buttonCancel.Location = new Point(549, 219); + buttonCancel.Name = "buttonCancel"; + buttonCancel.Size = new Size(94, 29); + buttonCancel.TabIndex = 8; + buttonCancel.Text = "Закрыть"; + buttonCancel.UseVisualStyleBackColor = true; + // // FormShop // AutoScaleDimensions = new SizeF(8F, 20F); AutoScaleMode = AutoScaleMode.Font; - ClientSize = new Size(800, 450); + ClientSize = new Size(672, 450); + Controls.Add(buttonCancel); + Controls.Add(buttonSave); + Controls.Add(dataGridView); + Controls.Add(dateTimePickerOpeningDate); + Controls.Add(textBoxAddress); + Controls.Add(textBoxName); + Controls.Add(labelOpeningDate); + Controls.Add(labelAddress); + Controls.Add(labelName); Name = "FormShop"; Text = "Магазин"; + ((System.ComponentModel.ISupportInitialize)dataGridView).EndInit(); ResumeLayout(false); + PerformLayout(); } #endregion + + private Label labelName; + private Label labelAddress; + private Label labelOpeningDate; + private TextBox textBoxName; + private TextBox textBoxAddress; + private DateTimePicker dateTimePickerOpeningDate; + private DataGridView dataGridView; + private DataGridViewTextBoxColumn ColumnId; + private DataGridViewTextBoxColumn ColumnName; + private DataGridViewTextBoxColumn ColumnCount; + private ColorDialog colorDialog1; + private Button buttonSave; + private Button buttonCancel; } } \ No newline at end of file diff --git a/SecuritySystem/SecuritySystemView/Shop/FormShop.cs b/SecuritySystem/SecuritySystemView/Shop/FormShop.cs index 4d19325..6ea11d3 100644 --- a/SecuritySystem/SecuritySystemView/Shop/FormShop.cs +++ b/SecuritySystem/SecuritySystemView/Shop/FormShop.cs @@ -1,20 +1,125 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Data; -using System.Drawing; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Windows.Forms; +using Microsoft.Extensions.Logging; +using SecuritySystemContracts.BindingModels; +using SecuritySystemContracts.BusinessLogicsContracts; +using SecuritySystemContracts.SearchModels; +using SecuritySystemDataModels.Models; namespace SecuritySystemView { public partial class FormShop : Form { - public FormShop() + private readonly IShopLogic _logic; + private readonly ILogger _logger; + private Dictionary _shopSecures; + private int? _id; + public int Id { set { _id = value; } } + + public FormShop(ILogger logger, IShopLogic logic) { InitializeComponent(); + _logger = logger; + _logic = logic; + _shopSecures = new(); + } + + private void FormShop_Load(object sender, EventArgs e) + { + if (_id.HasValue) + { + _logger.LogInformation("Loading shop"); + + try + { + var view = _logic.ReadElement(new ShopSearchModel { Id = _id.Value }); + + if (view != null) + { + textBoxName.Text = view.Name; + textBoxAddress.Text = view.Address; + dateTimePickerOpeningDate.Value = view.OpeningDate; + _shopSecures = view.ShopSecures ?? new Dictionary(); + LoadData(); + } + } + catch (Exception ex) + { + _logger.LogError(ex, "Ошибка загрузки магазина"); + MessageBox.Show(ex.Message, "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error); + } + } + } + + private void LoadData() + { + _logger.LogInformation("Загрузка магазина"); + + try + { + if (_shopSecures != null) + { + dataGridView.Rows.Clear(); + foreach (var secure in _shopSecures) + { + dataGridView.Rows.Add(new object[] { secure.Key, secure.Value.Item1.SecureName, secure.Value.Item2 }); + } + } + } + catch (Exception ex) + { + _logger.LogError(ex, "Ошибка загрузки магазина"); + MessageBox.Show(ex.Message, "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error); + } + } + + private void buttonSave_Click(object sender, EventArgs e) + { + if (string.IsNullOrEmpty(textBoxName.Text)) + { + MessageBox.Show("Заполните название", "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error); + return; + } + + if (string.IsNullOrEmpty(textBoxAddress.Text)) + { + MessageBox.Show("Заполните адрес", "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error); + return; + } + + _logger.LogInformation("Сохранение магазина"); + + try + { + var model = new ShopBindingModel + { + Id = _id ?? 0, + Name = textBoxName.Text, + Address = textBoxAddress.Text, + OpeningDate = dateTimePickerOpeningDate.Value.Date, + ShopSecures = _shopSecures + }; + + var operationResult = _id.HasValue ? _logic.Update(model) : _logic.Create(model); + + if (!operationResult) + { + throw new Exception("Ошибка при сохранении. Дополнительная информация в логах."); + } + + MessageBox.Show("Сохранение прошло успешно", "Сообщение", MessageBoxButtons.OK, MessageBoxIcon.Information); + DialogResult = DialogResult.OK; + Close(); + } + catch (Exception ex) + { + _logger.LogError(ex, "Ошибка при сохранении магазина"); + MessageBox.Show(ex.Message, "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error); + } + } + + private void buttonCancel_Click(object sender, EventArgs e) + { + DialogResult = DialogResult.Cancel; + Close(); } } } diff --git a/SecuritySystem/SecuritySystemView/Shop/FormShop.resx b/SecuritySystem/SecuritySystemView/Shop/FormShop.resx index a395bff..09810c9 100644 --- a/SecuritySystem/SecuritySystemView/Shop/FormShop.resx +++ b/SecuritySystem/SecuritySystemView/Shop/FormShop.resx @@ -117,4 +117,16 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + True + + + True + + + True + + + 17, 17 + \ No newline at end of file From 671b74d99b5f2d16c315c904fc4783814fb35627 Mon Sep 17 00:00:00 2001 From: "ns.potapov" Date: Mon, 11 Mar 2024 11:20:30 +0400 Subject: [PATCH 17/20] =?UTF-8?q?=D0=A0=D0=B5=D0=B0=D0=BB=D0=B8=D0=B7?= =?UTF-8?q?=D0=BE=D0=B2=D0=B0=D0=BD=D1=8B=20=D1=84=D0=BE=D1=80=D0=BC=D1=8B?= =?UTF-8?q?=20=D0=B4=D0=BB=D1=8F=20=D1=80=D0=B0=D0=B1=D0=BE=D1=82=D1=8B=20?= =?UTF-8?q?=D1=81=20=D0=BC=D0=B3=D0=B0=D0=B7=D0=B8=D0=BD=D0=B0=D0=BC=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Shop/FormShop.Designer.cs | 3 + .../Shop/FormShopSupply.Designer.cs | 115 ++++++++++++++++- .../SecuritySystemView/Shop/FormShopSupply.cs | 117 ++++++++++++++++-- .../Shop/FormShopSupply.resx | 52 ++++---- 4 files changed, 247 insertions(+), 40 deletions(-) diff --git a/SecuritySystem/SecuritySystemView/Shop/FormShop.Designer.cs b/SecuritySystem/SecuritySystemView/Shop/FormShop.Designer.cs index 1c71dfa..c888b1b 100644 --- a/SecuritySystem/SecuritySystemView/Shop/FormShop.Designer.cs +++ b/SecuritySystem/SecuritySystemView/Shop/FormShop.Designer.cs @@ -140,6 +140,7 @@ buttonSave.TabIndex = 7; buttonSave.Text = "Сохранить"; buttonSave.UseVisualStyleBackColor = true; + buttonSave.Click += buttonSave_Click; // // buttonCancel // @@ -150,6 +151,7 @@ buttonCancel.TabIndex = 8; buttonCancel.Text = "Закрыть"; buttonCancel.UseVisualStyleBackColor = true; + buttonCancel.Click += buttonCancel_Click; // // FormShop // @@ -167,6 +169,7 @@ Controls.Add(labelName); Name = "FormShop"; Text = "Магазин"; + Load += FormShop_Load; ((System.ComponentModel.ISupportInitialize)dataGridView).EndInit(); ResumeLayout(false); PerformLayout(); diff --git a/SecuritySystem/SecuritySystemView/Shop/FormShopSupply.Designer.cs b/SecuritySystem/SecuritySystemView/Shop/FormShopSupply.Designer.cs index 9a26ee8..202b48c 100644 --- a/SecuritySystem/SecuritySystemView/Shop/FormShopSupply.Designer.cs +++ b/SecuritySystem/SecuritySystemView/Shop/FormShopSupply.Designer.cs @@ -28,12 +28,119 @@ /// private void InitializeComponent() { - this.components = new System.ComponentModel.Container(); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(800, 450); - this.Text = "FormShopSupply"; + comboBoxShop = new ComboBox(); + comboBoxSecure = new ComboBox(); + labelShop = new Label(); + label2 = new Label(); + label3 = new Label(); + buttonSupply = new Button(); + buttonCancel = new Button(); + textBoxCount = new TextBox(); + SuspendLayout(); + // + // comboBoxShop + // + comboBoxShop.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right; + comboBoxShop.FormattingEnabled = true; + comboBoxShop.Location = new Point(125, 6); + comboBoxShop.Name = "comboBoxShop"; + comboBoxShop.Size = new Size(432, 28); + comboBoxShop.TabIndex = 0; + // + // comboBoxSecure + // + comboBoxSecure.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right; + comboBoxSecure.FormattingEnabled = true; + comboBoxSecure.Location = new Point(125, 47); + comboBoxSecure.Name = "comboBoxSecure"; + comboBoxSecure.Size = new Size(432, 28); + comboBoxSecure.TabIndex = 1; + // + // labelShop + // + labelShop.AutoSize = true; + labelShop.Location = new Point(12, 9); + labelShop.Name = "labelShop"; + labelShop.Size = new Size(72, 20); + labelShop.TabIndex = 3; + labelShop.Text = "Магазин:"; + // + // label2 + // + label2.AutoSize = true; + label2.Location = new Point(12, 50); + label2.Name = "label2"; + label2.Size = new Size(71, 20); + label2.TabIndex = 4; + label2.Text = "Изделие:"; + // + // label3 + // + label3.AutoSize = true; + label3.Location = new Point(12, 89); + label3.Name = "label3"; + label3.Size = new Size(93, 20); + label3.TabIndex = 5; + label3.Text = "Количество:"; + // + // buttonSupply + // + buttonSupply.Anchor = AnchorStyles.Bottom | AnchorStyles.Right; + buttonSupply.Location = new Point(342, 130); + buttonSupply.Name = "buttonSupply"; + buttonSupply.Size = new Size(94, 29); + buttonSupply.TabIndex = 6; + buttonSupply.Text = "Поставить"; + buttonSupply.UseVisualStyleBackColor = true; + buttonSupply.Click += buttonSupply_Click; + // + // buttonCancel + // + buttonCancel.Anchor = AnchorStyles.Bottom | AnchorStyles.Right; + buttonCancel.Location = new Point(463, 130); + buttonCancel.Name = "buttonCancel"; + buttonCancel.Size = new Size(94, 29); + buttonCancel.TabIndex = 7; + buttonCancel.Text = "Отмена"; + buttonCancel.UseVisualStyleBackColor = true; + buttonCancel.Click += buttonCancel_Click; + // + // textBoxCount + // + textBoxCount.Location = new Point(125, 89); + textBoxCount.Name = "textBoxCount"; + textBoxCount.Size = new Size(167, 27); + textBoxCount.TabIndex = 8; + // + // FormShopSupply + // + AutoScaleDimensions = new SizeF(8F, 20F); + AutoScaleMode = AutoScaleMode.Font; + ClientSize = new Size(569, 169); + Controls.Add(textBoxCount); + Controls.Add(buttonCancel); + Controls.Add(buttonSupply); + Controls.Add(label3); + Controls.Add(label2); + Controls.Add(labelShop); + Controls.Add(comboBoxSecure); + Controls.Add(comboBoxShop); + Name = "FormShopSupply"; + Text = "Поставка изделия"; + Load += FormShopSupply_Load; + ResumeLayout(false); + PerformLayout(); } #endregion + + private ComboBox comboBoxShop; + private ComboBox comboBoxSecure; + private Label labelShop; + private Label label2; + private Label label3; + private Button buttonSupply; + private Button buttonCancel; + private TextBox textBoxCount; } } \ No newline at end of file diff --git a/SecuritySystem/SecuritySystemView/Shop/FormShopSupply.cs b/SecuritySystem/SecuritySystemView/Shop/FormShopSupply.cs index 463d314..ff14ef8 100644 --- a/SecuritySystem/SecuritySystemView/Shop/FormShopSupply.cs +++ b/SecuritySystem/SecuritySystemView/Shop/FormShopSupply.cs @@ -1,20 +1,117 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Data; -using System.Drawing; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Windows.Forms; +using Microsoft.Extensions.Logging; +using SecuritySystemContracts.BindingModels; +using SecuritySystemContracts.BusinessLogicsContracts; +using SecuritySystemContracts.SearchModels; namespace SecuritySystemView { public partial class FormShopSupply : Form { - public FormShopSupply() + private readonly ILogger _logger; + private readonly ISecureLogic _logicSecure; + private readonly IShopLogic _logicShop; + + public FormShopSupply(ILogger logger, ISecureLogic logicSecure, IShopLogic logicShop) { InitializeComponent(); + _logger = logger; + _logicSecure = logicSecure; + _logicShop = logicShop; + } + + private void FormShopSupply_Load(object sender, EventArgs e) + { + _logger.LogInformation("Загрузка secure для пополнения"); + + try + { + var list = _logicSecure.ReadList(null); + if (list != null) + { + comboBoxSecure.DisplayMember = "SecureName"; + comboBoxSecure.ValueMember = "Id"; + comboBoxSecure.DataSource = list; + comboBoxSecure.SelectedItem = null; + } + + } + catch (Exception ex) + { + _logger.LogError(ex, "Ошибка загрузки списка secure"); + MessageBox.Show(ex.Message, "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error); + } + + _logger.LogInformation("Загрузка магазинов для пополнения"); + + try + { + var list = _logicShop.ReadList(null); + if (list != null) + { + comboBoxShop.DisplayMember = "Name"; + comboBoxShop.ValueMember = "Id"; + comboBoxShop.DataSource = list; + comboBoxShop.SelectedItem = null; + } + + } + catch (Exception ex) + { + _logger.LogError(ex, "Ошибка загрузки списка магазинов"); + MessageBox.Show(ex.Message, "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error); + } + } + + private void buttonSupply_Click(object sender, EventArgs e) + { + if (string.IsNullOrEmpty(textBoxCount.Text)) + { + MessageBox.Show("Заполните поле Количество", "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error); + return; + } + + if (comboBoxSecure.SelectedValue == null) + { + MessageBox.Show("Выберите secure", "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error); + return; + } + + if (comboBoxShop.SelectedValue == null) + { + MessageBox.Show("Выберите магазин", "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error); + return; + } + + _logger.LogInformation("Создание поставки"); + + try + { + var operationResult = _logicShop.SupplySecures( + new ShopSearchModel { Id = Convert.ToInt32(comboBoxShop.SelectedValue), Name = comboBoxShop.Text }, + new SecureBindingModel { Id = Convert.ToInt32(comboBoxSecure.SelectedValue), SecureName = comboBoxSecure.Text }, + Convert.ToInt32(textBoxCount.Text) + ); + + if (!operationResult) + { + throw new Exception("Ошибка при создании поставки. Дополнительная информация в логах."); + } + + MessageBox.Show("Сохранение прошло успешно", "Сообщение", MessageBoxButtons.OK, MessageBoxIcon.Information); + DialogResult = DialogResult.OK; + Close(); + } + catch (Exception ex) + { + _logger.LogError(ex, "Ошибка создания поставки"); + MessageBox.Show(ex.Message, "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error); + } + } + + private void buttonCancel_Click(object sender, EventArgs e) + { + DialogResult = DialogResult.Cancel; + Close(); } } } diff --git a/SecuritySystem/SecuritySystemView/Shop/FormShopSupply.resx b/SecuritySystem/SecuritySystemView/Shop/FormShopSupply.resx index 1af7de1..a395bff 100644 --- a/SecuritySystem/SecuritySystemView/Shop/FormShopSupply.resx +++ b/SecuritySystem/SecuritySystemView/Shop/FormShopSupply.resx @@ -1,24 +1,24 @@  - From 138b58383ea46fda30302340dea381d72898fa3a Mon Sep 17 00:00:00 2001 From: "ns.potapov" Date: Mon, 11 Mar 2024 11:21:25 +0400 Subject: [PATCH 18/20] =?UTF-8?q?=D0=9F=D1=80=D0=B0=D0=B2=D0=BA=D0=B0=20?= =?UTF-8?q?=D0=B2=20Program?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- SecuritySystem/SecuritySystemView/Program.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/SecuritySystem/SecuritySystemView/Program.cs b/SecuritySystem/SecuritySystemView/Program.cs index e5fad2f..10ac2a8 100644 --- a/SecuritySystem/SecuritySystemView/Program.cs +++ b/SecuritySystem/SecuritySystemView/Program.cs @@ -39,6 +39,8 @@ namespace SecuritySystemView services.AddTransient(); services.AddTransient(); services.AddTransient(); + services.AddTransient(); + services.AddTransient(); services.AddTransient(); services.AddTransient(); services.AddTransient(); @@ -46,6 +48,9 @@ namespace SecuritySystemView services.AddTransient(); services.AddTransient(); services.AddTransient(); + services.AddTransient(); + services.AddTransient(); + services.AddTransient(); } } } \ No newline at end of file From 0ba2240d1fbe0e2fb3c78ce5ad74a7b4bd11098b Mon Sep 17 00:00:00 2001 From: "ns.potapov" Date: Mon, 11 Mar 2024 11:22:37 +0400 Subject: [PATCH 19/20] =?UTF-8?q?=D0=9F=D1=80=D0=B0=D0=B2=D0=BA=D0=B0=20?= =?UTF-8?q?=D1=81=D1=82=D0=B8=D0=BB=D1=8F=20dropdown?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../SecuritySystemView/Shop/FormShopSupply.Designer.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/SecuritySystem/SecuritySystemView/Shop/FormShopSupply.Designer.cs b/SecuritySystem/SecuritySystemView/Shop/FormShopSupply.Designer.cs index 202b48c..08b5bec 100644 --- a/SecuritySystem/SecuritySystemView/Shop/FormShopSupply.Designer.cs +++ b/SecuritySystem/SecuritySystemView/Shop/FormShopSupply.Designer.cs @@ -41,6 +41,7 @@ // comboBoxShop // comboBoxShop.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right; + comboBoxShop.DropDownStyle = ComboBoxStyle.DropDownList; comboBoxShop.FormattingEnabled = true; comboBoxShop.Location = new Point(125, 6); comboBoxShop.Name = "comboBoxShop"; @@ -50,6 +51,7 @@ // comboBoxSecure // comboBoxSecure.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right; + comboBoxSecure.DropDownStyle = ComboBoxStyle.DropDownList; comboBoxSecure.FormattingEnabled = true; comboBoxSecure.Location = new Point(125, 47); comboBoxSecure.Name = "comboBoxSecure"; From 6f0b96bd9ab9af6379b7024d5176b0b3a4533575 Mon Sep 17 00:00:00 2001 From: "ns.potapov" Date: Sun, 24 Mar 2024 10:37:26 +0400 Subject: [PATCH 20/20] =?UTF-8?q?=D0=98=D1=81=D0=BF=D1=80=D0=B0=D0=B2?= =?UTF-8?q?=D0=BB=D0=B5=D0=BD=20=D0=BF=D0=BE=D1=80=D1=8F=D0=B4=D0=BE=D0=BA?= =?UTF-8?q?=20tab=20=D0=BD=D0=B0=20=D1=84=D0=BE=D1=80=D0=BC=D0=B0=D1=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Component/FormComponent.Designer.cs | 8 ++++---- .../Order/FormCreateOrder.Designer.cs | 8 ++++---- .../Secure/FormSecure.Designer.cs | 16 ++++++++-------- .../Secure/FormSecureComponent.Designer.cs | 8 ++++---- .../Secure/FormSecures.Designer.cs | 6 +++--- .../SecuritySystemView/Shop/FormShop.Designer.cs | 10 +++++----- .../Shop/FormShopSupply.Designer.cs | 10 +++++----- .../Shop/FormShops.Designer.cs | 8 ++++---- 8 files changed, 37 insertions(+), 37 deletions(-) diff --git a/SecuritySystem/SecuritySystemView/Component/FormComponent.Designer.cs b/SecuritySystem/SecuritySystemView/Component/FormComponent.Designer.cs index ffb456e..17bf335 100644 --- a/SecuritySystem/SecuritySystemView/Component/FormComponent.Designer.cs +++ b/SecuritySystem/SecuritySystemView/Component/FormComponent.Designer.cs @@ -41,14 +41,14 @@ textBoxComponentName.Location = new Point(98, 6); textBoxComponentName.Name = "textBoxComponentName"; textBoxComponentName.Size = new Size(372, 27); - textBoxComponentName.TabIndex = 0; + textBoxComponentName.TabIndex = 1; // // textBoxComponentCost // textBoxComponentCost.Location = new Point(98, 41); textBoxComponentCost.Name = "textBoxComponentCost"; textBoxComponentCost.Size = new Size(125, 27); - textBoxComponentCost.TabIndex = 1; + textBoxComponentCost.TabIndex = 2; // // labelComponentName // @@ -73,7 +73,7 @@ buttonSaveComponent.Location = new Point(211, 80); buttonSaveComponent.Name = "buttonSaveComponent"; buttonSaveComponent.Size = new Size(115, 29); - buttonSaveComponent.TabIndex = 1; + buttonSaveComponent.TabIndex = 3; buttonSaveComponent.Text = "Сохранить"; buttonSaveComponent.UseVisualStyleBackColor = true; buttonSaveComponent.Click += ButtonSaveComponent_Click; @@ -83,7 +83,7 @@ buttonCancel.Location = new Point(348, 80); buttonCancel.Name = "buttonCancel"; buttonCancel.Size = new Size(122, 29); - buttonCancel.TabIndex = 5; + buttonCancel.TabIndex = 4; buttonCancel.Text = "Отмена"; buttonCancel.UseVisualStyleBackColor = true; buttonCancel.Click += ButtonCancel_Click; diff --git a/SecuritySystem/SecuritySystemView/Order/FormCreateOrder.Designer.cs b/SecuritySystem/SecuritySystemView/Order/FormCreateOrder.Designer.cs index d99f108..0c53ac2 100644 --- a/SecuritySystem/SecuritySystemView/Order/FormCreateOrder.Designer.cs +++ b/SecuritySystem/SecuritySystemView/Order/FormCreateOrder.Designer.cs @@ -72,7 +72,7 @@ comboBoxSecure.Location = new Point(110, 9); comboBoxSecure.Name = "comboBoxSecure"; comboBoxSecure.Size = new Size(462, 28); - comboBoxSecure.TabIndex = 3; + comboBoxSecure.TabIndex = 1; comboBoxSecure.SelectedIndexChanged += ComboBoxSecure_SelectedIndexChanged; // // textBoxCount @@ -80,7 +80,7 @@ textBoxCount.Location = new Point(110, 43); textBoxCount.Name = "textBoxCount"; textBoxCount.Size = new Size(462, 27); - textBoxCount.TabIndex = 4; + textBoxCount.TabIndex = 2; textBoxCount.TextChanged += TextBoxCount_TextChanged; // // textBoxSum @@ -96,7 +96,7 @@ buttonSave.Location = new Point(370, 118); buttonSave.Name = "buttonSave"; buttonSave.Size = new Size(94, 29); - buttonSave.TabIndex = 1; + buttonSave.TabIndex = 3; buttonSave.Text = "Сохранить"; buttonSave.UseVisualStyleBackColor = true; buttonSave.Click += ButtonSave_Click; @@ -106,7 +106,7 @@ buttonCancel.Location = new Point(478, 118); buttonCancel.Name = "buttonCancel"; buttonCancel.Size = new Size(94, 29); - buttonCancel.TabIndex = 7; + buttonCancel.TabIndex = 4; buttonCancel.Text = "Отменить"; buttonCancel.UseVisualStyleBackColor = true; buttonCancel.Click += ButtonCancel_Click; diff --git a/SecuritySystem/SecuritySystemView/Secure/FormSecure.Designer.cs b/SecuritySystem/SecuritySystemView/Secure/FormSecure.Designer.cs index d64046a..99d5de1 100644 --- a/SecuritySystem/SecuritySystemView/Secure/FormSecure.Designer.cs +++ b/SecuritySystem/SecuritySystemView/Secure/FormSecure.Designer.cs @@ -70,7 +70,7 @@ textBoxName.Location = new Point(108, 6); textBoxName.Name = "textBoxName"; textBoxName.Size = new Size(368, 27); - textBoxName.TabIndex = 2; + textBoxName.TabIndex = 1; // // textBoxPrice // @@ -78,7 +78,7 @@ textBoxPrice.Location = new Point(108, 43); textBoxPrice.Name = "textBoxPrice"; textBoxPrice.Size = new Size(143, 27); - textBoxPrice.TabIndex = 3; + textBoxPrice.TabIndex = 2; // // groupBoxComponentsControl // @@ -99,7 +99,7 @@ buttonRefresh.Location = new Point(668, 197); buttonRefresh.Name = "buttonRefresh"; buttonRefresh.Size = new Size(94, 29); - buttonRefresh.TabIndex = 4; + buttonRefresh.TabIndex = 6; buttonRefresh.Text = "Обновить"; buttonRefresh.UseVisualStyleBackColor = true; buttonRefresh.Click += ButtonRefresh_Click; @@ -109,7 +109,7 @@ buttonDelete.Location = new Point(668, 147); buttonDelete.Name = "buttonDelete"; buttonDelete.Size = new Size(94, 29); - buttonDelete.TabIndex = 3; + buttonDelete.TabIndex = 5; buttonDelete.Text = "Удалить"; buttonDelete.UseVisualStyleBackColor = true; buttonDelete.Click += ButtonDelete_Click; @@ -119,7 +119,7 @@ buttonEdit.Location = new Point(668, 99); buttonEdit.Name = "buttonEdit"; buttonEdit.Size = new Size(94, 29); - buttonEdit.TabIndex = 2; + buttonEdit.TabIndex = 4; buttonEdit.Text = "Изменить"; buttonEdit.UseVisualStyleBackColor = true; buttonEdit.Click += ButtonEdit_Click; @@ -129,7 +129,7 @@ buttonAdd.Location = new Point(668, 48); buttonAdd.Name = "buttonAdd"; buttonAdd.Size = new Size(94, 29); - buttonAdd.TabIndex = 1; + buttonAdd.TabIndex = 3; buttonAdd.Text = "Добавить"; buttonAdd.UseVisualStyleBackColor = true; buttonAdd.Click += ButtonAdd_Click; @@ -173,7 +173,7 @@ buttonSave.Location = new Point(537, 409); buttonSave.Name = "buttonSave"; buttonSave.Size = new Size(108, 29); - buttonSave.TabIndex = 1; + buttonSave.TabIndex = 7; buttonSave.Text = "Сохранить"; buttonSave.UseVisualStyleBackColor = true; buttonSave.Click += ButtonSave_Click; @@ -183,7 +183,7 @@ buttonCancel.Location = new Point(665, 409); buttonCancel.Name = "buttonCancel"; buttonCancel.Size = new Size(109, 29); - buttonCancel.TabIndex = 6; + buttonCancel.TabIndex = 8; buttonCancel.Text = "Отмена"; buttonCancel.UseVisualStyleBackColor = true; buttonCancel.Click += ButtonCancel_Click; diff --git a/SecuritySystem/SecuritySystemView/Secure/FormSecureComponent.Designer.cs b/SecuritySystem/SecuritySystemView/Secure/FormSecureComponent.Designer.cs index f49c86c..06d5749 100644 --- a/SecuritySystem/SecuritySystemView/Secure/FormSecureComponent.Designer.cs +++ b/SecuritySystem/SecuritySystemView/Secure/FormSecureComponent.Designer.cs @@ -61,21 +61,21 @@ comboBoxComponents.Location = new Point(109, 6); comboBoxComponents.Name = "comboBoxComponents"; comboBoxComponents.Size = new Size(315, 28); - comboBoxComponents.TabIndex = 2; + comboBoxComponents.TabIndex = 1; // // textBoxCount // textBoxCount.Location = new Point(109, 41); textBoxCount.Name = "textBoxCount"; textBoxCount.Size = new Size(315, 27); - textBoxCount.TabIndex = 3; + textBoxCount.TabIndex = 2; // // buttonSave // buttonSave.Location = new Point(230, 84); buttonSave.Name = "buttonSave"; buttonSave.Size = new Size(94, 29); - buttonSave.TabIndex = 1; + buttonSave.TabIndex = 3; buttonSave.Text = "Сохранить"; buttonSave.UseVisualStyleBackColor = true; buttonSave.Click += ButtonSave_Click; @@ -85,7 +85,7 @@ buttonCancel.Location = new Point(330, 84); buttonCancel.Name = "buttonCancel"; buttonCancel.Size = new Size(94, 29); - buttonCancel.TabIndex = 5; + buttonCancel.TabIndex = 4; buttonCancel.Text = "Отмена"; buttonCancel.UseVisualStyleBackColor = true; buttonCancel.Click += ButtonCancel_Click; diff --git a/SecuritySystem/SecuritySystemView/Secure/FormSecures.Designer.cs b/SecuritySystem/SecuritySystemView/Secure/FormSecures.Designer.cs index b3ac3b4..06698ee 100644 --- a/SecuritySystem/SecuritySystemView/Secure/FormSecures.Designer.cs +++ b/SecuritySystem/SecuritySystemView/Secure/FormSecures.Designer.cs @@ -56,7 +56,7 @@ buttonRefresh.Location = new Point(739, 162); buttonRefresh.Name = "buttonRefresh"; buttonRefresh.Size = new Size(94, 29); - buttonRefresh.TabIndex = 8; + buttonRefresh.TabIndex = 4; buttonRefresh.Text = "Обновить"; buttonRefresh.UseVisualStyleBackColor = true; buttonRefresh.Click += ButtonRefreshSecures_Click; @@ -67,7 +67,7 @@ buttonDelete.Location = new Point(739, 114); buttonDelete.Name = "buttonDelete"; buttonDelete.Size = new Size(94, 29); - buttonDelete.TabIndex = 7; + buttonDelete.TabIndex = 3; buttonDelete.Text = "Удалить"; buttonDelete.UseVisualStyleBackColor = true; buttonDelete.Click += ButtonDeleteSecure_Click; @@ -78,7 +78,7 @@ buttonEdit.Location = new Point(739, 64); buttonEdit.Name = "buttonEdit"; buttonEdit.Size = new Size(94, 29); - buttonEdit.TabIndex = 6; + buttonEdit.TabIndex = 2; buttonEdit.Text = "Изменить"; buttonEdit.UseVisualStyleBackColor = true; buttonEdit.Click += ButtonEditSecure_Click; diff --git a/SecuritySystem/SecuritySystemView/Shop/FormShop.Designer.cs b/SecuritySystem/SecuritySystemView/Shop/FormShop.Designer.cs index c888b1b..cdaf9ef 100644 --- a/SecuritySystem/SecuritySystemView/Shop/FormShop.Designer.cs +++ b/SecuritySystem/SecuritySystemView/Shop/FormShop.Designer.cs @@ -77,7 +77,7 @@ textBoxName.Location = new Point(98, 6); textBoxName.Name = "textBoxName"; textBoxName.Size = new Size(562, 27); - textBoxName.TabIndex = 3; + textBoxName.TabIndex = 1; // // textBoxAddress // @@ -85,14 +85,14 @@ textBoxAddress.Location = new Point(98, 38); textBoxAddress.Name = "textBoxAddress"; textBoxAddress.Size = new Size(562, 27); - textBoxAddress.TabIndex = 4; + textBoxAddress.TabIndex = 2; // // dateTimePickerOpeningDate // dateTimePickerOpeningDate.Location = new Point(131, 71); dateTimePickerOpeningDate.Name = "dateTimePickerOpeningDate"; dateTimePickerOpeningDate.Size = new Size(185, 27); - dateTimePickerOpeningDate.TabIndex = 5; + dateTimePickerOpeningDate.TabIndex = 3; // // dataGridView // @@ -137,7 +137,7 @@ buttonSave.Location = new Point(549, 145); buttonSave.Name = "buttonSave"; buttonSave.Size = new Size(94, 29); - buttonSave.TabIndex = 7; + buttonSave.TabIndex = 4; buttonSave.Text = "Сохранить"; buttonSave.UseVisualStyleBackColor = true; buttonSave.Click += buttonSave_Click; @@ -148,7 +148,7 @@ buttonCancel.Location = new Point(549, 219); buttonCancel.Name = "buttonCancel"; buttonCancel.Size = new Size(94, 29); - buttonCancel.TabIndex = 8; + buttonCancel.TabIndex = 5; buttonCancel.Text = "Закрыть"; buttonCancel.UseVisualStyleBackColor = true; buttonCancel.Click += buttonCancel_Click; diff --git a/SecuritySystem/SecuritySystemView/Shop/FormShopSupply.Designer.cs b/SecuritySystem/SecuritySystemView/Shop/FormShopSupply.Designer.cs index 08b5bec..0a99cab 100644 --- a/SecuritySystem/SecuritySystemView/Shop/FormShopSupply.Designer.cs +++ b/SecuritySystem/SecuritySystemView/Shop/FormShopSupply.Designer.cs @@ -46,7 +46,7 @@ comboBoxShop.Location = new Point(125, 6); comboBoxShop.Name = "comboBoxShop"; comboBoxShop.Size = new Size(432, 28); - comboBoxShop.TabIndex = 0; + comboBoxShop.TabIndex = 1; // // comboBoxSecure // @@ -56,7 +56,7 @@ comboBoxSecure.Location = new Point(125, 47); comboBoxSecure.Name = "comboBoxSecure"; comboBoxSecure.Size = new Size(432, 28); - comboBoxSecure.TabIndex = 1; + comboBoxSecure.TabIndex = 2; // // labelShop // @@ -91,7 +91,7 @@ buttonSupply.Location = new Point(342, 130); buttonSupply.Name = "buttonSupply"; buttonSupply.Size = new Size(94, 29); - buttonSupply.TabIndex = 6; + buttonSupply.TabIndex = 4; buttonSupply.Text = "Поставить"; buttonSupply.UseVisualStyleBackColor = true; buttonSupply.Click += buttonSupply_Click; @@ -102,7 +102,7 @@ buttonCancel.Location = new Point(463, 130); buttonCancel.Name = "buttonCancel"; buttonCancel.Size = new Size(94, 29); - buttonCancel.TabIndex = 7; + buttonCancel.TabIndex = 5; buttonCancel.Text = "Отмена"; buttonCancel.UseVisualStyleBackColor = true; buttonCancel.Click += buttonCancel_Click; @@ -112,7 +112,7 @@ textBoxCount.Location = new Point(125, 89); textBoxCount.Name = "textBoxCount"; textBoxCount.Size = new Size(167, 27); - textBoxCount.TabIndex = 8; + textBoxCount.TabIndex = 3; // // FormShopSupply // diff --git a/SecuritySystem/SecuritySystemView/Shop/FormShops.Designer.cs b/SecuritySystem/SecuritySystemView/Shop/FormShops.Designer.cs index e3588d0..42e785c 100644 --- a/SecuritySystem/SecuritySystemView/Shop/FormShops.Designer.cs +++ b/SecuritySystem/SecuritySystemView/Shop/FormShops.Designer.cs @@ -58,7 +58,7 @@ buttonRefresh.Location = new Point(735, 261); buttonRefresh.Name = "buttonRefresh"; buttonRefresh.Size = new Size(94, 29); - buttonRefresh.TabIndex = 8; + buttonRefresh.TabIndex = 4; buttonRefresh.Text = "Обновить"; buttonRefresh.UseVisualStyleBackColor = true; buttonRefresh.Click += buttonRefresh_Click; @@ -69,7 +69,7 @@ buttonDelete.Location = new Point(735, 213); buttonDelete.Name = "buttonDelete"; buttonDelete.Size = new Size(94, 29); - buttonDelete.TabIndex = 7; + buttonDelete.TabIndex = 3; buttonDelete.Text = "Удалить"; buttonDelete.UseVisualStyleBackColor = true; buttonDelete.Click += buttonDelete_Click; @@ -80,7 +80,7 @@ buttonEdit.Location = new Point(735, 163); buttonEdit.Name = "buttonEdit"; buttonEdit.Size = new Size(94, 29); - buttonEdit.TabIndex = 6; + buttonEdit.TabIndex = 2; buttonEdit.Text = "Изменить"; buttonEdit.UseVisualStyleBackColor = true; buttonEdit.Click += buttonEdit_Click; @@ -91,7 +91,7 @@ buttonAdd.Location = new Point(735, 111); buttonAdd.Name = "buttonAdd"; buttonAdd.Size = new Size(94, 29); - buttonAdd.TabIndex = 5; + buttonAdd.TabIndex = 1; buttonAdd.Text = "Добавить"; buttonAdd.UseVisualStyleBackColor = true; buttonAdd.Click += buttonAdd_Click;