public JsonResult Search(DataTableParamCase param) { var cases = CaseService.SearchCaseDetails(param.CaseNumber, param.CaseKey, param.EntityName, param.SocialSecurityNumber, param.BirthDate, param.FilingDate, param.RegionId, param.ClinicId, param.EBTNumber) .OrderBy(m => m.CaseId) .ToPagedList(param.Start + 1, param.Length); var data = CaseViewModel.CreateFrom(cases).ToList(); var result = new DataTableResult <CaseViewModel> { draw = param.Draw, data = data, recordsFiltered = cases.Count, recordsTotal = cases.TotalItemCount }; return(Json(result, JsonRequestBehavior.AllowGet)); }
public JsonResult SearchForOtherRelatedCases(DataTableParamCase param, string CurrentCaseNumber) { IEnumerable <CaseDetail> RelatedCases = CaseService.FindRelatedCasesDetailByCaseNumber(CurrentCaseNumber, "00"); IEnumerable <CaseDetail> Cases = CaseService.SearchCaseDetails(param.CaseNumber, param.CaseKey, param.EntityName, param.SocialSecurityNumber, param.BirthDate, param.FilingDate, param.RegionId, param.ClinicId, param.EBTNumber) .ToPagedList(param.Start + 1, param.Length); var results = Cases.Select(r => new { CaseNumber = r.CaseNumber, FullName = r.Entity.FullName, SSN = r.Entity.SSN, Birthdate = r.Entity.BirthDate, EBT = r.EBTAccount, Adjudication = TransactionService.GetTotalAdjudicationByCase(r.CaseId), CaseId = r.CaseId, IsRelated = RelatedCases.Contains(r) }); return(Json(new BasicDataTablesResult(results), JsonRequestBehavior.AllowGet)); //return Json(result, JsonRequestBehavior.AllowGet); }