public MainResponse GetFinancialViewDetail(ViewDetailRequest viewDetailRequest)
        {
            var financialDetail = _exhibitorRepository.GetFinancialViewDetail(viewDetailRequest);

            if (financialDetail.getExhibitorTransactions != null && financialDetail.getExhibitorTransactions.Count() != 0)
            {
                _mainResponse.GetAllExhibitorTransactions = financialDetail;
                _mainResponse.Success = true;
            }
            else
            {
                _mainResponse.Message = Constants.NO_RECORD_FOUND;
                _mainResponse.Success = false;
            }
            return(_mainResponse);
        }
Exemplo n.º 2
0
        public GetAllExhibitorTransactions GetFinancialViewDetail(ViewDetailRequest viewDetailRequest)
        {
            IEnumerable <GetExhibitorTransactions> data = null;
            GetAllExhibitorTransactions            getAllExhibitorTransactions = new GetAllExhibitorTransactions();

            data = (from exhibitorPaymentDetail in _context.ExhibitorPaymentDetail
                    where exhibitorPaymentDetail.ExhibitorId == viewDetailRequest.ExhibitorId &&
                    exhibitorPaymentDetail.FeeTypeId == viewDetailRequest.FeeTypeId &&
                    exhibitorPaymentDetail.IsActive == true && exhibitorPaymentDetail.IsDeleted == false
                    select new GetExhibitorTransactions
            {
                ExhibitorPaymentDetailId = exhibitorPaymentDetail.ExhibitorPaymentId,
                PayDate = exhibitorPaymentDetail.PayDate,
                TypeOfFee = _context.GlobalCodes.Where(x => x.GlobalCodeId == exhibitorPaymentDetail.FeeTypeId).Select(x => x.CodeName).FirstOrDefault(),
                TimeFrameType = exhibitorPaymentDetail.TimeFrameType,
                Amount = exhibitorPaymentDetail.Amount,
                AmountPaid = exhibitorPaymentDetail.AmountPaid,
                RefundAmount = exhibitorPaymentDetail.RefundAmount
            });
            getAllExhibitorTransactions.getExhibitorTransactions = data.ToList();
            return(getAllExhibitorTransactions);
        }
        public GetAllExhibitorTransactions GetFinancialViewDetail(ViewDetailRequest viewDetailRequest)
        {
            GetAllExhibitorTransactions            getAllExhibitorTransactions = new GetAllExhibitorTransactions();
            IEnumerable <GetExhibitorTransactions> data = null;
            // int yealryMaintId = _context.YearlyMaintainence.Where(x => x.Years == DateTime.Now.Year && x.IsDeleted == false).Select(x => x.YearlyMaintainenceId).FirstOrDefault();
            int yealryMaintId = _context.YearlyMaintainence.Where(x => x.IsDeleted == false).Select(x => x.YearlyMaintainenceId).FirstOrDefault();
            var fee           = _context.YearlyMaintainenceFee.Where(x => x.YearlyMaintainenceFeeId == viewDetailRequest.FeeTypeId).FirstOrDefault();
            var allFee        = _context.YearlyMaintainenceFee.Where(x => x.FeeName == (fee != null? fee.FeeName:"") && x.YearlyMaintainenceId == yealryMaintId &&
                                                                     x.IsDeleted == false).ToList();

            int[] feeId = new int[allFee.Count];

            for (int i = 0; i <= feeId.Length - 1; i++)
            {
                feeId[i] = allFee[i].YearlyMaintainenceFeeId;
            }

            data = (from exhibitorPaymentDetail in _context.ExhibitorPaymentDetail
                    where exhibitorPaymentDetail.ExhibitorId == viewDetailRequest.ExhibitorId &&
                    (exhibitorPaymentDetail.FeeTypeId == (feeId.Length != 0?feeId[0]:0) ||
                     exhibitorPaymentDetail.FeeTypeId == (feeId.Length == 2? feeId[1]:0)) &&
                    exhibitorPaymentDetail.IsDeleted == false
                    select new GetExhibitorTransactions
            {
                ExhibitorPaymentDetailId = exhibitorPaymentDetail.ExhibitorPaymentId,
                PayDate = exhibitorPaymentDetail.PayDate,
                TypeOfFee = _context.YearlyMaintainenceFee.Where(x => x.YearlyMaintainenceFeeId == exhibitorPaymentDetail.FeeTypeId).Select(x => x.FeeName).FirstOrDefault(),
                TimeFrameType = exhibitorPaymentDetail.TimeFrameType,
                Amount = exhibitorPaymentDetail.Amount,
                AmountPaid = exhibitorPaymentDetail.AmountPaid,
                RefundAmount = exhibitorPaymentDetail.RefundAmount
            }).ToList();

            getAllExhibitorTransactions.getExhibitorTransactions = data.ToList();
            return(getAllExhibitorTransactions);
        }
 public ActionResult GetFinancialViewDetail(ViewDetailRequest viewDetailRequest)
 {
     _mainResponse = _exhibitorService.GetFinancialViewDetail(viewDetailRequest);
     _jsonString   = Mapper.Convert <GetAllExhibitorTransactions>(_mainResponse);
     return(new OkObjectResult(_jsonString));
 }