public ActionResult Index(int?page, int PatientId, int pageSize = 5, string test = "") { Session["newpatientid"] = PatientId; List <MedicalCertificateModel> myList = ee.GetallMedCert().FindAll(x => x.PatientId == PatientId).ToList(); var search = myList.OrderBy(x => x.Date).Where(x => x.PatintName.ToLower().Contains(test.ToLower()) || test == null).ToList(); var Pb = new PatientBusiness(); var Pname = Pb.GetPatients().Find(x => x.PatientId == PatientId); string name = Pname.FullName + " " + Pname.Surname; ViewBag.Name = name; if (Request.HttpMethod != "GET") { page = 1; } int pageNumber = (page ?? 1); List <MedicalCertificateModel> mdcert = search; PagedList <MedicalCertificateModel> model = new PagedList <MedicalCertificateModel>(mdcert, pageNumber, pageSize); return(View("Index", mdcert.ToPagedList(pageNumber, pageSize))); //(ee.GetallMedCert()); }
private void DeletePatient() { DataGridViewRow currentRow = grdPatientList.CurrentRow; DataGridViewRow currentTestInfor = grdTestType.CurrentRow; if (currentRow != null) { int rowIndex = grdPatientList.CurrentRow.Index; string patientId = Lablink.Utilities.UI.GetCellValue(currentRow.Cells["colPatient_ID"]); DataTable dtTestInfor = TestInfoBusiness.GetTestInfoToPatient(patientId); if (dtTestInfor.Rows.Count > 0) { MessageBox.Show("Bệnh nhận đã đăng ký xét nghiệm. Không thể xóa được !", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information); } else { PatientBusiness.DeletePatient(patientId); //PatientBusiness.DeletePatient( // dtPatientList.Rows[rowIndex][LPatientInfo.Columns.PatientId].ToString()); dtPatientList.Rows.RemoveAt(rowIndex); dtPatientList.AcceptChanges(); } if (grdPatientList.Rows.Count <= 0) { barcode1.Data = "0000000000"; } } }
public void Insert(string username) { using (var rep = new OrderRepository()) { ApplicationDbContext dbcon = new ApplicationDbContext(); OrderView model = new OrderView(); var obj = new PatientBusiness(); var shop = new ShoppingCartBusiness(); var person = dbcon.Patients.SingleOrDefault(x => x.UserName.Equals(username)); var tot = shop.ComputeTotal(username); if (tot != 0) { if (person != null) { model.FirstName = person.FirstName; model.LastName = person.LastName; } model.TotalCost = shop.ComputeTotal(username); model.Username = username; rep.Insert(ConvertToProduct(model)); } ShoppingCartBusiness biz = new ShoppingCartBusiness(); biz.UpdateCheck(username); } }
public int CreateNewPatient(PatientViewModel newUser) { PatientBusiness businessLayer = new PatientBusiness(); PatientViewModel result = businessLayer.PatientRegister(newUser); if (result.ConflictEmailAddress == 1) { return(2); } if (result != null) { try { string mailFrom = ConstantHelper.AppSettings.MailFrom; string emailSubject = ConstantHelper.Email.AccountVerification.EmailSubject; string emailBody = ConstantHelper.Email.AccountVerification.EmailBody; string linkToVerify = ConstantHelper.AppSettings.RootSiteUrl + ConstantHelper.API.Patient.PatientVerification + "?accId=" + result.AccId; emailBody = emailBody.Replace(ConstantHelper.Email.Keyword.LinkToVerify, linkToVerify); string userName = ConstantHelper.AppSettings.UserName; string password = ConstantHelper.AppSettings.Password; EmailHelper.SentMail(mailFrom, result.EmailAddress, emailSubject, emailBody, userName, password); } catch (Exception err) { new LogHelper().LogMessage("RegistrationController.CreateNewPatient : " + err); } return(1); } else { return(0); } }
private void grdPatientList_SelectionChanged(object sender, EventArgs e) { _rowFilter = "1=2"; txtBarcode.Clear(); if (grdPatientList.CurrentRow != null) { stsTestTypeList.Enabled = true; _rowFilter = "Patient_ID=" + Utility.Int32Dbnull( Utility.GetValueFromGridColumn(grdPatientList, "colPatient_ID", grdPatientList.CurrentRow.Index), -1); if (grdTestType.CurrentRow != null) { if (!string.IsNullOrEmpty(Utility.sDbnull(grdTestType.CurrentRow.Cells["colBarcode"].Value, ""))) { barcode = PatientBusiness.GetBarCodeTestInfo( Convert.ToInt32(Utility.GetValueFromGridColumn(grdPatientList, "colPatient_ID", grdPatientList.CurrentRow.Index)), SystemParaBarcode.ParaBacode, 0); barcode1.Data = barcode; } else { barcode1.Data = "0000000000"; } } } dtRegisteredTestType.DefaultView.RowFilter = _rowFilter; dtRegisteredTestType.AcceptChanges(); }
private void grdPatientList_MouseUp(object sender, MouseEventArgs e) { if (e.Button == MouseButtons.Right) { try { if (grdPatientList.CurrentRow != null) { string in_barcode = PatientBusiness.GetBarCodeTestInfo( Convert.ToInt32(Utility.GetValueFromGridColumn(grdPatientList, "colPatient_ID", grdPatientList.CurrentRow.Index)), SystemParaBarcode.ParaBacode, 0); if (in_barcode != null) { barcode1.Data = in_barcode; barcode1.Image().Save(Application.StartupPath + "\\Temp.jpg", ImageFormat.Jpeg); } else { barcode1.Data = "0000000000"; } if (printDialog1.ShowDialog() == DialogResult.OK) { printDocument1.PrinterSettings = printDialog1.PrinterSettings; printDocument1.DefaultPageSettings.Margins = margins; printDocument1.Print(); } } } catch (Exception) { throw; } } }
public UserAccountTests() { adminBiz = new AdminBusiness(dbContext); physBiz = new PhysicianBusiness(dbContext); agentBiz = new AgentBusiness(dbContext); vendorBiz = new VendorBusiness(dbContext); patientBiz = new PatientBusiness(dbContext); }
public AppointmentHistory(Patient patient) { InitializeComponent(); _patientBusiness = new PatientBusiness(); _patient = patient; List <Apointment> listAppointment = _patientBusiness.AppointmentHistory(_patient); gridAppointment.DataSource = listAppointment; }
public MedicalRecordForm(MedicalRecord medicalRecord) { InitializeComponent(); mediclRecordBusiness = new MedicalRecordBusiness(); patientBusiness = new PatientBusiness(); pretBusiness = new PrescriptionDetailBusiness(); _medicalRecord = medicalRecord; }
private void UpdatePatient() { actionResult = PatientBusiness.UpdatePatientInfo(CreatePatientInfo()); MessageStatus(); if (checkBox1.Checked) { Close(); } }
public LoginInfo GetLogin(LoginInfo loginInfo) { LoginInfo result = loginInfo; PatientBusiness businessLayer = new PatientBusiness(); result = businessLayer.PatientLogin(loginInfo); return(result); }
public int AddAuthorizePractitioner(AuthorizePractitionerModel authorizePractitioner) { int result = 0; PatientBusiness businessLayer = new PatientBusiness(); result = businessLayer.AddAuthorizePractitioner(authorizePractitioner); //if 1 then added, if 0 means fail return(result); }
public List <SpecialistNearby> SpecialistSearch(SpecialistNearbyViewModel speacialistvm) { SpecialistNearbyViewModel result = new SpecialistNearbyViewModel(); PatientBusiness businessLayer = new PatientBusiness(); result = businessLayer.SpecialistSearch(speacialistvm); return(result.ResultTable); }
public List <AuthorizedPractitionersTable> AuthorizedPractitionersTable(PatientBaseViewModel vm) { List <AuthorizedPractitionersTable> result = new List <AuthorizedPractitionersTable>(); PatientBusiness businessLayer = new PatientBusiness(); result = businessLayer.GetAuthorizedPractitionersTable(vm.AccId); return(result); }
public JsonResult GetPatients(string term) { var pb = new PatientBusiness(); DataContext da = new DataContext(); List <string> myp; myp = da.Patients.Where(x => x.Surname.StartsWith(term)).Select(x => x.Surname).ToList(); return(Json(myp, JsonRequestBehavior.AllowGet)); }
public void PatientList() { //Arrange ( Create objects and prepare everything needed to test functionality ) PatientBusiness pb = new PatientBusiness(); //DataContext da = new DataContext(); //Act ( Execute and get the output ) List <PatientModel> model = pb.GetAllPatients(); //Assert ( Compare final output with expected Output ) Assert.AreEqual(pb.GetAllPatients(), model); }
public PatientBaseViewModel PatientProfile(PatientBaseViewModel vm) { PatientBaseViewModel result = new PatientBaseViewModel(); Guid accId = vm.AccId; PatientBusiness businessLayer = new PatientBusiness(); result = businessLayer.PatientProfile(accId); return(result); }
public List <MedicineModel> ProductSearch(MedicineViewModel search) { List <MedicineModel> result = new List <MedicineModel>(); if (search != null) { PatientBusiness businessLayer = new PatientBusiness(); result = businessLayer.ProductSearch(search); } return(result); }
public int ProfileEdit(PatientBaseViewModel profile) { int result = 0; if (profile != null) { PatientBusiness businessLayer = new PatientBusiness(); result = businessLayer.ProfileEdit(profile); } return(result); }
public List <PractitionerRecordsDirectory> GetRecordsDirectory(PatientBaseViewModel vm) { List <PractitionerRecordsDirectory> result = new List <PractitionerRecordsDirectory>(); if (vm != null) { PatientBusiness businessLayer = new PatientBusiness(); result = businessLayer.GetRecordsDirectory(vm.AccId); } return(result); }
public List <PractitionerRecordsDirectory> SearchRecords(PractitionerRecordSearch vm) { List <PractitionerRecordsDirectory> result = new List <PractitionerRecordsDirectory>(); if (vm != null) { PatientBusiness businessLayer = new PatientBusiness(); result = businessLayer.SearchRecords(vm); } return(result); }
public ActionResult PrintAllPatients(string id) { int count = 0; PatientBusiness pb = new PatientBusiness(); // With no Model and default view name. Pdf is always the default view name //return new PdfResult(); if (id == "7days") { List <PatientModel> pm = pb.GetAllPatients().FindAll(x => x.registeredDate > DateTime.Today.AddDays(-7)).ToList(); foreach (var p in pm) { count++; } ViewBag.Count = count; return(new PdfResult(pm, "PrintAllPatients")); } else if (id == "1month") { List <PatientModel> pm = pb.GetAllPatients().FindAll(x => x.registeredDate > DateTime.Today.AddMonths(-1)).ToList(); foreach (var p in pm) { count++; } ViewBag.Count = count; return(new PdfResult(pm, "PrintAllPatients")); } else if (id == "1year") { List <PatientModel> pm = pb.GetAllPatients().FindAll(x => x.registeredDate > DateTime.Today.AddYears(-1)).ToList(); foreach (var p in pm) { count++; } ViewBag.Count = count; return(new PdfResult(pm, "PrintAllPatients")); } else { ViewBag.Count = 0; return(new PdfResult(pb.GetAllPatients(), "PrintAllPatients")); } }
public RecordFileSystem GetRecord(RecordFileSystem record) { RecordFileSystem result = new RecordFileSystem(); if (record != null) { PatientBusiness businessLayer = new PatientBusiness(); result = businessLayer.GetRecord(record); result.FileContents = null; } return(result); }
public PatientDetailForm(int id) { InitializeComponent(); medicalRecordBusines = new MedicalRecordBusiness(); patientBusiness = new PatientBusiness(); _patient = patientBusiness.GetbyId(id); textFullName.Text = _patient.FullName; textGender.Text = _patient.Gender; memoAddress.Text = _patient.Address; textDateOfBirth.Text = _patient.DateOfBirth.ToShortDateString(); textJob.Text = _patient.Job; textPhone.Text = _patient.Phone; memoNote.Text = _patient.Note; textCreateDay.Text = _patient.CreateDate.ToShortDateString(); this.Text = "BN: " + _patient.FullName; }
public CompanyViewModel ViewCompanyProfile(CompanyViewModel company) { CompanyViewModel result = new CompanyViewModel(); if (company != null) { PatientBusiness businessLayer = new PatientBusiness(); result = businessLayer.ViewCompanyProfile(company.CompanyId); } else { return(null); } return(result); }
public ActionResult AddTestResult(int?page, string testpar = "") { var dbo = new PatientBusiness(); if (Request.HttpMethod != "GET") { page = 1; } int pageSize = 5; int pageNumber = (page ?? 1); return(View("AddTestResult", dbo.GetAllPatients().Where(x => x.FullName.ToLower().Contains(testpar.ToLower()) || x.Surname.ToLower().Contains(testpar.ToLower()) || x.NationalId.ToLower().Contains(testpar.ToLower()) || testpar == null).ToPagedList(pageNumber, pageSize))); }
public int PatientVerification(PatientViewModel vm) { int result = 0; try { var accId = vm.AccId; PatientBusiness businessLayer = new PatientBusiness(); result = businessLayer.PatientVerification(accId); } catch (Exception err) { new LogHelper().LogMessage("RegistrationController.PatientVerification : " + err); } return(result); }
// // GET: /TestResult/Create public ActionResult Create(int?PatientId) { var ee = new HIVTestResultBusiness(); var Pb = new PatientBusiness(); if (PatientId.HasValue) { var Pname = Pb.GetPatients().Find(x => x.PatientId == PatientId.Value); var model = new HIVTestResultModel { PatientName = Pname.FullName.ToUpper() + " " + Pname.Surname.ToUpper(), PatientId = PatientId.Value }; System.Web.HttpContext.Current.Session["himPatientId"] = PatientId; return(View(model)); } return(View()); }
private void buttonFinishExamine_Click(object sender, EventArgs e) { if (selecteRow == null) { return; } bool result = true; if (textMedicalRecordID.Text != "") { result = UpdateMedicalRecord("NotPayment"); } queueBusiness.UpdateStatus((int)selecteRow["QueueID"], "I"); if (dateReExamineDay.EditValue != null) { var scheduleBusiness = new ScheduleBusiness(); var patientBusiness = new PatientBusiness(); var patient = patientBusiness.GetbyId((int)selecteRow["PatientID"]); var schedule = new Schedule { DoctorID = UserBusiness.User.UserID, FullName = patient.FullName, ScheduleDate = (DateTime)dateReExamineDay.EditValue, ScheduleType = "Tái khám", Phone = patient.Phone, Address = patient.Address }; result = result && scheduleBusiness.Insert(schedule) > 0; } if (!result) { XtraMessageBox.Show(this, "Có lỗi trong quá trình lưu", "Lỗi", MessageBoxButtons.OK, MessageBoxIcon.Error); } else { //Refresh queue LoadQueueByDoctor(); LoadExaminedList(); ResetAll(); } }
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 ActionResult CreateMedCertificate(int?PatientId) { var ee = new MedCertificateBusiness(); var Pb = new PatientBusiness(); if (PatientId.HasValue) { var Pname = Pb.GetPatients().Find(x => x.PatientId == PatientId.Value); var model = new MedicalCertificateModel { PatintName = Pname.FullName + " " + Pname.Surname, PatientId = PatientId.Value, FileName = Pname.FileName, FileType = Pname.FileType, resultFile = Pname.File }; System.Web.HttpContext.Current.Session["PId"] = PatientId; return(View(model)); } return(View()); }