Exemplo n.º 1
0
        public async Task <ActionResult> Index(Models.ExportViewModel model)
        {
            if (string.IsNullOrEmpty(model?.ExportDefinitionName))
            {
                //return error
            }

            var authClient = await _repository.GetAuthorizedVantagePointClientAsync();

            string requestUri = $"exportutility/exportdefinitions/{model.ExportDefinitionName}";

            var contacts = await _repository.GetAsync(authClient, requestUri);

            var mailchimpmembersTyped = await _repository.GetAsync <List <Models.MailChimpMemberModel> >(authClient, requestUri);

            //remove contacts without email
            mailchimpmembersTyped.RemoveAll(x => string.IsNullOrEmpty(x.EMailAddress));

            model.Contacts = mailchimpmembersTyped;

            return(View(model));
        }
Exemplo n.º 2
0
        public IActionResult Index()
        {
            var model = new Models.ExportViewModel();

            return(View(model));
        }