public ActionResult DeleteConfirmed(int id)
        {
            tipo_restaurante tipo_restaurante = _context.tipo_restaurante.Find(id);

            _context.tipo_restaurante.Remove(tipo_restaurante);
            _context.SaveChanges();
            return(RedirectToAction("Index"));
        }
 public ActionResult Edit([Bind(Include = "tipo_restaurante_id,descripcion")] tipo_restaurante tipo_restaurante)
 {
     if (ModelState.IsValid)
     {
         _context.Entry(tipo_restaurante).State = EntityState.Modified;
         _context.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(tipo_restaurante));
 }
        public ActionResult Create([Bind(Include = "tipo_restaurante_id,descripcion")] tipo_restaurante tipo_restaurante)
        {
            if (ModelState.IsValid)
            {
                _context.tipo_restaurante.Add(tipo_restaurante);
                _context.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(tipo_restaurante));
        }
Esempio n. 4
0
 public ActionResult Guardar(tipo_restaurante empresa)
 {
     if (ModelState.IsValid)
     {
         empresa.guardar();
         return(Redirect("~/tipo_restaurante"));
     }
     else
     {
         return(View("~/Views/tipo_restaurante/Agregar.cshtml", empresa));
     }
 }
        // GET: Admin/TiposRestaurante/Delete/5
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            tipo_restaurante tipo_restaurante = _context.tipo_restaurante.Find(id);

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