Example #1
0
 public IActionResult Delete([FromRoute] int id)
 {
     try
     {
         var eventoBll = new EventoBll();
         eventoBll.Delete(id);
         return(NoContent());
     }
     catch (Exception ex)
     {
         Console.WriteLine(ex.Message);
         return(StatusCode(500));
     }
 }
 private void tsbDeletar_Click(object sender, EventArgs e)
 {
     try
     {
         bll.Delete(EventoSelect());
         UpdateGrid();
         UpdateForm();
         Clean();
         lblMsgErro.Visible = false;
     }
     catch (Exception ex)
     {
         lblMsgErro.Visible = true;
         lblMsgErro.Text    = "Erro: " + ex.Message;
     }
 }