Example #1
0
        public ActionResult DeleteConfirmed(int id)
        {
            tipo_cerveza tipo_cerveza = db.tipo_cerveza.Find(id);

            //db.tipo_cerveza.Remove(tipo_cerveza);
            // db.SaveChanges();
            db.borrarTipoCerveza(tipo_cerveza.id);
            return(RedirectToAction("Index"));
        }
Example #2
0
 public ActionResult Edit([Bind(Include = "id,nombre,descripcion,alcohol")] tipo_cerveza tipo_cerveza)
 {
     if (ModelState.IsValid)
     {
         //db.Entry(tipo_cerveza).State = EntityState.Modified;
         // db.SaveChanges();
         db.editarTipoCerveza(tipo_cerveza.id, tipo_cerveza.nombre, tipo_cerveza.descripcion, tipo_cerveza.alcohol);
         return(RedirectToAction("Index"));
     }
     return(View(tipo_cerveza));
 }
Example #3
0
        public ActionResult Create([Bind(Include = "id,nombre,descripcion,alcohol")] tipo_cerveza tipo_cerveza)
        {
            if (ModelState.IsValid)
            {
                // db.tipo_cerveza.Add(tipo_cerveza);
                //db.SaveChanges();
                db.guardarTipoCerveza(tipo_cerveza.nombre, tipo_cerveza.descripcion, tipo_cerveza.alcohol);
                return(RedirectToAction("Index"));
            }

            return(View(tipo_cerveza));
        }
Example #4
0
        // GET: /TipoCerveza/Delete/5
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            tipo_cerveza tipo_cerveza = db.tipo_cerveza.Find(id);

            if (tipo_cerveza == null)
            {
                return(HttpNotFound());
            }
            return(View(tipo_cerveza));
        }