public void OrderSign(int id) { OrderFormView tmp = OrderList.Find(id); tmp.status = "Подписан"; Entry(tmp).State = EntityState.Modified; SaveChanges(); }
public OrderFormView GetOrderById(int id) { OrderFormView tmp = OrderList.Find(id); if (tmp != null) { var obj_list = ObjectList.Where(c => c.OrderFormViewId == id); if (obj_list != null) { tmp.obj_list = obj_list.ToList(); } } return(tmp); }
public void UpdateOrder(OrderFormView order) { var list = ObjectList.Where(c => c.OrderFormViewId == order.id).AsEnumerable(); if (list != null) { foreach (var obj in list) { Entry(obj).State = EntityState.Deleted; } } foreach (var obj in order.obj_list) { ObjectList.Add(obj); } Entry(order).State = EntityState.Modified; SaveChanges(); }
public void AddNewOrder(OrderFormView order) { OrderList.Add(order); SaveChanges(); }
public void SetDeletedStateOrder(OrderFormView order) { order.status = "Удаленная"; Entry(order).State = EntityState.Modified; SaveChanges(); }