public ActionResult Index() { medicalHistoriesBusinessLayer = new MedicalHistoriesBusinessLayer(); Logging.loggInfo($"Showing list of all medical histories"); return View(medicalHistoriesBusinessLayer.GetMedicalHistory(null)); }
protected override void Dispose(bool disposing) { medicalHistoriesBusinessLayer = new MedicalHistoriesBusinessLayer(); if (disposing) { medicalHistoriesBusinessLayer.Dispose(); } base.Dispose(disposing); }
public ActionResult Create(MedicalHistory medicalHistory) { if (ModelState.IsValid) { MedicalHistoriesBusinessLayer businessLayer = new MedicalHistoriesBusinessLayer(); if (appointmentId != null) { medicalHistory.AppointmentId = (int)appointmentId; AppointmentBusinessLayer appointmentBusinessLayer = new AppointmentBusinessLayer(); appointmentBusinessLayer.ChangeAppointmentStatus(medicalHistory.AppointmentId); } medicalHistory.PatientId = patientId; businessLayer.AddHistory(medicalHistory); Logging.loggInfo($"Medcial history added of the patient having patient id = {medicalHistory.PatientId}"); return Redirect("/Patients/Details/" + patientId); } return View(medicalHistory); }
// GET: MedicalHistories/Details/5 public ActionResult Details(int? id) { if (id == null) { return Redirect("/Error/Index?error=400"); } medicalHistoriesBusinessLayer = new MedicalHistoriesBusinessLayer(); var history = medicalHistoriesBusinessLayer.GetMedicalHistory(id); if (history == null) { Logging.loggError($"No Patient found having nurse id = {id}"); return Redirect("/Error/Index"); } Logging.loggInfo($"Showing Medical history of Patient having id = {id}"); return View(history); }
public void TestGetAllMedicalHistories() { MedicalHistoriesBusinessLayer businessLayer = new MedicalHistoriesBusinessLayer(); Assert.IsFalse(businessLayer.GetMedicalHistory(null).Count == 0); }