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)); }
public ActionResult ExpDocumentDestroy([DataSourceRequest] DataSourceRequest request, ObkExpProductSeries productSeries) { if (productSeries != null && ModelState.IsValid) { var dbProcuntsSeries = db.OBK_StageExpDocument.SingleOrDefault(x => x.ProductSeriesId == productSeries.SeriesId); if (dbProcuntsSeries != null) { } } return(Json(new[] { productSeries }.ToDataSourceResult(request, ModelState))); }