Ejemplo n.º 1
0
        public ActionResult Export()
        {
            var all = _landingPageService.GetAll();
            var landingPageExports = new List <LandingPageExport>();

            if (all.IsAny())
            {
                foreach (var landingPage in all)
                {
                    var landingPageExport = new LandingPageExport
                    {
                        FullName    = landingPage.FullName,
                        DateOfBith  = landingPage.DateOfBith,
                        Email       = landingPage.Email,
                        PhoneNumber = landingPage.PhoneNumber,
                        Status      = Common.GetStatusLanddingPage(landingPage.Status),
                        PlaceOfGift = string.Concat(landingPage.ContactInformation.Title, " - ", landingPage.ContactInformation.Address)
                    };
                    landingPageExports.Add(landingPageExport);
                }
            }

            ExportToExcel.ListToExcel(landingPageExports);

            return(new EmptyResult());
        }