Beispiel #1
0
        private void CheckAuthorization()
        {
            if (!ClientCommon.HasAuthority(UserInfo.UserRole, BSRole.QuanLyBSG))
            {
                // Danh mục nhóm tài khoản
                AccountGroup_Button_Panel.Enabled = false;
                AccountGroup_GridView.OptionsBehavior.Editable       = false;
                AccountGroup_GridView.OptionsView.NewItemRowPosition = NewItemRowPosition.None;

                // Danh mục tài khoản
                Accounts_Button_Panel.Enabled             = false;
                Account_TreeList.OptionsBehavior.Editable = false;
                AccountSpecialGroup_Panel.Enabled         = false;
            }

            if (!ClientCommon.HasAuthority(UserInfo.UserRole, BSRole.KeToanTruong))
            {
                // Thống kê
                AccountDetailInfo_Panel.Enabled = false;
                ItemPrice_LayoutControl.Enabled = false;
                AccountDetail_GridView.OptionsBehavior.Editable = false;

                AccountDetailInfo_GroupControl.CustomHeaderButtons[0].CastTo <GroupBoxButton>().Enabled = false;
            }
        }
 private void CheckAuthorityToShowKCButton()
 {
     if (ClientCommon.HasAuthority(UserInfo.UserRole, BSRole.QuanLyBSG) || ClientCommon.HasAuthority(UserInfo.UserRole, BSRole.ADMIN))
     {
         KetChuyen_Button.Enabled = true;
     }
 }
Beispiel #3
0
        private void AccountDetail_GridView_SelectionChanged(object sender, DevExpress.Data.SelectionChangedEventArgs e)
        {
            int rowIndex = AccountDetail_GridView.FocusedRowHandle;

            if (!AccountDetail_GridView.IsRowSelected(rowIndex))
            {
                return;
            }

            var  selected = AccountDetail_GridView.GetFocusedRow().CastTo <AccountDetail>();
            bool isNewRow = AccountDetail_GridView.IsNewItemRow(rowIndex);

            if (selected == null)
            {
                return;
            }

            // Dòng thêm mới
            if (isNewRow || selected.Status == ModifyMode.Insert)
            {
                return;
            }

            // Có quyền kế toán trưởng
            if (ClientCommon.HasAuthority(UserInfo.UserRole, BSRole.KeToanTruong))
            {
                return;
            }

            if (selected.CreateUser.ToUpper() != UserInfo.UserID.ToUpper())
            {
                AccountDetail_GridView.UnselectRow(rowIndex);
            }
        }
Beispiel #4
0
 private void SetEnableScreen()
 {
     if (!ClientCommon.HasAuthority(UserInfo.UserRole, BSRole.QuanLyBSG))
     {
         AddNew_Button.Enabled = false;
         Delete_Button.Enabled = false;
     }
 }
 private void CheckAuthorization()
 {
     if (!ClientCommon.HasAuthority(UserInfo.UserRole, BSRole.Write))
     {
         Button_Panel.Enabled = false;
         this.Customer_GroupControl.CustomHeaderButtons[0].CastTo <GroupBoxButton>().Enabled = false;
         Customer_GridView.OptionsBehavior.Editable       = false;
         Customer_GridView.OptionsView.NewItemRowPosition = NewItemRowPosition.None;
     }
 }
Beispiel #6
0
 private void SetAuthority()
 {
     if (!ClientCommon.HasAuthority(UserInfo.UserRole, BSRole.QuanLyBSG))
     {
         UserList_Button.Visible    = false;
         BookClosing_Button.Visible = false;
         SapXepCT_accordionControlElement.Visible  = false;
         SapXepKho_accordionControlElement.Visible = false;
     }
 }
Beispiel #7
0
        private void Account_TreeList_RowClick(object sender, DevExpress.XtraTreeList.RowClickEventArgs e)
        {
            if (e.Button == MouseButtons.Right && ClientCommon.HasAuthority(UserInfo.UserRole, BSRole.QuanLyBSG))
            {
                TreeList        tl      = (TreeList)sender;
                TreeListHitInfo hitInfo = tl.CalcHitInfo(e.Location);
                if (hitInfo.Node != null)
                {
                    tl.FocusedNode = hitInfo.Node;
                }

                Point point = Cursor.Position;
                popupMenu.ShowPopup(point);
            }
        }
Beispiel #8
0
        private void LoadDataGridView()
        {
            using (CompanyController controller = new CompanyController())
            {
                List <CM_Company> companys = controller.GetCompanys();
                if (ClientCommon.HasAuthority(UserInfo.UserRole, BSRole.QuanLyBSG))
                {
                    // full
                }
                else
                {
                    companys = companys.Where(o => IsExist(o.CompanyID)).ToList();
                }

                CompanyData = new BindingList <CM_Company>(companys);
                Company_GridControl.DataSource = CompanyData;
            }
        }
        private void SetEnable()
        {
            if (Mode == ScreenMode.Add)
            {
                AddNew_Button.Visible = true;
                Update_Button.Visible = false;

                AddNew_Button.Location = Update_Button.Location;
            }
            else
            {
                AddNew_Button.Visible = false;
                Update_Button.Visible = true;
            }

            if (!ClientCommon.HasAuthority(UserInfo.UserRole, BSRole.KeToanTruong))
            {
                AddNew_Button.Enabled = false;
                Update_Button.Enabled = false;
            }
        }
        public ItemList()
        {
            InitializeComponent();

            LoadGrid();

            if (!ClientCommon.HasAuthority(UserInfo.UserRole, BSRole.KeToanTruong))
            {
                ItemType_Button_Panel.Enabled = false;
                this.ItemType_GroupControl.CustomHeaderButtons[0].CastTo <GroupBoxButton>().Enabled = false;
                ItemType_GridView.OptionsBehavior.Editable       = false;
                ItemType_GridView.OptionsView.NewItemRowPosition = NewItemRowPosition.None;

                ItemUnit_Button_Panel.Enabled = false;
                this.ItemUnit_GroupControl.CustomHeaderButtons[0].CastTo <GroupBoxButton>().Enabled = false;
                ItemUnit_GridView.OptionsBehavior.Editable       = false;
                ItemUnit_GridView.OptionsView.NewItemRowPosition = NewItemRowPosition.None;

                Items_Button_Panel.Enabled = false;
                this.Items_GroupControl.CustomHeaderButtons[0].CastTo <GroupBoxButton>().Enabled = false;
                Items_GridView.OptionsBehavior.Editable = false;
            }
        }
Beispiel #11
0
        private void AccountDetail_GridView_ShowingEditor(object sender, CancelEventArgs e)
        {
            int  rowIndex = AccountDetail_GridView.FocusedRowHandle;
            var  selected = AccountDetail_GridView.GetFocusedRow().CastTo <AccountDetail>();
            bool isNewRow = AccountDetail_GridView.IsNewItemRow(rowIndex);

            // Dòng thêm mới
            if (isNewRow || selected.Status == ModifyMode.Insert)
            {
                return;
            }

            // Có quyền kế toán trưởng
            if (ClientCommon.HasAuthority(UserInfo.UserRole, BSRole.KeToanTruong))
            {
                return;
            }

            if (selected.CreateUser.ToUpper() != UserInfo.UserID.ToUpper())
            {
                e.Cancel = true;
            }
        }