示例#1
0
        // 1. *************RETRIEVE ALLDoctor DETAILS ******************
        // GET:Doctor
        public ActionResult DoctorList()
        {
            DoctorMasterDbHandle dbhandle = new DoctorMasterDbHandle();

            ModelState.Clear();
            return(View(dbhandle.GetDoctor()));
        }
示例#2
0
 public ActionResult Edit(int id, DoctorClass smodel)
 {
     try
     {
         DoctorMasterDbHandle sdb = new DoctorMasterDbHandle();
         sdb.UpdateDetails(smodel);
         return(RedirectToAction("DoctorList"));
     }
     catch (Exception ex)
     {
         Console.WriteLine(ex);
         return(View());
     }
 }
示例#3
0
 // 4. ************* DELETEDoctor DETAILS ******************
 // GET:Doctor/Delete/5
 public ActionResult Delete(int id)
 {
     try
     {
         DoctorMasterDbHandle sdb = new DoctorMasterDbHandle();
         if (sdb.DeleteDoctor(id))
         {
             ViewBag.AlertMsg = "S Deleted Successfully";
         }
         return(RedirectToAction("DoctorList"));
     }
     catch
     {
         return(View());
     }
 }
示例#4
0
 public ActionResult Create(DoctorClass smodel)
 {
     try
     {
         if (ModelState.IsValid)
         {
             DoctorMasterDbHandle sdb = new DoctorMasterDbHandle();
             if (sdb.AddDoctor(smodel))
             {
                 ViewBag.Message = "Doctor Details Added Successfully";
                 ModelState.Clear();
             }
         }
         return(View());
     }
     catch (Exception ex)
     {
         ex.StackTrace.ToString();
         return(View());
     }
 }
示例#5
0
        // 3. ************* EDITDoctor DETAILS ******************
        // GET:Doctor/Edit/5
        public ActionResult Edit(int id)
        {
            DoctorMasterDbHandle sdb = new DoctorMasterDbHandle();

            return(View(sdb.GetDoctor().Find(smodel => smodel.DoctorId == id)));
        }