public ActionResult MasterGridViewPartialUpdate(AdvancedMasterDetail.Models.Supplier item)
        {
            var model = context.Suppliers;

            if (ModelState.IsValid)
            {
                try
                {
                    var existingItem = context.Suppliers.Where(x => x.SupplierID == item.SupplierID).FirstOrDefault();
                    existingItem.CompanyName = item.CompanyName;
                    existingItem.ContactName = item.ContactName;
                    existingItem.Country     = item.Country;
                    existingItem.City        = item.City;
                    context.SubmitChanges();
                }
                catch (Exception e)
                {
                    ViewData["EditError"] = e.Message;
                }
            }
            else
            {
                ViewData["EditError"] = "Please, correct all errors.";
            }
            return(PartialView("_MasterGridViewPartial", model));
        }
        public ActionResult MasterGridViewPartialAddNew(AdvancedMasterDetail.Models.Supplier item)
        {
            var model = context.Suppliers;

            if (ModelState.IsValid)
            {
                try
                {
                    // Insert here a code to insert the new item in your model
                    context.Suppliers.InsertOnSubmit(item);
                    context.SubmitChanges();
                }
                catch (Exception e)
                {
                    ViewData["EditError"] = e.Message;
                }
            }
            else
            {
                ViewData["EditError"] = "Please, correct all errors.";
            }
            return(PartialView("_MasterGridViewPartial", model));
        }
 partial void DeleteSupplier(Supplier instance);
 partial void UpdateSupplier(Supplier instance);
 partial void InsertSupplier(Supplier instance);