public async Task <JsonResult> FillData(string Prefix, string EventId) { try { switch (Prefix.ToLower()) { case "details": string Enum_NatureOfIncident = Convert.ToString(En.NatureOfIncident.O); //load/bind dropdown var DropdownFraudIncidentsViewModel = new FraudIncidentsViewModel { ReportedVia = await BaseService.GetRefLib("ReportVia"), NextStatus = await BaseService.GetRefLib("FraudSts"), NatureOfIncident = await BaseService.GetRefLib("NtfIncidentType"), InvestigatedBy = await FraudOpService.GetFraudDropdown((int)En.FraudSection.IncidentInvestigationTeam, "Y", null, null, null) }; var fraudMainViewModel = (await FraudOpService.GetFraudByEventId(EventId)).webFraudDetail; //get customer sale list var customerDetailsShowList = (await FraudOpService.FraudCustomerDetailsByacctNoEventId(fraudMainViewModel.FraudCustomerDetailsViewModel.AcctNo, EventId)).fraudCustomerDetails; var cardNoLst = (await FraudOpService.GetCardNoListByAcctNo((int)En.FraudSection.CardDetails, "Y", null, fraudMainViewModel.FraudCustomerDetailsViewModel.AcctNo, EventId)).fraudCard; var cardDetailsShowList = (await FraudOpService.GetFraudCardDetailsList(null, fraudMainViewModel.FraudCustomerDetailsViewModel.AcctNo, EventId, cardNoLst)).fraudCardDetails; var CardMonth1Date = cardDetailsShowList.Where(s => !string.IsNullOrEmpty(s.CardMonth1Date)).Distinct().Select(s => s.CardMonth1Date).FirstOrDefault(); var CardMonth2Date = cardDetailsShowList.Where(s => !string.IsNullOrEmpty(s.CardMonth2Date)).Distinct().Select(s => s.CardMonth2Date).FirstOrDefault(); var CardMonth3Date = cardDetailsShowList.Where(s => !string.IsNullOrEmpty(s.CardMonth3Date)).Distinct().Select(s => s.CardMonth3Date).FirstOrDefault(); var CardMonth4Date = cardDetailsShowList.Where(s => !string.IsNullOrEmpty(s.CardMonth4Date)).Distinct().Select(s => s.CardMonth4Date).FirstOrDefault(); var CardMonth5Date = cardDetailsShowList.Where(s => !string.IsNullOrEmpty(s.CardMonth5Date)).Distinct().Select(s => s.CardMonth5Date).FirstOrDefault(); var CardMonth6Date = cardDetailsShowList.Where(s => !string.IsNullOrEmpty(s.CardMonth6Date)).Distinct().Select(s => s.CardMonth6Date).FirstOrDefault(); var CardAvgSalesDisplay = cardDetailsShowList.Where(s => !string.IsNullOrEmpty(s.CardAvgSalesDisplay)).Distinct().Select(s => s.CardAvgSalesDisplay).FirstOrDefault(); return(Json(new { _FraudIncidentsViewModel = fraudMainViewModel.FraudIncidentsViewModel, _FraudCustomerDetailsViewModel = fraudMainViewModel.FraudCustomerDetailsViewModel, _FraudCardDetailsViewModel = fraudMainViewModel.FraudCardDetailsViewModel, Selects = DropdownFraudIncidentsViewModel, CardNo = cardNoLst, model = customerDetailsShowList.Select(x => new object[] { x.CmpyName1, x.AccountType, x.ClientType, x.AgeingDays, x.Month1Date, x.Month2Date, x.Month3Date, x.Month4Date, x.Month5Date, x.Month6Date, x.AvgSalesDisplay, x.SubsidyNo }).FirstOrDefault(), aaData = customerDetailsShowList.Select(x => new object[] { x.Month1Amt, x.Month2Amt, x.Month3Amt, x.Month4Amt, x.Month5Amt, x.Month6Amt, x.AvgSales }), cardModel = new object[] { CardMonth1Date, CardMonth2Date, CardMonth3Date, CardMonth4Date, CardMonth5Date, CardMonth6Date, CardAvgSalesDisplay }, cardaaData = cardDetailsShowList.Select(x => new object[] { x.FraudCards[0].SelectedCardNo, x.CardMonth1Amt, x.CardMonth2Amt, x.CardMonth3Amt, x.CardMonth4Amt, x.CardMonth5Amt, x.CardMonth6Amt, x.CardAvgSales, x.LitLimit, x.SingleTxn, x.DailyTxn, x.MonthlyTxn, x.DailyCnt, x.MonthlyCnt, x.DailyLitre, x.MonthlyLitre }), liFraudCards = cardDetailsShowList.SelectMany(x => x.FraudCards), Enum_NatureOfIncident = Enum_NatureOfIncident }, JsonRequestBehavior.AllowGet)); case "txn": var _FraudTxnDisputeViewModel = new FraudTxnDisputeViewModel { TxnCategory = await BaseService.GetTransactionCategory(), TxnCd = await BaseService.WebGetTxnCode("I") }; var json = Json(new { Selects = _FraudTxnDisputeViewModel }, JsonRequestBehavior.AllowGet); json.MaxJsonLength = int.MaxValue; return(json); default: HttpContext.Response.StatusCode = 404; return(Json(null, JsonRequestBehavior.AllowGet)); } } catch (Exception ex) { HttpContext.Response.StatusCode = 404; return(Json(null, JsonRequestBehavior.AllowGet)); } }
public async Task <ActionResult> GetFraudTxnSearch(jQueryDataTableParamModel Params, FraudTxnDisputeViewModel _FraudTxnDisputeViewModel, string IsPostedDispute) { var _filtered = new List <FraudTxnDisputeViewModel>(); var list = (await FraudOpService.GetFraudDisputeTxnSearch(NumberExtensions.ConvertLongToDb(_FraudTxnDisputeViewModel.EventId), Convert.ToInt32(IsPostedDispute), _FraudTxnDisputeViewModel.SelectedTxnCategory, _FraudTxnDisputeViewModel.SelectedTxnCd, _FraudTxnDisputeViewModel.AcctNo, _FraudTxnDisputeViewModel.SelectedCardNo, _FraudTxnDisputeViewModel.FromDate, _FraudTxnDisputeViewModel.ToDate)).fraudTxnDisputes; _filtered = list.Skip(Params.iDisplayStart).Take(Params.iDisplayLength).ToList(); return(Json(new { sEcho = Params.sEcho, iTotalRecords = list.Count, iTotalDisplayRecords = list.Count, aaData = _filtered.Select(x => new object[] { null, x.TxnId, x.TxnDesp, x.TxnDate, x.AuthCardNo, x.VehRegNo, x.Stan, x.RRn, x.BSNLocation, x.BSNLocationName, x.TermId, x.TxnAmt }) }, JsonRequestBehavior.AllowGet)); }