Example #1
0
        private void btnChonBenhNhanNhan_Click(object sender, EventArgs e)
        {
            dlgSelectPatient dlg = new dlgSelectPatient(PatientSearchType.BenhNhan);

            if (dlg.ShowDialog(this) == System.Windows.Forms.DialogResult.OK)
            {
                if (_patientRow != null)
                {
                    string fileNum  = _patientRow["FileNum"].ToString().ToLower();
                    string fileNum2 = dlg.PatientRow["FileNum"].ToString().ToLower();

                    if (fileNum == fileNum2)
                    {
                        MsgBox.Show(Application.ProductName, "Bệnh nhân chuyển và bệnh nhân nhận phải khác nhau.", IconType.Information);
                        btnChonBenhNhanNhan.Focus();
                        return;
                    }
                }

                _patientRow2 = dlg.PatientRow;
                if (_patientRow2 != null)
                {
                    txtFileNumNhan.Text     = _patientRow2["FileNum"].ToString();
                    txtTenBenhNhanNhan.Text = _patientRow2["FullName"].ToString();
                    txtNgaySinhNhan.Text    = _patientRow2["DobStr"].ToString();
                    txtGioiTinhNhan.Text    = _patientRow2["GenderAsStr"].ToString();

                    OnSetPatientNhan();
                }
            }
        }
Example #2
0
        private void btnChonBenhNhan_Click(object sender, EventArgs e)
        {
            dlgSelectPatient dlg = new dlgSelectPatient(PatientSearchType.BenhNhan);

            if (dlg.ShowDialog(this) == System.Windows.Forms.DialogResult.OK)
            {
                _patientRow = dlg.PatientRow;
                if (_patientRow != null)
                {
                    txtTenBenhNhan.Tag  = _patientRow["PatientGUID"].ToString();
                    txtTenBenhNhan.Text = _patientRow["FullName"].ToString();
                    txtNgaySinh.Text    = _patientRow["DobStr"].ToString();
                    txtGioiTinh.Text    = _patientRow["GenderAsStr"].ToString();
                    txtDienThoai.Text   = _patientRow["Mobile"].ToString();
                    txtDiaChi.Text      = _patientRow["Address"].ToString();
                }
            }
        }
        private void OnCapNhatBenhNhan()
        {
            if (dgXetNghiem.SelectedRows == null || dgXetNghiem.SelectedRows.Count <= 0)
            {
                MsgBox.Show(Application.ProductName, "Vui lòng chọn 1 xét nghiệm để cập nhật bệnh nhân.", IconType.Information);
                return;
            }

            DataRow row = (dgXetNghiem.SelectedRows[0].DataBoundItem as DataRowView).Row;

            if (row == null)
            {
                return;
            }

            dlgSelectPatient dlg = new dlgSelectPatient(PatientSearchType.BenhNhan);

            if (dlg.ShowDialog(this) == System.Windows.Forms.DialogResult.OK)
            {
                DataRow patientRow = dlg.PatientRow;
                if (patientRow != null)
                {
                    KetQuaXetNghiem_Hitachi917 kqxn = new KetQuaXetNghiem_Hitachi917();
                    kqxn.KQXN_Hitachi917GUID = Guid.Parse(row["KQXN_Hitachi917GUID"].ToString());
                    kqxn.PatientGUID         = Guid.Parse(patientRow["PatientGUID"].ToString());
                    Result result = XetNghiem_Hitachi917Bus.UpdatePatient(kqxn);
                    if (result.IsOK)
                    {
                        row["PatientGUID"] = patientRow["PatientGUID"];
                        row["FileNum"]     = patientRow["FileNum"];
                        row["FullName"]    = patientRow["FullName"];
                        row["DobStr"]      = patientRow["DobStr"];
                        row["GenderAsStr"] = patientRow["GenderAsStr"];

                        OnDisplayChiTietKetQuaXetNghiem(row["KQXN_Hitachi917GUID"].ToString());
                    }
                    else
                    {
                        MsgBox.Show(Application.ProductName, result.GetErrorAsString("XetNghiem_Hitachi917Bus.UpdatePatient"), IconType.Error);
                        Utility.WriteToTraceLog(result.GetErrorAsString("XetNghiem_Hitachi917Bus.UpdatePatient"));
                    }
                }
            }
        }
Example #4
0
        private void OnAddBenhNhanThanThuoc()
        {
            dlgSelectPatient dlg = new dlgSelectPatient(PatientSearchType.BenhNhanKhongThanThuoc);

            if (dlg.ShowDialog(this) == DialogResult.OK)
            {
                List <DataRow> patientRows = dlg.CheckedPatientRows;
                if (patientRows == null || patientRows.Count <= 0)
                {
                    return;
                }

                Result result = PatientBus.InsertBenhNhanThanThuoc(patientRows);
                if (result.IsOK)
                {
                    SearchAsThread();
                }
                else
                {
                    MsgBox.Show(Application.ProductName, result.GetErrorAsString("PatientBus.DeletePatient"), IconType.Error);
                    Utility.WriteToTraceLog(result.GetErrorAsString("PatientBus.DeletePatient"));
                }
            }
        }