Exemple #1
0
        /// <summary>
        /// Generates header
        /// </summary>
        /// <returns></returns>
        protected override String GenerateHeader()
        {
            const String RECORD_TYPE                   = "0";
            const String REEL_SEQUENCE_NUMBER          = "01";
            String       FILE_DESCRIPTION_TWELVE_CHARS = String.Empty;
            String       DIRECT_ENTRY_USERID           = String.Empty;

            if (this.Mode == ABAMode.DirectDebit)
            {
                FILE_DESCRIPTION_TWELVE_CHARS = "DIRECT DEBIT";
                DIRECT_ENTRY_USERID           = AbaConfig.NAB_APCAUserID.PadLeft(6, '0');
            }
            else if (this.Mode == ABAMode.DirectCredit)
            {
                FILE_DESCRIPTION_TWELVE_CHARS = "Donations   ";
                DIRECT_ENTRY_USERID           = AbaConfig.NAB_DeUserID.PadLeft(6, '0');
                //DIRECT_ENTRY_USERID = "000000";
            }

            StringBuilder sb = new StringBuilder();

            sb.Append(RECORD_TYPE);                         //Record Type
            sb.Append(AbaConfig.Space(17));                 //17 blank spaces
            sb.Append(REEL_SEQUENCE_NUMBER);                //Reel sequence number
            sb.Append(AbaConfig.NAB_BankShortName);         //User financial institution
            sb.Append(AbaConfig.Space(7));                  //7 blakn spaces
            sb.Append(AbaConfig.NAB_APCAName.PadRight(26)); //Direct Entry User Name
            sb.Append(DIRECT_ENTRY_USERID);                 //Direct Entry User ID
            sb.Append(FILE_DESCRIPTION_TWELVE_CHARS);       //File description
            sb.Append(DateTime.Today.ToString("ddMMyy"));   //Value date
            sb.Append(AbaConfig.Space(40));                 //40 blank spaces
            sb.Append(Environment.NewLine);                 //Carriage Return + Line Feed

            return(sb.ToString());
        }
Exemple #2
0
        /// <summary>
        /// Generates footer
        /// </summary>
        /// <returns></returns>
        protected override String GenerateFooter()
        {
            const String RECORD_TYPE = "7";
            const String BSB         = "999-999";

            StringBuilder sb = new StringBuilder();

            sb.Append(RECORD_TYPE);                                               //Record Type
            sb.Append(BSB);                                                       //BSB
            sb.Append(AbaConfig.Space(12));                                       //12 blank spaces
            sb.Append(this.TotalNetAmountInCents.ToString().PadLeft(10, '0'));    //File net total amount
            sb.Append(this.TotalCreditAmountInCents.ToString().PadLeft(10, '0')); //File credit total amount
            sb.Append(this.TotalDebitAmountInCents.ToString().PadLeft(10, '0'));  //File debit total amount
            sb.Append(AbaConfig.Space(24));                                       //24 blank spaces
            sb.Append(this.TotalRecordCount.ToString().PadLeft(6, '0'));          //File total count of record Type 1
            sb.Append(AbaConfig.Space(40));                                       //40 blank spaces
            sb.Append(Environment.NewLine);                                       //Carriage Return + Line Feed

            return(sb.ToString());
        }