public IActionResult Delete([FromBody] Evento evento)
        {
            EventoBLL eventoBLL = new EventoBLL();

            eventoBLL.Delete(evento);
            return(NoContent());
        }
Exemple #2
0
 public static int EliminarEvento(int idEvento)
 {
     try
     {
         EventoBLL.Delete(idEvento);
         return(idEvento);
     }
     catch (Exception)
     {
         return(-1);
     }
 }
 public IHttpActionResult Delete(int id)
 {
     try
     {
         EventoBLL.Delete(id);
         return(Ok("Evento eliminado correctamente"));
     }
     catch (Exception ex)
     {
         return(Content(HttpStatusCode.BadRequest, ex));
     }
 }
Exemple #4
0
        // GET: Eventos/Delete/5
        public JsonResult DeleteEventos(int id)
        {
            var          eveBLL  = new EventoBLL();
            wmJsonResult objJson = new wmJsonResult();

            try
            {
                tblEvento evento = eveBLL.RetrievEventoByID(id);

                if (evento != null)
                {
                    bool banderita = eveBLL.Delete(id);

                    if (banderita == true)
                    {
                        objJson.bandera = true;
                        objJson.mensaje = "El evento se eliminó correctamente";
                    }
                    else
                    {
                        objJson.bandera = false;
                        objJson.mensaje = "El evento NO se eliminó correctamente";
                    }
                }
                else
                {
                    objJson.bandera = false;
                    objJson.mensaje = "El evento no se encontró";
                }
            }
            catch
            {
                objJson.bandera = false;
                objJson.mensaje = "Ocurrio una excepcion al eliminar el evento";
            }

            return(Json(objJson, JsonRequestBehavior.AllowGet));
        }
 public ActionResult DeleteConfirmed(int id)
 {
     EventoBLL.Delete(id);
     return(RedirectToAction("Index"));
 }