예제 #1
0
        private void frmTaiKhoan_Load(object sender, EventArgs e)
        {
            #region Init GridView
            AppGridView.InitGridView(gridViewTaiKhoan, true, true, GridMultiSelectMode.CellSelect, false, false, "Nhấn vào đây để thêm dòng mới");
            AppGridView.ShowField(gridViewTaiKhoan, new string[] { "MaNhomQuyen", "HoTen", "TenDangNhap", "MatKhau", "Xem", "TrangThai", "ResetPassWordGv", "PhanQuyen", "UserUis" },
                                  new string[] { "Nhóm quyền", "Họ tên", "Tên truy cập", "Mật khẩu", "Xem", "Khoá tài khoản", "Reset mật khẩu GV", "Phân quyền chức năng", "Tài khoản UIS" }, new int[] { 200, 200, 150, 70, 60, 100, 120, 150, 200 });
            AppGridView.ShowEditor(gridViewTaiKhoan, NewItemRowPosition.Top);
            AppGridView.AlignHeader(gridViewTaiKhoan, new string[] { "MaNhomQuyen", "HoTen", "TenDangNhap", "MatKhau", "Xem", "TrangThai", "ResetPassWordGv", "PhanQuyen", "UserUis" }, DevExpress.Utils.HorzAlignment.Center);
            //Attach Control to GridView
            AppGridView.RegisterControlField(gridViewTaiKhoan, "MaNhomQuyen", repositoryItemGridLookUpEditNhomQuyen);
            AppGridView.RegisterControlField(gridViewTaiKhoan, "MatKhau", repositoryItemTextEditMatKhau);
            AppGridView.RegisterControlField(gridViewTaiKhoan, "Xem", repositoryItemButtonEditXem);
            AppGridView.RegisterControlField(gridViewTaiKhoan, "PhanQuyen", repositoryItemButtonEditPhanQuyenTaiKhoan);
            AppGridView.RegisterControlField(gridViewTaiKhoan, "UserUis", repositoryItemCheckedComboBoxEditTaiKhoanUis);
            AppGridView.AlignHeader(gridViewTaiKhoan, new string[] { "Xem", "TrangThai", "PhanQuyen" }, DevExpress.Utils.HorzAlignment.Center);
            AppGridView.UnSortField(gridViewTaiKhoan, new string[] { "Xem", "TrangThai", "PhanQuyen" });
            AppGridView.HideField(gridViewTaiKhoan, new string[] { "Xem" });
            #endregion

            #region RepositoryItemGridLookUpEdit Nhom Quyen
            AppRepositoryItemGridLookUpEdit.InitRepositoryItemGridLookUp(repositoryItemGridLookUpEditNhomQuyen, true, TextEditStyles.Standard);
            AppRepositoryItemGridLookUpEdit.ShowField(repositoryItemGridLookUpEditNhomQuyen, new string[] { "TenNhomQuyen", "GhiChu" }, new string[] { "Tên nhóm quyền", "Ghi chú" });
            repositoryItemGridLookUpEditNhomQuyen.ValueMember   = "MaNhomQuyen";
            repositoryItemGridLookUpEditNhomQuyen.DisplayMember = "TenNhomQuyen";
            repositoryItemGridLookUpEditNhomQuyen.NullText      = string.Empty;
            #endregion

            #region Init Datasource
            bindingSourceTaiKhoan.DataSource  = DataServices.TaiKhoan.GetByNhomQuyenQL((Int32)UserInfo.GroupID);
            bindingSourceNhomQuyen.DataSource = DataServices.NhomQuyen.GetByNhomQuyenQL((Int32)UserInfo.GroupID);

            repositoryItemCheckedComboBoxEditTaiKhoanUis.SelectAllItemCaption = "Tất cả";
            repositoryItemCheckedComboBoxEditTaiKhoanUis.TextEditStyle        = TextEditStyles.Standard;
            repositoryItemCheckedComboBoxEditTaiKhoanUis.Items.Clear();

            IDataReader dr    = DataServices.TaiKhoan.GetAllTaiKhoanUis();
            DataTable   tkUis = new DataTable();
            tkUis.Load(dr);
            bindingSourceTKUis.DataSource = tkUis;

            List <CheckedListBoxItem> list = new List <CheckedListBoxItem>();
            foreach (DataRow obj in tkUis.Rows)
            {
                list.Add(new CheckedListBoxItem((string)obj["MaTaiKhoan"], (string)obj["HoTen"], CheckState.Unchecked, true));
            }
            repositoryItemCheckedComboBoxEditTaiKhoanUis.Items.AddRange(list.ToArray());
            repositoryItemCheckedComboBoxEditTaiKhoanUis.SeparatorChar = ';';


            #endregion
        }
예제 #2
0
        private void frmKhoaTaiKhoanGiangVien_Load(object sender, EventArgs e)
        {
            #region Init GridView
            AppGridView.InitGridView(gridViewKhoaTaiKhoan, true, true, DevExpress.XtraGrid.Views.Grid.GridMultiSelectMode.RowSelect, true, true);
            AppGridView.ShowField(gridViewKhoaTaiKhoan, new string[] { "MaGiangVien", "MaQuanLy", "HoTen", "TenHocHam", "TenHocVi", "TenLoaiGiangVien", "TenDonVi", "KhoaTaiKhoan" }
                                  , new string[] { "Id", "Mã giảng viên", "Họ tên", "Học hàm", "Học vị", "Loại giảng viên", "Khoa - Đơn vị", "Khoá tài khoản" }
                                  , new int[] { 99, 90, 140, 100, 100, 100, 100, 100 });

            AppGridView.AlignHeader(gridViewKhoaTaiKhoan, new string[] { "MaGiangVien", "MaQuanLy", "HoTen", "TenHocHam", "TenHocVi", "TenLoaiGiangVien", "TenDonVi", "KhoaTaiKhoan" }, DevExpress.Utils.HorzAlignment.Center);
            AppGridView.HideField(gridViewKhoaTaiKhoan, new string[] { "MaGiangVien" });
            AppGridView.ReadOnlyColumn(gridViewKhoaTaiKhoan, new string[] { "MaGiangVien", "MaQuanLy", "HoTen", "TenHocHam", "TenHocVi", "TenLoaiGiangVien", "TenDonVi" });
            AppGridView.SummaryField(gridViewKhoaTaiKhoan, "MaQuanLy", "{0}", DevExpress.Data.SummaryItemType.Count);
            #endregion
            InitData();
        }