private void DebugFillFiles(DragEventArgs e) { string[] s = (string[])e.Data.GetData(DataFormats.FileDrop, false); int i; var fields = GetReportItems(); for (i = 0; i < s.Length; i++) { Console.WriteLine(); using (StreamReader file = File.OpenText(s[i])) using (JsonTextReader reader = new JsonTextReader(file)) { TT_Fill fill = new TT_Fill(JToken.ReadFrom(reader)); FDLog.LogMessage(String.Format("Parsing fill from file {0}", s[i])); string row = ""; foreach (var field in fields) { try { row += field.DisplayField(fill) + ","; } catch (Exception ex) { row += ","; FDLog.LogError("Error parsing fill column " + field.ColumnName + " for fill " + fill.RecordID + Environment.NewLine + ex.Message); } } FDLog.LogMessage(row); } } }
public static List <FillReport> GetReports(TT_Fill fill, bool individual_fills) { List <FillReport> reports = new List <FillReport>(); if (individual_fills && fill.HasFillsGroup) { int count = fill.FillsGroupCount; for (int i = 0; i < count; ++i) { reports.Add(new IndividualFillReport(fill, i)); } } else { reports.Add(new FillReport(fill)); } return(reports); }
public IndividualFillReport(TT_Fill fill_, int index_) : base(fill_) { index = index_; }
public FillReport(TT_Fill fill_) { fill = fill_; }
public String DisplayField(TT_Fill fill) { return(fieldDisplay(fill)); }