Exemplo n.º 1
0
        public JsonResult Read(int skip, int take)
        {
            IEnumerable <DetailProductModel> result = DetailProductRepository.All().OrderByDescending(p => p.ProductID);

            result = result.Skip(skip).Take(take);

            return(this.Jsonp(result));
        }
Exemplo n.º 2
0
        public JsonResult Update()
        {
            var models = this.DeserializeObject <IEnumerable <DetailProductModel> >("models");

            if (models != null)
            {
                DetailProductRepository.Update(models);
            }
            return(this.Jsonp(models));
        }
Exemplo n.º 3
0
        public ActionResult Create()
        {
            var products = this.DeserializeObject <IEnumerable <DetailProductModel> >("models");

            if (products != null)
            {
                DetailProductRepository.Insert(products);
            }
            return(this.Jsonp(products));
        }
Exemplo n.º 4
0
        public JsonResult Submit()
        {
            var model = this.DeserializeObject <DetailProductSubmitViewModel>("models");

            if (model != null && model.Created != null)
            {
                DetailProductRepository.Insert(model.Created);
            }

            if (model != null && model.Updated != null)
            {
                DetailProductRepository.Update(model.Updated);
            }

            if (model != null && model.Destroyed != null)
            {
                DetailProductRepository.Delete(model.Destroyed);
            }

            return(this.Jsonp(model));
        }
Exemplo n.º 5
0
 public ActionResult Index()
 {
     return(this.Jsonp(DetailProductRepository.All()));
 }