コード例 #1
0
 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();
         }
     }
 }
コード例 #2
0
 protected void btnDelete_Click(object sender, EventArgs e)
 {
     bsn_book.deleteBook(ent_book.Code);
     clean();
 }