Example #1
0
                                                    public async Task <IHttpActionResult> Delete(int Id)
                                                    {
                                                        try{ log.Info(new MDCSet(this.ControllerContext.RouteData), new InfoException(Id));
                                                             await _EventoRepo.Delete(Id);

                                                             return(Ok("Registro eliminado correctamente!")); }
                                                        catch (Exception e) { log.Error(new MDCSet(this.ControllerContext.RouteData), e);
                                                                              throw new Exception(e.Message, e); }
                                                    }
 public HttpResponseMessage Delete(int id)
 {
     try
     {
         _participanteRep.Delete(id);
         return(Request.CreateResponse(HttpStatusCode.OK, new { message = "Deletado com sucesso", success = true }));
     }
     catch (System.Exception e)
     {
         return(Request.CreateResponse(HttpStatusCode.InternalServerError, new { message = e.Message, success = false }));
     }
 }
Example #3
0
        public IActionResult EliminarEvento(IFormCollection form)
        {
            string idEventoString  = form["idEvento"];
            string idUsuarioString = form["idUsuario"];
            int    idEvento        = Convert.ToInt32(idEventoString);
            int    idUser          = Convert.ToInt32(idUsuarioString);

            EventoRepository eventoDAO = new EventoRepository();

            eventoDAO.Delete(idEvento);

            TempData["SuccessMessage"] = "Evento eliminado! :D";
            return(RedirectToAction("Index", "Eventos", new { idUsuario = idUser }));
        }
Example #4
0
 public void eliminarEvento(String lugar)
 {
     foreach (Evento a in eventos)
     {
         if (lugar == a.lugar)
         {
             DB context          = new DB();
             EventoRepository er = new EventoRepository();
             er.Delete(a.id_evento, context);
             eventos.Remove(a);
             Console.WriteLine("Evento eliminado");
             break;
         }
     }
 }
Example #5
0
 public async Task <bool> Deletar(long id)
 {
     return(await repository.Delete(id));
 }
Example #6
0
 public async Task Delete(int id)
 {
     var db = new EventoRepository(Service.Unit);
     await db.Delete(id);
 }
 public ActionResult Delete(int id)
 {
     eveRep.Delete(id);
     return(RedirectToAction("Eventos"));
 }
        // DELETE: api/Eventos/5
        public void Delete(int id)
        {
            var repo = new EventoRepository();

            repo.Delete(id);
        }
Example #9
0
        public void Delete(int id)
        {
            EventoRepository rep = new EventoRepository();

            rep.Delete(id);
        }
        public ActionResult Delete(int id)
        {
            _eventoRepository.Delete(id);

            return(RedirectToAction("Index"));
        }
Example #11
0
 public bool Delete(int id)
 {
     return(_eventoRepository.Delete(id));
 }