public JsonResult ReadCheques() { var cheques = _transporterChequeService.GetAllTransporterCheque().Where(t => t.Status < 4).Select(c => { var transporterChequeDetail = c.TransporterChequeDetails.FirstOrDefault(); return(transporterChequeDetail != null ? new { chequeNo = c.CheckNo, Transporter = transporterChequeDetail.TransporterPaymentRequest.TransportOrder.Transporter.Name, c.Amount, PreparedBy = c.UserProfile.FirstName + " " + c.UserProfile.LastName, ApprovedBy = c.AppovedBy != null ? _userProfileService.FindById((int)c.AppovedBy).FirstName + " " + _userProfileService.FindById((int)c.AppovedBy).LastName : "", DateApproved = c.AppovedDate.Date.ToCTSPreferedDateFormat(UserAccountHelper.UserCalendarPreference()), transporterChequeId = c.TransporterChequeId, State = c.Status, Status = c.BusinessProcess.CurrentState.BaseStateTemplate.Name, ButtonStatus = c.BusinessProcess.CurrentState.BaseStateTemplate.Name, c.BankName } : null); }); return(Json(cheques, JsonRequestBehavior.AllowGet)); }