Merge branch 'Lab2_Base' into Lab2_Hard

This commit is contained in:
Данияр Аглиуллов 2023-02-15 04:39:20 +04:00
commit 643ae3117b

View File

@ -45,15 +45,16 @@ namespace ConfectioneryFileImplement.Models
{ {
return null; return null;
} }
var dateImplement = element.Element("DateImplement")!.Value;
return new() return new()
{ {
Id = Convert.ToInt32(element.Attribute("Id")), Id = Convert.ToInt32(element.Attribute("Id")!.Value),
Sum = Convert.ToDouble(element.Element("Sum")), Sum = Convert.ToDouble(element.Element("Sum")!.Value),
Count = Convert.ToInt32(element.Element("Count")), Count = Convert.ToInt32(element.Element("Count")!.Value),
Status = (OrderStatus)Convert.ToInt32(element.Element("Status")), Status = (OrderStatus)Convert.ToInt32(element.Element("Status")!.Value),
PastryId = Convert.ToInt32(element.Element("PastryId")), PastryId = Convert.ToInt32(element.Element("PastryId")!.Value),
DateCreate = Convert.ToDateTime(element.Element("DateCreate")), DateCreate = Convert.ToDateTime(element.Element("DateCreate")!.Value),
DateImplement = Convert.ToDateTime(element.Element("DateImplement")), DateImplement = string.IsNullOrEmpty(dateImplement) ? null : Convert.ToDateTime(dateImplement),
}; };
} }