public static SettlementHistory Parse(string filename) { SettlementHistoryParser parser = new SettlementHistoryParser( filename, GetSettlementIdFromFile(filename)); SettlementHistory settlement = parser.Parse(); return(settlement); }
private bool SaveFileToDatabase(string filename, SettlementHistory settlement) { SettlementHistory parsedSettlement = SettlementHistoryParser.Parse(filename); if (parsedSettlement != null) { settlement.Credits = parsedSettlement.Credits; settlement.Deductions = parsedSettlement.Deductions; repository.SaveSettlementHistoryAsync(settlement).Wait(); System.Console.WriteLine($"Saved {settlement.SettlementId} to db."); return(true); } else { System.Console.WriteLine($"Unable to parse {filename}."); return(false); } }