Example #1
0
        public void Go()
        {
            foreach (var fname in GetNewFiles())
            {
                try
                {
                    var json = Source.GetFileText(fname);

                    if (string.IsNullOrEmpty(json))
                    {
                        throw new Exception($"{fname} is empty");
                    }

                    var dto = JsonParser.Parse(json);


                    if (!string.IsNullOrEmpty(dto.ReportPath) && dto.ReportPath.ToLower().EndsWith(".pdf"))
                    {
                        dto.ReportURL = FileStorage.Upload(dto.ReportPath, Source.GetReport(dto.ReportPath));
                    }


                    Saver.Save(dto);

                    Handled.Add(fname, json);
                }
                catch (Exception e)
                {
                    Handled.Error(fname, e.Message);
                }
            }
        }
Example #2
0
 public void MarkCompleted(string filename)
 {
     handled.Add(filename, source.GetFileText(filename));
 }