From cae87564d4dfa1d92c0f5fc3f1a5678b130cee04 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9D=D0=B8=D0=BA=D0=BE=D0=BB=D0=B0=D0=B9?= Date: Sat, 1 Apr 2023 12:37:25 +0400 Subject: [PATCH] =?UTF-8?q?ViewModel=20=D0=B4=D0=BB=D1=8F=20=D1=80=D0=B0?= =?UTF-8?q?=D0=B1=D0=BE=D1=82=D0=BD=D0=B8=D0=BA=D0=B0=20=D1=80=D0=B5=D0=B0?= =?UTF-8?q?=D0=BB=D0=B8=D0=B7=D0=BE=D0=B2=D0=B0=D0=BD=D0=BD=D1=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ViewModels/BuildViewModel.cs | 4 ++-- .../ViewModels/CommentViewModel.cs | 10 +++++++--- .../ViewModels/ComponentViewModel.cs | 2 +- .../ViewModels/GoodViewModel.cs | 2 +- .../ViewModels/OrderViewModel.cs | 2 +- .../ViewModels/PurchaseViewModel.cs | 20 ++++++++++++------- .../Models/IPurchaseModel.cs | 2 +- 7 files changed, 26 insertions(+), 16 deletions(-) diff --git a/HardwareShop/HardwareShopContracts/ViewModels/BuildViewModel.cs b/HardwareShop/HardwareShopContracts/ViewModels/BuildViewModel.cs index 5538c89..93e5ca1 100644 --- a/HardwareShop/HardwareShopContracts/ViewModels/BuildViewModel.cs +++ b/HardwareShop/HardwareShopContracts/ViewModels/BuildViewModel.cs @@ -13,8 +13,8 @@ namespace FoodOrdersContracts.ViewModels [DisplayName("Название компонента")] public string BuildName { get; set; } = string.Empty; - [DisplayName("Email клиента")] - public string Email { get; set; } = string.Empty; + [DisplayName("Клиент")] + public string UserEmail { get; set; } = string.Empty; public int UserID { get; set; } } diff --git a/HardwareShop/HardwareShopContracts/ViewModels/CommentViewModel.cs b/HardwareShop/HardwareShopContracts/ViewModels/CommentViewModel.cs index 6e73a3c..f7c8cce 100644 --- a/HardwareShop/HardwareShopContracts/ViewModels/CommentViewModel.cs +++ b/HardwareShop/HardwareShopContracts/ViewModels/CommentViewModel.cs @@ -6,10 +6,14 @@ namespace FoodOrdersContracts.ViewModels { public class CommentViewModel : ICommentModel { - public string Text => throw new NotImplementedException(); + public int Id { get; set; } - public int BuildID => throw new NotImplementedException(); + [DisplayName("Комментарий")] + public string Text { get; set; } = string.Empty; - public int Id => throw new NotImplementedException(); + [DisplayName("Название сборки")] + public string BuildName { get; set; } = string.Empty; + + public int BuildID { get; set; } } } diff --git a/HardwareShop/HardwareShopContracts/ViewModels/ComponentViewModel.cs b/HardwareShop/HardwareShopContracts/ViewModels/ComponentViewModel.cs index 22d6e23..b4e7e8f 100644 --- a/HardwareShop/HardwareShopContracts/ViewModels/ComponentViewModel.cs +++ b/HardwareShop/HardwareShopContracts/ViewModels/ComponentViewModel.cs @@ -9,6 +9,6 @@ namespace FoodOrdersContracts.ViewModels { public class ComponentViewModel : IComponentModel { - public int Id => throw new NotImplementedException(); + public int Id { get; set; } } } diff --git a/HardwareShop/HardwareShopContracts/ViewModels/GoodViewModel.cs b/HardwareShop/HardwareShopContracts/ViewModels/GoodViewModel.cs index 191360e..e396318 100644 --- a/HardwareShop/HardwareShopContracts/ViewModels/GoodViewModel.cs +++ b/HardwareShop/HardwareShopContracts/ViewModels/GoodViewModel.cs @@ -10,6 +10,6 @@ namespace FoodOrdersContracts.ViewModels { public class GoodViewModel : IGoodModel { - public int Id => throw new NotImplementedException(); + public int Id { get; set; } } } diff --git a/HardwareShop/HardwareShopContracts/ViewModels/OrderViewModel.cs b/HardwareShop/HardwareShopContracts/ViewModels/OrderViewModel.cs index 73ea37f..c6c7758 100644 --- a/HardwareShop/HardwareShopContracts/ViewModels/OrderViewModel.cs +++ b/HardwareShop/HardwareShopContracts/ViewModels/OrderViewModel.cs @@ -6,6 +6,6 @@ namespace FoodOrdersContracts.ViewModels { public class OrderViewModel : IOrderModel { - public int Id => throw new NotImplementedException(); + public int Id { get; set; } } } diff --git a/HardwareShop/HardwareShopContracts/ViewModels/PurchaseViewModel.cs b/HardwareShop/HardwareShopContracts/ViewModels/PurchaseViewModel.cs index 094d2b1..565d063 100644 --- a/HardwareShop/HardwareShopContracts/ViewModels/PurchaseViewModel.cs +++ b/HardwareShop/HardwareShopContracts/ViewModels/PurchaseViewModel.cs @@ -6,18 +6,24 @@ namespace FoodOrdersContracts.ViewModels { public class PurachaseViewModel : IPurchaseModel { - public int Id => throw new NotImplementedException(); + public int Id { get; set; } - public decimal Sum => throw new NotImplementedException(); + [DisplayName("Цена")] + public decimal Sum { get; set; } - public PurchaseStatus Status => throw new NotImplementedException(); + [DisplayName("Статус покупки")] + public PurchaseStatus PurchaseStatus { get; set; } = PurchaseStatus.Неизвестен; - public DateTime? DatePurchase => throw new NotImplementedException(); + [DisplayName("Дата оплаты")] + public DateTime? DatePurchase { get; set; } - public int UserID => throw new NotImplementedException(); + public int UserID { get; set; } - public Dictionary? PurchaseBuilds => throw new NotImplementedException(); + [DisplayName("Email клиента")] + public string UserEmail { get; set; } = string.Empty; - public Dictionary PurchaseGoods => throw new NotImplementedException(); + public Dictionary? PurchaseBuilds { get; set; } + + public Dictionary PurchaseGoods { get; set; } } } diff --git a/HardwareShop/HardwareShopDataModels/Models/IPurchaseModel.cs b/HardwareShop/HardwareShopDataModels/Models/IPurchaseModel.cs index 42e81ae..32b0af5 100644 --- a/HardwareShop/HardwareShopDataModels/Models/IPurchaseModel.cs +++ b/HardwareShop/HardwareShopDataModels/Models/IPurchaseModel.cs @@ -6,7 +6,7 @@ namespace HardwareShopDataModels.Models { decimal Sum { get; } - PurchaseStatus Status { get; } + PurchaseStatus PurchaseStatus { get; } //через "?" обозначается что поле может быть null DateTime? DatePurchase { get; }