Exemplo n.º 1
0
 public EntryTransaction3()
 {
     this.cardTxField      = new CardTransaction1();
     this.cshDpstField     = new List <CashDeposit1>();
     this.sfkpgAcctField   = new SecuritiesAccount13();
     this.corpActnField    = new CorporateAction9();
     this.rtrInfField      = new PaymentReturnReason2();
     this.taxField         = new TaxInformation3();
     this.finInstrmIdField = new SecurityIdentification14();
     this.rltdQtiesField   = new List <TransactionQuantities2Choice>();
     this.rltdPricField    = new TransactionPrice3Choice();
     this.rltdDtsField     = new TransactionDates2();
     this.rmtInfField      = new RemittanceInformation7();
     this.rltdRmtInfField  = new List <RemittanceLocation2>();
     this.purpField        = new Purpose2Choice();
     this.rltdAgtsField    = new TransactionAgents3();
     this.rltdPtiesField   = new TransactionParties3();
     this.intrstField      = new List <TransactionInterest3>();
     this.chrgsField       = new List <Charges3>();
     this.bkTxCdField      = new BankTransactionCodeStructure4();
     this.avlbtyField      = new List <CashBalanceAvailability2>();
     this.amtDtlsField     = new AmountAndCurrencyExchange3();
     this.amtField         = new ActiveOrHistoricCurrencyAndAmount();
     this.refsField        = new TransactionReferences3();
 }
 public TaxInformation3(
     TaxParty1 creditor,
     TaxParty2 debtor,
     string administrationZone,
     string referenceNumber,
     string method,
     ActiveOrHistoricCurrencyAndAmount totalTaxableBaseAmount,
     ActiveOrHistoricCurrencyAndAmount totalTaxAmount,
     System.DateTime date,
     bool dateSepecified,
     decimal sequenceNumber,
     bool sequenceNumberSpecified,
     TaxRecord1[] record)
 {
     this.cdtrField = creditor;
     this.dbtrField = debtor;
     this.admstnZnField = administrationZone;
     this.refNbField = referenceNumber;
     this.mtdField = method;
     this.ttlTaxblBaseAmtField = totalTaxableBaseAmount;
     this.ttlTaxAmtField = totalTaxAmount;
     this.dtField = date;
     this.dtFieldSpecified = dateSepecified;
     this.seqNbField = sequenceNumber;
     this.seqNbFieldSpecified = sequenceNumberSpecified;
     this.rcrdField = (TaxRecord1[])record.Clone(); ;
 }
Exemplo n.º 3
0
        private void CreateXML()
        {
            int index = 0; //DataTable row index
            int tableNumberRows = ds.Tables[0].Rows.Count; //counts number of rows in DataTable

            CreditTransferTransactionInformation10[] crdtTransTransacInfoTransactions = new CreditTransferTransactionInformation10[tableNumberRows];

            foreach (DataRow row in ds.Tables[0].Rows)
            {
                CreditTransferTransactionInformation10 crdtTransTransacInfo = new CreditTransferTransactionInformation10();

                PaymentIdentification1 paymentIndNum = new PaymentIdentification1();
                paymentIndNum.EndToEndId = index.ToString();

                EquivalentAmount2 eqvAmount = new EquivalentAmount2();
                ActiveOrHistoricCurrencyAndAmount curAndAmnt = new ActiveOrHistoricCurrencyAndAmount();
                curAndAmnt.Ccy = row[10].ToString();//Currency
                curAndAmnt.Value = decimal.Parse(row[9].ToString());//Transaction ammount

                eqvAmount.Amt = curAndAmnt;

                AmountType3Choice amntType = new AmountType3Choice();
                amntType.Item = eqvAmount;

                crdtTransTransacInfo.PmtId = paymentIndNum;
                crdtTransTransacInfo.Amt = amntType;

                crdtTransTransacInfoTransactions[index] = crdtTransTransacInfo;

                index++;
            }

            PaymentInstructionInformation3[] pmntInstrInf = new PaymentInstructionInformation3[1];
            PaymentInstructionInformation3 pmntInstrInfIteam = new PaymentInstructionInformation3();
            pmntInstrInfIteam.CdtTrfTxInf = crdtTransTransacInfoTransactions;
            pmntInstrInf[0] = pmntInstrInfIteam;

            Authorisation1Choice[] authChoiceArray = new Authorisation1Choice[1];
            Authorisation1Choice authChoice = new Authorisation1Choice();
            authChoice.Item = "Sergei";
            authChoiceArray[0] = authChoice;

            GroupHeader32 grpHdr = new GroupHeader32();
            grpHdr.Authstn = authChoiceArray;

            CustomerCreditTransferInitiationV03 cctiv = new CustomerCreditTransferInitiationV03();
            cctiv.GrpHdr = grpHdr;
            cctiv.PmtInf = pmntInstrInf;

            Document document = new Document();

            document.CstmrCdtTrfInitn = cctiv;

            var data = document;
            var serializer = new XmlSerializer(typeof(Document));
            using (var stream = new StreamWriter("C:\\Users\\yulya\\Desktop\\test.xml"))

               serializer.Serialize(stream, data);
        }
 public TaxAmount1(
     decimal rate,
     bool rateSpecified,
     ActiveOrHistoricCurrencyAndAmount taxableBase,
     ActiveOrHistoricCurrencyAndAmount totalAmount,
     TaxRecordDetails1[] details)
 {
     this.rateField = rate;
     this.rateFieldSpecified = rateSpecified;
     this.taxblBaseAmtField = taxableBase;
     this.ttlAmtField = totalAmount;
     this.dtlsField = (TaxRecordDetails1[])details.Clone();
 }
 public DocumentAdjustment1(
     ActiveOrHistoricCurrencyAndAmount adjustmentAmount,
     CreditDebitCode creditDebitIndicatorCode,
     bool creditDebitIndicatorCodeSpecified,
     string adjustmentReason,
     string additionalInformationForAdjustment
     )
 {
     this.amtField = adjustmentAmount;
     this.cdtDbtIndField = creditDebitIndicatorCode;
     this.cdtDbtIndFieldSpecified = creditDebitIndicatorCodeSpecified;
     this.rsnField = adjustmentReason;
     this.addtlInfField = additionalInformationForAdjustment;
 }
Exemplo n.º 6
0
 public ReportEntry3()
 {
     _ntryDtlsField      = new List <EntryDetails2>();
     _cardTxField        = new CardEntry1();
     _intrstField        = new List <TransactionInterest3>();
     _techInptChanlField = new TechnicalInputChannel1Choice();
     _chrgsField         = new List <Charges3>();
     _amtDtlsField       = new AmountAndCurrencyExchange3();
     _addtlInfIndField   = new MessageIdentification2();
     _bkTxCdField        = new BankTransactionCodeStructure4();
     _avlbtyField        = new List <CashBalanceAvailability2>();
     _valDtField         = new DateAndDateTimeChoice();
     _bookgDtField       = new DateAndDateTimeChoice();
     _amtField           = new ActiveOrHistoricCurrencyAndAmount();
 }
 public RemittanceAmount1(
     ActiveOrHistoricCurrencyAndAmount duePayableAmount,
     ActiveOrHistoricCurrencyAndAmount discountApliedAmount,
     ActiveOrHistoricCurrencyAndAmount creditNoteAmount,
     ActiveOrHistoricCurrencyAndAmount taxAmount,
     DocumentAdjustment1[] adjustedAmountAndReason,
     ActiveOrHistoricCurrencyAndAmount remittedAmount
     )
 {
     this.duePyblAmtField = duePayableAmount;
     this.dscntApldAmtField = discountApliedAmount;
     this.cdtNoteAmtField=creditNoteAmount;
     this.taxAmtField = taxAmount;
     this.adjstmntAmtAndRsnField = (DocumentAdjustment1[])adjustedAmountAndReason.Clone();
     this.rmtdAmtField = remittedAmount;
 }
 public StructuredRegulatoryReporting3(
     string type,
     System.DateTime date,
     bool dateSpecified,
     string country,
     string code,
     ActiveOrHistoricCurrencyAndAmount amount,
     string[] information)
 {
     this.tpField = type;
     this.dtField = date;
     this.dtFieldSpecified = dateSpecified;
     this.ctryField = country;
     this.cdField = code;
     this.amtField = amount;
     this.infField = (string[])information.Clone();
 }
 public DirectDebitTransactionInformation9(
     PaymentIdentification1 paymentIdentification,
     PaymentTypeInformation20 paymentTypeInformation,
     ActiveOrHistoricCurrencyAndAmount instructedAmount,
     ChargeBearerType1Code chargeBearer,
     bool chargeBearerSpecified,
     DirectDebitTransaction6 directDebitTransaction,
     PartyIdentification32 ultimateCreditor,
     BranchAndFinancialInstitutionIdentification4 debtorAgent,
     CashAccount16 debtorAgentAccount,
     PartyIdentification32 debtor,
     CashAccount16 debtorAccount,
     PartyIdentification32 ultimateDebtor,
     string instructionForCreditorAgent,
     Purpose2Choice purpose,
     RegulatoryReporting3[] regulatoryReporting,
     TaxInformation3 tax,
     RemittanceLocation2[] relatedRemittanceInformation,
     RemittanceInformation5 remittanceInformation)
 {
     this.pmtIdField = paymentIdentification;
     this.pmtTpInfField = paymentTypeInformation;
     this.instdAmtField = instructedAmount;
     this.chrgBrField = chargeBearer;
     this.chrgBrFieldSpecified = chargeBearerSpecified;
     this.drctDbtTxField=directDebitTransaction;
     this.ultmtCdtrField=ultimateCreditor;
     this.dbtrAgtField=debtorAgent;
     this.dbtrAgtAcctField=debtorAgentAccount;
     this.dbtrField = debtor;
     this.dbtrAcctField = debtorAccount;
     this.ultmtDbtrField = ultimateDebtor;
     this.instrForCdtrAgtField = instructionForCreditorAgent;
     this.purpField = purpose;
     this.rgltryRptgField = (RegulatoryReporting3[])regulatoryReporting.Clone();
     this.taxField = tax;
     this.rltdRmtInfField=(RemittanceLocation2[])relatedRemittanceInformation.Clone();
     this.rmtInfField = remittanceInformation;
 }
Exemplo n.º 10
0
        private void CreateXML()
        {
            int index           = 0;                       //DataTable row index
            int tableNumberRows = ds.Tables[0].Rows.Count; //counts number of rows in DataTable

            CreditTransferTransactionInformation10[] crdtTransTransacInfoTransactions = new CreditTransferTransactionInformation10[tableNumberRows];

            foreach (DataRow row in ds.Tables[0].Rows)
            {
                CreditTransferTransactionInformation10 crdtTransTransacInfo = new CreditTransferTransactionInformation10();

                PaymentIdentification1 paymentIndNum = new PaymentIdentification1();
                paymentIndNum.EndToEndId = index.ToString();

                EquivalentAmount2 eqvAmount = new EquivalentAmount2();
                ActiveOrHistoricCurrencyAndAmount curAndAmnt = new ActiveOrHistoricCurrencyAndAmount();
                curAndAmnt.Ccy   = row[10].ToString();               //Currency
                curAndAmnt.Value = decimal.Parse(row[9].ToString()); //Transaction ammount

                eqvAmount.Amt = curAndAmnt;

                AmountType3Choice amntType = new AmountType3Choice();
                amntType.Item = eqvAmount;

                crdtTransTransacInfo.PmtId = paymentIndNum;
                crdtTransTransacInfo.Amt   = amntType;

                crdtTransTransacInfoTransactions[index] = crdtTransTransacInfo;

                index++;
            }

            PaymentInstructionInformation3[] pmntInstrInf      = new PaymentInstructionInformation3[1];
            PaymentInstructionInformation3   pmntInstrInfIteam = new PaymentInstructionInformation3();

            pmntInstrInfIteam.CdtTrfTxInf = crdtTransTransacInfoTransactions;
            pmntInstrInf[0] = pmntInstrInfIteam;

            Authorisation1Choice[] authChoiceArray = new Authorisation1Choice[1];
            Authorisation1Choice   authChoice      = new Authorisation1Choice();

            authChoice.Item    = "Sergei";
            authChoiceArray[0] = authChoice;

            GroupHeader32 grpHdr = new GroupHeader32();

            grpHdr.Authstn = authChoiceArray;

            CustomerCreditTransferInitiationV03 cctiv = new CustomerCreditTransferInitiationV03();

            cctiv.GrpHdr = grpHdr;
            cctiv.PmtInf = pmntInstrInf;

            Document document = new Document();

            document.CstmrCdtTrfInitn = cctiv;

            var data       = document;
            var serializer = new XmlSerializer(typeof(Document));

            using (var stream = new StreamWriter("C:\\Users\\yulya\\Desktop\\test.xml"))

                serializer.Serialize(stream, data);
        }
Exemplo n.º 11
0
 public TaxCharges2()
 {
     this.amtField = new ActiveOrHistoricCurrencyAndAmount();
 }
Exemplo n.º 12
0
 public TaxAmountAndType1()
 {
     this.amtField = new ActiveOrHistoricCurrencyAndAmount();
     this.tpField  = new TaxAmountType1Choice();
 }
 public TaxRecordDetails1(TaxPeriod1 period, ActiveOrHistoricCurrencyAndAmount amount)
 {
     this.prdField = period;
     this.amtField = amount;
 }
Exemplo n.º 14
0
 public TaxRecordDetails1()
 {
     amtField = new ActiveOrHistoricCurrencyAndAmount();
     prdField = new TaxPeriod1();
 }
Exemplo n.º 15
0
 public UnderlyingPaymentTransaction2()
 {
     this._orgnlIntrBkSttlmAmtField = new ActiveOrHistoricCurrencyAndAmount();
     this._orgnlGrpInfField         = new UnderlyingGroupInformation1();
 }
 public UnderlyingPaymentInstruction2()
 {
     this._orgnlInstdAmtField = new ActiveOrHistoricCurrencyAndAmount();
     this._orgnlGrpInfField   = new UnderlyingGroupInformation1();
 }
Exemplo n.º 17
0
 public TransactionInterest3()
 {
     this.rcrdField = new List <InterestRecord1>();
     this.ttlIntrstAndTaxAmtField = new ActiveOrHistoricCurrencyAndAmount();
 }
Exemplo n.º 18
0
 public TaxAmount1()
 {
     dtlsField         = new List <TaxRecordDetails1>();
     ttlAmtField       = new ActiveOrHistoricCurrencyAndAmount();
     taxblBaseAmtField = new ActiveOrHistoricCurrencyAndAmount();
 }
Exemplo n.º 19
0
        /// <summary>
        /// Adds a new transaction to the document
        /// </summary>
        /// <param name="receiver">Object with all the required information about the receiver of the new transaction</param>
        /// <param name="transaction">Object with all the required information about the transaction itself</param>
        public void AddTransaction(PaymentInstructionInformation3CH pmtInf, Receiver receiver, TransactionBase transaction)
        {
            CreditTransferTransactionInformation10CH cdtTrfTxInf = new CreditTransferTransactionInformation10CH(); // Index 2.27

            PaymentIdentification1 pmtId = new PaymentIdentification1();                                           // Index 2.28

            cdtTrfTxInf.PmtId = pmtId;
            pmtId.InstrId     = "1-" + pmtInf.CdtTrfTxInf.Length;    // Index 2.29
            pmtId.EndToEndId  = transaction.ReferenceIdentification; // Index 2.30

            AmountType3Choice amt = new AmountType3Choice();         // Index 2.42

            cdtTrfTxInf.Amt = amt;

            ActiveOrHistoricCurrencyAndAmount currencyAndAmount = new ActiveOrHistoricCurrencyAndAmount(); // Index 2.43

            amt.Item = currencyAndAmount;
            currencyAndAmount.Ccy   = transaction.CurrencyCode;
            currencyAndAmount.Value = transaction.Amount;

            PartyIdentification32CH_Name cdtr = new PartyIdentification32CH_Name(); // Index 2.79

            cdtTrfTxInf.Cdtr = cdtr;

            cdtr.Nm = receiver.Name;                           // Index 2.79 / Name
            PostalAddress6CH pstlAdr = new PostalAddress6CH(); // Index 2.79 / Postal Address

            cdtr.PstlAdr = pstlAdr;


            pstlAdr.StrtNm = receiver.StreetName; // Index 2.79 / Street Name

            if (!string.IsNullOrWhiteSpace(receiver.StreetNumber))
            {
                pstlAdr.StrtNm = receiver.StreetName + " " + receiver.StreetNumber; // Index 2.79 / Building Number
            }

            pstlAdr.PstCd = receiver.Zip;                                // Index 2.79 / Post Code
            pstlAdr.TwnNm = receiver.City;                               // Index 2.79 / Town Name
            pstlAdr.Ctry  = receiver.CountryCode;                        // Index 2.79 / Country

            CashAccount16CH_Id cdtrAcct = new CashAccount16CH_Id();      // Index 2.80

            cdtrAcct.Id          = new AccountIdentification4ChoiceCH(); // Index 2.80 / Identification
            cdtTrfTxInf.CdtrAcct = cdtrAcct;

            if (transaction.GetType() == typeof(TransactionIBANandQRR))
            {
                TransactionIBANandQRR transactionIbaNandQrr = ((TransactionIBANandQRR)transaction);

                cdtrAcct.Id.Item = transactionIbaNandQrr.ReceiverIban; // Index 2.80 / Id / IBAN  Ziel-Konto

                if (!string.IsNullOrWhiteSpace(transactionIbaNandQrr.ReceiverBIC))
                {
                    BranchAndFinancialInstitutionIdentification4CH cdtrAgt = new BranchAndFinancialInstitutionIdentification4CH(); // Index 2.77
                    cdtTrfTxInf.CdtrAgt = cdtrAgt;

                    FinancialInstitutionIdentification7CH finInstnIdCdtr = new FinancialInstitutionIdentification7CH(); // Index 2.77 / Financial Institution Identification
                    cdtrAgt.FinInstnId = finInstnIdCdtr;
                    finInstnIdCdtr.BIC = transactionIbaNandQrr.ReceiverBIC;                                             // Index 2.21
                }

                // QRR
                if (!string.IsNullOrWhiteSpace(transactionIbaNandQrr.QRReferenceNumber))
                {
                    var rmtInf = new RemittanceInformation5CH(); // Index 2.126
                    cdtTrfTxInf.RmtInf = rmtInf;
                    rmtInf.Strd        = new StructuredRemittanceInformation7
                    {
                        CdtrRefInf = new CreditorReferenceInformation2
                        {
                            Ref = transactionIbaNandQrr.QRReferenceNumber,
                            Tp  = new CreditorReferenceType2
                            {
                                CdOrPrtry = new CreditorReferenceType1Choice
                                {
                                    Item = "QRR"
                                }
                            }
                        }
                    };
                }
            }
            else if (transaction.GetType() == typeof(TransactionESR))
            {
                TransactionESR transactionESR = ((TransactionESR)transaction);

                PaymentTypeInformation19CH pmtTpInf = new PaymentTypeInformation19CH(); // Index 2.31
                cdtTrfTxInf.PmtTpInf = pmtTpInf;
                cdtTrfTxInf.PmtTpInf = new PaymentTypeInformation19CH                   // Index 2.31
                {
                    LclInstrm = new LocalInstrument2Choice                              // Index 2.36
                    {
                        ItemElementName = ItemChoiceType5.Prtry,                        // Index 2.38
                        Item            = transactionESR.PaymentType
                    }
                };

                cdtrAcct.Id.Item = new GenericAccountIdentification1CH() // Index 2.80
                {
                    Id = transactionESR.ReceiverAccount
                };

                var rmtInf = new RemittanceInformation5CH(); // Index 2.98
                cdtTrfTxInf.RmtInf = rmtInf;
                rmtInf.Strd        = new StructuredRemittanceInformation7
                {
                    CdtrRefInf = new CreditorReferenceInformation2
                    {
                        Ref = transactionESR.ESRReferenceNumber
                    }
                };
            }
            else if (transaction.GetType() == typeof(TransactionES))
            {
                TransactionES transactionES = ((TransactionES)transaction);

                PaymentTypeInformation19CH pmtTpInf = new PaymentTypeInformation19CH(); // Index 2.31
                cdtTrfTxInf.PmtTpInf = pmtTpInf;
                cdtTrfTxInf.PmtTpInf = new PaymentTypeInformation19CH                   // Index 2.31
                {
                    LclInstrm = new LocalInstrument2Choice                              // Index 2.36
                    {
                        ItemElementName = ItemChoiceType5.Prtry,                        // Index 2.38
                        Item            = transactionES.PaymentType
                    }
                };

                cdtrAcct.Id.Item = new GenericAccountIdentification1CH() // Index 2.80
                {
                    Id = transactionES.ReceiverAccount
                };
            }

            AddNewCreditTransferTransactionInformation(pmtInf, cdtTrfTxInf);
        }
        /// <summary>
        /// Adds a new transaction to the document
        /// </summary>
        /// <param name="receiver">Object with all the required information about the receiver of the new transaction</param>
        /// <param name="transaction">Object with all the required information about the transaction itself</param>
        public void AddTransaction(Receiver receiver, Transaction transaction)
        {
            CreditTransferTransactionInformation10CH cdtTrfTxInf = new CreditTransferTransactionInformation10CH(); // Index 2.27

            PaymentIdentification1 pmtId = new PaymentIdentification1();                                           // Index 2.28

            cdtTrfTxInf.PmtId = pmtId;
            pmtId.InstrId     = "1-" + pmtInf1.CdtTrfTxInf.Length;                  // Index 2.29
            pmtId.EndToEndId  = transaction.ReferenceIdentification;                // Index 2.30

            PaymentTypeInformation19CH pmtTpInf = new PaymentTypeInformation19CH(); // Index 2.31

            cdtTrfTxInf.PmtTpInf = pmtTpInf;

            AmountType3Choice amt = new AmountType3Choice(); // Index 2.42

            cdtTrfTxInf.Amt = amt;

            ActiveOrHistoricCurrencyAndAmount currencyAndAmount = new ActiveOrHistoricCurrencyAndAmount(); // Index 2.43

            amt.Item = currencyAndAmount;
            currencyAndAmount.Ccy   = transaction.CurrencyCode;
            currencyAndAmount.Value = transaction.Amount;

            BranchAndFinancialInstitutionIdentification4CH cdtrAgt = new BranchAndFinancialInstitutionIdentification4CH(); // Index 2.77

            cdtTrfTxInf.CdtrAgt = cdtrAgt;

            FinancialInstitutionIdentification7CH finInstnIdCdtr = new FinancialInstitutionIdentification7CH(); // Index 2.77 / Financial Institution Identification

            cdtrAgt.FinInstnId = finInstnIdCdtr;

            PartyIdentification32CH_Name cdtr = new PartyIdentification32CH_Name(); // Index 2.79

            cdtTrfTxInf.Cdtr = cdtr;

            cdtr.Nm = receiver.Name;                           // Index 2.79 / Name
            PostalAddress6CH pstlAdr = new PostalAddress6CH(); // Index 2.79 / Postal Address

            cdtr.PstlAdr = pstlAdr;


            pstlAdr.StrtNm = receiver.StreetName; // Index 2.79 / Street Name

            if (!string.IsNullOrWhiteSpace(receiver.StreetNumber))
            {
                pstlAdr.StrtNm = receiver.StreetName + " " + receiver.StreetNumber; // Index 2.79 / Building Number
            }

            pstlAdr.PstCd = receiver.Zip;                           // Index 2.79 / Post Code
            pstlAdr.TwnNm = receiver.City;                          // Index 2.79 / Town Name
            pstlAdr.Ctry  = receiver.CountryCode;                   // Index 2.79 / Country

            CashAccount16CH_Id cdtrAcct = new CashAccount16CH_Id(); // Index 2.80

            cdtTrfTxInf.CdtrAcct = cdtrAcct;

            cdtrAcct.Id      = new AccountIdentification4ChoiceCH(); // Index 2.80 / Identification
            cdtrAcct.Id.Item = transaction.ReceiverIban;             // Index 2.80 / Id / IBAN  Ziel-Konto

            AddNewCreditTransferTransactionInformation(pmtInf1.CdtTrfTxInf, cdtTrfTxInf);
            UpdateLevelA();
        }