public IHttpActionResult PutCONTACTOS(int id, CONTACTOS cONTACTOS)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (id != cONTACTOS.CONTACTO_ID)
            {
                return(BadRequest());
            }

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

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

            return(StatusCode(HttpStatusCode.NoContent));
        }
示例#2
0
        public ActionResult DeleteConfirmed(int id)
        {
            CONTACTOS cONTACTOS = db.CONTACTOS.Find(id);

            db.CONTACTOS.Remove(cONTACTOS);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
示例#3
0
 public ActionResult Edit([Bind(Include = "ID,CEDULA,NombreCompleto,FECHA")] CONTACTOS cONTACTOS)
 {
     if (ModelState.IsValid)
     {
         db.Entry(cONTACTOS).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(cONTACTOS));
 }
示例#4
0
        public ActionResult Create([Bind(Include = "ID,CEDULA,NombreCompleto,FECHA")] CONTACTOS cONTACTOS)
        {
            if (ModelState.IsValid)
            {
                db.CONTACTOS.Add(cONTACTOS);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(cONTACTOS));
        }
        public IHttpActionResult GetCONTACTOS(int id)
        {
            CONTACTOS cONTACTOS = db.CONTACTOS.Find(id);

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

            return(Ok(cONTACTOS));
        }
        public IHttpActionResult PostCONTACTOS(CONTACTOS cONTACTOS)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            db.CONTACTOS.Add(cONTACTOS);
            db.SaveChanges();

            return(CreatedAtRoute("DefaultApi", new { id = cONTACTOS.CONTACTO_ID }, cONTACTOS));
        }
示例#7
0
        // GET: CONTACTOS/Delete/5
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            CONTACTOS cONTACTOS = db.CONTACTOS.Find(id);

            if (cONTACTOS == null)
            {
                return(HttpNotFound());
            }
            return(View(cONTACTOS));
        }
        public IHttpActionResult DeleteCONTACTOS(int id)
        {
            CONTACTOS cONTACTOS = db.CONTACTOS.Find(id);

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

            db.CONTACTOS.Remove(cONTACTOS);
            db.SaveChanges();

            return(Ok(cONTACTOS));
        }