public ActionResult GetPatientHistoryByPatientID(int _patientID, int?_skip, string _sortBy, string _order) { var _patientHistory = _intakeService.getPatientHistoryByPatientID(_patientID, _skip.Value, GlobalConst.Records.Take, _sortBy, _order); PatientHistoryViewModel _PatientHistoryViewModel = new PatientHistoryViewModel(); _PatientHistoryViewModel.PatientHistoryDetails = Mapper.Map <IEnumerable <PatientHistory> >(_patientHistory.PatientHistoryDetails); _PatientHistoryViewModel.TotalCount = _patientHistory.TotalCount; return(Json(_PatientHistoryViewModel, GlobalConst.ContentTypes.TextHtml)); }
// // GET: /SecretaryDashboard/PatientHistoryDetails/PatientDetails/5 public ActionResult PatientHistoryDetails(int patientHistoryID) { PatientHistoryViewModel patientHistory = patientRepository.getPatinetHistoryDetails(patientHistoryID); if (patientHistory == null) { return(HttpNotFound()); } return(View(patientHistory)); }
// GET: Patients/History/5 public async Task <IActionResult> History(int?id) { if (id == null) { return(NotFound()); } PatientHistoryViewModel patient = await PatientsHelper.GetPatientHistoryByIdAsync((int)id); if (patient == null) { return(NotFound()); } return(View(patient)); }
public bool addNewPatinetHistory(PatientHistoryViewModel patientHistory) { int count = 0; using (Entities.Entities ctx = new Entities.Entities()) { PatientHistory patientHistoryEntity = ctx.PatientHistories.Create(); patientHistoryEntity.PatientID = patientHistory.PatientID; patientHistoryEntity.Name = patientHistory.Name; patientHistoryEntity.Descripation = patientHistory.Descripation; ctx.PatientHistories.Add(patientHistoryEntity); count = ctx.SaveChanges(); } return(count > 0 ? true : false); }
public ActionResult PatientHistoryEdit(PatientHistoryViewModel patientHistory) { try { if (ModelState.IsValid) { bool check = patientRepository.updatePatinetHistory(patientHistory); } else { return(View(patientHistory)); } return(RedirectToAction("patientHistoryList", new { patientID = patientHistory.PatientID })); } catch { return(View(patientHistory)); } }
public bool updatePatinetHistory(PatientHistoryViewModel patientHistory) { int count = 0; using (Entities.Entities ctx = new Entities.Entities()) { PatientHistory patientHistoryEntity = ctx.PatientHistories.Find(patientHistory.HistoryID); if (patientHistoryEntity == null) { return(false); } patientHistoryEntity.Name = patientHistory.Name; patientHistoryEntity.Descripation = patientHistory.Descripation; ctx.Entry(patientHistoryEntity).State = System.Data.Entity.EntityState.Modified; count = ctx.SaveChanges(); } return(count > 0 ? true : false); }
public ActionResult PatientHistoryCreate(PatientHistoryViewModel patientHistory) { try { if (ModelState.IsValid) { bool check = patientRepository.addNewPatinetHistory(patientHistory); } else { ViewBag.patientID = patientHistory.PatientID; return(View()); } return(RedirectToAction("patientHistoryList", new { patientID = patientHistory.PatientID })); } catch { ViewBag.patientID = patientHistory.PatientID; return(View()); } }
public PatientHistoryViewModel getPatinetHistoryDetails(int patientHistorytID) { PatientHistoryViewModel patientHistoryViewModel; using (Entities.Entities ctx = new Entities.Entities()) { PatientHistory patientHistoryEntity = ctx.PatientHistories.Find(patientHistorytID); if (patientHistoryEntity != null) { patientHistoryViewModel = new PatientHistoryViewModel { HistoryID = patientHistoryEntity.HistoryID, Name = patientHistoryEntity.Name, Descripation = patientHistoryEntity.Descripation, PatientID = patientHistoryEntity.PatientID }; } else { patientHistoryViewModel = null; } } return(patientHistoryViewModel); }