public async Task <ISingleResponse <vmTransactionPrepareRequest> > PrepareTransactionRelatedRequestAsync(int currentUid)
        {
            var response = new SingleResponse <vmTransactionPrepareRequest>();

            try
            {
                // Retrieve PaymentMethods list
                response.Model.PaymentMethods = await PaymentMethodRepository.GetListPaymentMethodAsync();

                // Retrieve PaymentPayors list
                response.Model.PaymentPayors = await PaymentPayorRepository.GetListPaymentPayorAsync(currentUid);

                // Retrieve TransactionCategorys list
                response.Model.TransactionCategorys = await TransactionCategoryRepository.GetListTransactionCategoryAsync();

                // Retrieve TransactionTypes list
                response.Model.TransactionTypes = await TransactionTypeRepository.GetListTransactionTypeAsync();
            }
            catch (Exception ex)
            {
                response.SetError(ex);
            }

            return(response);
        }
示例#2
0
        public async Task <IListResponse <vmPaymentMethodListRequest> > GetListPaymentMethodAsync(int createdBy)
        {
            var response = new ListResponse <vmPaymentMethodListRequest>();

            try
            {
                var listPaymentMethodFromDb = await PaymentMethodRepository.GetListPaymentMethodAsync(createdBy);

                response.Model   = _mapper.Map <IEnumerable <PaymentMethod>, IEnumerable <vmPaymentMethodListRequest> >(listPaymentMethodFromDb);
                response.Message = ResponseMessageDisplay.Success;
            }
            catch (Exception ex)
            {
                response.SetError(ex);
            }

            return(response);
        }