public ActionResult GetProductSeries([DataSourceRequest] DataSourceRequest request, int productId) { var lists = expRepo.GetProductSeries(productId); List <ObkExpProductSeries> series = new List <ObkExpProductSeries>(); foreach (var list in lists) { var stage = list.OBK_StageExpDocument.FirstOrDefault(e => e.ProductSeriesId == list.Id); ObkExpProductSeries s = new ObkExpProductSeries(); if (stage != null) { s.ExpResult = stage.ExpResult; s.ExpStartDate = stage.ExpStartDate.ToString(); s.ExpEndDate = stage.ExpEndDate.ToString(); s.ExpReasonNameRu = stage.ExpReasonNameRu; s.ExpReasonNameKz = stage.ExpReasonNameKz; s.ExpProductNameRu = stage.ExpProductNameRu; s.ExpProductNameKz = stage.ExpProductNameKz; s.ExpAddInfoRu = stage.ExpAddInfoRu; s.ExpAddInfoKz = stage.ExpAddInfoKz; s.ExpConclusionNumber = stage.ExpConclusionNumber; s.ExpBlankNumber = stage.ExpBlankNumber; s.ExpApplicationNumber = stage.ExpApplicationNumber; } series.Add(s); s.SeriesNameRu = list.Series; s.SeriesResultText = stage.ExpResult ? "Соответсвует требованиям" : "Не соотвествует требованиям"; } var result = series.ToDataSourceResult(request); return(Json(result, JsonRequestBehavior.AllowGet)); }