예제 #1
0
 private void btnDeleteButton_Click(object sender, EventArgs e)
 {
     if (bsCompanies.Current is Company)
     {
         DialogResult dialogResult = MessageBox.Show("Czy na pewno chcesz usunąć wybraną firmę?"
                                                     , "Potwierdzienie usunięcia"
                                                     , MessageBoxButtons.OKCancel);
         if (dialogResult == DialogResult.OK)
         {
             CompanyRepository companyRepository = new CompanyRepository();
             companyRepository.DeleteById(((Company)bsCompanies.Current).Id);
             bsCompanies.DataSource = companyRepository.FindAll();
             grdCompanies.Refresh();
         }
     }
 }