//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; }
public VendingBL() { vc = new VendingMachineContext(); v = new vending(); q = new quantity(); }