Ejemplo n.º 1
0
        public UserModel UpdateUser(UserModel model)
        {
            model.Id = 0;
            ChangePicture(model.PictureToUpdate);
            User user = Mapper.Map<User>(model);

            return null;
            //return Mapper.Map<UserModel>(DataAccess.UpdateUserData(user));
        }
Ejemplo n.º 2
0
        public ActionResult Registration(UserModel model)
        {
            if (!ModelState.IsValid)
                return View();

            var convertedUser = Mapper.Map<User>(model);

            if (!UserService.RegistrateUser(convertedUser))
                return RedirectToAction("Error", "Account", new { errorCase = ErrorCase.DuplicateEmail });

            UserContext.CurrentUserId = convertedUser.Id;

            return RedirectToAction("Courses", "Study");
        }