public HttpResponseMessage CompanyApproved(Guid accId) { string companyEmailAddress = String.Empty; try { //var accId = vm.CompanyId; PractitionerBusiness businessLayer = new PractitionerBusiness(); companyEmailAddress = businessLayer.CompanyApproved(accId); if (!String.IsNullOrEmpty(companyEmailAddress)) { string mailFrom = ConstantHelper.AppSettings.MailFrom; string emailSubject = ConstantHelper.Email.CompanyVerification.CompanyApprovedSubject; string emailBody = ConstantHelper.Email.CompanyVerification.CompanyApprovedBody; string userName = ConstantHelper.AppSettings.UserName; string password = ConstantHelper.AppSettings.Password; EmailHelper.SentMail(mailFrom, companyEmailAddress, emailSubject, emailBody, userName, password); } } catch (Exception err) { new LogHelper().LogMessage("RegistrationController.CompanyApproved : " + err); } string route = ConstantHelper.AppSettings.RootSiteUrl + "HomePage/CompanyApproved"; var response = Request.CreateResponse(HttpStatusCode.Moved); response.Headers.Location = new Uri(route); return(response); }
public List <PractitionerRecordsDirectory> GetRecordsDirectory(PractitionerBaseViewModel vm) { PractitionerBusiness businessLayer = new PractitionerBusiness(); List <PractitionerRecordsDirectory> result = businessLayer.GetRecordsDirectory(vm.AccId); return(result); }
public NewPractitionerViewModel GetCompanyList(NewPractitionerViewModel vm) { PractitionerBusiness businessLayer = new PractitionerBusiness(); NewPractitionerViewModel result = businessLayer.GetCompanyList(vm); return(result); }
public int AppointmentPending(AppointmentModel appointmentModel) { int result = 0; PractitionerBusiness businessLayer = new PractitionerBusiness(); result = businessLayer.AppointmentPending(appointmentModel); return(result); }
public LoginInfo GetLogin(LoginInfo loginInfo) { LoginInfo result = loginInfo; PractitionerBusiness businessLayer = new PractitionerBusiness(); result = businessLayer.PractitionerLogin(loginInfo); return(result); }
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 int UpdateProduct(MedicineModel newMedicine) { int result = 0; if (newMedicine != null) { PractitionerBusiness businessLayer = new PractitionerBusiness(); result = businessLayer.UpdateProduct(newMedicine); } return(result); }
public MedicineModel GetProduct(MedicineModel medicine) { MedicineModel result = new MedicineModel(); if (medicine != null) { PractitionerBusiness businessLayer = new PractitionerBusiness(); result = businessLayer.GetProduct(medicine); } return(result); }
public List <MedicineModel> SearchProduct(MedicineViewModel vm) { List <MedicineModel> result = new List <MedicineModel>(); if (vm != null) { PractitionerBusiness businessLayer = new PractitionerBusiness(); result = businessLayer.SearchProduct(vm); } return(result); }
public NewPatientRecordViewModel CreateNewRecord(PatientRecordModel vm) { NewPatientRecordViewModel result = new NewPatientRecordViewModel(); if (vm != null) { PractitionerBusiness businessLayer = new PractitionerBusiness(); result = businessLayer.CreateNewRecord(vm); } return(result); }
public int ProfileEdit(PractitionerBaseViewModel profile) { int result = 0; if (profile != null) { PractitionerBusiness businessLayer = new PractitionerBusiness(); result = businessLayer.ProfileEdit(profile); } return(result); }
public List <PatientsDirectory> SearchPatients(PatientsDirectorySearch search) { List <PatientsDirectory> result = new List <PatientsDirectory>(); if (search != null) { PractitionerBusiness businessLayer = new PractitionerBusiness(); result = businessLayer.SearchPatients(search); } return(result); }
public List <PractitionerRecordsDirectory> SearchRecords(PractitionerRecordSearch vm) { List <PractitionerRecordsDirectory> result = new List <PractitionerRecordsDirectory>(); if (vm != null) { PractitionerBusiness businessLayer = new PractitionerBusiness(); result = businessLayer.SearchRecords(vm); } return(result); }
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 int StoreRecordToDB(RecordFileSystem fileSystem) { int result = 0; if (fileSystem != null) { PractitionerBusiness businessLayer = new PractitionerBusiness(); result = businessLayer.StoreRecordToDB(fileSystem); } 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 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 RecordFileSystem GetRecord(RecordFileSystem record) { RecordFileSystem result = new RecordFileSystem(); if (record != null) { PractitionerBusiness businessLayer = new PractitionerBusiness(); result = businessLayer.GetRecord(record); result.FileContents = null; } return(result); }
public int CreateNewCompany(CompanyViewModel newCompany) { PractitionerBusiness businessLayer = new PractitionerBusiness(); if (newCompany != null) { CompanyViewModel result = businessLayer.CompanyRegister(newCompany); if (result.ConflictEmailAddress == 1) { return(2); } if (result != null) { try { //Sending verification email to admin to verify string mailFrom = ConstantHelper.AppSettings.MailFrom; string adminMail = ConstantHelper.AppSettings.AdminEmail; string emailSubject = ConstantHelper.Email.CompanyVerification.EmailSubject; string emailBody = ConstantHelper.Email.CompanyVerification.EmailBody; string linkToApprove = ConstantHelper.AppSettings.BackEndUrl + ConstantHelper.API.Company.CompanyApproved + "?accId=" + result.CompanyId; string linkToReject = ConstantHelper.AppSettings.BackEndUrl + ConstantHelper.API.Company.CompanyRejected + "?accId=" + result.CompanyId; string companyDetailsTable = "<table><tr><th>" + "Company Name" + "</th><td>" + result.CompanyName + "</td></tr><tr><th>" + "Company Phone Number" + "</th><td>" + result.CompanyPhoneNumber + "</td></tr><tr><th>" + "Company Email Address" + "</th><td>" + result.CompanyEmailAddress + "</td></tr><tr><th rowspan='3'>" + "Company Address" + "</th><td>" + result.CompanyAddressLine1 + "</td></tr><tr><td>" + result.CompanyAddressLine2 + "</td></tr><tr><td>" + result.CompanyAddressLine3 + "</td></tr></table>"; emailBody = emailBody.Replace(ConstantHelper.Email.Keyword.LinkToApprove, linkToApprove); emailBody = emailBody.Replace(ConstantHelper.Email.Keyword.LinkToReject, linkToReject); emailBody = emailBody.Replace(ConstantHelper.Email.Keyword.companyDetailsTable, companyDetailsTable); string userName = ConstantHelper.AppSettings.UserName; string password = ConstantHelper.AppSettings.Password; EmailHelper.SentMail(mailFrom, adminMail, emailSubject, emailBody, userName, password); //Notify company string emailBodyForCompany = ConstantHelper.Email.CompanyVerification.CompanyEmailBody; EmailHelper.SentMail(mailFrom, result.CompanyEmailAddress, emailSubject, emailBodyForCompany, userName, password); } catch (Exception err) { new LogHelper().LogMessage("RegistrationController.CreateNewCompany : " + err); } return(1); } } return(0); }
public int CloseAppointment(PatientRecordModel patientRecord) { int result = 0; if (patientRecord != null) { PractitionerBusiness businessLayer = new PractitionerBusiness(); businessLayer.StockUpdate(patientRecord); if (patientRecord.AppointmentId != null || !patientRecord.AppointmentId.Equals(Guid.Empty)) { result = businessLayer.CloseAppointment(patientRecord.AppointmentId); } } return(result); }
public int CreateNewPractitioner(NewPractitionerViewModel newUser) { PractitionerBusiness businessLayer = new PractitionerBusiness(); NewPractitionerViewModel result = businessLayer.PractitionerRegister(newUser); if (result.ConflictEmailAddress == 1) { return(2); } if (result != null) { try { //Sent to Practitioner to inform waiting company actions string mailFrom = ConstantHelper.AppSettings.MailFrom; string emailSubject = ConstantHelper.Email.AccountVerification.EmailSubject; string emailBody = ConstantHelper.Email.AccountVerification.PractitionerEmailBody; string userName = ConstantHelper.AppSettings.UserName; string password = ConstantHelper.AppSettings.Password; EmailHelper.SentMail(mailFrom, result.EmailAddress, emailSubject, emailBody, userName, password); //Sent to Company to request actions string practitionerDetailsTable = "<table><tr><th>" + "Practitioner First Name" + "</th><td>" + result.FirstName + "</td></tr><tr><th>" + "Practitioner Last Name" + "</th><td>" + result.LastName + "</td></tr><tr><th>" + "Practitioner Gender" + "</th><td>" + result.Gender + "</td></tr><tr><th>" + "Practiitoner Email Address" + "</th><td>" + result.EmailAddress + "</td></tr><tr><th>" + "Role" + "</th><td>" + result.Role + "</td></tr><tr><th>" + "Specialist" + "</th><td>" + result.Specialist + "</td></tr></table>"; string linkToApprove = ConstantHelper.AppSettings.BackEndUrl + ConstantHelper.API.Practitioner.PractitionerApproved + "?accId=" + result.AccId; string linkToReject = ConstantHelper.AppSettings.BackEndUrl + ConstantHelper.API.Practitioner.PractitionerRejected + "?accId=" + result.AccId; string companyEmailSubject = ConstantHelper.Email.AccountVerification.PractitionerConfirmEmailSubject; string companyEmailBody = ConstantHelper.Email.AccountVerification.PractitionerConfirmEmailBody; companyEmailBody = companyEmailBody.Replace(ConstantHelper.Email.Keyword.PractitionerDetailsTable, practitionerDetailsTable); companyEmailBody = companyEmailBody.Replace(ConstantHelper.Email.Keyword.LinkToApprove, linkToApprove); companyEmailBody = companyEmailBody.Replace(ConstantHelper.Email.Keyword.LinkToReject, linkToReject); EmailHelper.SentMail(mailFrom, result.CompanyEmailAddress, companyEmailSubject, companyEmailBody, userName, password); } catch (Exception err) { new LogHelper().LogMessage("RegistrationController.CreateNewPatient : " + err); } return(1); } else { return(0); } }
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); }