Ejemplo n.º 1
0
        public ActionResult GetProducts([DataSourceRequest] DataSourceRequest request, Guid contractId)
        {
            var lists = expRepo.GetProducts(contractId);
            List <ObkExpProducts> products = new List <ObkExpProducts>();

            foreach (var list in lists)
            {
                ObkExpProducts r = new ObkExpProducts();
                r.ProductId             = list.Id;
                r.ProductNameRu         = list.NameRu;
                r.ProductCountryNameRu  = list.CountryNameRu;
                r.ProductProducerNameRu = list.ProducerNameRu;
                products.Add(r);
            }
            var result = products.ToDataSourceResult(request);

            return(Json(result));
        }