예제 #1
0
        public async Task <IActionResult> Detail(string slug, string error, string serviceProcessed)
        {
            var response = await _repository.Get <ServicePayPayment>(slug);

            if (!response.IsSuccessful())
            {
                return(response);
            }

            var payment = response.Content as ProcessedServicePayPayment;

            var paymentSubmission = new ServicePayPaymentSubmissionViewModel
            {
                Payment = payment
            };

            if (!string.IsNullOrEmpty(payment?.PaymentAmount))
            {
                paymentSubmission.Amount = payment.PaymentAmount;
            }

            if (!string.IsNullOrEmpty(error) && !string.IsNullOrEmpty(serviceProcessed) && serviceProcessed.ToUpper().Equals("FALSE"))
            {
                ModelState.AddModelError(nameof(ServicePayPaymentSubmissionViewModel.Reference), error);
                ModelState.AddModelError(nameof(ServicePayPaymentSubmissionViewModel.EmailAddress), error);
                ModelState.AddModelError(nameof(ServicePayPaymentSubmissionViewModel.Name), error);
                ModelState.AddModelError(nameof(ServicePayPaymentSubmissionViewModel.Amount), error);
            }

            return(View(paymentSubmission));
        }
예제 #2
0
        public async Task <IActionResult> Detail(string slug, [FromQuery] DateTime?date = null)
        {
            var queries = new List <Query>();

            if (date.HasValue)
            {
                queries.Add(new Query("date", date.Value.ToString("yyyy-MM-dd")));
            }

            var httpResponse = await _processedContentRepository.Get <Event>(slug, queries);

            if (!httpResponse.IsSuccessful())
            {
                return(httpResponse);
            }

            var response = httpResponse.Content as ProcessedEvents;

            ViewBag.CurrentUrl = Request?.GetUri();

            if (date != null || date == DateTime.MinValue)
            {
                ViewBag.Eventdate = date.Value.ToString("yyyy-MM-dd");
            }
            else
            {
                ViewBag.Eventdate = response?.EventDate.ToString("yyyy-MM-dd");
            }


            return(View(response));
        }
        public async Task <IActionResult> Index(string slug)
        {
            var response = await _processedContentRepository.Get <StartPage>(slug);

            if (!response.IsSuccessful())
            {
                return(response);
            }

            var startPage = response.Content as ProcessedStartPage;

            return(View(startPage));
        }
예제 #4
0
        public async Task <IActionResult> Showcase(string slug)
        {
            var response = await _repository.Get <Showcase>(slug);

            if (!response.IsSuccessful())
            {
                return(response);
            }

            var showcase = response.Content as ProcessedShowcase;

            return(View("Showcase", showcase));
        }
        public async Task <IActionResult> Detail(string slug)
        {
            var result = await _repository.Get <PrivacyNotice>(slug);

            if (!result.IsSuccessful())
            {
                return(result);
            }

            var viewModel = new PrivacyNoticeViewModel(result.Content as ProcessedPrivacyNotice);

            return(View(viewModel));
        }
예제 #6
0
        public async Task <IActionResult> Detail(string slug, string error, string serviceprocessed)
        {
            var response = await _repository.Get <Payment>(slug);

            if (!response.IsSuccessful())
            {
                return(response);
            }

            var payment = response.Content as ProcessedPayment;

            var paymentSubmission = new PaymentSubmission
            {
                Payment = payment
            };

            if (!string.IsNullOrEmpty(error) && !string.IsNullOrEmpty(serviceprocessed) && serviceprocessed.ToUpper().Equals("FALSE"))
            {
                ModelState.AddModelError(nameof(PaymentSubmission.Reference), error);
            }

            return(View(paymentSubmission));
        }
        public async Task <IActionResult> Detail(string slug)
        {
            var response = await _repository.Get <Organisation>(slug);

            if (!response.IsSuccessful())
            {
                return(response);
            }

            var organisation = response.Content as ProcessedOrganisation;

            ViewBag.CurrentUrl = Request?.GetUri();

            return(View(organisation));
        }
예제 #8
0
        public async Task <IActionResult> Detail(string slug)
        {
            HttpResponse initialResponse = await _processedContentRepository.Get <News>(slug);

            IActionResult finalResult = (IActionResult)initialResponse;

            if (initialResponse.IsSuccessful())
            {
                var response = initialResponse.Content as ProcessedNews;

                var latestNewsResponse = await _repository.GetLatest <List <News> >(7);

                var latestNews    = latestNewsResponse.Content as List <News>;
                var newsViewModel = new NewsViewModel(response, latestNews);

                ViewBag.CurrentUrl = Request?.GetUri();

                finalResult = View(newsViewModel);
            }

            return(finalResult);
        }
        public async Task <IActionResult> Index()
        {
            if (_featureToggles.ContactUsArea)
            {
                _logger.LogInformation("Contact Us Area: Getting Content from Repository");
                var contactUsAreaHttpResponse = await _repository.Get <ContactUsArea>();

                _logger.LogInformation($"Contact Us Area: Response from Repository: {contactUsAreaHttpResponse.StatusCode}");
                if (!contactUsAreaHttpResponse.IsSuccessful())
                {
                    return(contactUsAreaHttpResponse);
                }

                _logger.LogInformation("Contact Us Area: Processing Repository content");
                var contactUsArea = contactUsAreaHttpResponse.Content as ProcessedContactUsArea;
                _logger.LogInformation($"Contact Us Area: Returning processed content to view");

                return(View(contactUsArea));
            }

            _logger.LogInformation("Contact us area, feature toggle false, returning Not Found");
            return(NotFound());
        }
예제 #10
0
        public async Task <ProcessedGroupHomepage> GetGroupHomepage()
        {
            var response = await _processedContentRepository.Get <GroupHomepage>();

            return(response.Content as ProcessedGroupHomepage);
        }