Exemplo n.º 1
0
 public static HkpvReportInfo Create(HkpvReport report, int id, DateTime created)
 {
     return(new HkpvReportInfo
     {
         Id = id,
         Created = created,
         Month = report.FromD.Month,
         Year = report.FromD.Year,
         Institution = report.Institution.Id,
         HashSHA256 = report.GetSHA256Hash()
     });
 }
Exemplo n.º 2
0
        public static string GetFileName(HkpvReport report, bool asJson, bool compressed = true)
        {
            var filename = $"{report.Institution.Id}_{report.FromD.Year}_{report.FromD.Month}_{report.GetSHA256Hash()}";

            if (compressed)
            {
                return($"{filename}.zip");
            }
            else if (asJson)
            {
                return($"{filename}.json");
            }
            else
            {
                return($"{filename}.hkpv");
            }
        }