Exemplo n.º 1
0
        protected void LoadRights()
        {
            try
            {
                Right RightsObj = new Right();

                if (this.hdnRoleId.Value != string.Empty)
                {
                    RightsObj.RoleId = new Guid(this.hdnRoleId.Value);
                }

                gvRights.DataSource = RightsObj.SelectByRolesId();
                gvRights.DataBind();

                if (this.hdnRoleId.Value != string.Empty)
                {

                    for (int i = 0; i <= gvRights.VisibleRowCount - 1; i++)
                    {
                        if (gvRights.GetRowValues(i, "RoleId").ToString() != string.Empty)
                        {
                            gvRights.Selection.SelectRow(i);
                        }
                    }

                }

            }
            catch (System.Exception ex)
            {
                throw ex;
            }
        }
Exemplo n.º 2
0
        protected void DisplayData()
        {
            try
            {

                Guid currentRoleId = new Guid(this.hdnRoleId.Value);
                Role RolesObj = new Role();
                RolesObj.RoleId = currentRoleId;
                RolesObj = RolesObj.Select();
                this.txtRoleName.Text = RolesObj.RoleName;
                this.txtRoleDescription.Text = RolesObj.RoleDescription;

                Right RightsObj = new Right();
                RightsObj.RoleId = RolesObj.RoleId.Value;
                gvRights.DataSource = RightsObj.SelectByRolesId();
                gvRights.DataBind();

            }
            catch (System.Exception)
            {

            }
        }