public ActionResult SignUp(DoctorSign doctorSign) { try { IBL bl = new BlClass(); Dictionary <string, string> errorMessege = bl.SignValidation(doctorSign); if (errorMessege.Count == 0) { bl.SignUp(doctorSign); ViewBag.TitlePopUp = "עבר בהצלחה"; ViewBag.Message = "ההרשמה עברה בהצלחה, אישור נוסף תמצא בתיבת המייל האישית שלך."; return(View("~/Views/Home/Index.cshtml")); } foreach (var item in errorMessege) { ModelState.AddModelError(item.Key, item.Value); } return(View("LogIn")); } catch (System.Exception ex) { ViewBag.TitlePopUp = "שגיאה"; ViewBag.Message = ex.Message; return(View("~/Views/Home/Index.cshtml")); } }
protected override void Dispose(bool disposing) { IBL bL = new BlClass(); bL.Dispose(disposing); base.Dispose(disposing); }
public ActionResult Create(DoctorVM doctor) { try { if (ModelState.IsValid) { IBL bL = new BlClass(); Dictionary <string, string> errorMessege = bL.PersonValidation(doctor.Current); if (errorMessege.Count == 0) { bL.AddDoctor(doctor.Current); ViewBag.TitlePopUp = "עבר בהצלחה"; ViewBag.Message = "הרופא.ה התווספ.ה בהצלחה למאגר הרופאים"; return(View("Index", new DoctorModel().getDoctorVms())); } foreach (var item in errorMessege) { ModelState.AddModelError(item.Key, item.Value); } } return(View(doctor)); } catch (Exception ex) { ViewBag.TitlePopUp = "שגיאה"; ViewBag.Message = ex.Message; return(View("Index", new DoctorModel().getDoctorVms())); } }
public ActionResult Create(PatientVM patient) { try { if (ModelState.IsValid) { IBL bL = new BlClass(); Dictionary <string, string> errorMessege = bL.PersonValidation(patient.Current); if (errorMessege.Count == 0) { bL.AddPatient(patient.Current); ViewBag.TitlePopUp = "עבר בהצלחה"; ViewBag.Message = "המטופל.ת התווספ.ה בהצלחה למאגר המטופלים"; return(View("Index", new PatientModel().getPatientVms())); } foreach (var item in errorMessege) { ModelState.AddModelError(item.Key, item.Value); } } return(View(patient)); } catch (Exception ex) { ViewBag.TitlePopUp = "שגיאה"; ViewBag.Message = ex.Message; return(View("Index", new PatientModel().getPatientVms())); } }
public ActionResult Log(DoctorSign doctorSign) { try { IBL bl = new BlClass(); Dictionary <string, string> errorMessege = bl.SignValidation(doctorSign); if (errorMessege.Count == 1) { if (doctorSign.email == "*****@*****.**" && doctorSign.password == "מנהל") { RouteConfig.IsManager = true; return(View("~/Views/Home/Index.cshtml")); } bl.SignIn(doctorSign); Doctor doctor = bl.GetDoctors(doc => doc.email == doctorSign.email).FirstOrDefault(); RouteConfig.doctor = doctor; return(View("~/Views/Home/Index.cshtml")); } foreach (var item in errorMessege) { ModelState.AddModelError(item.Key, item.Value); } ViewBag.SigndivActive = "true"; return(View("LogIn")); } catch (System.Exception ex) { ViewBag.TitlePopUp = "שגיאה"; ViewBag.Message = ex.Message; ViewBag.SigndivActive = "true"; return(View("LogIn")); } }
// GET: Prescriptions public ActionResult Index(int?id) { IBL bl = new BlClass(); var prescriptions = bl.GetPrescriptions(pre => pre.PatientId == id).Select(pr => new PrescriptionVM(pr)); ViewBag.Patient = id; return(View(prescriptions)); }
public static MvcHtmlString DropDownListForMedicines(this HtmlHelper htmlHelper, string name) { IBL bl = new BlClass(); string options = ""; foreach (var medicine in bl.GetMedicines()) { options += $"<option value ='{medicine.Id}'> {medicine.commercialName} </option>"; } return(new MvcHtmlString($"<select class='form-control' name='{name}'>{options}</select>")); }
public static MvcHtmlString DropDownListForMedicinesName(this HtmlHelper htmlHelper) { IBL bl = new BlClass(); string options = $"<option disabled selected>בחר שם גנרי</option>"; IEnumerable <MedicineWrraper> ndc = bl.GetAllNDC(); foreach (var number in ndc) { options += $"<option value ='{number.genericName}'>{number.genericName}</option>"; } return(new MvcHtmlString($"<select class='form-control'>{options}</select>")); }
// GET: Patients/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } IBL bL = new BlClass(); Patient patient = bL.GetPatient(id); if (patient == null) { return(HttpNotFound()); } return(View(new PatientVM(patient))); }
// GET: Medicines/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } IBL bL = new BlClass(); Medicine medicine = bL.GetMedicine(id); if (medicine == null) { return(HttpNotFound()); } return(View(new MedicineVM(medicine))); }
// GET: Doctors/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } IBL bL = new BlClass(); Doctor doctor = bL.GetDoctor(id); if (doctor == null) { return(HttpNotFound()); } return(View(new DoctorVM(doctor))); }
// GET: Prescriptions/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } IBL bL = new BlClass(); Prescription prescription = bL.GetPrescription(id); if (prescription == null) { return(HttpNotFound()); } return(View(prescription)); }
public ActionResult DeleteConfirmed(int id) { try { IBL bL = new BlClass(); bL.DeleteMedicine(id); ViewBag.TitlePopUp = "עבר בהצלחה"; ViewBag.Message = "התרופה נמחקה בהצלחה ממאגר התרופות"; return(View("Index", new MedicineModel().getMedicineVms())); } catch (Exception ex) { ViewBag.TitlePopUp = "שגיאה"; ViewBag.Message = ex.Message; return(View(id)); } }
public ActionResult ForgotPassword(string mail) { try { IBL Bl = new BlClass(); Bl.ForgotPassword(mail); ViewBag.TitlePopUp = "איפוס סיסמה"; ViewBag.Message = "ממתינה לך סיסמה חדשה בתיבת המייל איתו נרשמת למערכת"; return(View("~/Views/Home/Index.cshtml")); } catch (System.Exception ex) { ViewBag.TitlePopUp = "שגיאה"; ViewBag.Message = ex.Message; return(View("~/Views/Home/Index.cshtml")); } }
public ActionResult DeleteConfirmed(int id) { try { IBL bL = new BlClass(); bL.DeletePatient(id); ViewBag.TitlePopUp = "עבר בהצלחה"; ViewBag.Message = "המטופלץת נמחק.ה בהצלחה ממאגר המטופלים"; return(View("Index", new PatientModel().getPatientVms())); } catch (Exception ex) { ViewBag.TitlePopUp = "שגיאה"; ViewBag.Message = ex.Message; return(View("Index", new PatientModel().getPatientVms())); } }
public ActionResult DeleteConfirmed(int id) { try { IBL bL = new BlClass(); bL.DeleteDoctor(id); ViewBag.TitlePopUp = "עבר בהצלחה"; ViewBag.Message = "הרופא.ה נמחק.ה בהצלחה ממאגר הרופאים"; return(View("Index", new DoctorModel().getDoctorVms())); } catch (Exception ex) { ViewBag.TitlePopUp = "שגיאה"; ViewBag.Message = ex.Message; return(View("Index", new DoctorModel().getDoctorVms())); } }
public ActionResult Create(MedicineVM medicine) { try { if (ModelState.IsValid) { IBL bL = new BlClass(); bL.AddMedicine(medicine.Current, medicine.img); ViewBag.TitlePopUp = "עבר בהצלחה"; ViewBag.Message = "התרופה נוספה בהצלחה למאגר התרופות"; return(View("Index", new MedicineModel().getMedicineVms())); } return(View(medicine)); } catch (Exception ex) { ViewBag.TitlePopUp = "שגיאה"; ViewBag.Message = ex.Message; return(View(medicine)); } }
public ActionResult Chart(int?id) { List <int> list = new List <int>() { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; IBL bl = new BlClass(); Medicine medicine = bl.GetMedicine(id); ViewBag.ChartTitle = medicine.commercialName; IEnumerable <Prescription> prescriptions = bl.GetPrescriptions(pre => pre.startDate > new DateTime(2020, 01, 01)); var prescriptionsForMedicine = prescriptions.Where(pr => bl.GetMedicine(pr.MedicineId).commercialName == medicine.commercialName); foreach (var item in prescriptionsForMedicine) { list[item.startDate.Month - 1]++; } return(View(list)); }
public ActionResult Edit(MedicineVM medicine) { try { IBL bL = new BlClass(); medicine.NDC = bL.GetNDCForMedicine(medicine.genericaName); if (ModelState.IsValid) { bL.UpdateMedicine(medicine.Current, medicine.img); ViewBag.TitlePopUp = "עבר בהצלחה"; ViewBag.Message = "התרופה עודכנה בהצלחה במאגר התרופות"; return(View("Index", new MedicineModel().getMedicineVms())); } return(View(medicine)); } catch (Exception ex) { ViewBag.TitlePopUp = "שגיאה"; ViewBag.Message = ex.Message; return(View(medicine)); } }
public ActionResult Create(PrescriptionVM prescription) { try { if (ModelState.IsValid) { IBL bL = new BlClass(); prescription.DoctorId = RouteConfig.doctor != null ? RouteConfig.doctor.Id : -1; bL.AddPrescription(prescription.Current); ViewBag.TitlePopUp = "עבר בהצלחה"; ViewBag.Message = "המרשם נוסף בהצלחה"; var prescriptions = bL.GetPrescriptions(pre => pre.PatientId == prescription.PatientId).Select(pr => new PrescriptionVM(pr)); ViewBag.Patient = prescription.PatientId; return(View("Index", prescriptions)); } return(View(prescription)); } catch (System.Exception ex) { ViewBag.TitlePopUp = "שגיאה"; ViewBag.Message = ex.Message; return(View(prescription)); } }
public PatientModel() { BlClass bL = new BlClass(); patients = bL.GetPatients(); }
public DoctorModel() { BlClass bL = new BlClass(); doctors = bL.GetDoctors(); }
public MedicineModel() { BlClass bL = new BlClass(); medicines = bL.GetMedicines(); }
public static IEnumerable <BE.Prescription> GetPrescriptionsForPatient(this PatientVM patVM) { IBL bl = new BlClass(); return(bl.FilterPrescriptionsForPatient(patVM.Current.Id)); }
public static BE.Medicine GetMedicineForPrescription(this PrescriptionVM pre) { IBL bl = new BlClass(); return(bl.GetMedicine(pre.MedicineId)); }
public static DoctorVM GetDoctorForPrescription(this PrescriptionVM pre) { IBL bl = new BlClass(); return(new DoctorVM(bl.GetDoctor(pre.DoctorId))); }