public override string ToString() { var sb = new StringBuilder(AchFile.CharactersPerLine); sb.Append(RecordType); sb.Append((int)ServiceClass); sb.Append(EntryCount.ToString().TrimAndPadLeft(6, '0')); sb.Append(EntryHash.TrimAndPadLeft(10, '0')); sb.Append((TotalDebits * 100).ToString("0").TrimAndPadLeft(12, '0')); sb.Append((TotalCredits * 100).ToString("0").TrimAndPadLeft(12, '0')); sb.Append(CompanyId.TrimAndPadRight(10)); sb.Append(MessageAuthenticationCode.TrimAndPadRight(19)); sb.Append(Reserved.TrimAndPadRight(6)); sb.Append(OriginatingDfiId.TrimAndPadRight(8)); sb.Append(BatchNumber.ToString().TrimAndPadLeft(7, '0')); sb.AppendLine(); return(sb.ToString()); }
public override string ToString() { var sb = new StringBuilder(AchFile.CharactersPerLine); sb.Append(RecordType); sb.Append(BatchCount.ToString().TrimAndPadLeft(6, '0')); sb.Append(BlockCount.ToString().TrimAndPadLeft(6, '0')); sb.Append(EntryCount.ToString().TrimAndPadLeft(8, '0')); sb.Append(EntryHash.TrimAndPadLeft(10, '0')); sb.Append((TotalDebits * 100).ToString("0").TrimAndPadLeft(12, '0')); // 123.45 => 000000012345 sb.Append((TotalCredits * 100).ToString("0").TrimAndPadLeft(12, '0')); // 123.45 => 000000012345 sb.Append(Reserved.TrimAndPadRight(39)); sb.AppendLine(); return(sb.ToString()); }