public ReceptionControl(DTO.BenhNhanDTO patient) { InitializeComponent(); this.setupView(); this.patient = patient; this.setupData(patient); }
//MARK: Load data private void fetchData() { Application.AddMessageFilter(this); this.benhNhan = this.bus.getBenhNhan(this.hoSoBenhAn.MaBenhNhan); this.patientMainInformation.binding(benhNhan); this.txtYeuCauKham.Text = this.hoSoBenhAn.YeuCauKham; var phong = this.bus.getPhong(Common.User.SharedInstance.RoomId); this.txtPhong.Text = phong != null ? phong.TenPhong : ""; this.txtChuanDoanBenh.Text = this.hoSoBenhAn.ChuanDoan; this.txtTrieuChung.Text = this.hoSoBenhAn.TrieuChung; this.bus.getListNhanVien((listNhanVien, result) => { if (result.Equals(COM.Constant.RES_SUC)) { listNhanVien.ForEach(nv => { cbBacSi.Items.Add(nv); }); this.cbBacSi.SelectedIndex = listNhanVien.FindIndex(nv => nv.MaNV.Equals(Common.User.SharedInstance.UserId)); } }); this.bus.getListKetQuaXetNghiem(this.hoSoBenhAn.MaHoSo, (listKQXNView, result) => { if (result.Equals(COM.Constant.RES_SUC)) { this.grdKetQuaXetNghiem.DataSource = Common.ClinicBus.ConvertToDatatable(listKQXNView); } }); this.panelResult.Height = 0; }
private void PatientTableWithSearch_SearchCompleted(object sender, DTO.BenhNhanDTO e) { DevExpress.Utils.WaitDialogForm f = new DevExpress.Utils.WaitDialogForm(); this.timer1.Tick += new EventHandler((s, er) => { var interval = (DateTime.Now - this.time).TotalSeconds; if (!f.IsDisposed && interval > 5) { this.timer1.Stop(); f.Close(); MessageBox.Show("Không thể load dữ liệu", "Lỗi", MessageBoxButtons.OK, MessageBoxIcon.Error); } }); this.timer1.Interval = 1000; this.time = DateTime.Now; this.timer1.Start(); this.searchBenhNhan(e, (listPatients, result) => { f.Close(); this.timer1.Stop(); if (result.Equals(COM.Constant.RES_SUC)) { this.table.fetchData(listPatients); } else { MessageBox.Show("Không tìm thấy kết quả phù hợp!", "Lỗi", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } }); }
public void searchBenhNhan(DTO.BenhNhanDTO benhNhanEntity, Action <List <DTO.BenhNhanDTO>, string> completion) { var listResult = new List <DTO.BenhNhanDTO>(); var result = this.clientBus.SearchBenhNhan(benhNhanEntity, out listResult, 0); completion(listResult, result); }
public void BenhNhanInputCheck(DTO.BenhNhanDTO benhNhan, Action <string, List <string> > completion) { var listMessageError = new List <string>(); var result = this.clientBus.BenhNhanInputCheck(benhNhan, ref listMessageError); completion(result, listMessageError); }
public DTO.BenhNhanDTO getData() { DateTime birthDay; try { var dateListString = this.cbBirthDay.DateTimePicker.Text.Split('/'); int day = int.Parse(dateListString.First()); int month = int.Parse(dateListString[1]); int year = int.Parse(dateListString.Last()); birthDay = new DateTime(year, month, day); } catch (Exception ex) { Console.WriteLine(ex.Message); return(new DTO.BenhNhanDTO()); } var patient = new DTO.BenhNhanDTO() { HoTen = this.txtName.Text, GioiTinh = this.cbSex.ComboBox.Text.Equals("Nam") ? true : false, NgaySinh = this.cbBirthDay.DateTimePicker.Text, SoDienThoai = this.txtPhoneNumber.Text, GhiChu = this.txtNote.Text, DiaChi = this.txtAddress.Text, CMND = this.txtCMND.Text }; return(patient); }
private void setupView() { Application.AddMessageFilter(this); this.txtChiPhi.Text = totalCharge.ToString(); this.benhNhan = this.bus.getBenhNhan(this.hoSoBenhAn.MaBenhNhan); this.patientMainInformation.binding(benhNhan); this.txtYeuCauKham.Text = this.hoSoBenhAn.YeuCauKham; var phong = this.bus.getPhong(Common.User.SharedInstance.RoomId); this.txtPhong.Text = phong != null ? phong.TenPhong : ""; this.bus.getListNhanVien((listNhanVien, result) => { if (result.Equals(COM.Constant.RES_SUC)) { listNhanVien.ForEach(nv => { cbBacSi.Items.Add(nv); }); this.cbBacSi.SelectedIndex = listNhanVien.FindIndex(nv => nv.MaNV.Equals(Common.User.SharedInstance.UserId)); } }); this.panelResult.Height = 0; }
public void searchBenhNhan(DTO.BenhNhanDTO benhNhanEntity, Action <List <DTO.BenhNhanDTO>, string> completion) { var listResult = new List <DTO.BenhNhanDTO>(); var bus = new BUS.Mdl.TiepNhanModule(); var result = bus.SearchBenhNhan(benhNhanEntity, out listResult, 0); completion(listResult, result); }
private void btnSearch_Click(object sender, EventArgs e) { var entity = new DTO.BenhNhanDTO { MaBenhNhan = this.txtMaBenhNhan.Text, HoTen = this.txtHoTen.Text, CMND = this.txtCMND.Text }; this.SearchCompleted?.Invoke(this, entity); }
public void fillData(DTO.BenhNhanDTO patient) { this.name.Text = patient.HoTen; this.birthDay.DateTime = DateTime.ParseExact(patient.NgaySinh, "yyyyMMdd", CultureInfo.InvariantCulture); this.phoneNumber.Text = patient.SoDienThoai; this.identify.Text = patient.CMND; this.gender.Text = patient.GioiTinh == true ? "Nam" : "Nữ"; this.address.Text = patient.DiaChi; this.note.Text = patient.GhiChu; this.maBenhNhan = patient.MaBenhNhan; }
private void DetailControl_CreateClick(object sender, DTO.BenhNhanDTO patient) { var formContainer = (sender as UserControl).Parent; var receptionControl = new SubForms.ReceptionControl(patient); receptionControl.Left = receptionControl.Top = 0; receptionControl.Anchor = AnchorStyles.Left | AnchorStyles.Top; formContainer.Controls.Add(receptionControl); receptionControl.BringToFront(); }
public BenhNhanView(DTO.BenhNhanDTO entity) { this.MaBenhNhan = entity.MaBenhNhan; this.HoTen = entity.HoTen; this.CMND = entity.CMND; this.NgaySinh = convertDate(entity.NgaySinh); this.GioiTinh = entity.GioiTinh ? "Nam" : "Nữ"; this.SoDienThoai = entity.SoDienThoai; this.DiaChi = entity.DiaChi; this.GhiChu = entity.GhiChu; }
private void AddPatientControl1_CreateCompleted(object sender, DTO.BenhNhanDTO e) { this.bus.insertBenhNhan(e, result => { if (result.Equals(COM.Constant.RES_SUC)) { MessageBox.Show("Thêm thành công!", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information); this.addPatientControl1.refreshControl(); } }); }
public void saveBenhNhan(DTO.BenhNhanDTO patient, Action <string, List <string> > completion) { var listMessageError = new List <string>(); var checkInputResult = this.clientBus.BenhNhanInputCheck(patient, ref listMessageError); if (checkInputResult.Equals(COM.Constant.RES_SUC)) { completion(this.clientBus.UpdateBenhNhan(patient), null); } completion(checkInputResult, listMessageError); }
private void fillCoreInformation(DTO.BenhNhanDTO patient) { this.txtMaBenhNhan.Text = patient.MaBenhNhan; this.txtCMND.Text = patient.CMND; var date = patient.NgaySinh; this.txtNgaySinh.Text = ClinicManagement.Common.ClinicBus.convertDateToView(date); this.txtGioiTinh.Text = patient.GioiTinh ? "Nam" : "Nữ"; this.txtHoTen.Text = patient.HoTen; this.txtSoDienThoai.Text = patient.SoDienThoai; this.txtDiaChi.Text = patient.DiaChi; this.txtGhiChu.Text = patient.GhiChu.Split('\n').First(); }
private void AddPatientControl_CreateCompleted(object sender, DTO.BenhNhanDTO e) { this.bus.insertBenhNhan(e, result => { if (result.Equals(COM.Constant.RES_SUC)) { MessageBox.Show("Thêm thành công!", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information); var parentForm = (Form)((Control)sender).Parent; parentForm.Close(); this.fetchData((msg, rslt) => { }); } }); }
public DTO.BenhNhanDTO getBenhNhan(string MaBenhNhan) { var patient = new DTO.BenhNhanDTO(); var result = this.clientBus.GetInformationBenhNhan(MaBenhNhan, out patient); if (result.Equals(COM.Constant.RES_SUC)) { return(patient); } else { return(null); } }
public DTO.BenhNhanDTO getData() { var patient = new DTO.BenhNhanDTO(); DateTime birthDay = this.birthDay.DateTime; patient.HoTen = this.name.Text; patient.GioiTinh = this.gender.Text.Equals("Nam") ? true : false; patient.MaBenhNhan = this.maBenhNhan; patient.NgaySinh = birthDay.ToString("yyyyMMdd"); patient.SoDienThoai = this.phoneNumber.Text; patient.GhiChu = this.note.Text; patient.DiaChi = this.address.Text; patient.CMND = this.identify.Text; return(patient); }
public void fillData(DTO.BenhNhanDTO patient) { this.txtName.Text = patient.HoTen; int year = int.Parse(patient.NgaySinh.Substring(0, 4)); int month = int.Parse(patient.NgaySinh.Substring(4, 2)); int day = int.Parse(patient.NgaySinh.Substring(6, 2)); this.txtBirthDay.Text = string.Format("{0}/{1}/{2}", day, month, year); this.txtPhoneNumber.Text = patient.SoDienThoai; this.txtCMND.Text = patient.CMND; this.txtGender.Text = patient.GioiTinh == true ? "Nam" : "Nữ"; this.txtAddress.Text = patient.DiaChi; this.txtNote.Text = patient.GhiChu; this.idNumber = patient.MaBenhNhan; }
private void FilterControl_SearchCompleted(object sender, DTO.BenhNhanDTO e) { var filterControl = (ClinicManagement.Common.ClinicComponents.FilterUserControl)sender; var formContainer = (Form)(filterControl.Parent); this.bus.searchBenhNhan(e, (listResult, result) => { if (result.Equals(COM.Constant.RES_SUC)) { this.tableDataView1.fetchData(listResult); formContainer.Close(); } else { MessageBox.Show("Không tìm thấy kết quả phù hợp", "Lỗi", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } }); }
public void searchHoSo(DTO.BenhNhanDTO patient, Action <List <Model.HoSoBenhAnView>, string> completion) { var listResult = new List <Model.HoSoBenhAnView>(); var MaBenhNhan = patient.MaBenhNhan; var HoTen = patient.HoTen; var CMND = patient.CMND; this.getListHoSo((listHoSo, result) => { listHoSo.ForEach(hoso => { if (hoso.MaBenhNhan.Contains(MaBenhNhan) && hoso.HoTen.Contains(HoTen) && hoso.CMND.Contains(CMND)) { listResult.Add(hoso); } }); completion(listHoSo, result); }); }
private void setupView() { var enterEvent = new KeyEventHandler((sender, e) => { if (e.KeyCode != Keys.Enter) { return; } var entity = new DTO.BenhNhanDTO() { MaBenhNhan = this.txtMaBenh.Text, HoTen = this.txtHoTen.Text, CMND = this.txtCMND.Text }; this.SearchCompleted?.Invoke(this, entity); }); this.txtMaBenh.TextBox.KeyDown += enterEvent; this.txtHoTen.TextBox.KeyDown += enterEvent; this.txtCMND.TextBox.KeyDown += enterEvent; }
public DTO.BenhNhanDTO getData() { var list = this.txtBirthDay.Text.Split('/'); var year = int.Parse(list.Last()); var month = int.Parse(list[1]); var day = int.Parse(list.First()); var patient = new DTO.BenhNhanDTO() { HoTen = this.txtName.Text, GioiTinh = this.txtGender.Text.Equals("Nam") ? true : false, MaBenhNhan = this.idNumber, NgaySinh = string.Format("{0}{1}{2}", year, month >= 10 ? month.ToString(): "0" + month, day >= 10 ? day.ToString() : "0" + day), SoDienThoai = this.txtPhoneNumber.Text, GhiChu = this.txtNote.Text, DiaChi = this.txtAddress.Text, CMND = this.txtCMND.Text }; return(patient); }
public ExaminationConfirm(DTO.HoSoBenhAnDTO hoso, string tenPhong, DTO.BenhNhanDTO benhNhan, string chiphi = null, List <DTO.ChiTietDonThuocDTO> danhSachThuoc = null, List <DTO.XetNghiemDTO> danhSachXetNghiem = null, bool isConfirm = true) { InitializeComponent(); this.hoso = hoso; this.tenPhong = tenPhong; this.benhNhan = benhNhan; this.danhSachThuoc = danhSachThuoc; this.danhSachXetNghiem = danhSachXetNghiem; this.btnXacNhan.Text = isConfirm ? "Xác nhận" : "OK"; this.btnBack.Visible = isConfirm; if (chiphi != null) { this.txtChiPhi.Text = chiphi; } else { this.txtChiPhi.Visible = false; } this.ControlRemoved += ControlRemovedEvent; Application.AddMessageFilter(this); }
public void binding(DTO.BenhNhanDTO patient) { this.patient = patient; this.fillCoreInformation(patient); }
public void fillData(DTO.BenhNhanDTO patient) { this.patientInformation.fillData(patient); }
public PatientDetail(DTO.BenhNhanDTO patient) { InitializeComponent(); this.patientInformation.BringToFront(); this.fillData(patient); }
private void tableDataView1_DoubleClick(object sender, DTO.BenhNhanDTO e) { btnDetail_Click(null, null); }
public PatientMainInformation(DTO.BenhNhanDTO patient) { InitializeComponent(); this.patient = patient; this.fillCoreInformation(patient); }
private void Table_DoubleClick(object sender, DTO.BenhNhanDTO e) { this.DoubleClick?.Invoke(this, e); }