public ActionResult Create(ServiceProviderTypeModel branch) { if (ModelState.IsValid) { var dbModel = Mapper.Map <ServiceProviderTypeModel, ServiceProviderType>(branch); InsuranceContext.ServiceProviderTypes.Insert(dbModel); return(RedirectToAction("Index")); } return(View()); }
public ActionResult Edit(ServiceProviderTypeModel provider) { if (ModelState.IsValid) { var data = InsuranceContext.ServiceProviderTypes.Single(provider.Id); if (data != null) { data.ProviderType = provider.ProviderType; InsuranceContext.ServiceProviderTypes.Update(data); } return(RedirectToAction("Index")); } return(View()); }