private void BindData() { DataTable dtRoles = new d.RoleData().GetAllRolesByUser(getUserId()); cblRoles.DataSource = dtRoles; cblRoles.DataTextField = "Name"; cblRoles.DataValueField = "Id"; cblRoles.DataCheckField = "Selected"; cblRoles.DataBind(); }
protected override int SaveItem() { int roleId = new d.RoleData().Create(tbxRole.Text.Trim(), Identity.UserId); if (roleId < 0) { valUnique.IsValid = false; return(0); } return(1); }
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() { DataTable dtRoles = new d.RoleData().GetRecords(dgrRoles.SortExpression); if (dtRoles.Rows.Count > 0) { pnlGrid.Visible = true; dgrRoles.Prefix = LinkPrefix; dgrRoles.DataSource = dtRoles; dgrRoles.DataBind(); } else { pnlGrid.Visible = false; } }