From 816fdcb208645ac4bfadc375168ea2eca68c4e7c Mon Sep 17 00:00:00 2001 From: bekodeg Date: Thu, 25 Apr 2024 22:20:09 +0400 Subject: [PATCH] =?UTF-8?q?=D0=B8=D1=81=D0=BF=D1=80=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=D0=B8=D0=B5=20=D0=BC=D0=BE=D0=B4=D0=B5=D0=BB=D0=B5?= =?UTF-8?q?=D0=B9=20viue?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../BindingModels/ComponentBindingModel.cs | 2 +- .../ComputerHardwareStoreContracts.csproj | 4 ++++ .../{BuildModelContracts.cs => BuildViewModel.cs} | 6 +++--- .../{CommentModelContracts.cs => CommentViewModel.cs} | 4 ++-- .../{ComponentModelContracts.cs => ComponentViewModel.cs} | 5 +++-- .../{OrderModelContracts.cs => OrderViewModel.cs} | 6 +++--- .../{ProductModelContracts.cs => ProductViewModel.cs} | 5 +++-- .../{PurchaseModelContracts.cs => PurchaseViewModel.cs} | 6 +++--- ...oreKeeperModelContracts.cs => StoreKeeperViewModel.cs} | 8 ++++---- .../{VendorModelContracts.cs => VendorViewModel.cs} | 8 ++++---- .../ComputerHardwareStoreDataModels/Models/IBuildModel.cs | 2 +- .../Models/IComponentModel.cs | 2 +- .../ComputerHardwareStoreDataModels/Models/IOrderModel.cs | 1 - 13 files changed, 32 insertions(+), 27 deletions(-) rename ComputerHardwareStore/ComputerHardwareStoreContracts/ViewModels/{BuildModelContracts.cs => BuildViewModel.cs} (77%) rename ComputerHardwareStore/ComputerHardwareStoreContracts/ViewModels/{CommentModelContracts.cs => CommentViewModel.cs} (68%) rename ComputerHardwareStore/ComputerHardwareStoreContracts/ViewModels/{ComponentModelContracts.cs => ComponentViewModel.cs} (67%) rename ComputerHardwareStore/ComputerHardwareStoreContracts/ViewModels/{OrderModelContracts.cs => OrderViewModel.cs} (76%) rename ComputerHardwareStore/ComputerHardwareStoreContracts/ViewModels/{ProductModelContracts.cs => ProductViewModel.cs} (65%) rename ComputerHardwareStore/ComputerHardwareStoreContracts/ViewModels/{PurchaseModelContracts.cs => PurchaseViewModel.cs} (85%) rename ComputerHardwareStore/ComputerHardwareStoreContracts/ViewModels/{StoreKeeperModelContracts.cs => StoreKeeperViewModel.cs} (56%) rename ComputerHardwareStore/ComputerHardwareStoreContracts/ViewModels/{VendorModelContracts.cs => VendorViewModel.cs} (57%) diff --git a/ComputerHardwareStore/ComputerHardwareStoreContracts/BindingModels/ComponentBindingModel.cs b/ComputerHardwareStore/ComputerHardwareStoreContracts/BindingModels/ComponentBindingModel.cs index ecc9bc5..56ae673 100644 --- a/ComputerHardwareStore/ComputerHardwareStoreContracts/BindingModels/ComponentBindingModel.cs +++ b/ComputerHardwareStore/ComputerHardwareStoreContracts/BindingModels/ComponentBindingModel.cs @@ -5,7 +5,7 @@ namespace ComputerHardwareStoreContracts.BindingModels public class ComponentBindingModel : IComponentModel { public int Id { get; set; } - public string ComponentName { get; set; } = string.Empty; + public string Name { get; set; } = string.Empty; public double Cost { get; set; } } } diff --git a/ComputerHardwareStore/ComputerHardwareStoreContracts/ComputerHardwareStoreContracts.csproj b/ComputerHardwareStore/ComputerHardwareStoreContracts/ComputerHardwareStoreContracts.csproj index 9f4545e..813c446 100644 --- a/ComputerHardwareStore/ComputerHardwareStoreContracts/ComputerHardwareStoreContracts.csproj +++ b/ComputerHardwareStore/ComputerHardwareStoreContracts/ComputerHardwareStoreContracts.csproj @@ -14,4 +14,8 @@ + + + + diff --git a/ComputerHardwareStore/ComputerHardwareStoreContracts/ViewModels/BuildModelContracts.cs b/ComputerHardwareStore/ComputerHardwareStoreContracts/ViewModels/BuildViewModel.cs similarity index 77% rename from ComputerHardwareStore/ComputerHardwareStoreContracts/ViewModels/BuildModelContracts.cs rename to ComputerHardwareStore/ComputerHardwareStoreContracts/ViewModels/BuildViewModel.cs index 10ccf1b..5b5b5b7 100644 --- a/ComputerHardwareStore/ComputerHardwareStoreContracts/ViewModels/BuildModelContracts.cs +++ b/ComputerHardwareStore/ComputerHardwareStoreContracts/ViewModels/BuildViewModel.cs @@ -3,14 +3,14 @@ using System.ComponentModel; namespace ComputerHardwareStoreContracts.ViewModels { - public class BuildModelContracts : IBuildModel + public class BuildViewModel : IBuildModel { public int Id { get; set; } [DisplayName("Название сборки")] - public string BuildName { get; } + public string Name { get; } = string.Empty; [DisplayName("Стоимость")] public double Price { get; } public int VendorId { get; } - public Dictionary BuildComponent { get; } + public Dictionary BuildComponent { get; } = new(); } } diff --git a/ComputerHardwareStore/ComputerHardwareStoreContracts/ViewModels/CommentModelContracts.cs b/ComputerHardwareStore/ComputerHardwareStoreContracts/ViewModels/CommentViewModel.cs similarity index 68% rename from ComputerHardwareStore/ComputerHardwareStoreContracts/ViewModels/CommentModelContracts.cs rename to ComputerHardwareStore/ComputerHardwareStoreContracts/ViewModels/CommentViewModel.cs index ff666ee..b62b98c 100644 --- a/ComputerHardwareStore/ComputerHardwareStoreContracts/ViewModels/CommentModelContracts.cs +++ b/ComputerHardwareStore/ComputerHardwareStoreContracts/ViewModels/CommentViewModel.cs @@ -2,11 +2,11 @@ namespace ComputerHardwareStoreContracts.ViewModels { - public class CommentModelContracts : ICommentModel + public class CommentViewModel : ICommentModel { public int Id { get; set; } public DateTime Date { get; set; } - public string Text { get; set; } + public string Text { get; set; } = string.Empty; public int BuildId { get; set; } } } diff --git a/ComputerHardwareStore/ComputerHardwareStoreContracts/ViewModels/ComponentModelContracts.cs b/ComputerHardwareStore/ComputerHardwareStoreContracts/ViewModels/ComponentViewModel.cs similarity index 67% rename from ComputerHardwareStore/ComputerHardwareStoreContracts/ViewModels/ComponentModelContracts.cs rename to ComputerHardwareStore/ComputerHardwareStoreContracts/ViewModels/ComponentViewModel.cs index 6bc7d6a..6aadb04 100644 --- a/ComputerHardwareStore/ComputerHardwareStoreContracts/ViewModels/ComponentModelContracts.cs +++ b/ComputerHardwareStore/ComputerHardwareStoreContracts/ViewModels/ComponentViewModel.cs @@ -3,12 +3,13 @@ using System.ComponentModel; namespace ComputerHardwareStoreContracts.ViewModels { - public class ComponentModelContracts : IComponentModel + public class ComponentViewModel : IComponentModel { public int Id { get; set; } [DisplayName("Название компонента")] - public string ComponentName { get; set; } = string.Empty; + public string Name { get; set; } = string.Empty; [DisplayName("Цена")] public double Cost { get; set; } + public int StoreKeeperId { get; set; } } } diff --git a/ComputerHardwareStore/ComputerHardwareStoreContracts/ViewModels/OrderModelContracts.cs b/ComputerHardwareStore/ComputerHardwareStoreContracts/ViewModels/OrderViewModel.cs similarity index 76% rename from ComputerHardwareStore/ComputerHardwareStoreContracts/ViewModels/OrderModelContracts.cs rename to ComputerHardwareStore/ComputerHardwareStoreContracts/ViewModels/OrderViewModel.cs index 0a56ec2..02394a4 100644 --- a/ComputerHardwareStore/ComputerHardwareStoreContracts/ViewModels/OrderModelContracts.cs +++ b/ComputerHardwareStore/ComputerHardwareStoreContracts/ViewModels/OrderViewModel.cs @@ -3,13 +3,13 @@ using System.ComponentModel; namespace ComputerHardwareStoreContracts.ViewModels { - public class OrderModelContracts : IOrderModel + public class OrderViewModel : IOrderModel { public int Id { get; set; } [DisplayName("Стоимость")] public double Cost { get; set; } [DisplayName("Дата создания")] - DateTime DateCreate { get; set; } - public Dictionary OrderProduct { get; set; } + public DateTime DateCreate { get; set; } + public Dictionary OrderProduct { get; set; } = new(); } } diff --git a/ComputerHardwareStore/ComputerHardwareStoreContracts/ViewModels/ProductModelContracts.cs b/ComputerHardwareStore/ComputerHardwareStoreContracts/ViewModels/ProductViewModel.cs similarity index 65% rename from ComputerHardwareStore/ComputerHardwareStoreContracts/ViewModels/ProductModelContracts.cs rename to ComputerHardwareStore/ComputerHardwareStoreContracts/ViewModels/ProductViewModel.cs index 6a38c07..276e98a 100644 --- a/ComputerHardwareStore/ComputerHardwareStoreContracts/ViewModels/ProductModelContracts.cs +++ b/ComputerHardwareStore/ComputerHardwareStoreContracts/ViewModels/ProductViewModel.cs @@ -3,14 +3,15 @@ using System.ComponentModel; namespace ComputerHardwareStoreContracts.ViewModels { - public class ProductModelContracts : IProductModel + public class ProductViewModel : IProductModel { public int Id { get; set; } [DisplayName("Название изделия")] - public string CannedName { get; set; } + public string Name { get; set; } = string.Empty; [DisplayName("Цена")] public double Price { get; set; } public Dictionary CannedComponents { get; set; } = new(); + public Dictionary ProductComponent => throw new NotImplementedException(); } } diff --git a/ComputerHardwareStore/ComputerHardwareStoreContracts/ViewModels/PurchaseModelContracts.cs b/ComputerHardwareStore/ComputerHardwareStoreContracts/ViewModels/PurchaseViewModel.cs similarity index 85% rename from ComputerHardwareStore/ComputerHardwareStoreContracts/ViewModels/PurchaseModelContracts.cs rename to ComputerHardwareStore/ComputerHardwareStoreContracts/ViewModels/PurchaseViewModel.cs index 345e839..d0de94d 100644 --- a/ComputerHardwareStore/ComputerHardwareStoreContracts/ViewModels/PurchaseModelContracts.cs +++ b/ComputerHardwareStore/ComputerHardwareStoreContracts/ViewModels/PurchaseViewModel.cs @@ -3,7 +3,7 @@ using System.ComponentModel; namespace ComputerHardwareStoreContracts.ViewModels { - public class PurchaseModelContracts : IPurchaseModel + public class PurchaseViewModel : IPurchaseModel { public int Id { get; set; } [DisplayName("Стоимость")] @@ -13,8 +13,8 @@ namespace ComputerHardwareStoreContracts.ViewModels public int VendorId { get; set; } [DisplayName("Сумма")] public double Sum { get; set; } - public Dictionary PurchaseBuild { get; set; } + public Dictionary PurchaseBuild { get; set; } = new(); - public Dictionary PurchaseProduct { get; set; } + public Dictionary PurchaseProduct { get; set; } = new(); } } diff --git a/ComputerHardwareStore/ComputerHardwareStoreContracts/ViewModels/StoreKeeperModelContracts.cs b/ComputerHardwareStore/ComputerHardwareStoreContracts/ViewModels/StoreKeeperViewModel.cs similarity index 56% rename from ComputerHardwareStore/ComputerHardwareStoreContracts/ViewModels/StoreKeeperModelContracts.cs rename to ComputerHardwareStore/ComputerHardwareStoreContracts/ViewModels/StoreKeeperViewModel.cs index 6659ebf..7bcce0e 100644 --- a/ComputerHardwareStore/ComputerHardwareStoreContracts/ViewModels/StoreKeeperModelContracts.cs +++ b/ComputerHardwareStore/ComputerHardwareStoreContracts/ViewModels/StoreKeeperViewModel.cs @@ -3,14 +3,14 @@ using System.ComponentModel; namespace ComputerHardwareStoreContracts.ViewModels { - public class StoreKeeperModelContracts : IStoreKeeperModel + public class StoreKeeperViewModel : IStoreKeeperModel { public int Id { get; set; } [DisplayName("Имя кладовщика")] - public string Name { get; set; } + public string Name { get; set; } = string.Empty; [DisplayName("Логин")] - public string Login { get; set; } + public string Login { get; set; } = string.Empty; [DisplayName("Пароль")] - public string Password { get; set; } + public string Password { get; set; } = string.Empty; } } diff --git a/ComputerHardwareStore/ComputerHardwareStoreContracts/ViewModels/VendorModelContracts.cs b/ComputerHardwareStore/ComputerHardwareStoreContracts/ViewModels/VendorViewModel.cs similarity index 57% rename from ComputerHardwareStore/ComputerHardwareStoreContracts/ViewModels/VendorModelContracts.cs rename to ComputerHardwareStore/ComputerHardwareStoreContracts/ViewModels/VendorViewModel.cs index 1eb35eb..d734328 100644 --- a/ComputerHardwareStore/ComputerHardwareStoreContracts/ViewModels/VendorModelContracts.cs +++ b/ComputerHardwareStore/ComputerHardwareStoreContracts/ViewModels/VendorViewModel.cs @@ -3,14 +3,14 @@ using System.ComponentModel; namespace ComputerHardwareStoreContracts.ViewModels { - public class VendorModelContracts : IVendorModel + public class VendorViewModel : IVendorModel { public int Id { get; set; } [DisplayName("Имя продавца")] - public string Name { get; set; } + public string Name { get; set; } = string.Empty; [DisplayName("Логин")] - public string Login { get; set; } + public string Login { get; set; } = string.Empty; [DisplayName("Пароль")] - public string Password { get; set; } + public string Password { get; set; } = string.Empty; } } \ No newline at end of file diff --git a/ComputerHardwareStore/ComputerHardwareStoreDataModels/Models/IBuildModel.cs b/ComputerHardwareStore/ComputerHardwareStoreDataModels/Models/IBuildModel.cs index 823f80c..e8dfc3a 100644 --- a/ComputerHardwareStore/ComputerHardwareStoreDataModels/Models/IBuildModel.cs +++ b/ComputerHardwareStore/ComputerHardwareStoreDataModels/Models/IBuildModel.cs @@ -2,7 +2,7 @@ { public interface IBuildModel : IId { - string BuildName { get; } + string Name { get; } double Price { get; } int VendorId { get; } public Dictionary BuildComponent { get; } diff --git a/ComputerHardwareStore/ComputerHardwareStoreDataModels/Models/IComponentModel.cs b/ComputerHardwareStore/ComputerHardwareStoreDataModels/Models/IComponentModel.cs index 36a9b87..6eea153 100644 --- a/ComputerHardwareStore/ComputerHardwareStoreDataModels/Models/IComponentModel.cs +++ b/ComputerHardwareStore/ComputerHardwareStoreDataModels/Models/IComponentModel.cs @@ -2,7 +2,7 @@ { public interface IComponentModel : IId { - string ComponentName { get; } + string Name { get; } double Cost { get; } int StoreKeeperId { get; } } diff --git a/ComputerHardwareStore/ComputerHardwareStoreDataModels/Models/IOrderModel.cs b/ComputerHardwareStore/ComputerHardwareStoreDataModels/Models/IOrderModel.cs index 045b5dd..bddb1f6 100644 --- a/ComputerHardwareStore/ComputerHardwareStoreDataModels/Models/IOrderModel.cs +++ b/ComputerHardwareStore/ComputerHardwareStoreDataModels/Models/IOrderModel.cs @@ -4,7 +4,6 @@ { double Cost { get; } DateTime DateCreate { get; } - int StoreKeeperId { get; } public Dictionary OrderProduct { get; } } }