From c60b75d443b553e3487c9653c50135de1ba74791 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=95=D0=BB=D0=B5=D0=BD=D0=B0=20=D0=91=D0=B0=D0=BA=D0=B0?= =?UTF-8?q?=D0=BB=D1=8C=D1=81=D0=BA=D0=B0=D1=8F?= Date: Sat, 20 Apr 2024 21:28:08 +0400 Subject: [PATCH] =?UTF-8?q?=D0=B4=D0=BE=D0=B1=D0=B0=D0=B2=D0=B8=D0=BB?= =?UTF-8?q?=D0=B0=20=D0=B5=D1=89=D0=B5=20=D0=BD=D0=B5=D0=BA=D0=BE=D1=82?= =?UTF-8?q?=D0=BE=D1=80=D1=8B=D0=B5=20=D0=B8=D0=B7=D0=BC=D0=B5=D0=BD=D0=B5?= =?UTF-8?q?=D0=BD=D0=B8=D1=8F=20=D0=B2=20=D0=BA=D0=BB=D0=B0=D1=81=D1=81?= =?UTF-8?q?=D1=8B=20=D1=81=20=D0=B7=D0=B0=D0=BA=D0=B0=D0=B7=D0=B0=D0=BC?= =?UTF-8?q?=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- SushiBarDataModels/SushiBarDataModels.csproj | 4 ++++ SushiBarDatabaseImplement/Implements/OrderStorage.cs | 3 +-- SushiBarFileImplement/Models/Order.cs | 7 ++++++- SushiBarListImplements/Models/Order.cs | 4 ++++ 4 files changed, 15 insertions(+), 3 deletions(-) diff --git a/SushiBarDataModels/SushiBarDataModels.csproj b/SushiBarDataModels/SushiBarDataModels.csproj index a67f13a..92df11a 100644 --- a/SushiBarDataModels/SushiBarDataModels.csproj +++ b/SushiBarDataModels/SushiBarDataModels.csproj @@ -8,6 +8,10 @@ + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + diff --git a/SushiBarDatabaseImplement/Implements/OrderStorage.cs b/SushiBarDatabaseImplement/Implements/OrderStorage.cs index abd765c..8c1bd3b 100644 --- a/SushiBarDatabaseImplement/Implements/OrderStorage.cs +++ b/SushiBarDatabaseImplement/Implements/OrderStorage.cs @@ -1,5 +1,4 @@ - -using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore; using SushiBarContracts.BindingModel; using SushiBarContracts.SearchModel; using SushiBarContracts.StoragesContracts; diff --git a/SushiBarFileImplement/Models/Order.cs b/SushiBarFileImplement/Models/Order.cs index 3e81a93..cedea01 100644 --- a/SushiBarFileImplement/Models/Order.cs +++ b/SushiBarFileImplement/Models/Order.cs @@ -11,6 +11,7 @@ namespace SushiBarFileImplement.Models public int Id { get; private set; } public int SushiId { get; private set; } public int ClientId { 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; } = OrderStatus.Неизвестен; @@ -31,7 +32,8 @@ namespace SushiBarFileImplement.Models ClientId = model.ClientId, Status = model.Status, DateCreate = model.DateCreate, - DateImplement = model.DateImplement + DateImplement = model.DateImplement, + ImplementerId = model.ImplementerId, }; } public static Order? Create(XElement element) @@ -47,6 +49,7 @@ namespace SushiBarFileImplement.Models ClientId = Convert.ToInt32(element.Element("ClientId")!.Value), Count = Convert.ToInt32(element.Element("Count")!.Value), Sum = Convert.ToDouble(element.Element("Sum")!.Value), + ImplementerId = Convert.ToInt32(element.Element("ImplementerId")!.Value), Status = (OrderStatus)Enum.Parse(typeof(OrderStatus), element.Element("Status")!.Value), DateCreate = Convert.ToDateTime(element.Element("DateCreate")!.Value), DateImplement = string.IsNullOrEmpty(element.Element("DateImplement")!.Value) ? null : @@ -72,12 +75,14 @@ namespace SushiBarFileImplement.Models DateCreate = DateCreate, DateImplement = DateImplement, ClientId = ClientId, + ImplementerId = ImplementerId, }; public XElement GetXElement => new("Order", new XAttribute("Id", Id), new XElement("SushiId", SushiId.ToString()), new XElement("ClientId", ClientId.ToString()), + new XElement("ImplementerId", ImplementerId.ToString()), new XElement("Count", SushiId.ToString()), new XElement("Sum", Sum.ToString()), new XElement("Status", Status.ToString()), diff --git a/SushiBarListImplements/Models/Order.cs b/SushiBarListImplements/Models/Order.cs index b346a95..fd37c59 100644 --- a/SushiBarListImplements/Models/Order.cs +++ b/SushiBarListImplements/Models/Order.cs @@ -11,6 +11,7 @@ namespace SushiBarListImplements.Models public int Id { get; private set; } public int SushiId { get; private set; } public int ClientId { 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; } @@ -33,6 +34,7 @@ namespace SushiBarListImplements.Models DateCreate = model.DateCreate, DateImplement = model.DateImplement, ClientId = model.ClientId, + ImplementerId = model.ImplementerId, }; } @@ -49,6 +51,7 @@ namespace SushiBarListImplements.Models DateCreate = model.DateCreate; DateImplement = model.DateImplement; ClientId = model.ClientId; + ImplementerId = model.ImplementerId; } public OrderViewModel GetViewModel => new() @@ -61,6 +64,7 @@ namespace SushiBarListImplements.Models DateCreate = DateCreate, DateImplement = DateImplement, ClientId = ClientId, + ImplementerId = ImplementerId }; } }