Исправление падения чтения даты выполнения заказа

This commit is contained in:
Мк Игорь 2023-03-01 10:36:05 +04:00
parent 4b15203b79
commit 28f3cb773d

View File

@ -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)