示例#1
0
        public IHttpActionResult PutCustomer_Order_Line(int id, Customer_Order_Line customer_Order_Line)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (id != customer_Order_Line.Customer_Order_ID)
            {
                return(BadRequest());
            }

            db.Entry(customer_Order_Line).State = EntityState.Modified;

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

            return(StatusCode(HttpStatusCode.NoContent));
        }
示例#2
0
        public IHttpActionResult GetCustomer_Order_Line(int id)
        {
            Customer_Order_Line customer_Order_Line = db.Customer_Order_Line.Find(id);

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

            return(Ok(customer_Order_Line));
        }
示例#3
0
        public IHttpActionResult PostCustomer_Order_Line(Customer_Order_Line customer_Order_Line)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            db.Customer_Order_Line.Add(customer_Order_Line);
            db.SaveChanges();

            return(CreatedAtRoute("DefaultApi", new { id = customer_Order_Line.Customer_Order_ID }, customer_Order_Line));
        }
示例#4
0
        public IHttpActionResult DeleteCustomer_Order_Line(int id)
        {
            Customer_Order_Line customer_Order_Line = db.Customer_Order_Line.Find(id);

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

            db.Customer_Order_Line.Remove(customer_Order_Line);
            db.SaveChanges();

            return(Ok(customer_Order_Line));
        }