public ActionResult Index() { PatronDBhandle dbhandle = new PatronDBhandle(); ModelState.Clear(); return(View(dbhandle.GetPatron())); }
public ActionResult Edit(int id, PatronModel pmodel) { try { PatronDBhandle pdb = new PatronDBhandle(); pdb.UpdatePatronDetails(pmodel); return(RedirectToAction("Index")); } catch { return(View()); } }
public ActionResult Delete(int id) { try { PatronDBhandle pdb = new PatronDBhandle(); if (pdb.DeletePatron(id)) { ViewBag.AlertMsg = "User Deleted Successfully"; } return(RedirectToAction("Index")); } catch { return(View()); } }
public ActionResult Register(PatronModel pmodel) { try { if (ModelState.IsValid) { PatronDBhandle sdb = new PatronDBhandle(); if (sdb.AddPatron(pmodel)) { ViewBag.Message = "User Details Added Successfully"; ModelState.Clear(); return(RedirectToAction("ThankYou")); } } return(View()); } catch { return(View()); } }
public ActionResult Edit(int id) { PatronDBhandle sdb = new PatronDBhandle(); return(View(sdb.GetPatron().Find(pmodel => pmodel.Id == id))); }