コード例 #1
0
 public ActionResult Index(string criterio)
 {
     if (criterio == null || criterio == "")
     {
         return(View(restaurante1.Listar()));
     }
     else
     {
         return(View(restaurante1.buscar(criterio)));
     }
 }
コード例 #2
0
 public ActionResult Agregar(int id = 0)
 {
     ViewBag.Empresa     = empresa1.Listar();
     ViewBag.Restaurante = restaurante.Listar();
     ViewBag.Usuario     = usuario.Listar();
     return(View(id == 0 ? new empresa_restaurante_usuario() : empresa.Obtener(id)));
 }
コード例 #3
0
 public ActionResult Guardar(restaurante empresa)
 {
     ViewBag.Empresa = empresa.Listar();
     if (ModelState.IsValid)
     {
         empresa.guardar();
         return(Redirect("~/restaurante"));
     }
     else
     {
         return(View("~/Views/restaurante/Agregar.cshtml", empresa));
     }
 }
コード例 #4
0
 public ActionResult Agregar(int id = 0)
 {
     ViewBag.Tipo        = tipo.Listar();
     ViewBag.Restaurante = restaurante1.Listar();
     return(View(id == 0 ? new restaurante_tipo() : restaurante.Obtener(id)));
 }