public BillController() { im = new BillIM(db); om = new BillOM(db); orderIM = new OrderIM(db); orderOM = new OrderOM(db); order_itemIM = new Order_ItemIM(db); order_itemOM = new Order_ItemOM(db); }
public Boolean edit(order_item order_item) { Order_ItemIM im = new Order_ItemIM(db); OrderOM orderOM = new OrderOM(db); order_item dbVersion = im.find(order_item.id); if (dbVersion.version == order_item.version) { ((IObjectContextAdapter)db).ObjectContext.Detach(dbVersion); db.Entry(order_item).State = EntityState.Modified; order_item.version = order_item.version + 1; db.SaveChanges(); orderOM.edit(db.orders.Find(order_item.order_id)); return true; } return false; }
public Order_ItemController() { om = new Order_ItemOM(db); im = new Order_ItemIM(db); orderOM = new OrderOM(db); }