From d2241ea027a9c096be090013b754cac9e9874b18 Mon Sep 17 00:00:00 2001 From: gg12 darfren Date: Mon, 15 Apr 2024 15:31:58 +0400 Subject: [PATCH] =?UTF-8?q?=D0=9F=D1=80=D0=B0=D0=B2=D0=BA=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../BindingModels/OrderBindingModel.cs | 2 +- .../IceCreamShopContracts/ViewModels/OrderViewModel.cs | 2 +- IceCreamShop/IceCreamShopDataModels/IOrderModel.cs | 2 +- .../IceCreamShopDatabaseImplement/Models/Order.cs | 8 ++++---- IceCreamShop/IceCreamShopFileImplement/Models/Order.cs | 2 +- IceCreamShop/IceCreamShopListImplement/Models/Order.cs | 2 +- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/IceCreamShop/IceCreamShopContracts/BindingModels/OrderBindingModel.cs b/IceCreamShop/IceCreamShopContracts/BindingModels/OrderBindingModel.cs index b301f05..621fc4b 100644 --- a/IceCreamShop/IceCreamShopContracts/BindingModels/OrderBindingModel.cs +++ b/IceCreamShop/IceCreamShopContracts/BindingModels/OrderBindingModel.cs @@ -13,7 +13,7 @@ namespace IceCreamShopContracts.BindingModels { public int Id { get; set; } public int IceCreamId { get; set; } - public int ImplementerId { get; set; } + public int? ImplementerId { get; set; } = null; public int ClientId { get; set; } public int Count { get; set; } public double Sum { get; set; } diff --git a/IceCreamShop/IceCreamShopContracts/ViewModels/OrderViewModel.cs b/IceCreamShop/IceCreamShopContracts/ViewModels/OrderViewModel.cs index e38f633..b161d62 100644 --- a/IceCreamShop/IceCreamShopContracts/ViewModels/OrderViewModel.cs +++ b/IceCreamShop/IceCreamShopContracts/ViewModels/OrderViewModel.cs @@ -16,7 +16,7 @@ namespace IceCreamShopContracts.ViewModels public int Id { get; set; } public int IceCreamId { get; set; } public int ClientId { get; set; } - public int ImplementerId { get; set; } + public int? ImplementerId { get; set; } = null; [DisplayName("Клиент")] public string ClientFIO { get; set; } = string.Empty; [DisplayName("Мороженное")] diff --git a/IceCreamShop/IceCreamShopDataModels/IOrderModel.cs b/IceCreamShop/IceCreamShopDataModels/IOrderModel.cs index 862ec94..bd85d81 100644 --- a/IceCreamShop/IceCreamShopDataModels/IOrderModel.cs +++ b/IceCreamShop/IceCreamShopDataModels/IOrderModel.cs @@ -11,7 +11,7 @@ namespace IceCreamShopDataModels.Models { int IceCreamId { get; } int ClientId { get; } - int ImplementerId { get; } + int? ImplementerId { get; } int Count { get; } double Sum { get; } OrderStatus Status { get; } diff --git a/IceCreamShop/IceCreamShopDatabaseImplement/Models/Order.cs b/IceCreamShop/IceCreamShopDatabaseImplement/Models/Order.cs index dab371c..6676f9e 100644 --- a/IceCreamShop/IceCreamShopDatabaseImplement/Models/Order.cs +++ b/IceCreamShop/IceCreamShopDatabaseImplement/Models/Order.cs @@ -29,9 +29,9 @@ namespace IceCreamShopDatabaseImplement.Models [Required] public int ClientId { get; private set; } public virtual Client Client { get; private set; } - [Required] - public int ImplementerId { get; private set; } - public virtual Implementer Implementer { get; private set; } + [Required] + public int? ImplementerId { get; private set; } = null; + public virtual Implementer? Implementer { get; private set; } public static Order? Create(IceCreamShopDataBase context, OrderBindingModel model) { if (model == null) @@ -78,7 +78,7 @@ namespace IceCreamShopDatabaseImplement.Models IceCreamName = IceCream.IceCreamName, Id = Id, ClientFIO = Client.ClientFIO, - ImplementerFIO = Implementer.ImplementerFIO + ImplementerFIO = (Implementer != null ? Implementer.ImplementerFIO : string.Empty) }; } diff --git a/IceCreamShop/IceCreamShopFileImplement/Models/Order.cs b/IceCreamShop/IceCreamShopFileImplement/Models/Order.cs index 1edf86c..f0ac061 100644 --- a/IceCreamShop/IceCreamShopFileImplement/Models/Order.cs +++ b/IceCreamShop/IceCreamShopFileImplement/Models/Order.cs @@ -15,7 +15,7 @@ namespace IceCreamShopFileImplement.Models { public int Id { get; private set; } public int IceCreamId { get; private set; } - public int ImplementerId { get; private set; } + public int? ImplementerId { get; private set; } = null; public int ClientId { get; private set; } public int Count { get; private set; } public double Sum { get; private set; } diff --git a/IceCreamShop/IceCreamShopListImplement/Models/Order.cs b/IceCreamShop/IceCreamShopListImplement/Models/Order.cs index 73b77e8..a337328 100644 --- a/IceCreamShop/IceCreamShopListImplement/Models/Order.cs +++ b/IceCreamShop/IceCreamShopListImplement/Models/Order.cs @@ -18,7 +18,7 @@ namespace IceCreamShopListImplement.Models public int Id { get; private set; } public int IceCreamId { get; private set; } public int ClientId { get; private set; } - public int ImplementerId { get; private set; } + public int? ImplementerId { get; private set; } public int Count { get; private set; } public double Sum { get; private set; } public OrderStatus Status { get; private set; }