Exemple #1
0
 private void DeleteClub(int clubID)
 {
     if (ClubDAO.DeleteClub(clubID))
     {
         MessageBox.Show("XÓA CÂU LẠC BỘ THÀNH CÔNG", "THÔNG BÁO");
     }
     else
     {
         MessageBox.Show("XÓA CÂU LẠC BỘ THẤT BẠI", "THÔNG BÁO");
     }
 }
    protected void btDelete_Click(object sender, EventArgs e)
    {
        int clubId   = Convert.ToInt32(ListBoxClubs.SelectedValue);
        int deleteOk = clubDAO.DeleteClub(clubId);

        if (deleteOk == 0) // Delete succeeded
        {
            createClubsList();
            viewStateNew();
            showNoMessage();
        }
        else if (deleteOk == 1)
        {
            showErrorMessage("No record deleted. " +
                             "Please delete the club's riders first.");
        }
        else
        {
            showErrorMessage("No record deleted. " +
                             "THE DATABASE IS TEMPORARILY OUT OF USE.");
        }
    }