예제 #1
0
 public static void UpdateLab(this Lab item, LabVM itemVM)
 {
     item.Name    = itemVM.Name;
     item.Address = itemVM.Address;
     item.Phone   = itemVM.Phone;
     item.Fax     = itemVM.Fax;
 }
예제 #2
0
        public IActionResult Lab(LabVM bd, string Payment, string offlinepay)
        {
            int Patient_Reg_Id = (int)HttpContext.Session.GetInt32("User_Reg_Id");
            int Patient_Id     = _HDB.Patients.Where(f => f.Registration_Id == Patient_Reg_Id).Select(h => h.Id).SingleOrDefault();
            int sp_Id          = (int)HttpContext.Session.GetInt32("Sp_Id");

            int     staff_id = _HDB.Staff.Where(w => w.Specialization_Id == sp_Id).Select(e => e.Id).SingleOrDefault();
            Patient p;

            p = _HDB.Patients.FirstOrDefault(s => s.Id == Patient_Id);
            p.Medical_Record = bd.MedicalRecord;
            _HDB.Update(p);
            _HDB.SaveChanges();
            Follow_Up fup = new Follow_Up();

            fup.Patient_Id = Patient_Id;
            fup.Status     = "Pending";
            fup.Staff_Id   = staff_id;
            _HDB.Add(fup);
            _HDB.SaveChanges();

            Follow_Up_History fuph = new Follow_Up_History();

            fuph.Date = bd.Date + "T" + bd.Hour;
            fuph.Follow_Up_Type_Id = bd.Id;            ////Done
            fuph.Follow_Up_Id      = fup.Id;

            _HDB.Add(fuph);
            _HDB.SaveChanges();
            ViewBag.message = "Your Time has been recorded";
            HttpContext.Session.SetInt32("choose_test", (int)bd.Id);
            // bool ofon = _HDB.Payments.Where(o => o.Patient_Id == Patient_Id).Select(i => i.Online).FirstOrDefault();
            if (Payment == "PayOnline")
            {
                return(RedirectToAction("Payment", "Patient"));
            }
            else //if (offlinepay == "offlinepay")
            {
                return(RedirectToAction("offlinepay", "Patient"));
            }
        }