From be5db49184c6fd22cdb4fa66f837b083d2426f6e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=98=D0=BB=D1=8C=D1=8F=20=D0=A4=D0=B5=D0=B4=D0=BE=D1=82?= =?UTF-8?q?=D0=BE=D0=B2?= Date: Sun, 19 May 2024 17:52:59 +0400 Subject: [PATCH] fix --- .../BindingModels/OrderBindingModel.cs | 2 +- .../SearchModels/OrderSearchModel.cs | 4 ++-- .../ViewModels/OrderViewModel.cs | 9 ++++----- .../ElectronicsShopDataBaseImplement/Models/Order.cs | 10 +++++----- .../ElectronicsShopDataModels/Models/IOrderModel.cs | 2 +- 5 files changed, 13 insertions(+), 14 deletions(-) diff --git a/ElectronicsShop/ElectronicsShopContracts/BindingModels/OrderBindingModel.cs b/ElectronicsShop/ElectronicsShopContracts/BindingModels/OrderBindingModel.cs index e27f078..06ff2bf 100644 --- a/ElectronicsShop/ElectronicsShopContracts/BindingModels/OrderBindingModel.cs +++ b/ElectronicsShop/ElectronicsShopContracts/BindingModels/OrderBindingModel.cs @@ -11,7 +11,7 @@ namespace ElectronicsShopContracts.BindingModels public class OrderBindingModel : IOrderModel { public int ID { get; set; } - public int UserID { get; set; } + public int ClientID { get; set; } public int? ImplementerID { get; set; } public int PaymentID { get; set; } public double Sum { get; set; } diff --git a/ElectronicsShop/ElectronicsShopContracts/SearchModels/OrderSearchModel.cs b/ElectronicsShop/ElectronicsShopContracts/SearchModels/OrderSearchModel.cs index 974056e..bf0d84b 100644 --- a/ElectronicsShop/ElectronicsShopContracts/SearchModels/OrderSearchModel.cs +++ b/ElectronicsShop/ElectronicsShopContracts/SearchModels/OrderSearchModel.cs @@ -12,11 +12,11 @@ namespace ElectronicsShopContracts.SearchModels { public int? ID { get; set; } //public int? OplataID { get; set; } - public int? UserID { get; set; } + public int? ClientID { get; set; } public OrderStatus OrderStatus { get; set; } public PaymeantOption PaymeantOption { get; set; } public DateTime? DateFrom { get; set; } public DateTime? DateTo { get; set;} - public Dictionary? ProductList { get; set; } + public Dictionary ProductList { get; set; } = new(); } } diff --git a/ElectronicsShop/ElectronicsShopContracts/ViewModels/OrderViewModel.cs b/ElectronicsShop/ElectronicsShopContracts/ViewModels/OrderViewModel.cs index 6fbb140..da40d8d 100644 --- a/ElectronicsShop/ElectronicsShopContracts/ViewModels/OrderViewModel.cs +++ b/ElectronicsShop/ElectronicsShopContracts/ViewModels/OrderViewModel.cs @@ -13,9 +13,9 @@ namespace ElectronicsShopContracts.ViewModels { public int ID { get; set; } [DisplayName("Клиент ID")] - public int UserID { get; set; } + public int ClientID { get; set; } [DisplayName("Исполнитель ID")] - public int ImplementerID { get; set; } + public int? ImplementerID { get; set; } [DisplayName("Оплата ID")] public int PaymentID { get; set; } @@ -23,7 +23,7 @@ namespace ElectronicsShopContracts.ViewModels public double Sum { get; set; } [DisplayName("Статус")] - public OrderStatus OrderStatus { get; set; } = OrderStatus.Неизвестен; + public OrderStatus Status { get; set; } = OrderStatus.Неизвестен; [DisplayName("Стутус оплаты")] public PaymeantOption PaymeantOption { get; set; } = PaymeantOption.Неизвестно; @@ -35,6 +35,5 @@ namespace ElectronicsShopContracts.ViewModels public DateTime? DateImplement { get; set; } [DisplayName("Корзина")] public Dictionary ProductList { get; set; } = new(); - - } + } } diff --git a/ElectronicsShop/ElectronicsShopDataBaseImplement/Models/Order.cs b/ElectronicsShop/ElectronicsShopDataBaseImplement/Models/Order.cs index 966a181..6945815 100644 --- a/ElectronicsShop/ElectronicsShopDataBaseImplement/Models/Order.cs +++ b/ElectronicsShop/ElectronicsShopDataBaseImplement/Models/Order.cs @@ -18,8 +18,8 @@ namespace ElectronicsShopDataBaseImplement.Models public int ID { get; set; } [Required] public double Sum { get; set; } - [ForeignKey("UserID")] - public int UserID { get; set; } + [ForeignKey("ClientID")] + public int ClientID { get; set; } [Required] public OrderStatus Status { get; set; } = OrderStatus.Неизвестен; [Required] @@ -53,7 +53,7 @@ namespace ElectronicsShopDataBaseImplement.Models return new Order() { ID = model.ID, - UserID=model.UserID, + ClientID=model.ClientID, Sum = model.Sum, Status = model.Status, PaymeantOption = model.PaymeantOption, @@ -72,7 +72,7 @@ namespace ElectronicsShopDataBaseImplement.Models return; } ID = model.ID; - UserID = model.UserID; + ClientID = model.ClientID; Sum = model.Sum; PaymeantOption = model.PaymeantOption; Status = model.Status; @@ -87,7 +87,7 @@ namespace ElectronicsShopDataBaseImplement.Models public OrderViewModel GetViewModel => new() { ID = ID, - UserID = UserID, + ClientID = ClientID, Sum = Sum, PaymeantOption = PaymeantOption, Status = Status, diff --git a/ElectronicsShop/ElectronicsShopDataModels/Models/IOrderModel.cs b/ElectronicsShop/ElectronicsShopDataModels/Models/IOrderModel.cs index e3453b8..a1b5068 100644 --- a/ElectronicsShop/ElectronicsShopDataModels/Models/IOrderModel.cs +++ b/ElectronicsShop/ElectronicsShopDataModels/Models/IOrderModel.cs @@ -9,7 +9,7 @@ namespace ElectronicsShopDataModels.Models { public interface IOrderModel : IID { - int UserID { get; } + int ClientID { get; } int? ImplementerID { get; } int PaymentID { get; } OrderStatus Status { get; }