diff --git a/BlacksmithWorkshop/BlacksmithWorkshopFileImplement/Models/Order.cs b/BlacksmithWorkshop/BlacksmithWorkshopFileImplement/Models/Order.cs index c39e6ef..8ce8605 100644 --- a/BlacksmithWorkshop/BlacksmithWorkshopFileImplement/Models/Order.cs +++ b/BlacksmithWorkshop/BlacksmithWorkshopFileImplement/Models/Order.cs @@ -38,6 +38,11 @@ namespace BlacksmithWorkshopFileImplement.Models { return null; } + DateTime? dateImplement = null; + if (element.Element("DateImplement")!.Value != "") + { + dateImplement = Convert.ToDateTime(element.Element("DateImplement")!.Value); + } return new Order() { Id = Convert.ToInt32(element.Attribute("Id")!.Value), @@ -46,7 +51,7 @@ namespace BlacksmithWorkshopFileImplement.Models Sum = Convert.ToDouble(element.Element("Sum")!.Value), Status = (OrderStatus)Convert.ToInt32(element.Element("Status")!.Value), DateCreate = Convert.ToDateTime(element.Element("DateCreate")!.Value), - DateImplement = Convert.ToDateTime(element.Element("DateImplement")!.Value) + DateImplement = dateImplement }; } public void Update(OrderBindingModel? model)