コード例 #1
0
 private void Delete()
 {
     try
     {
         int             rowsAffected = 0;
         BusinessManager BM           = new BusinessManager();
         BOCustomer      BO           = new BOCustomer();
         BO.CustomerID = txtCustomerID.Text.Trim();
         rowsAffected  = BM.BALDeleteFromCustomer(BO);
         if (rowsAffected > 0)
         {
             MessageBox.Show("The record has been successfully deleted.", "Success", MessageBoxButtons.OK, MessageBoxIcon.Information);
             New();
         }
         else
         {
             MessageBox.Show("No record found", "Sorry", MessageBoxButtons.OK, MessageBoxIcon.Error);
             New();
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }