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(bill bill) { BillIM im = new BillIM(db); bill dbVersion = im.find(bill.id); if (dbVersion.version == bill.version) { ((IObjectContextAdapter)db).ObjectContext.Detach(dbVersion); db.Entry(bill).State = EntityState.Modified; bill.version = bill.version + 1; db.SaveChanges(); return true; } return false; }