protected void btnDelete_Click(object sender, EventArgs e) { if (rblPrestado.Visible) { if (rblPrestado.SelectedItem.Text == "Si") { List <EntClsLoan> list_loan = bsn_loan.checkForCodeLoan(ent_book.Code); foreach (EntClsLoan loan in list_loan) { bsn_loan.deleteLoan(loan.Id); } bsn_book.deleteBook(ent_book.Code); clean(); listAdd(); } } else { try { if (ValidFull()) { bsn_book.deleteBook(ent_book.Code); clean(); listAdd(); } else { ErrorMessage(); } } catch { rblPrestado.Visible = true; lblPrestado.Visible = true; btnDelete.Enabled = false; ErrorMessageLoan(); } } }
protected void btnDelete_Click(object sender, EventArgs e) { bsn_book.deleteBook(ent_book.Code); clean(); }