/*************************************
        *  Created by:   Tuan Tran
        *  Created on:   March 2, 2017
        *  Function:     GetManualSlipEntryBatchList
        *  Purpose:      GetManualSlipEntryBatchList
        *  Inputs:
        *  Returns:      PinMailerBatchResponse
        *************************************/
        public ManualSlipEntryResponse GetManualSlipEntryBatchList()
        {
            Logger.Info("Invoking GetManualSlipEntryBatchList fuction use EF to call SP");
            var response = new ManualSlipEntryResponse()
            {
                Status = ResponseStatus.Failure,
            };

            try
            {
                using (var scope = Container.BeginLifetimeScope())
                {
                    var manualSlipEntryOpDAO = scope.Resolve <IManualSlipEntryOpDAO>();
                    var results = manualSlipEntryOpDAO.GetManualSlipEntryBatchList();
                    if (results.Count() > 0)
                    {
                        response.merchManualTxns = Mapper.Map <IList <ManualSlipEntryDTO>, IList <ManualSlipEntry> >(results);
                    }
                }
                response.Status = ResponseStatus.Success;
            }
            catch (Exception ex)
            {
                string msg = string.Format("Error in GetManualSlipEntryBatchList: detail:{0}", ex.Message);
                Logger.Error(msg, ex);
                response.Status  = ResponseStatus.Exception;
                response.Message = msg;
            }
            return(response);
        }
        /*************************************
        *  Created by:   dandy Boy
        *  Created on:   june 29, 2017
        *  Function:     GetMerchManualTxnProductDetail
        *  Purpose:      GetMerchManualTxnProductDetail
        *  Inputs:       txnId,txnDetailId
        *  Returns:      ManualSlipEntryResponse
        *************************************/
        public async Task <ManualSlipEntryResponse> GetMerchManualTxnProductDetail(string txnId, string txnDetailId)
        {
            Logger.Info("Invoking GetMerchManualTxnProductDetail fuction use EF to call SP");
            var response = new ManualSlipEntryResponse()
            {
                Status = ResponseStatus.Failure,
            };

            try
            {
                using (var scope = Container.BeginLifetimeScope())
                {
                    var manualSlipEntryOpDAO = scope.Resolve <IManualSlipEntryOpDAO>();
                    var result = await manualSlipEntryOpDAO.GetMerchManualTxnProductDetail(txnId, txnDetailId);

                    if (result != null)
                    {
                        response.manualSlipEntryBatchDetail = Mapper.Map <MerchManualTxnDTO, ManualSlipEntry>(result);
                    }
                }
                response.Status = ResponseStatus.Success;
            }
            catch (Exception ex)
            {
                string msg = string.Format("Error in GetMerchManualTxnProductDetail: detail:{0}", ex.Message);
                Logger.Error(msg, ex);
                response.Status  = ResponseStatus.Exception;
                response.Message = msg;
            }
            return(response);
        }