public virtual void ModifyCustomers() { List <Customer> newCustomers = AddCustomers(10); context.SubmitChanges(); EditCustomers(newCustomers); context.SubmitChanges(); DeleteCustomers(newCustomers); context.SubmitChanges(); }
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)); }