/// <summary>
        /// hàm thục hiện việc thêm lần khám
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void cmdThemLanKham_Click(object sender, EventArgs e)
        {
            try
            {
                if (!Utility.isValidGrid(grdList))
                {
                    Utility.ShowMsg("Bạn phải chọn bệnh nhân để thêm lượt khám mới");
                    return;
                }
                DataTable _temp = _KCB_DANGKY.KcbLaythongtinBenhnhan(Utility.Int64Dbnull(grdList.GetValue(KcbLuotkham.Columns.IdBenhnhan)));
                if (_temp != null && Utility.ByteDbnull(_temp.Rows[0][KcbLuotkham.Columns.TrangthaiNoitru], 0) > 0 && Utility.ByteDbnull(_temp.Rows[0][KcbLuotkham.Columns.TrangthaiNoitru], 0) < 4)
                {
                    Utility.ShowMsg("Bệnh nhân đang ở trạng thái nội trú và chưa ra viện nên không thể thêm lần khám mới. Đề nghị bạn xem lại");
                    return ;
                }
                frm_Dangky_Kiemnghiem frm = new frm_Dangky_Kiemnghiem(this.Args);
                frm._OnAssign += frm__OnAssign;
                frm.txtMaBN.Text = Utility.sDbnull(grdList.GetValue(KcbLuotkham.Columns.IdBenhnhan));
                frm.txtMaLankham.Text = Utility.sDbnull(grdList.GetValue(KcbLuotkham.Columns.MaLuotkham));
                this.myTrace.FunctionID = globalVariables.FunctionID;
                this.myTrace.FunctionName = globalVariables.FunctionName;
                frm.myTrace = this.myTrace;
                frm.m_enAction = action.Add;
                frm._OnActionSuccess+=frm__OnActionSuccess;
                frm.m_dtPatient = m_dtPatient;
                frm.grdList = grdList;
                frm.ShowDialog();
                if (!frm.m_blnCancel)
                {
                    UpdateGroup();
                    grdList_SelectionChanged(grdList, new EventArgs());
                }
                ModifyCommand();
                ModifycommandAssignDetail();

            }
            catch (Exception)
            {
            }
            finally
            {
                //CauHinh();
            }
        }
        private void cmdThemMoiBN_Click(object sender, EventArgs e)
        {
            try
            {
                frm_Dangky_Kiemnghiem frm = new frm_Dangky_Kiemnghiem(this.Args);
                frm._OnAssign += frm__OnAssign;
                frm.m_enAction = action.Insert;
                frm.m_dtPatient = m_dtPatient;
                this.myTrace.FunctionID = globalVariables.FunctionID;
                this.myTrace.FunctionName = globalVariables.FunctionName;
                frm.myTrace = this.myTrace;
                frm._OnActionSuccess += frm__OnActionSuccess;
                frm.grdList = grdList;
                frm.ShowDialog();
                if (!frm.m_blnCancel)
                {
                    UpdateGroup();
                    grdList_SelectionChanged(grdList, new EventArgs());
                }
                ModifyCommand();
                ModifycommandAssignDetail();

            }
            catch (Exception exception)
            {

            }
            finally
            {
               // CauHinh();
            }
        }
        /// <summary>
        /// hàm thực hiện sửa thông tin của bệnh nhân
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void cmdSuaThongTinBN_Click(object sender, EventArgs e)
        {
            try
            {
                if (!Utility.isValidGrid(grdList))
                {
                    Utility.ShowMsg("Bạn phải chọn ít nhất 1 bệnh nhân để sửa thông tin");
                    return;
                }

                frm_Dangky_Kiemnghiem frm = new frm_Dangky_Kiemnghiem(this.Args);
                frm.txtMaBN.Text = Utility.sDbnull(grdList.GetValue(KcbLuotkham.Columns.IdBenhnhan));
                frm.txtMaLankham.Text = Utility.sDbnull(grdList.GetValue(KcbLuotkham.Columns.MaLuotkham));
                this.myTrace.FunctionID = globalVariables.FunctionID;
                this.myTrace.FunctionName = globalVariables.FunctionName;
                frm.myTrace = this.myTrace;
                frm._OnActionSuccess+=frm__OnActionSuccess;
                frm.m_enAction = action.Update;
                frm.m_dtPatient = m_dtPatient;
                frm.grdList = grdList;
                frm.ShowDialog();
                if (!frm.m_blnCancel)
                {
                    UpdateGroup();
                    grdList_SelectionChanged(grdList, new EventArgs());
                }
                ModifyCommand();
                ModifycommandAssignDetail();

            }
            catch (Exception)
            {

            }
            finally
            {
                //CauHinh();
            }
        }