Exemplo n.º 1
0
        public ActionResult Index()
        {
            PatronDBhandle dbhandle = new PatronDBhandle();

            ModelState.Clear();
            return(View(dbhandle.GetPatron()));
        }
Exemplo n.º 2
0
 public ActionResult Edit(int id, PatronModel pmodel)
 {
     try
     {
         PatronDBhandle pdb = new PatronDBhandle();
         pdb.UpdatePatronDetails(pmodel);
         return(RedirectToAction("Index"));
     }
     catch
     {
         return(View());
     }
 }
Exemplo n.º 3
0
 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());
     }
 }
Exemplo n.º 4
0
 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());
     }
 }
Exemplo n.º 5
0
        public ActionResult Edit(int id)
        {
            PatronDBhandle sdb = new PatronDBhandle();

            return(View(sdb.GetPatron().Find(pmodel => pmodel.Id == id)));
        }