protected override void OnInit(EventArgs e) { roleId = getRoleId(); catId = getCatId(); permissionData = new cc.PermissionData(); roleData = new d.RoleData(); arrExistingPermIds = roleData.GetPermissions(roleId); this.rptTopCats.ItemDataBound += new RepeaterItemEventHandler(rptTopCats_ItemDataBound); this.rptCats.ItemDataBound += new RepeaterItemEventHandler(rptCats_ItemDataBound); this.btnSave.Click += new EventHandler(btnSave_Click); this.btnCancel.Click += new EventHandler(btnCancel_Click); base.OnInit(e); }
private void BindData() { arrExistingPermIds = roleData.GetPermissions(roleId); //must reload rptTopCats.DataSource = permissionData.TopCategories; rptTopCats.DataBind(); if (catId > 0) { d.Role role = new d.Role(roleId); cc.PermissionCategory cat = permissionData.GetCategory(catId); pnlPermissions.Visible = true; ltrPermissionTitle.Text = "Select <b>" + cat.Name + "</b> permissions for the <b>" + role.Name + "</b> role:"; rptCats.DataSource = permissionData.GetCategories(catId); rptCats.DataBind(); } else { pnlPermissions.Visible = false; } }