示例#1
0
        private void _AppendBalance(FinAcctBalResp aBal, StringBuilder sb)
        {
            FinAcct      aAcct       = aBal.Account;
            SwiftBalance aCurrentBal = aBal.CurrentBal;
            SwiftBalance aPendingBal = aBal.IncludingPendingTransBal;

            if (aCurrentBal != null)
            {
                sb.AppendFormat("BOOKED;{0};{1};{2};{3};{4}",
                                aAcct.BankCode,
                                aAcct.AcctNo,
                                aCurrentBal.Date.ToString(SwiftDateFormat.StandardDate),
                                aCurrentBal.Currency,
                                SwiftAmt.Format(aCurrentBal.DecValue, ',', 2));
                sb.Append(Environment.NewLine);
            }

            if (aPendingBal != null)
            {
                sb.AppendFormat("FORWARD;{0};{1};{2};{3};{4}",
                                aAcct.BankCode,
                                aAcct.AcctNo,
                                aPendingBal.Date.ToString(SwiftDateFormat.StandardDate),
                                aPendingBal.Currency,
                                SwiftAmt.Format(aPendingBal.DecValue, ',', 2));
                sb.Append(Environment.NewLine);
            }
        }
示例#2
0
        private string _GetCsvStatementData(Swift9xxBase aStmt)
        {
            StringBuilder sb = new StringBuilder(20000);

            sb.Append("EntryDate;ValueDate;Value;AcctNo;BankCode;Name1;Name2;PaymtPurpose;EntryText;PrimaNotaNo;TranTypeIdCode;ZkaTranCode;TextKeyExt;BankRef;OwnerRef;SupplementaryDetails");
            sb.Append(Environment.NewLine);

            foreach (SwiftStatementLine aStmtLine in aStmt.StatementLines)
            {
                CsvValues aCsv = new CsvValues(16);

                if (!aStmtLine.EntryDate.IsNull)
                {
                    aCsv[0] = aStmtLine.EntryDate.ToString(SwiftDateFormat.StandardDate);
                }
                if (!aStmtLine.ValueDate.IsNull)
                {
                    aCsv[1] = aStmtLine.ValueDate.ToString(SwiftDateFormat.StandardDate);
                }

                aCsv[2] = SwiftAmt.Format(aStmtLine.DecValue, ',', 2);
                aCsv[3] = aStmtLine.PayeePayerAcctNo;
                aCsv[4] = aStmtLine.PayeePayerBankCode;
                aCsv[5] = aStmtLine.PayeePayerName1;
                aCsv[6] = aStmtLine.PayeePayerName2;

                string[] vsPaymtPurpose = aStmtLine.PaymtPurpose;
                if (vsPaymtPurpose != null)
                {
                    aCsv[7] = String.Join("|", vsPaymtPurpose);
                }

                aCsv[8]  = aStmtLine.EntryText;
                aCsv[9]  = aStmtLine.PrimaNotaNo;
                aCsv[10] = aStmtLine.TranTypeIdCode;
                aCsv[11] = aStmtLine.ZkaTranCode;
                aCsv[12] = aStmtLine.TextKeyExt;
                aCsv[13] = aStmtLine.BankRef;
                aCsv[14] = aStmtLine.OwnerRef;
                aCsv[15] = aStmtLine.SupplementaryDetails;

                sb.Append(aCsv);
                sb.Append(Environment.NewLine);
            }

            return(sb.ToString());
        }