示例#1
0
 public bool UpdateUser(User u)
 {
     User user = GetUser(u.NickName);
     user.Name = u.Name;
     user.Email = u.Email;
     return true;
 }
示例#2
0
 //Remove um user
 public bool DeleteUser(User u)
 {
     if (!_users.ContainsKey(u.NickName)) return false;
     _users.Remove(u.NickName);
     userBoards.Remove(u.NickName);
     userVisBoard.Remove(u.NickName);
     userEditBoard.Remove(u.NickName);
     RemoveEdit(u.NickName);
     RemoveVis(u.NickName);
     return true;
 }
示例#3
0
 public ActionResult EditProfile(string userId, User u)
 {
     u.NickName = User.Identity.Name;
     _userRepo.UpdateUser(u);
     return RedirectToAction("Profile");
 }
示例#4
0
 //Adiciona um user novo
 public bool CreateUser(User u)
 {
     if (!_users.ContainsKey(u.NickName))
     {
         _users.Add(u.NickName, u);
         userBoards.Add(u.NickName, new LinkedList<int>());
         userVisBoard.Add(u.NickName, new LinkedList<Pair>());
         userEditBoard.Add(u.NickName, new LinkedList<Pair>());
         letSee.Add(u.NickName, new Dictionary<string, LinkedList<int>>());
         letEdit.Add(u.NickName, new Dictionary<string, LinkedList<int>>());
         return true;
     }
     return false;
 }
示例#5
0
 public override MembershipUser CreateUser(string username, string password, string email, string passwordQuestion, string passwordAnswer, bool isApproved, object providerUserKey, out MembershipCreateStatus status)
 {
     User pendentUser = new User
     {
         NickName = username,
         Password = password,
         Email = email,
         Role = "guest"
     };
     if (_userRepo.CreateUser(pendentUser))
     {
         status = MembershipCreateStatus.Success;
     }
     else
     {
         status = MembershipCreateStatus.DuplicateUserName;
     }
     return pendentUser;
 }