Example #1
0
        /*************************************
        *  Created by:   dandy boy
        *  Created on:   May 2, 2017
        *  Function:     GetGLCode
        *  Purpose:      GetGLCode
        *  Inputs:       txnCode,settlement,acctNo
        *  Returns:      MultiPaymentResponse
        *************************************/
        public async Task <MultiPaymentResponse> GetGLCode(string txnCode, string settlement, string acctNo)
        {
            Logger.Info("Invoking GetGLCode function");
            var response = new MultiPaymentResponse()
            {
                Status = ResponseStatus.Failure,
            };

            try
            {
                using (var scope = Container.BeginLifetimeScope())
                {
                    var multiPaymentOpDAO = scope.Resolve <IMultiPaymentOpDAO>();
                    var objCodes          = await multiPaymentOpDAO.WebGetGLCode(txnCode, settlement, acctNo);

                    if (objCodes.Count() > 0)
                    {
                        response.multiPayments = Mapper.Map <List <MultiPayment> >(objCodes);
                    }
                }
                response.Status = ResponseStatus.Success;
            }
            catch (Exception ex)
            {
                string msg = string.Format("Error in GetGLCode: detail:{0}", ex.Message);
                Logger.Error(msg, ex);
                response.Status  = ResponseStatus.Exception;
                response.Message = msg;
            }
            return(response);
        }
Example #2
0
        /*************************************
        *  Created by:   Tuan Tran
        *  Created on:   March 5, 2017
        *  Function:     WebMultiPaymentListSelect
        *  Purpose:      WebMultiPaymentListSelect
        *  Inputs:
        *  Returns:      MultiPaymentResponse
        *************************************/
        public async Task <MultiPaymentResponse> WebMultiPaymentListSelect()
        {
            Logger.Info("Invoking WebMultiPaymentListSelect function");
            var response = new MultiPaymentResponse()
            {
                Status = ResponseStatus.Failure,
            };

            try
            {
                using (var scope = Container.BeginLifetimeScope())
                {
                    var multiPaymentOpDAO = scope.Resolve <IMultiPaymentOpDAO>();
                    var results           = await multiPaymentOpDAO.WebMultiPaymentListSelect();

                    if (results.Count() > 0)
                    {
                        response.multiPayments = Mapper.Map <IList <MultiPaymentDTO>, IList <MultiPayment> >(results);
                    }
                }
                response.Status = ResponseStatus.Success;
            }
            catch (Exception ex)
            {
                string msg = string.Format("Error in WebMultiPaymentListSelect: detail:{0}", ex.Message);
                Logger.Error(msg, ex);
                response.Status  = ResponseStatus.Exception;
                response.Message = msg;
            }
            return(response);
        }
Example #3
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);
        }