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


C# UserService.UpdateUser方法代码示例

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


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

示例1: PassTheUser

 public string PassTheUser(string userId, int userGroupId)
 {            
     UserService userservice = new UserService();
     User user = userservice.FindById(userId);
     user.ApproveStatus = EnumUserApproveStatus.Approved;
     user.AuthorityCategory = EnumUserCategory.Membership;
     user.ContentGroupId = userGroupId;
     userservice.UpdateUser(user);
     return "success";
 }
开发者ID:hiyouth,项目名称:R2.RRDL,代码行数:10,代码来源:UserVerifyController.cs

示例2: UserModule

        /// <summary>
        /// Sets up HTTP methods mappings.
        /// </summary>
        /// <param name="service">Service handling requests</param>
        public UserModule(UserService service)
            : base("/v2")
        {
            Post["/user"] = parameters =>
            {
                var body = this.Bind<User>();
                service.CreateUser(Context, body);
                return new Response { ContentType = "application/json"};
            };

            Post["/user/createWithArray"] = parameters =>
            {
                var body = this.Bind<List<User>>();
                service.CreateUsersWithArrayInput(Context, body);
                return new Response { ContentType = "application/json"};
            };

            Post["/user/createWithList"] = parameters =>
            {
                var body = this.Bind<List<User>>();
                service.CreateUsersWithListInput(Context, body);
                return new Response { ContentType = "application/json"};
            };

            Delete["/user/{username}"] = parameters =>
            {
                var username = Parameters.ValueOf<string>(parameters, Context.Request, "username", ParameterType.Path);
                Preconditions.IsNotNull(username, "Required parameter: 'username' is missing at 'DeleteUser'");

                service.DeleteUser(Context, username);
                return new Response { ContentType = "application/json"};
            };

            Get["/user/{username}"] = parameters =>
            {
                var username = Parameters.ValueOf<string>(parameters, Context.Request, "username", ParameterType.Path);
                Preconditions.IsNotNull(username, "Required parameter: 'username' is missing at 'GetUserByName'");

                return service.GetUserByName(Context, username);
            };

            Get["/user/login"] = parameters =>
            {
                var username = Parameters.ValueOf<string>(parameters, Context.Request, "username", ParameterType.Query);
                var password = Parameters.ValueOf<string>(parameters, Context.Request, "password", ParameterType.Query);
                return service.LoginUser(Context, username, password);
            };

            Get["/user/logout"] = parameters =>
            {

                service.LogoutUser(Context);
                return new Response { ContentType = "application/json"};
            };

            Put["/user/{username}"] = parameters =>
            {
                var username = Parameters.ValueOf<string>(parameters, Context.Request, "username", ParameterType.Path);
                var body = this.Bind<User>();
                Preconditions.IsNotNull(username, "Required parameter: 'username' is missing at 'UpdateUser'");

                service.UpdateUser(Context, username, body);
                return new Response { ContentType = "application/json"};
            };
        }
开发者ID:chameleon82,项目名称:swagger-codegen,代码行数:69,代码来源:UserModule.cs

示例3: UpdateUser

 //传入用户名和密码,更新用户密码
 public string UpdateUser(string userId, string password)
 {
     string id = userId;
     UserService uservice = new UserService();
     User user = uservice.FindById(id);
     user.Password = password;
     uservice.UpdateUser(user);
     return "success";
 }
开发者ID:hiyouth,项目名称:R2.RRDL,代码行数:10,代码来源:PersonalCenterController.cs

示例4: ModifyMemberAttrs

 //传入新的用户属性,将后台用户属性更改成传入的内容
 public string ModifyMemberAttrs(string userId, string userGroupId, string userAuthorityCategory)
 {
     UserService userservice = new UserService();
     User user = userservice.FindById(userId);
     user.ApproveStatus = EnumUserApproveStatus.Approved;
     user.AuthorityCategory = (EnumUserCategory)Convert.ToInt32(userAuthorityCategory);
     user.ContentGroupId = Convert.ToInt32(userGroupId);
     userservice.UpdateUser(user);
     return "success";           
 }
开发者ID:hiyouth,项目名称:R2.RRDL,代码行数:11,代码来源:MemberManageController.cs

示例5: WhenValidatingUserWithUnformattedPhoneNumberWithHyphensValidUserIsFound

        public void WhenValidatingUserWithUnformattedPhoneNumberWithHyphensValidUserIsFound()
        {
            _userService = new UserService(_ctx);

            var mobileNumber = "804-387-9693";
            var emailAddress = "[email protected]";

            var user = _userService.AddUser(Guid.NewGuid(), emailAddress, "james123", emailAddress, "");
            user.MobileNumber = mobileNumber;

            _userService.UpdateUser(user);

            Domain.User foundUser;
            _userService.ValidateUser("8043879693", "james123", out foundUser);

            Assert.AreEqual(user, foundUser);
        }
开发者ID:SomeHero,项目名称:SocialPayments,代码行数:17,代码来源:UserServicesTest.cs

示例6: WhenFindingUserByUnFormattedMobilieNumberUserWithMobileNumberIsFound

        public void WhenFindingUserByUnFormattedMobilieNumberUserWithMobileNumberIsFound()
        {
            _userService = new UserService(_ctx);

            var mobileNumber = "8043879693";
            var emailAddress = "[email protected]";

            var user = _userService.AddUser(Guid.NewGuid(), emailAddress, "james123", emailAddress, "");
            user.MobileNumber = mobileNumber;

            _userService.UpdateUser(user);

            var foundUser = _userService.FindUserByMobileNumber(mobileNumber);

            Assert.AreEqual(user, foundUser);
        }
开发者ID:SomeHero,项目名称:SocialPayments,代码行数:16,代码来源:UserServicesTest.cs

示例7: WhenFindingUserByIdUserWithIdIsFound

        public void WhenFindingUserByIdUserWithIdIsFound()
        {
            _userService = new UserService(_ctx);

            var mobileNumber = "8043879693";
            var emailAddress = "[email protected]";

            var user = _userService.AddUser(Guid.NewGuid(), emailAddress, "james123", emailAddress, "");
            user.MobileNumber = mobileNumber;

            _userService.UpdateUser(user);

            var foundUser = _userService.GetUserById(user.UserId.ToString());

            Assert.AreEqual(user, foundUser);
        }
开发者ID:SomeHero,项目名称:SocialPayments,代码行数:16,代码来源:UserServicesTest.cs


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