示例#1
0
        //public int GetQnty(int id)
        //{
        //    var qnty = vc.quantities.Where(p => p.qntId == id).FirstOrDefault();
        //    var qnt = qnty.quantity1;
        //    return qnt;
        //        }


        public void Store(vendingVM vm)
        {
            vending v = new vending();

            v.sodaId     = vm.sodaId;
            v.priceId    = vm.priceId;
            v.sodaQnt    = vm.sodaQnt;
            v.soldqnt    = vm.soldqnt;
            v.orgprice   = vm.orgprice;
            v.priceent   = vm.priceent;
            v.boughttime = vm.boughttime;

            vc.vendings.Add(v);
            vc.SaveChanges();

            vm.vendId = v.vendId;
        }
示例#2
0
 public VendingBL()
 {
     vc = new VendingMachineContext();
     v  = new vending();
     q  = new quantity();
 }