当前位置: 首页>>代码示例>>C#>>正文


C# UserService.AssignRoles方法代码示例

本文整理汇总了C#中UserService.AssignRoles方法的典型用法代码示例。如果您正苦于以下问题:C# UserService.AssignRoles方法的具体用法?C# UserService.AssignRoles怎么用?C# UserService.AssignRoles使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在UserService的用法示例。


在下文中一共展示了UserService.AssignRoles方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: OnGUI


//.........这里部分代码省略.........
        if (GUI.Button (new Rect (470, 250, 200, 30), "Lock User")) {
            userService = sp.BuildUserService (); // Initializing UserService.
            userService.LockUser (cons.userName, callBack);
        }

        //===================================###################=========================================
        if (GUI.Button (new Rect (680, 250, 200, 30), "Unlock User")) {
            userService = sp.BuildUserService (); // Initializing UserService.
            userService.UnlockUser (cons.userName, callBack);
        }

        //===================================###################=========================================
        if (GUI.Button (new Rect (890, 250, 200, 30), "Get LockedUsers")) {
            userService = sp.BuildUserService (); // Initializing UserService.
            userService.GetLockedUsers (callBack);
        }

        //===================================###################=========================================
        if (GUI.Button (new Rect (50, 300, 200, 30), "GetAllUsersByPaging")) {
            userService = sp.BuildUserService (); // Initializing UserService.
            userService.GetAllUsers (max, offSet, callBack);
        }

        //===================================###################=========================================
        if (GUI.Button (new Rect (260, 300, 200, 30), "GetAllUsersCount")) {
            userService = sp.BuildUserService (); // Initializing UserService.
            userService.GetAllUsersCount (callBack);
        }

        //===================================###################=========================================
        if (GUI.Button (new Rect (680, 300, 200, 30), "ResetUserPassword")) {
            userService = sp.BuildUserService (); // Initializing UserService.
            userService.ResetUserPassword (cons.userName, callBack);
        }

        //===================================###################=========================================
        if (GUI.Button (new Rect (890, 300, 200, 30), "Log out")) {
            userService = sp.BuildUserService (); // Initializing UserService.
            userService.Logout (cons.sessionId, callBack);
        }

        //===================================###################=========================================
        if (GUI.Button (new Rect (50, 350, 200, 30), "GetLockedUsersCount")) {
            userService = sp.BuildUserService (); // Initializing UserService.
            userService.GetLockedUsersCount (callBack);
        }

        //===================================###################=========================================
        if (GUI.Button (new Rect (260, 350, 200, 30), "GetUserByEmailId")) {
            userService = sp.BuildUserService (); // Initializing UserService.
            userService.GetUserByEmailId (cons.updateEmailId, callBack);
        }

        //===================================###################=========================================
        if (GUI.Button (new Rect (470, 350, 200, 30), "GetLockedUsersByPaging")) {
            userService = sp.BuildUserService (); // Initializing UserService.
            userService.GetLockedUsers (max, offSet, callBack);
        }

        //===================================###################=========================================
        if (GUI.Button (new Rect (680, 350, 200, 30), "CreateOrUpdateProfile")) {
            userService = sp.BuildUserService (); // Initializing UserService.

            User.Profile profileObj = new User.Profile (createUserObj);
            profileObj.SetCountry ("India");
            profileObj.SetCity ("GGN");
            profileObj.SetFirstName ("Akshay");
            profileObj.SetLastName ("Mishra");
            profileObj.SetHomeLandLine ("1234567890");
            profileObj.SetMobile ("12345678900987654321");
            profileObj.SetOfficeLandLine ("0987654321");
            profileObj.SetSex (UserGender.MALE);
            profileObj.SetState ("UP");

            userService.CreateOrUpdateProfile (createUserObj, callBack);
        }

        //===================================###################=========================================
        if (GUI.Button (new Rect (890, 350, 200, 30), "CreateUserWithRole")) {
            userService = sp.BuildUserService (); // Initializing UserService.

            IList<string> roleList = new List<string> ();
            roleList.Add ("Admin");
            roleList.Add ("Manager");
            roleList.Add ("Programmer");
            roleList.Add ("Tester");
            userService.CreateUser (cons.userName, password, cons.emailId, roleList, callBack);
        }

        //===================================###################=========================================
        if (GUI.Button (new Rect (50, 400, 200, 30), "AssignRoles")) {
            userService = sp.BuildUserService (); // Initializing UserService.

            IList<string> roleList = new List<string> ();
            roleList.Add ("Designer");
            roleList.Add ("Architect");

            userService.AssignRoles (cons.userName, roleList, callBack);
        }
    }
开发者ID:redstompstudio,项目名称:2015_Runner2D_Advergame,代码行数:101,代码来源:UserTest.cs


注:本文中的UserService.AssignRoles方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。