This commit is contained in:
Максим Сергунов 2023-04-27 23:29:50 +04:00
parent f6916f2cc1
commit d7b015b447

View File

@ -10,8 +10,6 @@ namespace GiftShopFileImplement.Models
{ {
public int GiftId { get; private set; } public int GiftId { get; private set; }
public string GiftName { get; private set; }
public int Count { get; private set; } public int Count { get; private set; }
public double Sum { get; private set; } public double Sum { get; private set; }
@ -34,7 +32,6 @@ namespace GiftShopFileImplement.Models
{ {
Id = model.Id, Id = model.Id,
GiftId = model.GiftId, GiftId = model.GiftId,
GiftName = model.GiftName,
Count = model.Count, Count = model.Count,
Sum = model.Sum, Sum = model.Sum,
Status = model.Status, Status = model.Status,
@ -53,7 +50,6 @@ namespace GiftShopFileImplement.Models
{ {
Id = Convert.ToInt32(element.Attribute("Id")!.Value), Id = Convert.ToInt32(element.Attribute("Id")!.Value),
GiftId = Convert.ToInt32(element.Element("GiftId")!.Value), GiftId = Convert.ToInt32(element.Element("GiftId")!.Value),
GiftName = element.Element("GiftName")!.Value,
Count = Convert.ToInt32(element.Element("Count")!.Value), Count = Convert.ToInt32(element.Element("Count")!.Value),
Sum = Convert.ToDouble(element.Element("Sum")!.Value), Sum = Convert.ToDouble(element.Element("Sum")!.Value),
Status = (OrderStatus)Enum.Parse(typeof(OrderStatus), element.Element("Status")!.Value), Status = (OrderStatus)Enum.Parse(typeof(OrderStatus), element.Element("Status")!.Value),
@ -73,7 +69,6 @@ namespace GiftShopFileImplement.Models
return; return;
} }
GiftId = model.GiftId; GiftId = model.GiftId;
GiftName = model.GiftName;
Count = model.Count; Count = model.Count;
Sum = model.Sum; Sum = model.Sum;
Status = model.Status; Status = model.Status;
@ -85,7 +80,6 @@ namespace GiftShopFileImplement.Models
{ {
Id = Id, Id = Id,
GiftId = GiftId, GiftId = GiftId,
GiftName = GiftName,
Count = Count, Count = Count,
Sum = Sum, Sum = Sum,
Status = Status, Status = Status,
@ -95,7 +89,6 @@ namespace GiftShopFileImplement.Models
public XElement GetXElement => new("Order", public XElement GetXElement => new("Order",
new XAttribute("Id", Id), new XAttribute("Id", Id),
new XElement("GiftName", GiftName),
new XElement("GiftId", GiftId.ToString()), new XElement("GiftId", GiftId.ToString()),
new XElement("Count", Count.ToString()), new XElement("Count", Count.ToString()),
new XElement("Sum", Sum.ToString()), new XElement("Sum", Sum.ToString()),