Exemple #1
0
        protected override string GenerateBankFileDetail(GenericBankFileDetail bankFileDetail)
        {
            EBankList banklist = new EBankList();

            banklist.BankCode = bankFileDetail.BankCode;
            if (EBankList.db.select(dbConn, banklist))
            {
                BankName = banklist.BankName;
            }

            string[] bankFileDetailRecord = new string[45];
            bankFileDetailRecord[0] = "TRN";
            bankFileDetailRecord[1] = "PAYROL"; //  PAYROL - Hong Kong Payroll ACH Payment (AUTOPAY)
            //bankFileDetailRecord[2] = "omit";.Substring(0, 3)
            bankFileDetailRecord[4] = "6055";   //  6055 -  BOA Hong Kong, HK
            bankFileDetailRecord[5] = AccountNo.PadRight(31).Substring(0, 31).TrimEnd();
            //bankFileDetailRecord[6] = "";//bankFileDetail.BranchCode;//.Substring(0, 9);
            bankFileDetailRecord[7] = "HKD";
            bankFileDetailRecord[8] = "PAY"; //  PAY - Payment
            bankFileDetailRecord[9] = "D";   //  D - Payment Only
            //bankFileDetailRecord[10] = FIELD_POSTINGINDICATOR;//.Substring(0, 1);
            //bankFileDetailRecord[11] = "";//.Substring(0, 16);
            //bankFileDetailRecord[12] = FIELD_PRIORITYINDICATOR;//.Substring(0, 1);
            bankFileDetailRecord[13] = AppUtils.ServerDateTime().ToString("MMddHHmmss") + TransactionID.ToString("000000");
            //bankFileDetailRecord[14] = "";//.Substring(0, 2);
            bankFileDetailRecord[15] = AccountHolderName.ToUpper().PadRight(35).Substring(0, 35).Trim();
            //bankFileDetailRecord[16] = "";.Substring(0, 15);


            bankFileDetailRecord[17] = PostalAddress1.PadRight(35).Substring(0, 35).Trim();
            bankFileDetailRecord[18] = PostalAddress2.PadRight(35).Substring(0, 35).Trim();
            bankFileDetailRecord[19] = PostalCityName.PadRight(30).Substring(0, 30).Trim();
            bankFileDetailRecord[22] = "HK";
            bankFileDetailRecord[23] = bankFileDetail.EmpName.ToUpper().PadRight(70).Substring(0, 70).Trim();
            //bankFileDetailRecord[25] = "ADDRESS LINE 1"+" " ";
            //bankFileDetailRecord[27] = "HONG KONG";
            bankFileDetailRecord[30] = "HK";
            bankFileDetailRecord[31] = bankFileDetail.ValueDate.ToString("yyyyMMdd");
            bankFileDetailRecord[33] = "HKD";
            bankFileDetailRecord[34] = bankFileDetail.Amount.ToString("0.00");
            bankFileDetailRecord[37] = BankName.ToUpper().PadRight(33).Substring(0, 33).Trim();
            bankFileDetailRecord[39] = bankFileDetail.BankCode.PadRight(3).Substring(0, 3) + bankFileDetail.BranchCode.PadRight(3).Substring(0, 3);
            bankFileDetailRecord[41] = bankFileDetail.AccountNo.PadRight(9).Substring(0, 9).Trim();
            bankFileDetailRecord[43] = "HONG KONG";
            bankFileDetailRecord[44] = "HK";
            string bankFileDetailData = "\"" + String.Join(FIELD_DELIMITER, bankFileDetailRecord) + "\"";

            bankFileDetailData = bankFileDetailData.Replace("\"\"", string.Empty);
            //if (bankFileDetailData.Length > 715)
            //    throw (new Exception("Incorrect Detail Length of Payment for " + bankFileDetail.EmpBankAccountHolderName + ":" + bankFileDetailData.Length));
            return(bankFileDetailData);
        }
Exemple #2
0
 public void Statement()
 {
     Console.WriteLine($"{BankName.ToUpper()}\n" +
                       $"- Account number: {AccountNumber}\n" +
                       $"- Balance: {Math.Round(Balance, 2)}\n\n" +
                       $"- The last movement was :\n" +
                       $"\tin date: {LastTransactionDate.ToShortDateString()}\n" +
                       $"\tat time: {LastTransactionDate.ToShortTimeString()}\n\n" +
                       $"\t***********************************\n" +
                       $"\t*                                 *\n" +
                       $"\t*\tLIST OF MOVEMENTS\t  *\n" +
                       $"\t*                                 *\n" +
                       $"\t***********************************\n\n");
     foreach (var item in Movements)
     {
         Console.WriteLine($"{item}\n" +
                           $"********************\n");
     }
 }