示例#1
0
        private void createProfileForUser(string email)
        {
            Applicant newUser = ApplicationBLL.GetByEmail(email);

            if (newUser == null)
            {
                Response.Redirect(RecruitmentConfiguration.ErrorPage(RecruitmentConfiguration.ErrorType.AUTH));
                return;
            }

            //Create a blank profile for the logged in user
            Profile blankProfile = new Profile();

            blankProfile.AssociatedApplicant = newUser;

            blankProfile.FirstName = string.Empty;
            blankProfile.LastName  = string.Empty;
            blankProfile.Address1  = string.Empty;
            blankProfile.City      = string.Empty;
            blankProfile.State     = string.Empty;

            blankProfile.LastUpdated = null;

            using (var ts = new TransactionScope())
            {
                ProfileBLL.EnsurePersistent(blankProfile);

                ts.CommitTransaction();
            }
        }