示例#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
        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;
        }
示例#3
0
 public Order_ItemController()
 {
     om = new Order_ItemOM(db);
     im = new Order_ItemIM(db);
     orderOM = new OrderOM(db);
 }