private void DeleteButton_Click(object render, RoutedEventArgs e) { if (PersonaBLL.Delete(Convert.ToInt32(PersonaIdTextBox.Text))) { Limpiar(); MessageBox.Show("Eliminado", "Exito", MessageBoxButton.OK); } else { MessageBox.Show("Error al eliminar", "Error", MessageBoxButton.OK); } }
public IHttpActionResult DeletePersona(int id) { Persona persona = PersonaBLL.Get(id); if (persona == null) { return(NotFound()); } try { PersonaBLL.Delete(id); return(Ok("Persona eliminada correctamente")); } catch (Exception ex) { return(Content(HttpStatusCode.BadRequest, ex)); } }