Beispiel #1
0
        public IHttpActionResult PutSchool_Costing(int id, School_Costing school_Costing)
        {
            if (id != school_Costing.School_CostingID)
            {
                return(BadRequest());
            }

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

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

            return(StatusCode(HttpStatusCode.NoContent));
        }
Beispiel #2
0
        public IHttpActionResult PostSchool_Costing(School_Costing school_Costing)
        {
            db.School_Costing.Add(school_Costing);
            db.SaveChanges();

            return(CreatedAtRoute("DefaultApi", new { id = school_Costing.School_CostingID }, school_Costing));
        }
Beispiel #3
0
        public IHttpActionResult GetSchool_Costing(int id)
        {
            School_Costing school_Costing = db.School_Costing.Find(id);

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

            return(Ok(school_Costing));
        }
Beispiel #4
0
        public IHttpActionResult DeleteSchool_Costing(int id)
        {
            School_Costing school_Costing = db.School_Costing.Find(id);

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

            db.School_Costing.Remove(school_Costing);
            db.SaveChanges();

            return(Ok(school_Costing));
        }