public ActionResult DischargePatient(DoctorDischargePatient post)
        {
            if (post.patientID > 0)
            {
                Patient_Doctor_Model patient_doctor_reg = new Patient_Doctor_Model()
                {
                    ID            = DataBase.Session.Load <Patient_Doctor_Model>(post.patientID).ID,
                    DoctorID      = Convert.ToInt32(Session["DOCID"]),
                    PatientID     = post.patientID,
                    isDischarged  = 1,
                    dischargeSlip = post.dischargeSlip
                };
                DataBase.Session.Update(patient_doctor_reg);
                ViewBag.successMsg = "Patient Successfully Discharged";
            }
            else
            {
                ViewBag.successMsg = "PLease Select Patient";
            }
            var        list = getPatientList().ToList();
            SelectList li   = new SelectList(list, "id", "Name");

            post.patientList = li;
            return(View(post));
        }
示例#2
0
 public ActionResult Index(ScheduleIndex m)
 {
     if (m.perDay > 0)
     {
         Patient_Doctor_Model patient_doctor_reg = new Patient_Doctor_Model()
         {
             ID            = DataBase.Session.Load <Patient_Doctor_Model>(m.patientID).ID,
             DoctorID      = Convert.ToInt32(Session["DOCID"]),
             PatientID     = m.patientID,
             isDischarged  = 0,
             readingPerDay = m.perDay
         };
         DataBase.Session.Update(patient_doctor_reg);
         ViewBag.success = 1;
     }
     if (m.patientID > 0)
     {
         scheduleIndex.patientID = m.patientID;
         scheduleIndex.Patient   = DataBase.Session.Query <PatientModel>().Where(x => x.ID == m.patientID).SingleOrDefault();
         scheduleIndex.perDay    = DataBase.Session.Query <Patient_Doctor_Model>().Where(x => (x.PatientID == m.patientID && x.DoctorID == Convert.ToInt32(Session["DOCID"]))).SingleOrDefault().readingPerDay;
         ViewBag.selected        = 1;
         return(View(scheduleIndex));// RedirectToAction("ViewSchedule",new { pId = m.patientID });
     }
     else
     {
         return(View(scheduleIndex));
     }
 }