Ejemplo n.º 1
0
        public IActionResult Get(int id)
        {
            EventoBLL eventoBLL = new EventoBLL();
            var       evento    = eventoBLL.Get(id);

            return(Json(evento));
        }
        // GET: Eventos/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Evento evento = EventoBLL.Get(id);

            if (evento == null)
            {
                return(HttpNotFound());
            }
            return(View(evento));
        }
        // GET: Eventos/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Evento evento = EventoBLL.Get(id);

            if (evento == null)
            {
                return(HttpNotFound());
            }
            ViewBag.idcategoria = new SelectList(CategoriaBLL.List(), "idcategoria", "nombre", evento.idcategoria);
            return(View(evento));
        }
 public IHttpActionResult Get(int id)
 {
     try
     {
         Evento result = EventoBLL.Get(id);
         if (result == null)
         {
             return(NotFound());
         }
         return(Content(HttpStatusCode.OK, result));
     }
     catch (Exception ex)
     {
         return(Content(HttpStatusCode.BadRequest, ex));
     }
 }