Esempio n. 1
0
        public ActionResult DeleteConfirmed(int id)
        {
            tbl_mascota tbl_mascota = db.tbl_mascota.Find(id);

            db.tbl_mascota.Remove(tbl_mascota);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Esempio n. 2
0
 public ActionResult Edit([Bind(Include = "mas_codigo,mas_nombre,mas_fecha_nac,mas_raza,tim_codigo,mas_sexo")] tbl_mascota tbl_mascota)
 {
     if (ModelState.IsValid)
     {
         db.Entry(tbl_mascota).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.tim_codigo = new SelectList(db.tbl_tiposMascota, "tim_codigo", "tim_nombre", tbl_mascota.tim_codigo);
     return(View(tbl_mascota));
 }
Esempio n. 3
0
        // GET: mascota/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            tbl_mascota tbl_mascota = db.tbl_mascota.Find(id);

            if (tbl_mascota == null)
            {
                return(HttpNotFound());
            }
            return(View(tbl_mascota));
        }
Esempio n. 4
0
        // GET: mascota/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            tbl_mascota tbl_mascota = db.tbl_mascota.Find(id);

            if (tbl_mascota == null)
            {
                return(HttpNotFound());
            }
            ViewBag.tim_codigo = new SelectList(db.tbl_tiposMascota, "tim_codigo", "tim_nombre", tbl_mascota.tim_codigo);
            return(View(tbl_mascota));
        }