Ejemplo n.º 1
0
        public ActionResult Index(AccountVerificationEditModel model)
        {
            model = model ?? new AccountVerificationEditModel();
            model.CheckoutPhoneNumber = _settings.PhoneTollFree;
            try
            {
                CorporateAccount corporateAccount = null;
                if (!string.IsNullOrWhiteSpace(model.UrlSuffix))
                {
                    corporateAccount = _corporateAccountRepository.GetByUrlSiffix(model.UrlSuffix);
                }
                else if (!string.IsNullOrWhiteSpace(model.InvitationCode))
                {
                    var theEvent = _eventRepository.GetEventByInvitationCode(model.InvitationCode);
                    if (theEvent != null)
                    {
                        corporateAccount = _corporateAccountRepository.GetbyEventId(theEvent.Id);
                    }
                }

                if (corporateAccount != null)
                {
                    model.Content = corporateAccount.Content;
                    model.AllowVerifiedMembersOnly = corporateAccount.AllowVerifiedMembersOnly;
                    model.CheckoutPhoneNumber      = (corporateAccount.CheckoutPhoneNumber != null && !string.IsNullOrWhiteSpace(corporateAccount.CheckoutPhoneNumber.DomesticPhoneNumber)) ? corporateAccount.CheckoutPhoneNumber.FormatPhoneNumber : _settings.PhoneTollFree;
                }
            }
            catch (Exception exception)
            {
                _logger.Error(string.Format("While accessing private\\Index Message: {0} \n Stack Trace: {1} ", exception.Message, exception.StackTrace));
            }

            return(View(model));
        }
Ejemplo n.º 2
0
        public ActionResult AccountMemberVerificationForm(AccountVerificationEditModel model)
        {
            if (!ModelState.IsValid)
            {
                return(PartialView(model));
            }
            var isCustomerVerified = _customerRepository.IsCustomerVerified(model);

            if (isCustomerVerified)
            {
                var customer = _customerRepository.GetCustomer(model.CustomerId);
                model.FirstName     = customer.Name.FirstName;
                model.LastName      = customer.Name.LastName;
                model.DateOfBirth   = customer.DateOfBirth.HasValue ? customer.DateOfBirth.Value : (DateTime?)null;
                model.CustomerEmail = customer.Email.ToString();
                model.MemberId      = customer.InsuranceId;
                model.ZipCode       = customer.Address.ZipCode.Zip;
            }


            model.FeedbackMessage = isCustomerVerified
                ? FeedbackMessageModel.CreateSuccessMessage("Verification Success")
                : FeedbackMessageModel.CreateFailureMessage(string.Format("Unable to verify your information. Please call us as {0} for any queries.", _settings.PhoneTollFree));

            return(PartialView(model));
        }