コード例 #1
0
 private void txtPatientCode_KeyDown(object sender, KeyEventArgs e)
 {
     if (e.KeyCode != Keys.Enter)
     {
         return;
     }
     dtPatient = SPs.NoitietTimkiemBenhnhan(txtPatientCode.Text, -1, -1).GetDataSet().Tables[0];
     if (txtPatientCode.TextLength < 8 && dtPatient.Rows.Count > 0)
     {
         frm_DSACH_BN_TKIEM frm = new frm_DSACH_BN_TKIEM();
         frm.PatientCode = txtPatientCode.Text;
         frm.dtPatient   = dtPatient;
         frm.ShowDialog();
         if (!frm.has_Cancel)
         {
             txtPatientCode.Text = frm.PatientCode;
         }
         GetData();
     }
     else if (txtPatientCode.TextLength == 8)
     {
         GetData();
     }
 }
コード例 #2
0
        private void txtPatient_Code_KeyDown(object sender, KeyEventArgs e)
        {
            try
            {
                var dtPatient = new DataTable();
                if (e.KeyCode == Keys.Enter)
                {
                    string _patient_Code = Utility.AutoFullPatientCode(txtPatient_Code.Text);
                    ClearControl();
                    dtPatient = _KCB_THAMKHAM.TimkiemBenhnhan(txtPatient_Code.Text,
                                                   -1,(byte)1, 0);

                    DataRow[] arrPatients = dtPatient.Select(KcbLuotkham.Columns.MaLuotkham + "='" + _patient_Code + "'");
                    if (arrPatients.GetLength(0) <= 0)
                    {
                        if (dtPatient.Rows.Count > 1)
                        {
                            var frm = new frm_DSACH_BN_TKIEM();
                            frm.MaLuotkham = txtPatient_Code.Text;
                            frm.dtPatient = dtPatient;
                            frm.ShowDialog();
                            if (!frm.has_Cancel)
                            {
                                txtPatient_Code.Text = frm.MaLuotkham;
                            }
                        }
                        else
                            txtPatient_Code.Text = _patient_Code;
                    }
                    else
                    {
                        txtPatient_Code.Text = _patient_Code;
                    }
                    objLuotkham = Utility.getKcbLuotkham(txtPatient_Code.Text);

                    if (objLuotkham!=null)
                    {
                        AllowTextChanged = false;
                        GetData();
                        txtPatient_Code.SelectAll();
                        if (objLuotkham.TrangthaiNoitru == 0)
                        {
                            Utility.ShowMsg("Bệnh nhân chưa nhập viện nội trú nên bạn không thể lập phiếu ra viện được. Đề nghị bạn kiểm tra lại");

                        }
                        //Kiểm tra lần nhập viện hoặc chuyển khoa gần nhất phải được phân buồng giường trước khi ra viện
                        NoitruPhanbuonggiuong objNoitruPhanbuonggiuong = NoitruPhanbuonggiuong.FetchByID(objLuotkham.IdRavien);
                        bool isValid = Utility.Int16Dbnull(objNoitruPhanbuonggiuong.IdBuong, 0) > 0 && Utility.Int16Dbnull(objNoitruPhanbuonggiuong.IdBuong, 0) > 0;
                        if (!isValid)
                        {
                            Utility.ShowMsg("Hệ thống phát hiện Bệnh nhân chưa được phân buồng giường cho lần chuyển khoa gần nhất nên bạn không thể tổng hợp ra viện được.");
                        }
                        cmdRavien.Enabled = cmdTonghop.Enabled = isValid && objLuotkham.TrangthaiNoitru > 0;
                    }
                    else
                    {
                        string sPatientTemp = txtPatient_Code.Text;
                        ClearControl();
                        ModifyCommmands();
                        txtPatient_Code.Text = sPatientTemp;
                        Utility.ShowMsg("Không tìm được Bệnh nhân nào có mã lượt khám " + txtPatient_Code.Text);
                        txtPatient_Code.SelectAll();
                        cmdRavien.Enabled = cmdTonghop.Enabled = false;

                    }

                }
            }
            catch (Exception)
            {
                Utility.ShowMsg("Có lỗi trong quá trình lấy thông tin bệnh nhân");
            }
            finally
            {
                AllowTextChanged = true;
            }
        }
コード例 #3
0
        /// <summary>
        /// hàm thực hienej phím tắt của form hiện tại
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void frm_KCB_DANGKY_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.F3)
            {
                if (this.ActiveControl != null && this.ActiveControl.Name == txtTEN_BN.Name && Utility.DoTrim(txtTEN_BN.Text)!="")
                {
                    frm_DSACH_BN_TKIEM Timkiem_Benhnhan = new frm_DSACH_BN_TKIEM();
                    Timkiem_Benhnhan.AutoSearch = true;
                    Timkiem_Benhnhan.FillAndSearchData(false, "", "", Utility.DoTrim(txtTEN_BN.Text), "", "", "-1");
                    if (Timkiem_Benhnhan.ShowDialog() == System.Windows.Forms.DialogResult.OK)
                    {
                        txtNoiDKKCBBD.Clear();
                        txtNoiphattheBHYT.Clear();
                        isAutoFinding = true;
                        FindPatient(Timkiem_Benhnhan.IdBenhnhan.ToString());
                        isAutoFinding = false;
                    }
                }
                else if (this.ActiveControl != null && this.ActiveControl.Name == txtCMT.Name && Utility.DoTrim(txtCMT.Text) != "")
                {
                    frm_DSACH_BN_TKIEM Timkiem_Benhnhan = new frm_DSACH_BN_TKIEM();
                    Timkiem_Benhnhan.AutoSearch = true;
                    Timkiem_Benhnhan.FillAndSearchData(false, "", "", "", Utility.DoTrim(txtCMT.Text), "", "-1");
                    if (Timkiem_Benhnhan.ShowDialog() == System.Windows.Forms.DialogResult.OK)
                    {
                        txtNoiDKKCBBD.Clear();
                        txtNoiphattheBHYT.Clear();
                        isAutoFinding = true;
                        FindPatient(Timkiem_Benhnhan.IdBenhnhan.ToString());
                        isAutoFinding = false;
                    }
                }
                else if (this.ActiveControl != null && this.ActiveControl.Name == txtSoDT.Name && Utility.DoTrim(txtSoDT.Text) != "")
                {
                    frm_DSACH_BN_TKIEM Timkiem_Benhnhan = new frm_DSACH_BN_TKIEM();
                    Timkiem_Benhnhan.AutoSearch = true;
                    Timkiem_Benhnhan.FillAndSearchData(false, "", "", "", "", Utility.DoTrim(txtSoDT.Text), "-1");
                    if (Timkiem_Benhnhan.ShowDialog() == System.Windows.Forms.DialogResult.OK)
                    {
                        txtNoiDKKCBBD.Clear();
                        txtNoiphattheBHYT.Clear();
                        isAutoFinding = true;
                        FindPatient(Timkiem_Benhnhan.IdBenhnhan.ToString());
                        isAutoFinding = false;
                    }
                }
                return;
            }

            if (e.Control && e.KeyCode == Keys.D)
            {

                _MaDoituongKcb = "DV";
                cboDoituongKCB.SelectedIndex = Utility.GetSelectedIndex(cboDoituongKCB, _MaDoituongKcb);
                return;
            }
            if (e.Control && e.KeyCode == Keys.B)
            {
                _MaDoituongKcb = "BHYT";
                cboDoituongKCB.SelectedIndex = Utility.GetSelectedIndex(cboDoituongKCB, _MaDoituongKcb);
                return;
            }
            if (e.Control && (e.KeyCode == Keys.C || e.KeyCode == Keys.P))
            {
                AllowTextChanged = false;
                txtDiachi._Text = txtDiachi_bhyt.Text;
                DiachiBNCu = DiachiBHYTCu;
                AllowTextChanged = true;
                return;
            }

            string ngay_kham = globalVariables.SysDate.ToString("dd/MM/yyyy");
            if (e.Control && e.KeyCode == Keys.K)
            {
                if (!NotPayment(txtMaBN.Text.Trim(), ref ngay_kham))
                {
                    m_enAction = action.Add;
                    SinhMaLanKham();
                    LaydanhsachdangkyKCB();
                    txtKieuKham.Focus();
                }
                else
                {
                    //nếu là ngày hiện tại thì đặt về trạng thái sửa
                    if (ngay_kham == globalVariables.SysDate.ToString("dd/MM/yyyy"))
                    {
                        Utility.ShowMsg(
                            "Bệnh nhân đang có lần khám chưa được thanh toán. Cần thanh toán hết các lần đến khám bệnh của Bệnh nhân trước khi thêm lần khám mới.Nhấn OK để hệ thống quay về trạng thái sửa thông tin BN");
                        m_enAction = action.Update;
                        AllowTextChanged = false;
                        LoadThongtinBenhnhan();
                        LaydanhsachdangkyKCB();
                        txtTEN_BN.Focus();
                    }
                    else //Không cho phép thêm lần khám khác nếu chưa thanh toán lần khám của ngày hôm trước
                    {
                        Utility.ShowMsg(
                            "Bệnh nhân đang có lần khám chưa được thanh toán. Cần thanh toán hết các lần đến khám bệnh của Bệnh nhân trước khi thêm lần khám mới. Nhấn OK để hệ thống chuyển về trạng thái thêm mới Bệnh nhân");
                        cmdThemMoiBN_Click(cmdThemMoiBN, new EventArgs());
                    }
                }
                return;
            }
            if (e.Control && e.KeyCode == Keys.F)
            {
                txtMaBN.SelectAll();
                txtMaBN.Focus();
            }

            if (e.KeyCode == Keys.F10) LoadThongTinChoKham();
            if (e.KeyCode == Keys.F1)
            {
                tabControl1.SelectedTab = tabControl1.TabPages[0];
                return;
            }
            if (e.KeyCode == Keys.F2)
            {
                tabControl1.SelectedTab = tabControl1.TabPages[1];
                return;
            }
            if (e.KeyCode == Keys.F11) Utility.ShowMsg(this.ActiveControl.Name);
            if (e.KeyCode == Keys.F4) cmdInPhieuKham.PerformClick();
            if (e.KeyCode == Keys.Escape && this.ActiveControl != null && this.ActiveControl.GetType()!=txtDantoc.GetType())
            {

                Close();
            }
            if (e.KeyCode == Keys.S && e.Control) cmdSave.PerformClick();
            if (e.KeyCode == Keys.T && e.Control) cmdThanhToanKham.PerformClick();
            // if(e.KeyCode==Keys.P&&e.Control)cmdSaveAndPrint.PerformClick();
            if (e.KeyCode == Keys.N && e.Control) cmdThemMoiBN.PerformClick();
            if (e.KeyCode == Keys.Enter) SendKeys.Send("{TAB}");
        }
コード例 #4
0
        private void txtPatient_Code_KeyDown(object sender, KeyEventArgs e)
        {
            try
            {
                if (Utility.Int32Dbnull(cboKhoanoitru.SelectedValue, -1) < 0)
                {
                    Utility.ShowMsg("Bạn cần chọn khoa nội trú trước khi chọn Bệnh nhân để lập phiếu điều trị");
                    cboKhoanoitru.Focus();
                    return;
                }
                var dtPatient = new DataTable();
                if (e.KeyCode == Keys.Enter)
                {
                    string _patient_Code = Utility.AutoFullPatientCode(txtPatient_Code.Text);
                    ClearControl();

                    dtPatient = _KCB_THAMKHAM.TimkiemBenhnhan(txtPatient_Code.Text,
                                                   -1,(byte)1, 0);

                    DataRow[] arrPatients = dtPatient.Select(KcbLuotkham.Columns.MaLuotkham + "='" + _patient_Code + "'");
                    if (arrPatients.GetLength(0) <= 0)
                    {
                        if (dtPatient.Rows.Count > 1)
                        {
                            var frm = new frm_DSACH_BN_TKIEM();
                            frm.MaLuotkham = txtPatient_Code.Text;
                            frm.dtPatient = dtPatient;
                            frm.ShowDialog();
                            if (!frm.has_Cancel)
                            {
                                txtPatient_Code.Text = frm.MaLuotkham;
                            }
                        }
                    }
                    else
                    {
                        txtPatient_Code.Text = _patient_Code;
                    }
                    txtMaluotkham.Text = _patient_Code;
                    m_dtPatients = _KCB_THAMKHAM.NoitruTimkiembenhnhan("01/01/1900", "01/01/1900", "", 1, Utility.DoTrim(txtMaluotkham.Text),
                                                         -1,
                                                         -1, chkChuyenkhoa.Checked ? 1 : 0);

                    if (!m_dtPatients.Columns.Contains("MAUSAC"))
                        m_dtPatients.Columns.Add("MAUSAC", typeof(int));

                    Utility.SetDataSourceForDataGridEx_Basic(grdPatientList, m_dtPatients, true, true, "", KcbDanhsachBenhnhan.Columns.TenBenhnhan); //"locked=0", "");

                    if (m_dtPatients.Rows.Count > 0)
                    {
                        AllowTextChanged = false;
                        if (dt_ICD_PHU != null) dt_ICD_PHU.Rows.Clear();
                        GetData();
                        txtPatient_Code.SelectAll();
                    }
                    else
                    {
                        string sPatientTemp = txtPatient_Code.Text;
                        ClearControl();
                        ModifyCommmands();
                        txtPatient_Code.Text = sPatientTemp;
                        txtPatient_Code.SelectAll();
                    }
                    txtMach.SelectAll();
                }
            }
            catch (Exception)
            {
                Utility.ShowMsg("Có lỗi trong quá trình lấy thông tin bệnh nhân");
            }
            finally
            {
                AllowTextChanged = true;
            }
        }
コード例 #5
0
        private void txtPatient_Code_KeyDown(object sender, KeyEventArgs e)
        {
            try
            {
                var dtPatient = new DataTable();
                if (e.KeyCode == Keys.Enter)
                {
                    string _patient_Code = Utility.AutoFullPatientCode(txtmaluotkham.Text);
                    ClearControl();
                    txtmaluotkham.Text = _patient_Code;
                    dtPatient = _KCB_THAMKHAM.TimkiemBenhnhan(txtmaluotkham.Text,
                                                   -1,(byte)2, 0);

                    string PatientCodeFilter = globalVariables.SysDate.Year.ToString().Substring(2, 2) +
                                               txtPatient_Code.Text.PadLeft(6, '0');
                    DataRow[] arrPatients = dtPatient.Select(KcbLuotkham.Columns.MaLuotkham + "='" + PatientCodeFilter + "'");
                    if (arrPatients.GetLength(0) <= 0)
                    {
                        if (dtPatient.Rows.Count > 1)
                        {
                            var frm = new frm_DSACH_BN_TKIEM();
                            frm.MaLuotkham = txtmaluotkham.Text;
                            frm.dtPatient = dtPatient;
                            frm.ShowDialog();
                            if (!frm.has_Cancel)
                            {
                                txtmaluotkham.Text = frm.MaLuotkham;
                            }
                        }
                    }
                    else
                    {
                        txtmaluotkham.Text = PatientCodeFilter;
                    }
                    DataTable dt_Patient = _KCB_THAMKHAM.TimkiemThongtinBenhnhansaukhigoMaBN(txtmaluotkham.Text,
                                                              -1,globalVariables.MA_KHOA_THIEN);
                    grdList.DataSource = null;
                    grdList.DataSource = dt_Patient;
                    if (dt_Patient.Rows.Count > 0)
                    {
                        grdList.MoveToRowIndex(0);
                        grdList.CurrentRow.BeginEdit();
                        grdList.CurrentRow.Cells["MAUSAC"].Value = 1;
                        grdList.CurrentRow.EndEdit();
                        AllowTextChanged = false;
                        if (dt_ICD_PHU != null) dt_ICD_PHU.Rows.Clear();
                        GetData();
                        txtPatient_Code.SelectAll();
                    }
                    else
                    {
                        string sPatientTemp = txtPatient_Code.Text;
                        ClearControl();

                        txtmaluotkham.Text = sPatientTemp;
                        txtmaluotkham.SelectAll();
                    }
                }
            }
            catch (Exception)
            {
                Utility.ShowMsg("Có lỗi trong quá trình lấy thông tin bệnh nhân");
            }
            finally
            {
                AllowTextChanged = true;
            }
        }
コード例 #6
0
        private void txtPatient_Code_KeyDown(object sender, KeyEventArgs e)
        {
            try
            {
                var dtPatient = new DataTable();
                if (e.KeyCode == Keys.Enter)
                {
                    Utility.FreeLockObject(m_strMaLuotkham);
                    string _patient_Code = Utility.AutoFullPatientCode(txtPatient_Code.Text);
                    ClearControl();
                    txtPatient_Code.Text = _patient_Code;
                    if (grdList.RowCount>0 && PropertyLib._ThamKhamProperties.Timtrenluoi)
                    {
                        DataRow[] arrData_tempt = null;
                        arrData_tempt = m_dtDanhsachbenhnhanthamkham.Select(KcbLuotkham.Columns.MaLuotkham + "='" + _patient_Code + "'");
                        if (arrData_tempt.Length > 0)
                        {
                            string _status=radChuaKham.Checked?"0":"1";
                            string regStatus=Utility.sDbnull(arrData_tempt[0][KcbDangkyKcb.Columns.TrangThai],"0");
                            if (_status != regStatus)
                            {
                                if (regStatus == "1") radDaKham.Checked = true;
                                else
                                    radChuaKham.Checked = true;
                            }
                            AllowTextChanged = false;
                            Utility.GotoNewRowJanus(grdList, KcbLuotkham.Columns.MaLuotkham, _patient_Code);
                            if (Utility.isValidGrid(grdList)) grdList_DoubleClick(grdList, new EventArgs());
                            return;
                        }
                    }

                    dtPatient = _KCB_THAMKHAM.TimkiemBenhnhan(txtPatient_Code.Text,
                                                   Utility.Int32Dbnull(cboPhongKhamNgoaiTru.SelectedValue, -1),(byte)0, 0);

                    DataRow[] arrPatients = dtPatient.Select(KcbLuotkham.Columns.MaLuotkham + "='" + _patient_Code + "'");
                    if (arrPatients.GetLength(0) <= 0)
                    {
                        if (dtPatient.Rows.Count > 1)
                        {
                            var frm = new frm_DSACH_BN_TKIEM();
                            frm.MaLuotkham = txtPatient_Code.Text;
                            frm.dtPatient = dtPatient;
                            frm.ShowDialog();
                            if (!frm.has_Cancel)
                            {
                                txtPatient_Code.Text = frm.MaLuotkham;
                            }
                        }
                    }
                    else
                    {
                        txtPatient_Code.Text = _patient_Code;
                    }
                    DataTable dt_Patient = _KCB_THAMKHAM.TimkiemThongtinBenhnhansaukhigoMaBN
                        (txtPatient_Code.Text, Utility.Int32Dbnull(cboPhongKhamNgoaiTru.SelectedValue, -1),globalVariables.MA_KHOA_THIEN);

                    grdList.DataSource = null;
                    grdList.DataSource = dt_Patient;
                    if (dt_Patient.Rows.Count > 0)
                    {
                        grdList.MoveToRowIndex(0);
                        grdList.CurrentRow.BeginEdit();
                        grdList.CurrentRow.Cells["MAUSAC"].Value = 1;
                        grdList.CurrentRow.EndEdit();
                        AllowTextChanged = false;
                        if (dt_ICD_PHU != null) dt_ICD_PHU.Rows.Clear();
                        GetData();
                        txtPatient_Code.SelectAll();
                    }
                    else
                    {
                        string sPatientTemp = txtPatient_Code.Text;
                        ClearControl();

                        txtPatient_Code.Text = sPatientTemp;
                        txtPatient_Code.SelectAll();
                        //Utility.SetMsg(lblMsg, "Không tìm thấy bệnh nhân có mã lần khám đang chọn",true);
                    }
                    txtMach.SelectAll();
                }
            }
            catch (Exception)
            {
                Utility.ShowMsg("Có lỗi trong quá trình lấy thông tin bệnh nhân");
            }
            finally
            {
                ModifyCommmands();
                AllowTextChanged = true;
            }
        }
コード例 #7
0
 private void txtPatientCode_KeyDown(object sender, KeyEventArgs e)
 {
     if(e.KeyCode != Keys.Enter)
         return;
     dtPatient = SPs.NoitietTimkiemBenhnhan(txtPatientCode.Text, -1, -1).GetDataSet().Tables[0];
     if (txtPatientCode.TextLength < 8 && dtPatient.Rows.Count > 0)
     {
             frm_DSACH_BN_TKIEM frm = new frm_DSACH_BN_TKIEM();
             frm.PatientCode = txtPatientCode.Text;
             frm.dtPatient = dtPatient;
             frm.ShowDialog();
             if (!frm.has_Cancel)
             {
                 txtPatientCode.Text = frm.PatientCode;
             }
         GetData();
     }
     else if (txtPatientCode.TextLength == 8)
     {
         GetData();
     }
 }
コード例 #8
0
        void txtMaluotkham_KeyDown(object sender, KeyEventArgs e)
        {
            try
            {
                if (e.KeyCode == Keys.Enter && Utility.DoTrim(txtMaluotkham.Text) != "")
                {
                    var dtPatient = new DataTable();

                        objLuotkham = null;
                        string _patient_Code = Utility.AutoFullPatientCode(txtMaluotkham.Text);
                        ClearControls();

                        dtPatient = new KCB_THAMKHAM().TimkiemBenhnhan(txtMaluotkham.Text,
                                                       -1,0, 0);

                        DataRow[] arrPatients = dtPatient.Select(KcbLuotkham.Columns.MaLuotkham + "='" + _patient_Code + "'");
                        if (arrPatients.GetLength(0) <= 0)
                        {
                            if (dtPatient.Rows.Count > 1)
                            {
                                var frm = new frm_DSACH_BN_TKIEM();
                                frm.MaLuotkham = txtMaluotkham.Text;
                                frm.dtPatient = dtPatient;
                                frm.ShowDialog();
                                if (!frm.has_Cancel)
                                {
                                    txtMaluotkham.Text = frm.MaLuotkham;
                                }
                            }
                        }
                        else
                        {
                            txtMaluotkham.Text = _patient_Code;
                        }
                        DataTable dt_Patient = new KCB_THAMKHAM().TimkiemThongtinBenhnhansaukhigoMaBN(txtMaluotkham.Text, -1, globalVariables.MA_KHOA_THIEN);
                        if (dt_Patient != null && dt_Patient.Rows.Count > 0)
                        {

                            txtIdBn.Text = Utility.sDbnull(dt_Patient.Rows[0][KcbDanhsachBenhnhan.Columns.IdBenhnhan], "");
                            objLuotkham = new Select().From(KcbLuotkham.Schema).Where(KcbLuotkham.Columns.IdBenhnhan).IsEqualTo(txtIdBn.Text)
                                .And(KcbLuotkham.Columns.MaLuotkham).IsEqualTo(txtMaluotkham.Text)
                                .ExecuteSingle<KcbLuotkham>();
                            txtTenBN.Text = Utility.sDbnull(dt_Patient.Rows[0][KcbDanhsachBenhnhan.Columns.TenBenhnhan], "");
                            txttuoi.Text = Utility.sDbnull(dt_Patient.Rows[0]["Tuoi"], "");
                            txtgioitinh.Text = Utility.sDbnull(dt_Patient.Rows[0][KcbDanhsachBenhnhan.Columns.GioiTinh], "");
                            txtDiaChi.Text = Utility.sDbnull(dt_Patient.Rows[0][KcbDanhsachBenhnhan.Columns.DiaChi], "");
                            txtmatheBhyt.Text = Utility.sDbnull(dt_Patient.Rows[0][KcbLuotkham.Columns.MatheBhyt], "");

                            txtKhoanoitru.Text = Utility.sDbnull(dt_Patient.Rows[0]["ten_khoaphong_noitru"], "");
                            txtBuong.Text = Utility.sDbnull(dt_Patient.Rows[0][NoitruDmucBuong.Columns.TenBuong], "");
                            txtGiuong.Text = Utility.sDbnull(dt_Patient.Rows[0][NoitruDmucGiuongbenh.Columns.TenGiuong], "");

                            txtIdkhoanoitru.Text = Utility.sDbnull(dt_Patient.Rows[0][KcbLuotkham.Columns.IdKhoanoitru], "-1");
                            txtIdravien.Text = Utility.sDbnull(dt_Patient.Rows[0][KcbLuotkham.Columns.IdRavien], "-1");
                            txtidBuong.Text = Utility.sDbnull(dt_Patient.Rows[0][KcbLuotkham.Columns.IdBuong], "-1");
                            txtidgiuong.Text = Utility.sDbnull(dt_Patient.Rows[0][KcbLuotkham.Columns.IdGiuong], "-1");

                            objPhieuchuyenvien = new Select().From(KcbPhieuchuyenvien.Schema)
                               .Where(KcbPhieuchuyenvien.Columns.IdBenhnhan).IsEqualTo(txtIdBn.Text)
                               .And(KcbPhieuchuyenvien.Columns.MaLuotkham).IsEqualTo(txtMaluotkham.Text)
                               .ExecuteSingle<KcbPhieuchuyenvien>();
                            if (objPhieuchuyenvien != null)
                            {
                                txtId.Text = objPhieuchuyenvien.IdPhieu.ToString();
                                txtNoichuyenden.SetId(objPhieuchuyenvien.IdBenhvienChuyenden);
                                txtdauhieucls._Text = objPhieuchuyenvien.DauhieuCls;
                                txtketquaCls.Text = objPhieuchuyenvien.KetquaXnCls;
                                txtChandoan.Text = objPhieuchuyenvien.ChanDoan;
                                txtThuocsudung.Text = objPhieuchuyenvien.ThuocSudung;
                                txtTrangthainguoibenh._Text = objPhieuchuyenvien.TrangthaiBenhnhan;
                                txtHuongdieutri._Text = objPhieuchuyenvien.HuongDieutri;
                                txtphuongtienvc._Text = objPhieuchuyenvien.PhuongtienChuyen;
                                txtNguoivanchuyen.Text = objPhieuchuyenvien.TenNguoichuyen;
                                cboDoctorAssign.SelectedIndex = Utility.GetSelectedIndex(cboDoctorAssign,Utility.sDbnull( objPhieuchuyenvien.IdBacsiChuyenvien,"-1"));
                                cmdPrint.Enabled = true;
                                cmdHuy.Enabled = true;
                            }
                            else
                            {
                                cmdPrint.Enabled = false;
                                cmdHuy.Enabled = false;
                            }
                            m_enAct = objPhieuchuyenvien == null ? action.Insert : action.Update;
                            if (m_enAct == action.Insert)
                                cmdPrint.Enabled = false;
                            else
                                cmdPrint.Enabled = true;
                            dtNgaychuyenvien.Focus();
                        }

                }
            }
            catch (Exception)
            {
                Utility.ShowMsg("Có lỗi trong quá trình lấy thông tin bệnh nhân");
            }
            finally
            {

                AllowTextChanged = true;
            }
        }
コード例 #9
0
 void cmdgetPatient_Click(object sender, EventArgs e)
 {
     frm_DSACH_BN_TKIEM _DSACH_BN_TKIEM = new frm_DSACH_BN_TKIEM();
     if (_DSACH_BN_TKIEM.ShowDialog() == System.Windows.Forms.DialogResult.OK)
     {
         txtMaluotkham.Text = _DSACH_BN_TKIEM.MaLuotkham;
         txtMaluotkham_KeyDown(txtMaluotkham, new KeyEventArgs(Keys.Enter));
     }
 }