Beispiel #1
0
        public IHttpActionResult PutTBLEVENTO(int id, TBLEVENTO tBLEVENTO)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (id != tBLEVENTO.id_evento)
            {
                return(BadRequest());
            }

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

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

            return(StatusCode(HttpStatusCode.NoContent));
        }
Beispiel #2
0
        public IHttpActionResult GetTBLEVENTO(int id)
        {
            TBLEVENTO tBLEVENTO = db.TBLEVENTO.Find(id);

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

            return(Ok(tBLEVENTO));
        }
Beispiel #3
0
        public IHttpActionResult PostTBLEVENTO(TBLEVENTO tBLEVENTO)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            db.TBLEVENTO.Add(tBLEVENTO);
            db.SaveChanges();

            return(CreatedAtRoute("DefaultApi", new { id = tBLEVENTO.id_evento }, tBLEVENTO));
        }
Beispiel #4
0
        public IHttpActionResult DeleteTBLEVENTO(int id)
        {
            TBLEVENTO tBLEVENTO = db.TBLEVENTO.Find(id);

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

            db.TBLEVENTO.Remove(tBLEVENTO);
            db.SaveChanges();

            return(Ok(tBLEVENTO));
        }