public PatientIptWorkup GetPatientIptWorkup(int id) { using (UnitOfWork _unitOfWork = new UnitOfWork(new GreencardContext())) { PatientIptWorkup patientIptWorkup = _unitOfWork.PatientIptWorkupRepository.GetById(id); _unitOfWork.Dispose(); return(patientIptWorkup); } }
public int UpdatePatientIptWorkup(PatientIptWorkup p) { using (UnitOfWork _unitOfWork = new UnitOfWork(new GreencardContext())) { _unitOfWork.PatientIptWorkupRepository.Update(p); _result = _unitOfWork.Complete(); _unitOfWork.Dispose(); return(_result); } }
public void DeletePatientIptWorkup(int id) { using (UnitOfWork _unitOfWork = new UnitOfWork(new GreencardContext())) { PatientIptWorkup icf = _unitOfWork.PatientIptWorkupRepository.GetById(id); _unitOfWork.PatientIptWorkupRepository.Remove(icf); _unitOfWork.Dispose(); _unitOfWork.Complete(); } }
public int AddPatientIptWorkup(PatientIptWorkup p) { PatientIptWorkup patientIptWorkup = new PatientIptWorkup() { PatientId = p.PatientId, PatientMasterVisitId = p.PatientMasterVisitId, AbdominalTenderness = p.AbdominalTenderness, LiverFunctionTests = p.LiverFunctionTests, Numbness = p.Numbness, YellowColouredUrine = p.YellowColouredUrine, YellownessOfEyes = p.YellownessOfEyes, IptStartDate = p.IptStartDate, StartIpt = p.StartIpt, CreatedBy = SessionManager.UserId }; return(_patientIptWorkup.AddPatientIptWorkup(patientIptWorkup)); }
public string AddPatientIptWorkup(int patientId, int patientMasterVisitId, bool abdominalTenderness, bool numbness, bool yellowColouredUrine, bool yellownessOfEyes, string liverFunctionTests, bool startIpt, DateTime?iptStartDate) { PatientIptWorkup patientIptWorkup = new PatientIptWorkup() { PatientId = patientId, PatientMasterVisitId = patientMasterVisitId, AbdominalTenderness = abdominalTenderness, LiverFunctionTests = liverFunctionTests, Numbness = numbness, YellowColouredUrine = yellowColouredUrine, YellownessOfEyes = yellownessOfEyes, IptStartDate = iptStartDate, StartIpt = startIpt }; try { var iptWorkup = new PatientIptWorkupManager(); var x = iptWorkup.GetByPatientId(patientId).FirstOrDefault(n => n.PatientMasterVisitId == patientMasterVisitId); if (x == null) { Result = iptWorkup.AddPatientIptWorkup(patientIptWorkup); } else { patientIptWorkup.Id = x.Id; Result = iptWorkup.UpdatePatientIptWorkup(patientIptWorkup); } if (Result > 0) { Msg = "Patient IPT Workup saved successfully!"; } } catch (Exception e) { Msg = e.Message; } return(Msg); }