Example #1
0
        public ActionResult ConfirmFriend(UserViewModel friend)
        {
            var userId = User.Identity.GetUserId();
            _userService.ConfirmFriend(userId, friend.Id);

            return Json(null);
        }
Example #2
0
 public static ApplicationUser ToApplicationUser(UserViewModel user)
 {
     Mapper.CreateMap<UserViewModel, ApplicationUser>();
     return Mapper.Map<UserViewModel, ApplicationUser>(user);
 }
 public ActionResult RemoveUserFromConversation(UserViewModel user, string conversationId)
 {
     _conversationService.RemoveUserFromConversation(user.Id, conversationId);
     return new EmptyResult();
 }
Example #4
0
        private void UpdateUserSong(UserViewModel user)
        {
            if (user != null)
            {
                if (user.IsOnline == false)
                {
                    user.SongAtThisMoment = string.Empty;
                    user.CurrentSong = null;
                }

                var song = _musicRepository.GetSong(user.SongAtThisMoment);
                if (song != null)
                {
                    user.CurrentSong = ModelConverters.ToSongViewModel(song);
                }

            }
        }
Example #5
0
 public void UpdateUser(UserViewModel userInfo)
 {
     var user = ModelConverters.ToApplicationUser(userInfo);
     _userRepository.UpdateUser(user);
 }
Example #6
0
 public JsonResult UpdateUser(UserViewModel userInfo)
 {
     _userService.UpdateUser(userInfo);
     return Json(new { Succes = true }, JsonRequestBehavior.AllowGet);
 }