Beispiel #1
0
 /// <summary>
 /// Gets the CSV reader.
 /// </summary>
 /// <param name="file">The file.</param>
 /// <param name="importId">The import id.</param>
 /// <returns></returns>
 private ImportCSVReader GetCSVReader(UploadedFile file, string importId)
 {
     try
     {
         string fileName = importId + ".csv";
         string path     = ImportService.GetImportProcessPath() + fileName;
         ImportService.DeleteImportFile(path);
         file.MoveTo(path);
         ImportCSVReader reader = new ImportCSVReader(path);
         return(reader);
     }
     catch (Exception exp)
     {
         lblError.Text = GetLocalResourceObject("error_InvalidImportPath").ToString();
         divError.Style.Add(HtmlTextWriterStyle.Display, "inline");
         divMainContent.Style.Add(HtmlTextWriterStyle.Display, "none");
         (Parent.Parent.FindControl("StartNavigationTemplateContainerID").FindControl("cmdStartButton")).Visible = false;
         throw new Exception(GetLocalResourceObject("error_InvalidImportPath").ToString(), exp.InnerException);
     }
 }