public static Order CreateOrder(Order instance) { List<Order> orders = GetOrderList(); // Set ID string ID = (int.Parse(orders.Max(a => a.ID)) + 1).ToString(); instance.ID = ID; orders.Add(instance); SaveOrders(orders); return instance; }
public Order CreateOrderJson(Order instance) { return XmlDataStore.CreateOrder(instance); }
public Order UpdateOrderJson(Order instance) { return XmlDataStore.UpdateOrder(instance); }
public static Order UpdateOrder(Order instance) { List<Order> orders = GetOrderList(); orders.Remove(orders.First(obj => obj.ID == instance.ID)); orders.Add(instance); SaveOrders(orders); return instance; }