diff --git a/SecuritySystem/SecuritySystemDatabaseImplement/Models/Implementer.cs b/SecuritySystem/SecuritySystemDatabaseImplement/Models/Implementer.cs index 3eb522b..182ab70 100644 --- a/SecuritySystem/SecuritySystemDatabaseImplement/Models/Implementer.cs +++ b/SecuritySystem/SecuritySystemDatabaseImplement/Models/Implementer.cs @@ -63,4 +63,3 @@ namespace SecuritySystemDatabaseImplement.Models }; } } -} diff --git a/SecuritySystem/SecuritySystemFileImplement/Models/Order.cs b/SecuritySystem/SecuritySystemFileImplement/Models/Order.cs index 975a4ab..13db84d 100644 --- a/SecuritySystem/SecuritySystemFileImplement/Models/Order.cs +++ b/SecuritySystem/SecuritySystemFileImplement/Models/Order.cs @@ -11,6 +11,7 @@ namespace SecuritySystemFileImplement.Models public int Id { get; private set; } public int SecureId { 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.Неизвестен; @@ -32,6 +33,7 @@ namespace SecuritySystemFileImplement.Models Status = model.Status, DateCreate = model.DateCreate, DateImplement = model.DateImplement, + ImplementerId = model.ImplementerId }; } @@ -49,7 +51,8 @@ namespace SecuritySystemFileImplement.Models Count = Convert.ToInt32(element.Element("Count")!.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 : Convert.ToDateTime(element.Element("DateImplement")!.Value) + DateImplement = string.IsNullOrEmpty(element.Element("DateImplement")!.Value) ? null : Convert.ToDateTime(element.Element("DateImplement")!.Value), + ImplementerId = Convert.ToInt32(element.Element("ImplementerId")!.Value), }; } @@ -61,6 +64,7 @@ namespace SecuritySystemFileImplement.Models } Status = model.Status; DateImplement = model.DateImplement; + ImplementerId = model.ImplementerId; } public OrderViewModel GetViewModel => new() @@ -72,6 +76,7 @@ namespace SecuritySystemFileImplement.Models DateCreate = DateCreate, DateImplement = DateImplement, Status = Status, + ImplementerId = ImplementerId, }; public XElement GetXElement => new( @@ -82,7 +87,8 @@ namespace SecuritySystemFileImplement.Models new XElement("Sum", Sum.ToString()), new XElement("Status", Status.ToString()), new XElement("DateCreate", DateCreate.ToString()), - new XElement("DateImplement", DateImplement.ToString()) + new XElement("DateImplement", DateImplement.ToString()), + new XElement("ImplementerId", ImplementerId.ToString()) ); } } diff --git a/SecuritySystem/SecuritySystemListImplement/Models/Order.cs b/SecuritySystem/SecuritySystemListImplement/Models/Order.cs index 514dfa9..aa8ce82 100644 --- a/SecuritySystem/SecuritySystemListImplement/Models/Order.cs +++ b/SecuritySystem/SecuritySystemListImplement/Models/Order.cs @@ -1,15 +1,17 @@ using SecuritySystemContracts.BindingModels; using SecuritySystemContracts.ViewModels; using SecuritySystemDataModels.Enums; +using SecuritySystemDataModels.Models; namespace SecuritySystemListImplement.Models { - public class Order + public class Order : IOrderModel { public int SecureId { get; private set; } public int ClientId { get; private set; } public int Count { get; private set; } public double Sum { get; private set; } + public int? ImplementerId { get; private set; } public OrderStatus Status { get; private set; } = OrderStatus.Неизвестен; public DateTime DateCreate { get; private set; } = DateTime.Now; public DateTime? DateImplement { get; private set; } @@ -29,6 +31,7 @@ namespace SecuritySystemListImplement.Models Status = model.Status, DateCreate = model.DateCreate, DateImplement = model.DateImplement, + ImplementerId = model.ImplementerId, }; } public void Update(OrderBindingModel? model) @@ -39,6 +42,7 @@ namespace SecuritySystemListImplement.Models } Status = model.Status; DateImplement = model.DateImplement; + ImplementerId = model.ImplementerId; } public OrderViewModel GetViewModel => new() { @@ -49,6 +53,7 @@ namespace SecuritySystemListImplement.Models DateImplement = DateImplement, Id = Id, Status = Status, + ImplementerId = ImplementerId, }; } }