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


C# UserService.Update方法代码示例

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


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

示例1: Submit_Click

        /// <summary>
        /// Handles the Click event of the Submit control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
        protected void Submit_Click(object sender, EventArgs e)
        {
            if (!IsValid)
            {
                return;
            }

            //store new user information to database
            UserService service = new UserService();
            User user = service.GetByID(UserID);
            ProfileControl1.FillUser(user);
            service.Update(user);
        }
开发者ID:jrummell,项目名称:projmgt-net,代码行数:18,代码来源:EditUser.aspx.cs

示例2: SubmitButton_Click

        /// <summary>
        /// Handles the Click event of the SubmitButton control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
        protected void SubmitButton_Click(object sender, EventArgs e)
        {
            StatusLabel.Visible = false;
            if (!Page.IsValid)
            {
                return;
            }

            ProfileControl1.FillUser(Global.LoggedInUser);

            UserService service = new UserService();
            service.Update(Global.LoggedInUser);

            StatusLabel.Text = "Your profile has been updated.";
            StatusLabel.Visible = true;
        }
开发者ID:jrummell,项目名称:projmgt-net,代码行数:21,代码来源:Profile.aspx.cs

示例3: Update

        public override void Update()
        {
            UserService target = new UserService();
            User user = (User) CreateRecord();
            Insert(user);

            user.LastName = "updated last name";
            target.Update(user);

            User updated = target.GetByID(user.ID);
            Assert.AreEqual(user.LastName, updated.LastName);
        }
开发者ID:jrummell,项目名称:projmgt-net,代码行数:12,代码来源:UserServiceTests.cs

示例4: Edit

        public ActionResult Edit(int id, EditUserModel model)
        {
            try
            {

                if (ModelState.IsValid)
                {
                    User user = new User()
                    {
                        UserID = model.UserID,
                        UserName = model.Username,
                        Password = model.Password,
                        Email = model.Email,
                        Description = model.Description,
                        FullName = model.Fullname,
                        Occupation = model.Occupation,
                        Address = model.Address,
                        Industry = model.Industry,
                        AnualIcome = model.AnualIncome,
                        BirthYear = model.BirthYear,
                        UserTypeID = model.UserTypeId,
                        PhoneNumber1 = model.Phone1,
                        PhoneNumber2 = model.Phone2,
                        PhoneNumber3 = model.Phone3,
                        //CreatedUserID = SessionManager.UserInfo.UserID,
                        UpdatedUserID = SessionManager.UserInfo.UserID,
                        GroupID = model.GroupID,
                    };
                    if (model.PartnerId > .0)
                    {
                        user.PartnerId = model.PartnerId;
                    }
                    UserService service = new UserService();
                    service.Update(user);
                    return RedirectToAction("Index");
                }
                // TODO: Add update logic here

            }
            catch (Exception ex)
            {
                Logger.Log(ex);
                ModelState.AddModelError("Error500", ex.Message);
            }
            return View(model);
        }
开发者ID:samuraitruong,项目名称:gmr,代码行数:46,代码来源:UserController.cs


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