示例#1
0
        public ActionResult DeleteConfirmed(int id)
        {
            destinos destinos = db.destinos.Find(id);

            db.destinos.Remove(destinos);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
示例#2
0
 public ActionResult Edit([Bind(Include = "id,nombre,direccion,id_comuna,telefono,mail")] destinos destinos)
 {
     if (ModelState.IsValid)
     {
         db.Entry(destinos).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.id_comuna = new SelectList(db.comunas, "id", "comuna", destinos.id_comuna);
     return(View(destinos));
 }
示例#3
0
 public ActionResult Create([Bind(Include = "id,nombre,direccion,id_comuna,telefono,mail")] destinos destinos)
 {
     if (ModelState.IsValid)
     {
         db.destinos.Add(destinos);
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.region    = new SelectList(db.regiones, "id", "region");
     ViewBag.id_comuna = new SelectList(db.comunas, "id", "comuna", destinos.id_comuna);
     return(View(destinos));
 }
示例#4
0
        // GET: Destinos/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            destinos destinos = db.destinos.Find(id);

            if (destinos == null)
            {
                return(HttpNotFound());
            }
            return(View(destinos));
        }
示例#5
0
        // GET: Destinos/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            destinos destinos = db.destinos.Find(id);

            if (destinos == null)
            {
                return(HttpNotFound());
            }
            ViewBag.id_comuna = new SelectList(db.comunas, "id", "comuna", destinos.id_comuna);
            return(View(destinos));
        }