Пример #1
0
        public override string SqlInsertString()
        {
            string sql = "declare @ID int\r\nEXEC @ID=InsertMT940statement 'MT940','{0}','{1}',{2},{3},'{4}','{5}','{6}',{7},{8}".Args(
                SenderAddress,
                AccountNumber,
                StatementNo,
                SequenceNo,
                Date.ToString("yyyyMMdd"),
                ContainingSwiftFileName.Replace(".working", ""),
                Currency,
                OpeningBalance,
                ClosingBalance
                );


            foreach (MT940Activity activity in MT940Activities)
            {
                sql += " \r\nINSERT MT940Activity(ValueDate,Amount,Description,StatementID) VALUES ('{0}','{1}','{2}',@ID)".Args(
                    activity.ValueDate.ToString("yyyyMMdd"),
                    activity.Amount,
                    activity.Description.Replace("'", "''")
                    );
            }
            return(sql);
        }
Пример #2
0
        public override string SqlInsertString()
        {
            // Ensure file entry is there and grab the ID
            StringBuilder sql = new StringBuilder();

            sql.AppendFormat("declare @ID int\r\nEXEC @ID=InsertSwiftFile '{0}'", ContainingSwiftFileName.Replace(".working", ""));

            sql.AppendFormat("EXEC InsertMT300message @ID,'{0}','{1}','{2}','{3}','{4}','{5}','{6}'",
                             ApplicationID,
                             ServiceID,
                             LogicalTerminalAddress,
                             SessionNumber,
                             SequenceNumber,
                             Direction,
                             ReceiverAddress);

            sql.AppendFormat(",'{0}','{1}','{2}','{3}','{4}','{5}','{6}','{7}'",
                             Priority,
                             DeliveryMonitor,
                             ObsolescencePeriod,
                             InputDate,
                             InputTime,
                             MessageInputReference,
                             OutputDate,
                             OutputTime
                             );

            sql.AppendFormat(",'{0}','{1}','{2}','{3}','{4}','{5}','{6}','{7}'",
                             SenderReference,
                             TypeOfOperation,
                             CommonReference,
                             PartyA,
                             PartyB,
                             TradeDate.ToString("yyyyMMdd"),
                             ValueDate.ToString("yyyyMMdd"),
                             ExchangeRate
                             );

            sql.AppendFormat(",'{0}','{1}','{2}','{3}','{4}','{5}'",
                             BoughtCurrency,
                             BoughtAmount,
                             BoughtReceivingAgent,
                             SoldCurrency,
                             SoldAmount,
                             SoldReceivingAgent
                             );

            sql.AppendFormat("\r\ndeclare @recid int\r\nselect @recid = recid from tblrec where name='FX Confirmation'\r\nEXEC ScheduleRec @recid,'{0:ddMMMyy}'", ValueDate);

            return(sql.ToString());
        }
Пример #3
0
        public override string SqlInsertString()
        {
            string sql = "declare @ID int\r\nEXEC @ID=InsertMT535statement 'MT535','{0}','{1}',{2},{3},'{4}','{5}','{6}'".Args(
                SenderAddress,
                AccountNumber,
                StatementNo,
                SequenceNumber,
                Date.ToString("yyyyMMdd"),
                ContainingSwiftFileName.Replace(".working", ""),
                SenderReference
                );


            foreach (MT535Activity activity in MT535Activities)
            {
                sql += " INSERT MT535Activity(SecurityIdentifier, Description, AggrBalance, StatementID) VALUES ('{0}','{1}',{2},@ID) \r\n".Args(
                    activity.SecurityIdentifier,
                    activity.Description.Replace("'", "''"),
                    activity.AggrBalance
                    );
            }
            return(sql);
        }