/// <summary> /// Default KPA Constructor /// </summary> public KPA() { plan = new Plan(); purch = new Purch(); purchSub = new Purch_Sub(); purchTotal = new Purch_Total(); purchPlanTotal = new Purch_Plan_Total(); followUp = new Follow_Up(); cancellations = new Cancellations(); ncrs = new NCRs(); hotJobs = new Hot_Jobs(); excessStockStock = new Excess_Stock_Stock(); excessStockOpenOrders = new Excess_Stock_Open_Order(); currPlanVsActual = new Current_Plan_vs_Actual(); mtc = new MTC(); }
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")); } }
public IActionResult Doctor(DoctorVM doc, 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(); Patient p; p = _HDB.Patients.FirstOrDefault(s => s.Id == Patient_Id); p.Medical_Record = doc.MedicalRecord; _HDB.Update(p); _HDB.SaveChanges(); Follow_Up fup = new Follow_Up(); fup.Patient_Id = Patient_Id; fup.Staff_Id = doc.Id; fup.Status = "Pending"; _HDB.Add(fup); _HDB.SaveChanges(); Follow_Up_History fuph = new Follow_Up_History(); fuph.Date = doc.Date + "T" + doc.Hour; fuph.Follow_Up_Type_Id = 2; fuph.Follow_Up_Id = fup.Id; _HDB.Add(fuph); _HDB.SaveChanges(); ViewBag.message = "Your Time has been recorded"; HttpContext.Session.SetInt32("choose_test", 2); if (Payment == "PayOnline") { return(RedirectToAction("Payment", "Patient")); } else //if (offlinepay == "offlinepay") { return(RedirectToAction("offlinepay", "Patient")); } }
public IActionResult AnotherDepartment(TransferAnotherDepVM obj) { Follow_Up v = new Follow_Up(); //var patient_id = 2; int Follow_up_Id = (int)HttpContext.Session.GetInt32("Follow_up_Id"); int patient_id = (int)_auc.Follow_Ups.Where(d => d.Id == Follow_up_Id) .Select(d => d.Patient_Id) .Single(); var m = Follow_up_Id; var entity = _auc.Follow_Ups.FirstOrDefault(s => s.Id == m); var followHistory = _auc.Follow_Ups_History.FirstOrDefault(n => n.Follow_Up_Id == m); if (entity != null) { entity.Staff_Id = obj.StaffId; entity.Status = "Pending"; followHistory.Follow_Up_Type_Id = obj.FollowTypeId; followHistory.Date = null; _auc.Entry(entity).State = EntityState.Modified; _auc.Entry(followHistory).State = EntityState.Modified; _auc.SaveChanges(); } var OtherDep = _auc.Specializations.Where(j => j.Code.Substring(0, 1) == "1") .Select(s => new Specialization { Name = s.Name, Id = s.Id }).ToList(); ViewBag.OtherDep = OtherDep; var OtherDoc = _auc.Staff.Select(n => new Staff { Name = n.Name, Specialization_Id = n.Specialization_Id, Id = n.Id }).ToList(); ViewBag.OtherDoc = OtherDoc; var followUpTypes = _auc.Follow_Ups_Types.ToList(); ViewBag.types = followUpTypes; //return View(); return(Redirect("/Doctor/Main")); }