Ejemplo n.º 1
0
        /// <summary>
        /// phím tắt
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>

        private void frm_DanhmucKhothuoc_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.Control && e.KeyCode == Keys.N)
            {
                cmdThemMoi.PerformClick();
            }
            if (e.Control && e.KeyCode == Keys.E)
            {
                cmdSua.PerformClick();
            }
            if (e.Control && e.KeyCode == Keys.D)
            {
                cmdXoa.PerformClick();
            }
            if (e.KeyCode == Keys.F5)
            {
                m_dtKhoThuoc = CommonLoadDuoc.LAYTHONGTIN_KHOTHUOCVaTuThuoc();
                Utility.SetDataSourceForDataGridEx(grdKhoThuoc, m_dtKhoThuoc, true, true, "1=1", TDmucKho.Columns.SttHthi + "," + TDmucKho.Columns.TenKho);
                ModifyCommand();
            }
            if (e.KeyCode == Keys.Escape)
            {
                cmdThoat.PerformClick();
            }
        }
        private void InitialData()
        {
            try
            {
                //Khởi tạo danh mục loại nhân viên
                DataTable v_dtStaffTypeList = THU_VIEN_CHUNG.LayDulieuDanhmucChung("LOAINHANVIEN", true);
                //  v_dtStaffTypeList =
                //   DataBinding.BindData(cboUserName,v_dtStaffTypeList.Select(""));
                cboStaffType.DataSource            = v_dtStaffTypeList.DefaultView;
                v_dtStaffTypeList.DefaultView.Sort = DmucChung.Columns.SttHthi;
                cboStaffType.ValueMember           = DmucChung.Columns.Ma;
                cboStaffType.DisplayMember         = DmucChung.Columns.Ten;
                //Khởi tạo danh mục chức vụ

                //Khởi tạo danh mục phòng ban
                m_dtDepartmentList = THU_VIEN_CHUNG.Laydanhmuckhoa("ALL", -1);
                DataBinding.BindData(cboUpLevel, m_dtDepartmentList, DmucKhoaphong.Columns.IdKhoaphong, DmucKhoaphong.Columns.TenKhoaphong);
                cboUpLevel_SelectedIndexChanged(cboUpLevel, new EventArgs());
                //Khởi tạo danh mục User
                DataTable v_dtUserList = new DataTable();
                if (em_Action == action.Insert)
                {
                    v_dtUserList =
                        new Select().From(SysUser.Schema).Where(SysUser.Columns.PkSuid).NotIn(
                            new Select(DmucNhanvien.Columns.UserName).From(DmucNhanvien.Schema)).ExecuteDataSet().Tables
                        [0];
                    DataBinding.BindData(cboUserName, v_dtUserList, SysUser.Columns.PkSuid, SysUser.Columns.PkSuid);
                }
                else
                {
                    v_dtUserList =
                        new Select().From(SysUser.Schema).ExecuteDataSet().Tables[0];
                    DataBinding.BindData(cboUserName, v_dtUserList, SysUser.Columns.PkSuid, SysUser.Columns.PkSuid);
                }

                //Utility.AddColumnAlltoUserDataTable(ref v_dtUserList, SysUser.Columns.PkSuid, "");
                //v_dtUserList.DefaultView.Sort = SysUser.Columns.PkSuid+" ASC";
                txtUID.Init(v_dtUserList, new List <string>()
                {
                    SysUser.Columns.PkSuid, SysUser.Columns.PkSuid, SysUser.Columns.PkSuid
                });


                m_dtKhoThuoc = CommonLoadDuoc.LAYTHONGTIN_KHOTHUOCVaTuThuoc();
                Utility.SetDataSourceForDataGridEx(grdKhoThuoc, m_dtKhoThuoc, false, true, "1=1", TDmucKho.Columns.SttHthi);
                m_dtPhongkham = THU_VIEN_CHUNG.LaydanhmucPhong(0);
                Utility.SetDataSourceForDataGridEx(grdPhongkham, m_dtPhongkham, false, true, "1=1", VDmucKhoaphong.Columns.SttHthi);

                m_dtKhoangoaitru = THU_VIEN_CHUNG.Laydanhmuckhoa("NGOAI", 0);
                Utility.SetDataSourceForDataGridEx(grdKhoa, m_dtKhoangoaitru, false, true, "1=1", VDmucKhoaphong.Columns.SttHthi);

                m_dtKhoanoitru = THU_VIEN_CHUNG.Laydanhmuckhoa("NOI", 0);
                Utility.SetDataSourceForDataGridEx(grdKhoanoitru, m_dtKhoanoitru, false, true, "1=1", VDmucKhoaphong.Columns.SttHthi);

                DataTable dtQuyen = new Select().From(DmucChung.Schema).Where(DmucChung.Columns.Loai).IsEqualTo("QUYENNHANVIEN").ExecuteDataSet().Tables[0];
                Utility.SetDataSourceForDataGridEx_Basic(grdQuyen, dtQuyen, false, true, "1=1", DmucChung.Columns.SttHthi + "," + DmucChung.Columns.Ten);

                Utility.SetDataSourceForDataGridEx_Basic(grdLoaiThuoc, SPs.DmucLaydanhsachLoaithuoc("-1").GetDataSet().Tables[0], false, true, "1=1", "stt_nhomthuoc," + DmucLoaithuoc.Columns.SttHthi + "," + DmucLoaithuoc.Columns.TenLoaithuoc);
                Utility.SetDataSourceForDataGridEx_Basic(grdDichvuCls, new Select().From(DmucChung.Schema).Where(DmucChung.Columns.Loai).IsEqualTo("LOAIDICHVUCLS").ExecuteDataSet().Tables[0], false, true, "1=1", DmucChung.Columns.SttHthi + "," + DmucChung.Columns.Ten);
            }
            catch (Exception ex)
            {
                Utility.ShowMsg(ex.Message);
            }
        }
Ejemplo n.º 3
0
 /// <summary>
 /// hàm thực hiện load thông tin kho thuốc
 ///
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void frm_DanhmucKhothuoc_Load(object sender, EventArgs e)
 {
     m_dtKhoThuoc = CommonLoadDuoc.LAYTHONGTIN_KHOTHUOCVaTuThuoc();
     Utility.SetDataSourceForDataGridEx(grdKhoThuoc, m_dtKhoThuoc, true, true, "1=1", "");
     ModifyCommand();
 }