コード例 #1
0
        }     //Execute

        private ActionResult HandleOneCommissionTransfer(SafeReader sr, bool b)
        {
            int loanBrokerCommissionID = sr["LoanBrokerCommissionID"];
            int brokerID = sr["BrokerID"];

            decimal commissionAmount = sr["CommissionAmount"];
            string  customerName     = sr["CustomerName"];
            string  brokerName       = sr["ContactName"];

            if (brokerName.Length > 18)
            {
                brokerName = brokerName.Substring(0, 17);
            }

            string accountNumber = sr["BankAccount"];
            string sortcode      = sr["SortCode"];
            var    response      = this.service.SendMoney(brokerID, commissionAmount, sortcode, accountNumber, brokerName, this.fileName, "GBP", "Commission");

            Log.Info("PacNet sending commission of {0} to broker {1} tracking {2} {3}",
                     commissionAmount, brokerID, response.TrackingNumber, response.HasError ? "error: " + response.Error : "");

            BrokerCommissionInvoice brokerCommissionInvoice = new BrokerCommissionInvoice(new BrokerInvoiceCommissionModel {
                BrokerID         = brokerID,
                BankAccount      = accountNumber,
                SortCode         = sortcode,
                CommissionTime   = this.now,
                InvoiceID        = loanBrokerCommissionID,
                CommissionAmount = commissionAmount,
                CustomerName     = customerName
            });

            brokerCommissionInvoice.Execute();

            DB.ExecuteNonQuery("UpdateBrokerCommissionTransferStatus",
                               CommandSpecies.StoredProcedure,
                               new QueryParameter("LoanBrokerCommissionID", loanBrokerCommissionID),
                               new QueryParameter("TrackingNumber", response.TrackingNumber),
                               new QueryParameter("TransactionStatus"),
                               new QueryParameter("Description", "Commission"),
                               new QueryParameter("Now", this.now),
                               new QueryParameter("InvoiceSent", true)
                               );

            this.anyCommission = true;
            return(ActionResult.Continue);
        }//HandleOneCommissionTransfer
コード例 #2
0
        }         // Execute

        private void BackFillOneBrokerCommissionInvoice(InvoiceData id)
        {
            try {
                BrokerCommissionInvoice brokerCommissionInvoice = new BrokerCommissionInvoice(
                    new BrokerInvoiceCommissionModel {
                    BankAccount      = id.BankAccount,
                    SortCode         = id.SortCode,
                    InvoiceID        = id.LoanBrokerCommissionID,
                    CustomerName     = id.CustomerName,
                    CommissionAmount = id.CommissionAmount,
                    CommissionTime   = id.PaidDate,
                    BrokerID         = id.BrokerID,
                }
                    );

                brokerCommissionInvoice.Execute();

                DB.ExecuteNonQuery(
                    "UpdateBrokerCommissionsInvoiceBackFill",
                    CommandSpecies.StoredProcedure,
                    new QueryParameter("@LoanBrokerCommissionID", id.LoanBrokerCommissionID)
                    );

                Log.Info(
                    "Broker Invoice Backfill for broker {0} commission id {1}.",
                    id.BrokerID,
                    id.LoanBrokerCommissionID
                    );
            } catch (Exception ex) {
                Log.Error(
                    ex,
                    "Failed sending invoice to broker {0} commission id {1}.",
                    id.BrokerID,
                    id.LoanBrokerCommissionID
                    );
            }             // try

            this.pc.Next();
        }         // BackFillOneBrokerCommissionInvoice