/// <summary>
        /// hàm thực hiện load form hiện tại
        /// </summary>
        private void InitData()
        {
            try
            {
                DataTable m_dtKhoXuat = CommonLoadDuoc.LAYTHONGTIN_KHOTHUOC_LE_TUTRUC_NOITRU();
                DataBinding.BindDataCombobox(cboKhoxuat, m_dtKhoXuat,
                                             TDmucKho.Columns.IdKho, TDmucKho.Columns.TenKho, "---Chọn kho xuất thuốc---", true);


                if (globalVariables.IsAdmin || Noisudung == "KHO" || Noisudung == "ALL")
                {
                    m_dtDataDepartment = THU_VIEN_CHUNG.Laydanhmuckhoa("NOI", 0);
                    //log.Info("Lay thong tin khoa noi tru cua admin");
                }
                else
                {
                    m_dtDataDepartment = THU_VIEN_CHUNG.Laydanhmuckhoa(globalVariablesPrivate.objKhoaphong.IdKhoaphong);
                    //log.Info("Lay thong tin khoa noi tru cua theo nguoi su dung voi Department_ID=" + globalVariables.DepartmentID + " and nguoi dang nhap ten=" + globalVariables.gv_sStaffName);
                }
                DataBinding.BindDataCombobox(cboDepartment, m_dtDataDepartment, DmucKhoaphong.Columns.IdKhoaphong, DmucKhoaphong.Columns.TenKhoaphong, "Chọn khoa phòng", true);
                LoadThongTinNhanVienTheoKhoa();
                //log.Info("lay thong tin cua nhan vien theo khoa");
            }
            catch
            {
            }
            finally
            {
                bln_hasloaded = true;
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// hàm hực hiện việc load lại danh mục khởi tạo thông tni
        /// </summary>
        private void InitData()
        {
            try
            {
                cboDepartment.Enabled   = cboStaff.Enabled = globalVariables.IsAdmin;
                dtTuNgay.Value          = DateTime.Now.AddDays(-2);
                dtDenNgay.Value         = DateTime.Now.AddDays(2);
                cboStatus.SelectedIndex = 0;
                DataTable dtKho = new DataTable();
                if (KIEUTHUOC_VT == "THUOC")
                {
                    dtKho = CommonLoadDuoc.LAYTHONGTIN_KHOTHUOC_LE_TUTRUC_NOITRU();
                }
                else
                {
                    dtKho = CommonLoadDuoc.LAYTHONGTIN_KHOVATTU_LE(new List <string> {
                        "TATCA", "NOITRU"
                    });
                }

                DataBinding.BindDataCombobox(cboKhoxuat, dtKho,
                                             TDmucKho.Columns.IdKho, TDmucKho.Columns.TenKho,
                                             "---Chọn kho xuất---", false);

                DataTable dtDoctorAssign = THU_VIEN_CHUNG.Laydanhsachnhanvien("ALL");
                DataBinding.BindDataCombox(cboStaff, dtDoctorAssign, DmucNhanvien.Columns.IdNhanvien,
                                           DmucNhanvien.Columns.TenNhanvien, "---Bác sỹ chỉ định---", true);
                if (globalVariables.gv_intIDNhanvien <= 0)
                {
                    if (cboStaff.Items.Count > 0)
                    {
                        cboStaff.SelectedIndex = 0;
                    }
                }
                else
                {
                    if (cboStaff.Items.Count > 0)
                    {
                        cboStaff.SelectedIndex = Utility.GetSelectedIndex(cboStaff,
                                                                          globalVariables.gv_intIDNhanvien.ToString());
                    }
                }
                LoadDepartments();
            }
            catch
            {
            }
        }
Exemplo n.º 3
0
        private void InitData()
        {
            try
            {
                DataTable m_dtKhoaNoitru = THU_VIEN_CHUNG.Laydanhmuckhoa("NOI", 0);
                txtKhoanoitru.Init(m_dtKhoaNoitru, new List <string>()
                {
                    DmucKhoaphong.Columns.IdKhoaphong, DmucKhoaphong.Columns.MaKhoaphong, DmucKhoaphong.Columns.TenKhoaphong
                });

                txtNhanvien.Enabled = globalVariables.IsAdmin;
                DataTable dtKho = new DataTable();
                if (kieu_thuoc_vt == "THUOC")
                {
                    dtKho = CommonLoadDuoc.LAYTHONGTIN_KHOTHUOC_LE_TUTRUC_NOITRU();
                }
                else
                {
                    dtKho = CommonLoadDuoc.LAYTHONGTIN_KHOVATTU_LE(new List <string> {
                        "TATCA", "NOITRU"
                    });
                }

                txtKhothuoc.Init(dtKho, new List <string>()
                {
                    TDmucKho.Columns.IdKho, TDmucKho.Columns.MaKho, TDmucKho.Columns.TenKho
                });
                txtNhanvien.Init(THU_VIEN_CHUNG.Laydanhsachnhanvien("ALL"), new List <string>()
                {
                    DmucNhanvien.Columns.IdNhanvien, DmucNhanvien.Columns.MaNhanvien, DmucNhanvien.Columns.TenNhanvien
                });
                txtNhanvien.SetId(globalVariables.gv_intIDNhanvien);
            }
            catch
            {
            }
        }