private bool GetActivityCode(SearchTransfer result) { var query = from activity in misContext.Activity .Include(p => p.Strategy) .Include(p => p.Unit) .Include(p => p.Dsp) .Include(p => p.Awp).Where(P => P.ActivityId == result.ActivityId).ToList().Where(p => GetActivityCode(p)).ToList() select activity.ActivityCode; result.ActivityCode = query.FirstOrDefault(); return(true); }
private bool HighLightSearchString(SearchTransfer p, string searchString) { if (p.ExpenseId == 0) { p.ActivityCode = HighLight(p.ActivityCode, searchString); p.ActivityIdString = HighLight(p.ActivityIdString, searchString); p.ActivityName = HighLight(p.ActivityName, searchString); p.ActivityDescription = HighLight(p.ActivityDescription, searchString); return(true); } else { p.ExpenseIdString = HighLight(p.ExpenseIdString, searchString); p.ActivityName = HighLight(p.ActivityName, searchString); p.ExpenseName = HighLight(p.ExpenseName, searchString); return(true); } }