public ActionResult DeleteConfirmed(int id)
        {
            poligono poligono = db.poligono.Find(id);

            db.poligono.Remove(poligono);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
 public ActionResult Edit([Bind(Include = "id,usuario_id")] poligono poligono)
 {
     if (ModelState.IsValid)
     {
         db.Entry(poligono).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.usuario_id = new SelectList(db.usuario, "id", "rut", poligono.usuario_id);
     return(View(poligono));
 }
        public ActionResult Create([Bind(Include = "id,usuario_id")] poligono poligono)
        {
            if (ModelState.IsValid)
            {
                db.poligono.Add(poligono);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            ViewBag.usuario_id = new SelectList(db.usuario, "id", "rut", poligono.usuario_id);
            return(View(poligono));
        }
        // GET: Poligonos/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            poligono poligono = db.poligono.Find(id);

            if (poligono == null)
            {
                return(HttpNotFound());
            }
            return(View(poligono));
        }
        // GET: Poligonos/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            poligono poligono = db.poligono.Find(id);

            if (poligono == null)
            {
                return(HttpNotFound());
            }
            ViewBag.usuario_id = new SelectList(db.usuario, "id", "rut", poligono.usuario_id);
            return(View(poligono));
        }