protected override string GenerateBankFileFooter() { string[] bankFileFooter = new string[7]; bankFileFooter[0] = "CI"; bankFileFooter[1] = BankCode.PadRight(3).Substring(0, 3) + BranchCode.PadRight(3).Substring(0, 3) + AccountNo.PadRight(8).Substring(0, 8); bankFileFooter[2] = this.AccountHolderName.ToUpper().PadRight(50).Substring(0, 50); if (FileType == FileTypeEnum.Autopay) { bankFileFooter[3] = "CR"; bankFileFooter[4] = ValueDate.ToString("yyyyMMdd"); bankFileFooter[5] = RecordCount.ToString("00000"); bankFileFooter[6] = TotalAmount.ToString("0.00").PadLeft(12); string bankFileFooterData = string.Join(FIELD_DELIMITER, bankFileFooter); if (bankFileFooterData.Length != 93) { throw (new Exception("Incorrect Detail Length of Payment for Footer")); } return(bankFileFooterData); } else { bankFileFooter[3] = ValueDate.ToString("yyyyMMdd"); bankFileFooter[4] = RecordCount.ToString("00000"); bankFileFooter[5] = TotalAmount.ToString("0.00").PadLeft(12); bankFileFooter[6] = string.Empty.PadLeft(7); string bankFileFooterData = string.Join(FIELD_DELIMITER, bankFileFooter); if (bankFileFooterData.Length != 98) { throw (new Exception("Incorrect Detail Length of Payment for Footer")); } return(bankFileFooterData); } }
protected override string GenerateBankFileHeader() { string[] bankFileHeader = new string[5]; bankFileHeader[0] = m_BatchID.PadRight(5).Substring(0, 5).Trim(); bankFileHeader[1] = ((int)m_TransactionType).ToString("00"); string companyAccountNo = BankCode.PadRight(3).Substring(0, 3) + "-" + BranchCode.PadRight(3).Substring(0, 3) + "-" + AccountNo.PadRight(9).Substring(0, 9).Trim(); bankFileHeader[2] = companyAccountNo; bankFileHeader[3] = AccountHolderName.PadRight(20).Substring(0, 20); bankFileHeader[4] = m_BatchName; string bankFileHeaderData = "\"" + string.Join(FIELD_DELIMITER, bankFileHeader) + "\""; //if (bankFileHeaderDetail.Length != 83) // throw new Exception("Incorrect Bank File Header Length:\r\n" + bankFileHeaderDetail); return(bankFileHeaderData); }
protected override string GenerateBankFileHeader() { string[] bankFileHeader = new string[13]; // Record Type 9(1) bankFileHeader[0] = "1"; // Service Type X(10) bankFileHeader[1] = "IBGINORM "; // Originating Bank Code 9(3) bankFileHeader[2] = BankCode.PadRight(3).Substring(0, 3); // Originating Branch Code 9(3) bankFileHeader[3] = BranchCode.PadRight(3).Substring(0, 3); // Originating Account No 9(11) bankFileHeader[4] = ((string)("0" + AccountNo)).PadRight(11).Substring(0, 11); // Originating A/C Name bankFileHeader[5] = AccountHolderName.PadRight(20).Substring(0, 20); // Creation Date 9(8) bankFileHeader[6] = AppUtils.ServerDateTime().ToString("yyyyMMdd"); // Value Date 9(8) bankFileHeader[7] = ValueDate.ToString("yyyyMMdd"); // Filler X(5) bankFileHeader[8] = " "; // Hash Indicator X(1) bankFileHeader[9] = " "; // Payment Advice Header Line1 X(105) bankFileHeader[10] = "".PadRight(105); // Payment Advice Header Line2 X(105) bankFileHeader[11] = "".PadRight(105); // Filler X(320) bankFileHeader[12] = "".PadRight(320); string bankFileHeaderData = string.Join(FIELD_DELIMITER, bankFileHeader); if (bankFileHeaderData.Length != 600) { throw new Exception("Incorrect Bank File Header Length:\r\n" + bankFileHeaderData); } return(bankFileHeaderData); }
public override string ActualBankFileName() { return(BranchCode.PadRight(3).Substring(0, 3) + AccountNo.PadRight(5).Substring(0, 5) + BankFileExtension()); }