Пример #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));
        }