public GetAllExhibitorTransactions GetAllExhibitorTransactions(int exhibitorId) { IEnumerable <GetExhibitorTransactions> data = null; GetAllExhibitorTransactions getAllExhibitorTransactions = new GetAllExhibitorTransactions(); var exhibitorSponsor = _context.SponsorExhibitor.Where(x => x.ExhibitorId == exhibitorId && x.IsActive == true && x.IsDeleted == false); data = (from exhibitorPaymentDetail in _context.ExhibitorPaymentDetail where exhibitorPaymentDetail.ExhibitorId == exhibitorId && exhibitorPaymentDetail.IsActive == true && 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, DocumentPath = exhibitorPaymentDetail.DocumentPath }); getAllExhibitorTransactions.getExhibitorTransactions = data.ToList(); if (exhibitorSponsor.Count() != 0) { getAllExhibitorTransactions.IsRefund = true; } else { getAllExhibitorTransactions.IsRefund = false; } return(getAllExhibitorTransactions); }
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); }