Beispiel #1
0
 public bool PatientInsert(waittime patient)
 {
     using (objDB)
     {
         objDB.waittimes.InsertOnSubmit(patient);
         objDB.SubmitChanges();
         return(true);
     }
 }
 public ActionResult delete(int id, waittime patient)
 {
     ViewBag.Group = "Admin";
     try
     {
         objWaittime.PatientDelete(id);
         return(RedirectToAction("admin"));
     }
     catch
     {
         return(View());
     }
 }
 public ActionResult update(int id, waittime patient)
 {
     ViewBag.Group = "Admin";
     if (ModelState.IsValid)
     {
         try
         {
             objWaittime.PatientUpdate(id, patient.name, patient.time_admit, patient.time_doctor); //update the patient's info
             return(RedirectToAction("admin"));
         }
         catch
         {
             return(View());
         }
     }
     return(View());
 }
 public ActionResult create(waittime patient)
 {
     ViewBag.Group = "Admin";
     if (ModelState.IsValid)
     {
         try
         {
             objWaittime.PatientInsert(patient);
             return(RedirectToAction("admin"));
         }
         catch
         {
             return(View());
         }
     }
     else
     {
         return(View());
     }
 }