Beispiel #1
0
        public void Load_cmbDonVi_TheoQuyen(VSCM.Base.Controls.ucSearchLookupEdit cmb, bool p)
        {
            cmb.Tag = 0;
            clsDM_DonVi cls = new clsDM_DonVi();
            DataTable   dt  = cls.SelectAll();

            dt = GlobalMethod.CheckQuyenDonVi(dt);
            if (dt.Rows.Count > 1)
            {
                DataRow row;
                row              = dt.NewRow();
                row["ID_DonVi"]  = "0";
                row["Ten_DonVi"] = "Tất cả";
                row["SuDung"]    = 1;
                row["TonTai"]    = 1;
                dt.Rows.Add(row);
            }

            dt.DefaultView.RowFilter = "SuDung = 1 AND TonTai = 1 AND ID_DonVi <> " + iID_DonVi;
            dt.DefaultView.Sort      = "STT_DonVi ASC";

            cmb.Properties.DataSource    = dt.DefaultView.ToTable();
            cmb.Properties.ValueMember   = "ID_DonVi";
            cmb.Properties.DisplayMember = "Ten_DonVi";
            cmb.Tag = 1;

            if (dt.DefaultView.ToTable().Rows.Count == 1)
            {
                cmb.EditValue = dt.DefaultView.ToTable().Rows[0]["ID_DonVi"];
            }
        }
Beispiel #2
0
        private void TimKiem()
        {
            var fg = fgNhanSu;

            fg.Tag = 0;
            fg.BeginUpdate();
            clsNS_ThongTinNS cls = new clsNS_ThongTinNS();

            DataTable dt = cls.TimKiemTheoTenNS_MaNS(txtSearch_NhanSu.Text,
                                                     GlobalVariables.GetCurrentDateTime(),
                                                     m_TrangThaiHD,
                                                     m_TrangThaiDiLam);

            dt = GlobalMethod.CheckQuyenDonVi(dt);
            fg.SetDataSource(dt, true);
            fg.AutoSizeRows();
            fg.EndUpdate();
            fg.Tag = 1;
        }