public ViewResult Details(string id) { PolicyVendor vendor = db.PolicyVendors.Where(x => x.PolicyVendorRegNo == id).SingleOrDefault(); return(View(vendor)); }
public ActionResult Edit(string id) { PolicyVendor vendor = db.PolicyVendors.Where( x => x.PolicyVendorRegNo == id).SingleOrDefault(); return(View(vendor)); }
public ActionResult PolicyVendorRegister(PolicyVendor vendor) { vendor.VendorStatus = 0; db.PolicyVendors.Add(vendor); db.SaveChanges(); ViewBag.VendorRegister = "Registration Successful."; return(RedirectToAction("VerifiedMsg")); }
public ActionResult Edit(PolicyVendor model) { PolicyVendor vendor = db.PolicyVendors.Where( x => x.PolicyVendorRegNo == model.PolicyVendorRegNo).SingleOrDefault(); if (vendor != null) { db.Entry(vendor).CurrentValues.SetValues(model); db.SaveChanges(); return(RedirectToAction("AdminHomePage")); } return(View(model)); }