Exemplo n.º 1
0
        private void ucTuDienDuLieu_Load(object sender, EventArgs e)
        {
            DataTable dt = DataProvider.ExecQueryStore("sp_UI_GridView_LayTheoMa", new SqlParameter("@MaGridView", _chucNang.MaGridView));
            DataRow   dr = dt.Rows[0];

            #region Init GridView
            AppGridView.Init(gridViewDuLieu
                             , (bool)XuLyKieuDuLieu.ThayTheNull(dr["MultiSelect"], typeof(bool))
                             , (string)XuLyKieuDuLieu.ThayTheNull(dr["MultiSelectMode"], typeof(string))
                             , (bool)XuLyKieuDuLieu.ThayTheNull(dr["ShowDetailButtons"], typeof(bool))
                             , (bool)XuLyKieuDuLieu.ThayTheNull(dr["ShowGroupPanel"], typeof(bool))
                             , (int)XuLyKieuDuLieu.ThayTheNull(dr["WordWrapHeader"], typeof(int))
                             , (string)XuLyKieuDuLieu.ThayTheNull(dr["NewItemRowText"], typeof(string))
                             , (string)XuLyKieuDuLieu.ThayTheNull(dr["GroupPanelText"], typeof(string))
                             , (string)XuLyKieuDuLieu.ThayTheNull(dr["ColumnFields"], typeof(string))
                             , (string)XuLyKieuDuLieu.ThayTheNull(dr["ColumnNames"], typeof(string))
                             , (string)XuLyKieuDuLieu.ThayTheNull(dr["ColumnWidths"], typeof(string))
                             , (string)XuLyKieuDuLieu.ThayTheNull(dr["HideFields"], typeof(string))
                             , (string)XuLyKieuDuLieu.ThayTheNull(dr["ReadOnlyFields"], typeof(string))
                             , (string)XuLyKieuDuLieu.ThayTheNull(dr["FixedFields"], typeof(string))
                             , (string)XuLyKieuDuLieu.ThayTheNull(dr["FixedStyle"], typeof(string))
                             );

            dt = DataProvider.ExecQueryStore("sp_UI_GridView_AlignHeader_LayTheoMa", new SqlParameter("@MaGridView", _chucNang.MaGridView));
            foreach (DataRow row in dt.Rows)
            {
                AppGridView.AlignHeader(gridViewDuLieu
                                        , (string)XuLyKieuDuLieu.ThayTheNull(row["AlignHeaders"], typeof(string))
                                        , (string)XuLyKieuDuLieu.ThayTheNull(row["AlignStyle"], typeof(string))
                                        );
            }
            #endregion
        }
Exemplo n.º 2
0
        protected override PMSObject PhanTichDataRow(DataRow dr)
        {
            LoaiChucNang lcn = new LoaiChucNang();

            lcn.MaLoai              = (string)XuLyKieuDuLieu.ThayTheNull(dr["MaLoai"], typeof(string));
            lcn.TenLoai             = (string)XuLyKieuDuLieu.ThayTheNull(dr["TenLoai"], typeof(string));
            lcn.LoaiChucNangBacTren = LayDuLieu((string)XuLyKieuDuLieu.ThayTheNull(dr["MaLoaiBacTren"], typeof(string)));
            return(lcn);
        }
Exemplo n.º 3
0
        public List <Quyen> LayDuLieu()
        {
            DataTable    dtQuyen = DataProvider.ExecQueryStore("sp_Quyen_LayDuLieu");
            List <Quyen> lsQuyen = new List <Quyen>();

            if (dtQuyen != null && dtQuyen.Rows.Count > 0)
            {
                foreach (DataRow dr in dtQuyen.Rows)
                {
                    Quyen q = new Quyen();
                    q.MaQuyen    = (string)XuLyKieuDuLieu.ThayTheNull(dr["MaQuyen"], typeof(string));
                    q.TenQuyen   = (string)XuLyKieuDuLieu.ThayTheNull(dr["TenQuyen"], typeof(string));
                    q.GhiChu     = (string)XuLyKieuDuLieu.ThayTheNull(dr["GhiChu"], typeof(string));
                    q.DsChucNang = _dataChucNang.LayDuLieu(q);
                    lsQuyen.Add(q);
                }
            }
            return(lsQuyen);
        }
Exemplo n.º 4
0
        public TaiKhoan LayDuLieu(string ten_dang_nhap, string mat_khau)
        {
            List <SqlParameter> lstParameter = new List <SqlParameter>();

            lstParameter.Add(new SqlParameter("@TenDangNhap", ten_dang_nhap));
            lstParameter.Add(new SqlParameter("@MatKhau", mat_khau));   //Sai mật khẩu vẫn lấy ra tài khoản như mật khẩu sẽ NULL
            DataTable dtTaiKhoan = DataProvider.ExecQueryStore("sp_TaiKhoan_LayTheoTenDangNhapMatKhau", lstParameter);
            TaiKhoan  tk         = null;

            if (dtTaiKhoan != null && dtTaiKhoan.Rows.Count > 0)
            {
                tk             = new TaiKhoan();
                tk.TenDangNhap = (string)XuLyKieuDuLieu.ThayTheNull(dtTaiKhoan.Rows[0]["TenDangNhap"], typeof(string));
                tk.MatKhau     = (string)XuLyKieuDuLieu.ThayTheNull(dtTaiKhoan.Rows[0]["MatKhau"], typeof(string));
                tk.HoTen       = (string)XuLyKieuDuLieu.ThayTheNull(dtTaiKhoan.Rows[0]["HoTen"], typeof(string));
                tk.NgayTao     = (DateTime)XuLyKieuDuLieu.ThayTheNull(dtTaiKhoan.Rows[0]["NgayTao"], typeof(DateTime));
                tk.DsQuyen     = _dataQuyen.LayDuLieu(tk);
                tk.TrangThai   = (bool)XuLyKieuDuLieu.ThayTheNull(dtTaiKhoan.Rows[0]["TrangThai"], typeof(bool));
            }
            return(tk);
        }
Exemplo n.º 5
0
        protected override PMSObject PhanTichDataRow(DataRow dr)
        {
            ChucNang cn = new ChucNang();

            cn.ModuleID = (string)XuLyKieuDuLieu.ThayTheNull(dr["ModuleID"], typeof(string));
            cn.Order    = (int)XuLyKieuDuLieu.ThayTheNull(dr["Order"], typeof(int));
            //cn.ChucNangBacTren = LayDuLieu((string)XuLyKieuDuLieu.ThayTheNull(dr["MaChucNangBacTren"], typeof(string)));
            cn.MaChucNangBacTren = (string)XuLyKieuDuLieu.ThayTheNull(dr["MaChucNangBacTren"], typeof(string));
            cn.ModuleName        = (string)XuLyKieuDuLieu.ThayTheNull(dr["ModuleName"], typeof(string));
            cn.GUIName           = (string)XuLyKieuDuLieu.ThayTheNull(dr["GUIName"], typeof(string));
            cn.LoaiChucNang      = new LoaiChucNang_Data().LayDuLieu((string)dr["PhanLoai"]);
            cn.HinhAnh           = AppImage.Base64StringToImage((string)XuLyKieuDuLieu.ThayTheNull(dr["HinhAnh"], null));
            cn.MaGridView        = (string)XuLyKieuDuLieu.ThayTheNull(dr["IDGridView"], typeof(string));
            cn.SelectStore       = (string)XuLyKieuDuLieu.ThayTheNull(dr["SelectStore"], typeof(string));
            cn.InsertStore       = (string)XuLyKieuDuLieu.ThayTheNull(dr["InsertStore"], typeof(string));
            cn.DeleteStore       = (string)XuLyKieuDuLieu.ThayTheNull(dr["DeleteStore"], typeof(string));
            cn.UpdateStore       = (string)XuLyKieuDuLieu.ThayTheNull(dr["UpdateStore"], typeof(string));
            cn.TrangThai         = (bool)XuLyKieuDuLieu.ThayTheNull(dr["TrangThai"], typeof(bool));
            cn.ListModuleGetData = _dataModule.LayModuleCungCapDuLieu(cn.ModuleID);
            return(cn);
        }
Exemplo n.º 6
0
        public List <Quyen> LayDuLieu(TaiKhoan tai_khoan)
        {
            List <SqlParameter> lstParameter = new List <SqlParameter>();

            lstParameter.Add(new SqlParameter("@TenDangNhap", tai_khoan.TenDangNhap));
            DataTable    dtQuyen = DataProvider.ExecQueryStore("sp_Quyen_LayTheoTaiKhoan", lstParameter);
            List <Quyen> lsQuyen = new List <Quyen>();

            if (dtQuyen != null && dtQuyen.Rows.Count > 0)
            {
                foreach (DataRow dr in dtQuyen.Rows)
                {
                    Quyen q = new Quyen();
                    q.MaQuyen    = (string)XuLyKieuDuLieu.ThayTheNull(dr["MaQuyen"], typeof(string));
                    q.TenQuyen   = (string)XuLyKieuDuLieu.ThayTheNull(dr["TenQuyen"], typeof(string));
                    q.GhiChu     = (string)XuLyKieuDuLieu.ThayTheNull(dr["GhiChu"], typeof(string));
                    q.DsChucNang = _dataChucNang.LayDuLieu(q);
                    lsQuyen.Add(q);
                }
            }
            return(lsQuyen);
        }