Beispiel #1
0
        // PUT: odata/CustomerReporting(5)
        public IHttpActionResult Put([FromODataUri] int key, Delta <customer_rpt> patch)
        {
            Validate(patch.GetEntity());

            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            customer_rpt customer_rpt = db.customers_rpt.Find(key);

            if (customer_rpt == null)
            {
                return(NotFound());
            }

            patch.Put(customer_rpt);

            try
            {
                db.SaveChanges();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!customer_rptExists(key))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(Updated(customer_rpt));
        }
        // PUT: odata/OrderQuantitiesReporting(5)
        public IHttpActionResult Put([FromODataUri] int key, Delta <vw_order_quantities> patch)
        {
            Validate(patch.GetEntity());

            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            vw_order_quantities vw_order_quantities = db.vw_order_quantities.Find(key);

            if (vw_order_quantities == null)
            {
                return(NotFound());
            }

            patch.Put(vw_order_quantities);

            try
            {
                db.SaveChanges();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!vw_order_quantitiesExists(key))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(Updated(vw_order_quantities));
        }