public int UpdatePatientPregnancyOutcome(PatientPreganancy pregnancy) { using (UnitOfWork unitOfWork = new UnitOfWork(new GreencardContext())) { unitOfWork.PatientPregnancyRepository.Update(pregnancy); unitOfWork.Complete(); unitOfWork.Dispose(); return(pregnancy.Id); } }
public int AddPatientPregnancy(PatientPreganancy a) { using (UnitOfWork _unitOfWork = new UnitOfWork(new GreencardContext())) { _unitOfWork.PatientPregnancyRepository.Add(a); result = _unitOfWork.Complete(); _unitOfWork.Dispose(); return(result); } }
public int UpdatePatientPregnancyOutcome(PatientPreganancy pregnancy) { try { return(_PatientPregnancy.UpdatePatientPregnancyOutcome(pregnancy)); } catch (Exception e) { Console.WriteLine(e); throw; } }
public int CheckIfPatientPregnancyExisists(int patientId) { using (UnitOfWork _unitOfWork = new UnitOfWork(new GreencardContext())) { PatientPreganancy pregnancy = _unitOfWork.PatientPregnancyRepository.FindBy(x => x.PatientId == patientId && !x.DeleteFlag && (x.Outcome == 0 || x.Outcome == null)).FirstOrDefault(); _unitOfWork.Dispose(); if (pregnancy != null) { return(pregnancy.Id); } return(0); } }
public int UpdatePatientPreganacy(int id, DateTime LMP, DateTime EDD, string gravidae, string parity, int outcome, DateTime dateOfOutcome) { try { var PG = new PatientPreganancy() { Id = id, LMP = LMP, EDD = EDD, Gravidae = gravidae, parity = parity, Outcome = outcome, DateOfOutcome = dateOfOutcome }; return(_PatientPregnancy.UpdatePatientPreganacy(PG)); } catch (Exception) { throw; } }
public int AddPatientPregnancy(int patientId, int patientMasterVisitId, DateTime LMP, DateTime EDD, string gravidae, string parity, int outcome, DateTime dateOfOutcome, int userId) { try { var PG = new PatientPreganancy() { PatientId = patientId, PatientmasterVisitId = patientMasterVisitId, LMP = LMP, EDD = EDD, Gravidae = gravidae, parity = parity, Outcome = outcome, DateOfOutcome = dateOfOutcome, CreatedBy = userId }; return(_PatientPregnancy.AddPatientPregnancy(PG)); } catch (Exception) { throw; } }
public int UpdatePatientPreganacy(PatientPreganancy patientPreganancy) { using (UnitOfWork _unitOfWork = new UnitOfWork(new GreencardContext())) { var PG = _unitOfWork.PatientPregnancyRepository.FindBy( x => x.PatientId == patientPreganancy.PatientId & !x.DeleteFlag) .FirstOrDefault(); if (PG != null) { PG.LMP = patientPreganancy.LMP; PG.EDD = patientPreganancy.EDD; PG.Gravidae = patientPreganancy.Gravidae; PG.Parity = patientPreganancy.Parity; PG.Outcome = patientPreganancy.Outcome; PG.DateOfOutcome = patientPreganancy.DateOfOutcome; } _unitOfWork.PatientPregnancyRepository.Update(PG); result = _unitOfWork.Complete(); _unitOfWork.Dispose(); return(result); } }