protected void btnDelete_Click(object sender, EventArgs e) { ent_edit = bsn_edit.checkEditorial(textName.Text); lstEditVal = bsn_edit.valEdit(ent_edit.Id); if (lstEditVal.Count() > 0) { errorDeleteEdit(); } else { bsn_edit.deleteEditorial(ent_edit.Id); SucceDeleteEdit(); listAdd(); } }
protected void btnDelete_Click(object sender, EventArgs e) { try { bsn_edit.deleteEditorial(Convert.ToInt16(ddlEditorial.SelectedValue)); listAdd(); clean(); string script = @"<script type='text/javascript'> alert('El Autor ha sido Eliminado'); </script>"; ScriptManager.RegisterStartupScript(this, typeof(Page), "BookAdmin", script, false); } catch { string script = @"<script type='text/javascript'> alert('No se puede Eliminar La Editorial'); </script>"; ScriptManager.RegisterStartupScript(this, typeof(Page), "BookAdmin", script, false); } }