public ActionResult EditUser(UserEditModel user) { if (ModelState.IsValid) { MembershipUser msuser = Membership.GetUser(user.UserName); AuthenticationsAndAuthorizationsOperations authenNAuthorOps = new AuthenticationsAndAuthorizationsOperations(); if (user.IsLockedOut) { authenNAuthorOps.InsertLockMembershipUserByUserName(user.UserName); } else { msuser.UnlockUser(); } msuser.IsApproved = user.IsApproved; msuser.Email = user.Email; msuser.Comment = user.Comment; authenNAuthorOps.InsertExpiryDate(user.UserName, Convert.ToDateTime(user.ExpiredDate)); authenNAuthorOps.InsertMobileAliasByUserName(user.UserName, user.PhoneAlias); authenNAuthorOps.InsertMobilePINByUserName(user.UserName, user.PhonePIN); Membership.UpdateUser(msuser); TempData["EditUserUpdateSuccess"] = "Update User (" + user.UserName + ") successfully."; } return(View(user)); }