示例#1
0
        public ActionResult Map(string feed, ColumnMapViewModel model)
        {
            var filePaths = TempData["FilePaths"] as List<string>;
            if (filePaths != null && filePaths.Any())
            {
                var mapper = this.mappingServiceFactory.GetMappingService(feed);

                var results = new MapResultsViewModel
                {
                    Results = mapper.Map(filePaths, this.Request.Form)
                };

                TempData["Errors"] = results.Results.Log;

                return View("Results", results);
            }

            return this.RedirectToAction("Index", "Home");
        }
示例#2
0
        // GET: /feed/map
        public ActionResult Map(string feed)
        {
            var filePaths = TempData["FilePaths"] as List<string>;

            if (filePaths != null && filePaths.Any())
            {
                TempData.Keep();

                var mapper = this.mappingServiceFactory.GetMappingService(feed);

                if (mapper != null)
                {
                    var model = new ColumnMapViewModel
                    {
                        Columns = mapper.GetHeaders(filePaths[0]),
                        FieldLabels = mapper.GetFieldLabels()
                    };

                    return View(model);
                }
            }

            return this.RedirectToAction("Index", "Home");
        }