Example #1
0
        public PartialViewResult _getItemToUpdate(int CategoryId, int VendorId)
        {
            OutletVendorModel model = new OutletVendorModel();

            model.getAllItems   = vendor.getAllItems(CategoryId, VendorId);
            model.IsRunningBill = vendor.checkBillingIsRunning(VendorId);
            return(PartialView(model));
        }
        public OutletVendorModel getVendorsForPriceUpdate()
        {
            OutletVendorModel model = new OutletVendorModel();

            model.getAllCategory = getAllCategory();
            model.getAllVendor   = getAllVendorList();

            return(model);
        }
        public void UpdatePrice(OutletVendorModel model)
        {
            int OutletId = getOutletId();

            for (int i = 0; i < model.MenuOutletId.Length; i++)
            {
                VendorPrice tbdelete = new VendorPrice();
                int         menuId   = model.MenuOutletId[i];
                tbdelete = entities.VendorPrices.Where(a => a.MenuOutletId == menuId && a.VendorId == model.VendorId).FirstOrDefault();
                if (tbdelete != null)
                {
                    entities.Entry(tbdelete).State = EntityState.Deleted;
                    entities.SaveChanges();
                }
                VendorPrice tb = new VendorPrice();
                tb.MenuOutletId = model.MenuOutletId[i];
                tb.Price        = model.Price[i];
                tb.VendorId     = model.VendorId;
                entities.VendorPrices.Add(tb);
                entities.SaveChanges();
            }
        }
Example #4
0
 public ActionResult UpdatePrice(OutletVendorModel model)
 {
     vendor.UpdatePrice(model);
     return(RedirectToAction("setPrice"));
 }