Пример #1
0
 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);
     }
 }
Пример #2
0
        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));
            }
        }