Esempio n. 1
0
        public IHttpActionResult Posttbl_bigplan(tbl_bigplan tbl_bigplan)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            db.tbl_bigplan.Add(tbl_bigplan);

            try
            {
                db.SaveChanges();
            }
            catch (DbUpdateException)
            {
                if (tbl_bigplanExists(tbl_bigplan.Bigplan_id))
                {
                    return(Conflict());
                }
                else
                {
                    throw;
                }
            }

            return(CreatedAtRoute("DefaultApi", new { id = tbl_bigplan.Bigplan_id }, tbl_bigplan));
        }
Esempio n. 2
0
        public IHttpActionResult Puttbl_bigplan(string id, tbl_bigplan tbl_bigplan)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (id != tbl_bigplan.Bigplan_id)
            {
                return(BadRequest());
            }

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

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

            return(StatusCode(HttpStatusCode.NoContent));
        }
Esempio n. 3
0
        public IHttpActionResult Gettbl_bigplan(string id)
        {
            tbl_bigplan tbl_bigplan = db.tbl_bigplan.Find(id);

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

            return(Ok(tbl_bigplan));
        }
Esempio n. 4
0
        public IHttpActionResult Deletetbl_bigplan(string id)
        {
            tbl_bigplan tbl_bigplan = db.tbl_bigplan.Find(id);

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

            db.tbl_bigplan.Remove(tbl_bigplan);
            db.SaveChanges();

            return(Ok(tbl_bigplan));
        }