Beispiel #1
0
        /*************************************
        *  Created by:   dandy boy
        *  Created on:   March 21, 2017
        *  Function:     GetMerchantMultiTxnAdjustmentDetail
        *  Purpose:      GetMerchantMultiTxnAdjustmentDetail
        *  Inputs:       invoiceNo,batchId
        *  Returns:      MerchMultitxnAdjustmentResponse
        *************************************/
        public async Task <MerchMultitxnAdjustmentResponse> GetMerchantMultiTxnAdjustmentDetail(string invoiceNo, string batchId)
        {
            Logger.Info("Invoking GetMerchantMultiTxnAdjustmentList function");
            var response = new MerchMultitxnAdjustmentResponse()
            {
                Status = ResponseStatus.Failure,
            };

            try
            {
                using (var scope = Container.BeginLifetimeScope())
                {
                    var merchMultitxnAdjustmentDAO = scope.Resolve <IMerchMultitxnAdjustmentDAO>();
                    var result = await merchMultitxnAdjustmentDAO.MerchantMultiTxnAdjustmentSelect(invoiceNo, batchId);

                    var txnList = new List <MultipleTxnRecordDTO>();
                    TxnAdjustmentDetailDTO txnAdjustment = new TxnAdjustmentDetailDTO();
                    if (result.Count() > 0)
                    {
                        foreach (var item in result)
                        {
                            MultipleTxnRecordDTO multipleTxtRecord = new MultipleTxnRecordDTO();
                            multipleTxtRecord.TxnAmt         = Convert.ToString(decimal.Round(item.Amt, 2, MidpointRounding.AwayFromZero));
                            multipleTxtRecord.MerchantAcctNo = item.MerchantNo;
                            multipleTxtRecord.AcctName       = item.MerchantName;
                            multipleTxtRecord.TxnId          = item.Ids.ToString();
                            multipleTxtRecord.Descp          = item.Description;
                            txnList.Add(multipleTxtRecord);
                            //
                            txnAdjustment.TxnCd           = item.TxnCd;
                            txnAdjustment.TxnType         = item.TxnType;
                            txnAdjustment.TxnDate         = item.TxnDate;
                            txnAdjustment.ChequeAmt       = item.ChequeAmt;
                            txnAdjustment.Owner           = item.Owner;
                            txnAdjustment.Sts             = item.Sts;
                            txnAdjustment.GroupingBatchId = item.GroupingBatchId;
                            txnAdjustment.BatchId         = item.BatchId;
                            txnAdjustment.InvoiceNo       = item.InvoiceNo;
                            txnAdjustment.ApprovalStatus  = item.ApprovalStatus;
                            txnAdjustment.ApprovalDesc    = item.ApprovalDesc;
                        }
                        txnAdjustment.multipleTxnRecord = txnList;
                        response.txnAdjustmentDetail    = Mapper.Map <TxnAdjustmentDetailDTO, TxnAdjustment>(txnAdjustment);
                    }
                }
            }
            catch (Exception ex)
            {
                string msg = string.Format("Error in GetMerchantMultiTxnAdjustmentList: detail:{0}", ex.Message);
                Logger.Error(msg, ex);
                response.Status  = ResponseStatus.Exception;
                response.Message = msg;
            }
            return(response);
        }
Beispiel #2
0
        /*************************************
        *  Created by:   Tuan Tran
        *  Created on:   Mar 5, 2017
        *  Function:     WebMultiPaymentSelect
        *  Purpose:      WebMultiPaymentSelect
        *  Inputs:       batchId,MultiPaymentDTO
        *  Returns:      MultiPaymentResponse
        *************************************/
        public async Task <MultiPaymentResponse> WebMultiPaymentSelect(string batchId, MultiPayment multiPayment)
        {
            Logger.Info("Invoking WebMultiPaymentSelect function");
            var response = new MultiPaymentResponse()
            {
                Status = ResponseStatus.Failure,
            };

            try
            {
                using (var scope = Container.BeginLifetimeScope())
                {
                    var multiPaymentOpDAO = scope.Resolve <IMultiPaymentOpDAO>();
                    var multi             = Mapper.Map <MultiPayment, MultiPaymentDTO>(multiPayment);
                    var result            = await multiPaymentOpDAO.WebMultiPaymentSelect(batchId, multi);

                    var             txnList       = new List <MultipleTxnRecordDTO>();
                    MultiPaymentDTO multilPayment = new MultiPaymentDTO();
                    if (result.Count() > 0)
                    {
                        foreach (var item in result)
                        {
                            MultipleTxnRecordDTO multipleTxtRecord = new MultipleTxnRecordDTO();
                            multipleTxtRecord.AcctNo        = Convert.ToInt32(item.AcctNo.ToString());
                            multipleTxtRecord.TxnAmt        = Convert.ToString(decimal.Round(item.TxnAmt, 2, MidpointRounding.AwayFromZero));
                            multipleTxtRecord.TxnDescp      = item.Descp;
                            multipleTxtRecord.SelectedSts   = item.Sts;
                            multipleTxtRecord.ChequeNo      = Convert.ToString(item.ChequeNo);
                            multipleTxtRecord.CreationDate  = CardTrend.Common.Extensions.NumberExtensions.DateConverter(item.CreationDate);
                            multipleTxtRecord.SelectedOwner = item.Owner;
                            multipleTxtRecord.TxnId         = item.TxnId;
                            multipleTxtRecord.AcctName      = item.AccountName;
                            txnList.Add(multipleTxtRecord);
                            //-----------
                            multilPayment.TxnId        = item.TxnId;
                            multilPayment.TxnDate      = item.TxnDate;
                            multilPayment.DueDate      = item.DueDate;
                            multilPayment.RefNo        = item.RefNo;
                            multilPayment.TxnCd        = item.TxnCd;
                            multilPayment.TxnCdDescp   = Convert.ToString(item.TxnCd);
                            multilPayment.ChequeNo     = item.ChequeNo;
                            multilPayment.ChequeAmt    = item.ChequeAmt;
                            multilPayment.CreationDate = item.CreationDate;
                            multilPayment.Owner        = item.Owner;
                            multilPayment.IssuingBank  = item.IssuingBank;
                            multilPayment.SlipNo       = item.SlipNo;
                            multilPayment.Sts          = item.Sts;
                            multilPayment.PymtType     = item.PymtType;
                            multilPayment.SettleVal    = item.SettleVal;
                        }
                    }
                    multilPayment.MultipleTxnRecordList = txnList;
                    response.multiPayment = Mapper.Map <MultiPaymentDTO, MultiPayment>(multilPayment);
                }
                response.Status = ResponseStatus.Success;
            }
            catch (Exception ex)
            {
                string msg = string.Format("Error in WebMultiPaymentSelect: detail:{0}", ex.Message);
                Logger.Error(msg, ex);
                response.Status  = ResponseStatus.Exception;
                response.Message = msg;
            }
            return(response);
        }
Beispiel #3
0
        /*************************************
        *  Created by:   Tuan Tran
        *  Created on:   Mar 8, 2017
        *  Function:     GetMultiTxnAdjustmentSelect
        *  Purpose:      GetMultiTxnAdjustmentSelect
        *  Inputs:       batchId,chequeNo
        *  Returns:      MultipleTxnOpResponse
        *************************************/
        public async Task <MultipleTxnOpResponse> GetMultiTxnAdjustmentSelect(string batchId, string chequeNo)
        {
            Logger.Info("Invoking GetMultiTxnAdjustmentSelect function");
            var response = new MultipleTxnOpResponse()
            {
                Status = ResponseStatus.Failure,
            };

            try
            {
                using (var scope = Container.BeginLifetimeScope())
                {
                    var multipleTxnOpDAO = scope.Resolve <IMultipleTxnOpDAO>();
                    var result           = await multipleTxnOpDAO.WebMultiTxnAdjustmentSelect(batchId, chequeNo);

                    var txnList = new List <MultipleTxnRecordDTO>();
                    TxnAdjustmentDTO txnAdjustment = new TxnAdjustmentDTO();
                    if (result.Count() > 0)
                    {
                        foreach (var item in result)
                        {
                            MultipleTxnRecordDTO multipleTxtRecord = new MultipleTxnRecordDTO();
                            multipleTxtRecord.AcctNo           = Convert.ToInt32(item.AccountNo);
                            multipleTxtRecord.CardNo           = item.CardNo;
                            multipleTxtRecord.TxnAmt           = Convert.ToString(decimal.Round(item.TxnAmount, 2, MidpointRounding.AwayFromZero));
                            multipleTxtRecord.TxnDescp         = item.TxnDescription;
                            multipleTxtRecord.AppvCd           = item.AppvCd;
                            multipleTxtRecord.DeftBusnLocation = item.Dealer;
                            multipleTxtRecord.DeftTermId       = item.TermId;
                            multipleTxtRecord.SelectedOwner    = item.Owner;
                            multipleTxtRecord.SelectedStsDescp = item.Status;
                            multipleTxtRecord.SelectedSts      = item.Sts;
                            multipleTxtRecord.TxnId            = Convert.ToString(item.TxnId);
                            multipleTxtRecord.AcctName         = item.AccountName;
                            txnList.Add(multipleTxtRecord);
                            //
                            txnAdjustment.TxnDate       = item.TxnDate;
                            txnAdjustment.ChequeAmt     = item.ChequeAmt;
                            txnAdjustment.ChequeNo      = item.ChequeNo;
                            txnAdjustment.BillingAmount = item.BillingAmount;
                            txnAdjustment.UserId        = item.UserId;
                            txnAdjustment.WUId          = item.WUId;
                            txnAdjustment.CreationDate  = item.CreationDate;
                            txnAdjustment.BatchId       = item.BatchId;
                            txnAdjustment.Owner         = item.Owner;
                            txnAdjustment.Sts           = item.Sts;
                            txnAdjustment.TxnCd         = item.TxnCd;
                            txnAdjustment.TxnType       = item.TxnType;
                            txnAdjustment.PymtType      = item.PymtType;
                        }
                    }
                    txnAdjustment.multipleTxnRecord = txnList;
                    response.txnAdjustment          = Mapper.Map <TxnAdjustment>(txnAdjustment);
                }
                response.Status = ResponseStatus.Success;
            }
            catch (Exception ex)
            {
                string msg = string.Format("Error in GetMultiTxnAdjustmentSelect: detail:{0}", ex.Message);
                Logger.Error(msg, ex);
                response.Status  = ResponseStatus.Exception;
                response.Message = msg;
            }
            return(response);
        }