Exemplo n.º 1
0
        private void sgdmPermission_CellClick(object sender, GridCellClickEventArgs e)
        {
            if (nsd.IsAdmin)
            {
                int numberPermis = 0x0000;

                if (e.GridCell.GridRow["ID"].Value.ToString() != null)
                {
                    if (e.GridCell.GridRow["Xem"].Value.Equals(true))
                    {
                        numberPermis |= 0x0001;
                    }
                    if (e.GridCell.GridRow["ThemMoi"].Value.Equals(true))
                    {
                        numberPermis |= 0x0002;
                    }
                    if (e.GridCell.GridRow["Sua"].Value.Equals(true))
                    {
                        numberPermis |= 0x0004;
                    }
                    if (e.GridCell.GridRow["Xoa"].Value.Equals(true))
                    {
                        numberPermis |= 0x0008;
                    }
                }
                PhanQuyen pquyen = new PhanQuyen();
                int       idFun  = Convert.ToInt32(e.GridCell.GridRow["ID"].Value.ToString());
                userDB.EditPermissionForUser(infoUserNow.UserName, idFun, numberPermis);
            }
            else
            {
                MessageBox.Show("Bạn không có quyền trong chức năng phân quyền!");
            }
        }