Esempio n. 1
0
 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");
 }
Esempio n. 2
0
 public void AddUsersToRolesTest()
 {
     int roleid = 3;
     int userid = 1;
     int portalID = 1;
     Roles roles = new Roles(Utils.DbContext);
     roles.AddUsersToRoles(roleid, userid, portalID);
 }
Esempio n. 3
0
        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();
        }
Esempio n. 4
0
 public void AddAdminUserToRole()
 {
     Roles roles = new Roles(Utils.DbContext);
     roles.AddUsersToRoles(3, 1, 1);
 }