Пример #1
0
        public void doCCExtPayment(decimal amount, int cardID, enums.ccCardType ccCardType)
        {
            //var ccFeeFor

            using (var ctx = new AccContexts())
                using (var ts = new TransactionScope())
                {
                    classes.ccPayment creditCardPayment = new ccPayment();
                    creditCardPayment.createNew(this.receiverEntityID, this.issuerEntityID, amount, this.currencyID, cardID);


                    /*Record New Invoice Payment*/
                    var NewInvoicePayment = new AccountingLib.Models.invoicePayment()
                    {
                        invoiceID = invoiceID,
                        paymentID = creditCardPayment.paymentID
                    };
                    ctx.invoicePayment.AddObject(NewInvoicePayment);
                    ctx.SaveChanges();

                    //get Fee bank cardType
                    var card = new classes.card.CreditCard();
                    card.loadByCardID(cardID);


                    ccFee ccfee = new ccFee();
                    ccfee.loadccFeeByBankCardTypeID((int)ccCardType, (card as Entity).getBankByCard(card.cardID).bankID);

                    //Record related transctions [for invoice payment]
                    List <int> transactions = new List <int>();

                    transactions.Add(Transaction.createNew(receiverEntityID, (int)AssetCategories.CCCASH, -1 * amount, this.currencyID));
                    transactions.Add(Transaction.createNew(receiverEntityID, (int)LibCategories.AP, +1 * amount, this.currencyID));

                    transactions.Add(Transaction.createNew(issuerEntityID, (int)AssetCategories.W, +1 * amount - (decimal)ccfee.amount, this.currencyID));
                    transactions.Add(Transaction.createNew(issuerEntityID, (int)AssetCategories.AR, -1 * amount, this.currencyID));
                    transactions.Add(Transaction.createNew(issuerEntityID, (int)OECategories.EXP, (decimal)ccfee.amount, this.currencyID));

                    /*Record Invoice Payment transactions*/
                    this.RecordInvoicePaymentTransactions(transactions, creditCardPayment.paymentID, enums.paymentStat.PaidApproved);

                    /*Record Invoice Transaction*/
                    enums.invoiceStat?invoicestat = null;
                    switch (ccCardType)
                    {
                    case enums.ccCardType.MASTERCARD:
                        invoicestat = enums.invoiceStat.masterCardPaymant;
                        break;

                    case enums.ccCardType.VISACARD:
                        invoicestat = enums.invoiceStat.visaCardPaymant;
                        break;
                    }
                    this.RecordInvoiceTransaction(transactions, (enums.invoiceStat)invoicestat);


                    ts.Complete();
                }
        }
Пример #2
0
        public void doINTERACPayment(decimal amount, int cardID)
        {
            using (var ctx = new AccContexts())
                using (var ts = new TransactionScope())
                {
                    classes.dbPayment debitCardPayment = new dbPayment();
                    debitCardPayment.createNew(this.receiverEntityID, this.issuerEntityID, amount, this.currencyID, cardID);

                    /*Record New Invoice Payment*/
                    var NewInvoicePayment = new AccountingLib.Models.invoicePayment()
                    {
                        invoiceID = this.invoiceID,
                        paymentID = debitCardPayment.paymentID
                    };
                    ctx.invoicePayment.AddObject(NewInvoicePayment);
                    ctx.SaveChanges();


                    //get Fee bank cardType
                    var card = new classes.card.DebitCard();
                    card.loadByCardID(cardID);


                    Fee fee = new Fee();
                    fee.loadFeeByBankCardTypeID(card.cardTypeID, ((Entity)card).getBankByCard(cardID).bankID);

                    //Record related transctions [for invoice payment]
                    List <int> transactions = new List <int>();
                    transactions.Add(Transaction.createNew(receiverEntityID, (int)AssetCategories.DBCASH, -1 * amount, this.currencyID));
                    transactions.Add(Transaction.createNew(receiverEntityID, (int)LibCategories.AP, +1 * amount, this.currencyID));

                    transactions.Add(Transaction.createNew(issuerEntityID, (int)AssetCategories.W, +1 * amount - (decimal)fee.amount, this.currencyID));
                    transactions.Add(Transaction.createNew(issuerEntityID, (int)AssetCategories.AR, -1 * amount, this.currencyID));
                    transactions.Add(Transaction.createNew(issuerEntityID, (int)OECategories.EXP, (decimal)fee.amount, this.currencyID));

                    /*Record Invoice Payment transactions*/
                    this.RecordInvoicePaymentTransactions(transactions, debitCardPayment.paymentID, enums.paymentStat.PaidApproved);

                    /*Record Invoice Transaction*/
                    this.RecordInvoiceTransaction(transactions, enums.invoiceStat.interacPaymant);


                    ts.Complete();
                }
        }
Пример #3
0
        /// <summary>
        /// this function records INVOICEACTION and INVOICEACTIONTRANSACTIONS
        /// </summary>
        /// <param name="invoiceID"></param>
        /// <param name="transactions"></param>



        /*Payment for Invoice*/
        public void doINTERNALTransfer(decimal amount)
        {
            try
            {
                using (var ctx = new AccContexts())
                    using (var ts = new TransactionScope())
                    {
                        classes.internalPayment internalPayment = new classes.internalPayment();
                        internalPayment.createNew(this.receiverEntityID, this.issuerEntityID, amount, this.currencyID);

                        /*Record New Invoice Payment*/
                        var NewInvoicePayment = new AccountingLib.Models.invoicePayment()
                        {
                            invoiceID = this.invoiceID,
                            paymentID = internalPayment.paymentID
                        };
                        ctx.invoicePayment.AddObject(NewInvoicePayment);
                        ctx.SaveChanges();

                        //Record related transctions [for invoice payment]
                        List <int> transactions = new List <int>();
                        transactions.Add(Transaction.createNew(issuerEntityID, (int)AssetCategories.W, -1 * amount, this.currencyID));
                        transactions.Add(Transaction.createNew(receiverEntityID, (int)LibCategories.AP, +1 * amount, this.currencyID));
                        transactions.Add(Transaction.createNew(receiverEntityID, (int)AssetCategories.W, +1 * amount, this.currencyID));
                        transactions.Add(Transaction.createNew(issuerEntityID, (int)AssetCategories.AR, -1 * amount, this.currencyID));

                        /*Record Invoice Payment transactions*/
                        this.RecordInvoicePaymentTransactions(transactions, internalPayment.paymentID, enums.paymentStat.PaidApproved);

                        /*Record Invoice Transaction*/
                        this.RecordInvoiceTransaction(transactions, enums.invoiceStat.internalPaymant);

                        ts.Complete();
                    }
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
            }
        }
Пример #4
0
        /// <summary>
        /// this function records INVOICEACTION and INVOICEACTIONTRANSACTIONS
        /// </summary>
        /// <param name="invoiceID"></param>
        /// <param name="transactions"></param>
        /*Payment for Invoice*/
        public void doINTERNALTransfer(decimal amount)
        {
            try
            {
                using (var ctx = new AccContexts())
                using (var ts = new TransactionScope())
                {
                    classes.internalPayment internalPayment = new classes.internalPayment();
                    internalPayment.createNew(this.receiverEntityID, this.issuerEntityID, amount, this.currencyID);

                    /*Record New Invoice Payment*/
                    var NewInvoicePayment = new AccountingLib.Models.invoicePayment()
                    {
                        invoiceID = this.invoiceID,
                        paymentID = internalPayment.paymentID
                    };
                    ctx.invoicePayment.AddObject(NewInvoicePayment);
                    ctx.SaveChanges();

                    //Record related transctions [for invoice payment]
                    List <int> transactions = new List<int>();
                    transactions.Add(Transaction.createNew(issuerEntityID, (int)AssetCategories.W, -1 * amount, this.currencyID));
                    transactions.Add(Transaction.createNew(receiverEntityID, (int)LibCategories.AP, +1 * amount, this.currencyID));
                    transactions.Add(Transaction.createNew(receiverEntityID, (int)AssetCategories.W, +1 * amount, this.currencyID));
                    transactions.Add(Transaction.createNew(issuerEntityID, (int)AssetCategories.AR, -1 * amount, this.currencyID));

                    /*Record Invoice Payment transactions*/
                    this.RecordInvoicePaymentTransactions(transactions, internalPayment.paymentID, enums.paymentStat.PaidApproved);

                    /*Record Invoice Transaction*/
                    this.RecordInvoiceTransaction( transactions, enums.invoiceStat.internalPaymant);

                    ts.Complete();
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
            }
        }
Пример #5
0
        public void doINTERACPayment(decimal amount,  int cardID)
        {
            using (var ctx = new AccContexts())
                using (var ts = new TransactionScope())
                {
                    classes.dbPayment debitCardPayment = new dbPayment();
                    debitCardPayment.createNew(this.receiverEntityID, this.issuerEntityID, amount, this.currencyID,cardID);

                    /*Record New Invoice Payment*/
                    var NewInvoicePayment = new AccountingLib.Models.invoicePayment()
                    {
                        invoiceID = this.invoiceID,
                        paymentID = debitCardPayment.paymentID
                    };
                    ctx.invoicePayment.AddObject(NewInvoicePayment);
                    ctx.SaveChanges();

                    //get Fee bank cardType
                    var card=new classes.card.DebitCard();
                    card.loadByCardID(cardID);

                    Fee fee = new Fee();
                    fee.loadFeeByBankCardTypeID(card.cardTypeID, ((Entity)card).getBankByCard(cardID).bankID);

                    //Record related transctions [for invoice payment]
                    List <int> transactions = new List<int>();
                    transactions.Add(Transaction.createNew(receiverEntityID, (int)AssetCategories.DBCASH, -1 * amount, this.currencyID));
                    transactions.Add(Transaction.createNew(receiverEntityID, (int)LibCategories.AP, +1 * amount, this.currencyID));

                    transactions.Add(Transaction.createNew(issuerEntityID, (int)AssetCategories.W, +1 * amount-(decimal)fee.amount, this.currencyID));
                    transactions.Add(Transaction.createNew(issuerEntityID, (int)AssetCategories.AR, -1 * amount, this.currencyID));
                    transactions.Add(Transaction.createNew(issuerEntityID, (int)OECategories.EXP, (decimal)fee.amount, this.currencyID));

                    /*Record Invoice Payment transactions*/
                    this.RecordInvoicePaymentTransactions(transactions, debitCardPayment.paymentID, enums.paymentStat.PaidApproved);

                    /*Record Invoice Transaction*/
                    this.RecordInvoiceTransaction( transactions,enums.invoiceStat.interacPaymant);

                    ts.Complete();
                }
        }
Пример #6
0
        public void doCCExtPayment(decimal amount,int cardID,enums.ccCardType ccCardType)
        {
            //var ccFeeFor

            using (var ctx = new AccContexts())
                using (var ts = new TransactionScope())
                {
                    classes.ccPayment creditCardPayment = new ccPayment();
                    creditCardPayment.createNew(this.receiverEntityID, this.issuerEntityID, amount, this.currencyID, cardID);

                    /*Record New Invoice Payment*/
                    var NewInvoicePayment = new AccountingLib.Models.invoicePayment()
                    {
                        invoiceID = invoiceID,
                        paymentID = creditCardPayment.paymentID
                    };
                    ctx.invoicePayment.AddObject(NewInvoicePayment);
                    ctx.SaveChanges();

                    //get Fee bank cardType
                    var card = new classes.card.CreditCard();
                    card.loadByCardID(cardID);

                    ccFee ccfee = new ccFee();
                    ccfee.loadccFeeByBankCardTypeID((int)ccCardType, (card as Entity).getBankByCard(card.cardID).bankID);

                    //Record related transctions [for invoice payment]
                    List <int> transactions = new List<int>();

                    transactions.Add(Transaction.createNew(receiverEntityID, (int)AssetCategories.CCCASH, -1 * amount, this.currencyID));
                    transactions.Add(Transaction.createNew(receiverEntityID, (int)LibCategories.AP, +1 * amount, this.currencyID));

                    transactions.Add(Transaction.createNew(issuerEntityID, (int)AssetCategories.W, +1 * amount - (decimal)ccfee.amount, this.currencyID));
                    transactions.Add(Transaction.createNew(issuerEntityID, (int)AssetCategories.AR, -1 * amount, this.currencyID));
                    transactions.Add(Transaction.createNew(issuerEntityID, (int)OECategories.EXP,  (decimal)ccfee.amount, this.currencyID));

                    /*Record Invoice Payment transactions*/
                    this.RecordInvoicePaymentTransactions(transactions, creditCardPayment.paymentID, enums.paymentStat.PaidApproved);

                    /*Record Invoice Transaction*/
                    enums.invoiceStat? invoicestat=null;
                    switch(ccCardType)
                    {
                        case enums.ccCardType.MASTERCARD:
                            invoicestat=enums.invoiceStat.masterCardPaymant;
                            break;
                        case enums.ccCardType.VISACARD:
                            invoicestat=enums.invoiceStat.visaCardPaymant;
                            break;
                    }
                    this.RecordInvoiceTransaction(transactions, (enums.invoiceStat)invoicestat);

                    ts.Complete();
                }
        }
 /// <summary>
 /// Create a new invoicePayment object.
 /// </summary>
 /// <param name="id">Initial value of the ID property.</param>
 public static invoicePayment CreateinvoicePayment(global::System.Int32 id)
 {
     invoicePayment invoicePayment = new invoicePayment();
     invoicePayment.ID = id;
     return invoicePayment;
 }
 /// <summary>
 /// Deprecated Method for adding a new object to the invoicePayment EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToinvoicePayment(invoicePayment invoicePayment)
 {
     base.AddObject("invoicePayment", invoicePayment);
 }