Пример #1
0
        public void Process(int step, int itemsPerStep, out int processedItemsCount)
        {
            _csvLines     = _reader.Lines.Where(s => !s.Skip).Skip(step * itemsPerStep).Take(itemsPerStep);
            _titleHeaders = MultistepActionHelper.GetFileFields(_importSettings, _reader);

            InitFields();
            ConvertCsvLinesToArticles();
            WriteArticlesToDb();
            processedItemsCount = _csvLines.Count();
        }
Пример #2
0
        public ActionResult FileFields(int parentId, int id, FormCollection collection)
        {
            var model = new ImportViewModel();

            TryUpdateModel(model);

            model.SetCorrespondingFieldName(collection);
            var settings = model.GetImportSettingsObject(parentId, id);

            return(Json(MultistepActionHelper.GetFileFields(settings, new FileReader(settings))));
        }