Пример #1
0
        /// <summary>
        /// Saves user details provided while signup
        /// </summary>
        public void SaveUserDetails(AspNetUser addedUser, RegisterViewModel model)
        {
            UserDetail user = userDetailsRepository.Create();

            user.UserId = addedUser.Id;
            userDetailsRepository.Add(user);
            userDetailsRepository.SaveChanges();
        }
Пример #2
0
        public IHttpActionResult Post(string eventId, [FromBodyAttribute] UserDetailViewModel userDetail)
        {
            var ud = _userDetailsRepository.Get(eventId, userDetail.Email);

            if (ud != null)
            {
                return(Conflict());
            }

            _userDetailsRepository.Add(eventId, userDetail);
            return(Created <UserDetailViewModel>(Request.RequestUri + "/" + HttpUtility.UrlEncode(userDetail.Email.ToLower()) + "/", userDetail));
        }
Пример #3
0
        /// <summary>
        /// Saves user details provided while signup
        /// </summary>
        public void SaveUserDetails(AspNetUser addedUser, RegisterViewModel model)
        {
            UserDetail user = userDetailsRepository.Create();

            user.AccountType     = model.AccountType;
            user.Address         = model.CompanyAddress;
            user.CompanyName     = model.CompanyName;
            user.CountryName     = model.CountryName;
            user.CompanyShortUrl = model.ShortUrl;
            user.UserId          = addedUser.Id;
            userDetailsRepository.Add(user);
            userDetailsRepository.SaveChanges();
        }
        public bool RegisterUser(UserRegistration user)
        {
            var userDetails  = new UserDetails();
            var existingUser = UserDetailsRepository.GetAll().FirstOrDefault(p => p.Email == user.Email);

            if (existingUser != null)
            {
                return(false);
            }
            PopulateUserDetails(userDetails, user);
            UserDetailsRepository.Add(userDetails);
            UnitOfWork.Commit();
            var loginDetails = new LoginDetails()
            {
                MemberId = userDetails.MemberId
            };

            PopulateLoginDetails(loginDetails, user);
            LoginDetailsRepository.Add(loginDetails);
            this.UnitOfWork.Commit();
            return(true);
        }