public void CreateRoleTest() { Roles roles = new Roles(Utils.DbContext); roles.CreateRole("Registered Users", "Basic Role"); roles.CreateRole("Subscribers", "Web Subscribers "); roles.CreateRole("Administrators", "Super Users"); }
public void AddUsersToRolesTest() { int roleid = 3; int userid = 1; int portalID = 1; Roles roles = new Roles(Utils.DbContext); roles.AddUsersToRoles(roleid, userid, portalID); }
protected void btAdd_Click(object sender, EventArgs e) { String id = tbRoleKey.Text; String strRoleName = tbRoleName.Text; String strRoleRemark = tbRoleRemark.Text; Roles role = new Roles(); role.Key = Convert.ToInt32(id); role.Name = strRoleName; role.Remark = strRoleRemark; if (BLL.admin.role.RoleManagement.createRole(role)) { lbMessage.Text = "创建角色成功!"; } databind(); }
public void AddAdminUserToRole() { Roles roles = new Roles(Utils.DbContext); roles.AddUsersToRoles(3, 1, 1); }