public IHttpActionResult DeleteAdmin(long id) { if (adminLogic.DeleteAdmin(id)) { return(StatusCode(HttpStatusCode.NoContent)); } return(NotFound()); }
private void buttonDelete_Click(object sender, EventArgs e) { Admin admin = (Admin)listBoxAdmins.SelectedItem; adminLogic.DeleteAdmin(admin); bool deleteUser = userLogic.DeleteUser(admin.UserId); MessageBox.Show("Se eliminó el administrador correctamente", "Confirmación"); panelAdminMaintenace.Visible = false; if (admin.Id == actualAdmin.Id) { ClearSignIn(); panelSignIn.Visible = true; } else { panelOptions.Visible = true; } }