Exemplo n.º 1
0
 /// <summary>
 /// UpdateInfo
 /// </summary>
 /// <param name="m"></param>
 /// <returns></returns>
 public Status UpdateInfo(UserInfos m)
 {
     if (AppUser == null)
     {
         return(Status.TokenExpired);
     }
     if (m.Name != null)
     {
         AppUser.Name = m.Name;
     }
     if (m.Phone != null)
     {
         AppUser.Phone = m.Phone;
     }
     if (m.Email != null)
     {
         AppUser.Email = m.Email;
     }
     if (m.WhutId != null)
     {
         AppUser.WhutId = m.WhutId;
     }
     if (m.WhutPwd != null)
     {
         AppUser.WhutPwd = m.WhutPwd;
     }
     _db.Update(AppUser);
     return(Status.Ok);
 }
Exemplo n.º 2
0
        public ActionResult ConfirmEmail(string id)
        {
            if (string.IsNullOrEmpty(id))
            {
                return(RedirectToAction("Index", "Home"));
            }

            string userId = Encoding.Unicode.GetString(Convert.FromBase64String(id));
            var    user   = _userDbContext.GetById(int.Parse(userId));

            if (user == null)
            {
                return(RedirectToAction("Index", "Home"));
            }
            user.IsActive = true;
            _userDbContext.Update(user);

            return(RedirectToAction("Index", "Home"));
        }