public ActionResult ProductUpdate(MedicineModel medicine) { int result = 0; PractitionerProcess process = new PractitionerProcess(); result = process.UpdateProduct(medicine); if (result == 0) { PractitionerBaseViewModel viewModel = new PractitionerBaseViewModel(); viewModel.AccId = medicine.PractitionerId; viewModel.MedicineModel = medicine; return(View(viewModel)); } else { return(Content(@"<body> <script type='text/javascript'> if(confirm('Product update is updated successfully. Press Ok to close this tab.')){ window.close();window.opener.location.reload(); }; </script> </body> ")); } }
public ActionResult SpecialistProfile(string specialistId, string accId) { AppointmentViewModel result = new AppointmentViewModel(); PractitionerBaseViewModel practitioner = new PractitionerBaseViewModel(); if (String.IsNullOrEmpty(specialistId) && String.IsNullOrEmpty(accId)) { return(new HttpNotFoundResult("Oops..There is no account selected. Please try again.")); } else { Guid patientAccId = Guid.Parse(accId); result.PatientId = patientAccId; Guid specialistAccId = Guid.Parse(specialistId); if (specialistAccId.Equals(Guid.Empty)) { return(new HttpNotFoundResult("Oops..There is some errors occur. Please try again.")); } else { PractitionerBaseViewModel vm = new PractitionerBaseViewModel(); vm.AccId = specialistAccId; PractitionerProcess process = new PractitionerProcess(); practitioner = process.GetProfile(vm); result.Practitioner = practitioner; } } return(View(result)); }
public List <PractitionerRecordsDirectory> GetRecordsDirectory(PractitionerBaseViewModel vm) { PractitionerBusiness businessLayer = new PractitionerBusiness(); List <PractitionerRecordsDirectory> result = businessLayer.GetRecordsDirectory(vm.AccId); return(result); }
public ActionResult CreateProduct(PractitionerBaseViewModel viewModel) { MedicineModel model = new MedicineModel(); model.PractitionerId = viewModel.AccId; return(View(model)); }
public int AppointmentRejected(AppointmentModel appointmentModel) { int result = 0; try { //Change Appointment Status to rejected PractitionerData dataLayer = new PractitionerData(); AppointmentModel model = new AppointmentModel(); //model is with appointmentdatestring and appointmenttimestring and PatientId + RejectReasons + PracitionerId model = dataLayer.AppointmentRejected(appointmentModel); if (!model.PatientId.Equals(Guid.Empty)) { //Get PatientId to retrieve email PatientData patientDataLayer = new PatientData(); string patientEmailAddress = patientDataLayer.GetPatientEmail(model.PatientId); PractitionerBaseViewModel companyDetails = new PractitionerBaseViewModel(); PractitionerBaseViewModel temp = new PractitionerBaseViewModel(); temp.AccId = appointmentModel.PractitionerId; companyDetails = dataLayer.GetProfile(temp); result = SentAppointmentRejectedNotificationEmail(patientEmailAddress, model.AppointmentDateString, model.AppointmentTimeString, model.RejectReasons, companyDetails); } } catch (Exception err) { new LogHelper().LogMessage("PractitionerBusiness.AppointmentAccepted : " + err); } return(result); }
public ActionResult PractitionerLogin(LoginInfo loginInfo) { LoginInfo result = new LoginInfo(); if (Request.Form["Submit"] != null) { if (ModelState.IsValid == true) { PractitionerProcess process = new PractitionerProcess(); result = process.PractitionerLogin(loginInfo); TempData["Deleted"] = ""; TempData["Pending"] = ""; TempData["Incorrect"] = ""; //Account found if (result.AccountNo != Guid.Empty) { //Check Status if (result.AccountStatus.Equals(ConstantHelper.AccountStatus.Active)) { PractitionerBaseViewModel vm = new PractitionerBaseViewModel(); vm.AccId = result.AccountNo; FormsAuthentication.SetAuthCookie(result.AccountNo.ToString(), false); return(RedirectToAction("Profile", "Practitioner", vm)); } else if (result.AccountStatus.Equals(ConstantHelper.AccountStatus.Deleted)) { //Account deleted TempData["Deleted"] = "Deleted"; loginInfo.Password = ""; return(View(loginInfo)); } else if (result.AccountStatus.Equals(ConstantHelper.AccountStatus.Pending)) { //Account pending TempData["Pending"] = "Pending"; loginInfo.Password = ""; return(View(loginInfo)); } } else { //Account not found TempData["Incorrect"] = "Incorrect"; loginInfo.Password = ""; return(View(loginInfo)); } } } return(View(loginInfo)); }
public PractitionerBaseViewModel GetProfile(PractitionerBaseViewModel vm) { PractitionerBaseViewModel result = new PractitionerBaseViewModel(); PractitionerBusiness businessLayer = new PractitionerBusiness(); result = businessLayer.GetProfile(vm); return(result); }
public List <AppointmentModel> GetAppointmentsTable(PractitionerBaseViewModel vm) { List <AppointmentModel> result = new List <AppointmentModel>(); PractitionerBusiness businessLayer = new PractitionerBusiness(); result = businessLayer.GetAppointmentsTable(vm.AccId); return(result); }
public ActionResult Records(string practitionerId) { PractitionerBaseViewModel vm = new PractitionerBaseViewModel(); vm.AccId = Guid.Parse(practitionerId); PractitionerProcess process = new PractitionerProcess(); List <PractitionerRecordsDirectory> result = process.GetRecordsDirectory(vm); //pass balck list of records model return(Json(result, JsonRequestBehavior.AllowGet)); }
public List <PractitionerRecordsDirectory> PatientPractitionerRecords(PractitionerBaseViewModel vm) { List <PractitionerRecordsDirectory> result = new List <PractitionerRecordsDirectory>(); if (vm != null) { PractitionerBusiness businessLayer = new PractitionerBusiness(); result = businessLayer.PatientPractitionerRecords(vm.AccId, vm.PatientBaseViewModel.AccId); } return(result); }
public ActionResult PatientPractitionerRecords(string practitionerId, string patientId) { List <PractitionerRecordsDirectory> result = new List <PractitionerRecordsDirectory>(); PractitionerProcess process = new PractitionerProcess(); PractitionerBaseViewModel vm = new PractitionerBaseViewModel(); vm.AccId = Guid.Parse(practitionerId); vm.PatientBaseViewModel.AccId = Guid.Parse(patientId); result = process.PatientPractitionerRecords(vm); return(Json(result, JsonRequestBehavior.AllowGet)); }
public List <MedicineModel> GetProducts(PractitionerBaseViewModel profile) { List <MedicineModel> result = new List <MedicineModel>(); if (profile != null) { PractitionerBusiness businessLayer = new PractitionerBusiness(); result = businessLayer.GetProducts(profile.AccId); } return(result); }
public int ProfileEdit(PractitionerBaseViewModel profile) { int result = 0; if (profile != null) { PractitionerBusiness businessLayer = new PractitionerBusiness(); result = businessLayer.ProfileEdit(profile); } return(result); }
public PatientRecordModel GetMedicinesDropDown(PractitionerBaseViewModel vm) { PatientRecordModel result = new PatientRecordModel(); if (vm != null) { PractitionerBusiness businessLayer = new PractitionerBusiness(); result = businessLayer.GetMedicinesDropDown(vm.CompanyId); } return(result); }
public List <PatientsDirectory> GetPatientsDirectory(PractitionerBaseViewModel vm) { List <PatientsDirectory> result = new List <PatientsDirectory>(); if (vm != null) { PractitionerBusiness businessLayer = new PractitionerBusiness(); result = businessLayer.GetPatientsDirectory(vm.AccId); } return(result); }
public int ProfileEdit(PractitionerBaseViewModel profile) { PractitionerData dataLayer = new PractitionerData(); profile.DateOfBirth = Convert.ToDateTime(profile.DateOfBirthString); int result = 0; result = dataLayer.ProfileEdit(profile); return(result); }
public ActionResult Patients(PractitionerBaseViewModel vm) { if (vm.AccId.Equals(Guid.Empty)) { return(RedirectToAction("PractitionerLogin", "HomePage", null)); } else { PractitionerBaseViewModel result = new PractitionerBaseViewModel(); result.AccId = vm.AccId; return(View(result)); } }
public int ProfileEdit(PractitionerBaseViewModel vm) { var client = new RestClient(ConstantHelper.AppSettings.BackEndUrl); RestRequest request = new RestRequest(ConstantHelper.API.Practitioner.ProfileEdit, Method.POST); request.RequestFormat = DataFormat.Json; request.AddBody(vm); IRestResponse <int> response = client.Execute <int>(request); int result = response.Data; return(result); }
public ActionResult Records(PractitionerBaseViewModel vm) { if (vm.AccId.Equals(Guid.Empty)) { return(RedirectToAction("PractitionerLogin", "HomePage", null)); } else { PractitionerBaseViewModel result = new PractitionerBaseViewModel(); result.AccId = vm.AccId; result.PractitionerRecordSearch.Year = DateTime.Today.Year; return(View(result)); } }
public List <PatientsDirectory> GetPatientsDirectory(PractitionerBaseViewModel vm) { var client = new RestClient(ConstantHelper.AppSettings.BackEndUrl); RestRequest request = new RestRequest(ConstantHelper.API.Practitioner.GetPatientsDirectory, Method.POST); request.RequestFormat = DataFormat.Json; request.AddBody(vm); IRestResponse <List <PatientsDirectory> > response = client.Execute <List <PatientsDirectory> >(request); List <PatientsDirectory> result = response.Data; return(result); }
public ActionResult Profile(PractitionerBaseViewModel vm) { if (vm.AccId.Equals(Guid.Empty)) { return(RedirectToAction("PractitionerLogin", "HomePage", null)); } else { PractitionerBaseViewModel result = new PractitionerBaseViewModel(); PractitionerProcess process = new PractitionerProcess(); result = process.GetProfile(vm); return(View(result)); } }
public Dictionary <string, string> GetMedicinesDropDown(PractitionerBaseViewModel vm) { var client = new RestClient(ConstantHelper.AppSettings.BackEndUrl); RestRequest request = new RestRequest(ConstantHelper.API.PatientRecord.GetMedicinesDropDown, Method.POST); request.RequestFormat = DataFormat.Json; request.AddBody(vm); IRestResponse <PatientRecordModel> response = client.Execute <PatientRecordModel>(request); PatientRecordModel result = response.Data; return(result.MedicineDropDown); }
public ActionResult ProfileEdit(PractitionerBaseViewModel vm) { if (vm.AccId.Equals(Guid.Empty)) { return(RedirectToAction("PractitionerLogin", "HomePage", null)); } else { vm.Religion = (Religion)Enum.Parse(typeof(Religion), vm.ReligionString); vm.Specialist = (Specialist)Enum.Parse(typeof(Specialist), vm.SpecialistString); vm.DateOfBirthString = vm.DateOfBirth.ToString("yyyy-MM-dd"); return(View(vm)); } }
public ActionResult ViewPatient(string patientId, string practitionerId) { PractitionerBaseViewModel result = new PractitionerBaseViewModel(); PatientBaseViewModel patientModel = new PatientBaseViewModel(); patientModel.AccId = Guid.Parse(patientId); PractitionerProcess process = new PractitionerProcess(); result.PatientBaseViewModel = process.ViewPatient(patientModel); result.AccId = Guid.Parse(practitionerId); return(View(result)); }
public PractitionerBaseViewModel GetProfile(PractitionerBaseViewModel vm) { PractitionerBaseViewModel result = new PractitionerBaseViewModel(); try { PractitionerData dataLayer = new PractitionerData(); result = dataLayer.GetProfile(vm); } catch (Exception err) { new LogHelper().LogMessage("PractitionerBusiness.GetProfile : " + err); } return(result); }
public List <AppointmentModel> GetAppointmentsTable(string practitionerId) { PractitionerBaseViewModel vm = new PractitionerBaseViewModel(); vm.AccId = Guid.Parse(practitionerId); var client = new RestClient(ConstantHelper.AppSettings.BackEndUrl); RestRequest request = new RestRequest(ConstantHelper.API.Practitioner.GetAppointmentsTable, Method.POST); request.RequestFormat = DataFormat.Json; request.AddBody(vm); IRestResponse <List <AppointmentModel> > response = client.Execute <List <AppointmentModel> >(request); List <AppointmentModel> result = response.Data; return(result); }
public int MakeAppointment(AppointmentModel appointmentModel) { int result = 0; PatientBusiness businessLayer = new PatientBusiness(); result = businessLayer.MakeAppointment(appointmentModel); if (result == 1) { PractitionerBaseViewModel pt = new PractitionerBaseViewModel(); PractitionerBaseViewModel ptResult = new PractitionerBaseViewModel(); pt.AccId = appointmentModel.PractitionerId; PractitionerBusiness practitionerBusiness = new PractitionerBusiness(); ptResult = practitionerBusiness.GetProfile(pt); businessLayer.SentEmailNotification(appointmentModel, ptResult); } return(result); }
public void SentEmailNotification(AppointmentModel model, PractitionerBaseViewModel ptResult) { string mailFrom = ConstantHelper.AppSettings.MailFrom; string userName = ConstantHelper.AppSettings.UserName; string password = ConstantHelper.AppSettings.Password; try { PatientData patientDataLayer = new PatientData(); string patientEmail = patientDataLayer.GetPatientEmail(model.PatientId); if (!String.IsNullOrEmpty(patientEmail)) { //Sent notification email to patient string patientEmailSubject = ConstantHelper.Email.AppointmentVerification.AppointmentMadeSubject; string patientEmailBody = ConstantHelper.Email.AppointmentVerification.AppointmentMadeBody; //replace with appointment details DateTime tempAppointmentDateTime = Convert.ToDateTime(model.AppointmentDate.ToString()); string appointmentDetailsTable = "<table><caption>Appointment Details</caption><tr><th>Appointment Date</th><td>" + tempAppointmentDateTime.ToString("dd/MM/yyyy") + "</td></tr><tr><th>Appointment Time</th><td>" + tempAppointmentDateTime.ToString("hh:mm tt") + "</td></tr><tr><th>Company</th><td>" + ptResult.CompanyName + "</td></tr><tr><th>City</th><td>" + ptResult.City + "</td></tr><tr><th>Postal Code</th><td>" + ptResult.PostalCode + "</td></tr><tr><th>State</th><td>" + ptResult.State + "</td></tr><tr><th>Appointment Description</th><td>" + model.Description + "</td></tr><tr><th>Appointment Remarks</th><td>" + model.Remarks + "</td></tr></table>"; patientEmailBody = patientEmailBody.Replace(ConstantHelper.Email.Keyword.AppointmentDetails, appointmentDetailsTable); EmailHelper.SentMail(mailFrom, patientEmail, patientEmailSubject, patientEmailBody, userName, password); } PractitionerData practitionerDataLayer = new PractitionerData(); string practitionerEmail = practitionerDataLayer.GetPractitionerEmail(model.PractitionerId); if (!String.IsNullOrEmpty(practitionerEmail)) { //Sent notification email to practitioner string practitionerEmailSubject = ConstantHelper.Email.AppointmentVerification.NewAppointmentSubject; string practitionerEmailBody = ConstantHelper.Email.AppointmentVerification.NewAppointmentBody; //replace maybe link to practitionerLogin string practitionerLoginPage = "<a href='" + ConstantHelper.AppSettings.RootSiteUrl + ConstantHelper.API.Practitioner.PractitionerLogin + "'>Practitioner Login Page</a>"; practitionerEmailBody = practitionerEmailBody.Replace(ConstantHelper.Email.Keyword.PractitionerLoginPage, practitionerLoginPage); EmailHelper.SentMail(mailFrom, practitionerEmail, practitionerEmailSubject, practitionerEmailBody, userName, password); } } catch (Exception err) { new LogHelper().LogMessage("PatientBusiness.SentEmailNotification : " + err); } }
public ActionResult Products(Guid practitionerId) { if (practitionerId != null) { if (!practitionerId.Equals(Guid.Empty)) { List <MedicineModel> result = new List <MedicineModel>(); PractitionerBaseViewModel vm = new PractitionerBaseViewModel(); vm.AccId = practitionerId; PractitionerProcess processLayer = new PractitionerProcess(); result = processLayer.GetProducts(vm); return(Json(result, JsonRequestBehavior.AllowGet)); } } else { throw new UnauthorizedAccessException("Error! Not Authorized.", new Exception("No Practitioner Id Found!")); } return(View()); }
public ActionResult ProfileEdit(PractitionerBaseViewModel vm, Guid accId) { PractitionerBaseViewModel result = new PractitionerBaseViewModel(); result.AccId = accId; PractitionerProcess process = new PractitionerProcess(); int returnValue = process.ProfileEdit(vm); if (returnValue != 0) { return(RedirectToAction("Profile", "Practitioner", result)); } else { return(Content(@"<body> <script type='text/javascript'> if(confirm('Profile is not updated successfully. Press Ok to try again.')){ window.history.back(); }; </script> </body> ")); } }