示例#1
0
 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);
 }
示例#2
0
文件: BillOM.cs 项目: pmoda/TFFCode
        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;
        }