コード例 #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;
            }
        }
コード例 #2
0
 public DataSet SelectByRolesId(Right right)
 {
     Database db = DatabaseFactory.CreateDatabase(Constant.DiaryDBConnectionString);
     DbCommand dbCommand = db.GetStoredProcCommand("usp_RightSelectByRoleId");
     db.AddInParameter(dbCommand, "@RoleId", DbType.Guid, right.RoleId);
     return db.ExecuteDataSet(dbCommand);
 }
コード例 #3
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)
            {

            }
        }