Zbiór zmian 567 dla trunk

Pokaż
Ignoruj:
Data:
2009-04-09 12:47:51 (17 years ago)
Autor:
marek
Opis:

re #160 - poprawiono blad w oknie Start, zakladka Kontakty- Object cannot be cast from DBNull to other types.

Pliki:
1 zmodyfikowane

Legenda:

Bez zmian
Dodane
Usunięte
  • trunk/BazaReklam/StartForm.cs

    r566 r567  
    236236        private void klient2ToolStripButton_Click(object sender, EventArgs e) 
    237237        { 
    238             if (zastawienieKontaktowBindingSource.Current != null) 
    239             { 
    240                 DataRowView row = (DataRowView)zastawienieKontaktowBindingSource.Current; 
    241  
    242                 int custID = Convert.ToInt32(row["CustomerId"]); 
    243  
    244                 ClientsForm.getClientsForm((MDIBazaReklam)MdiParent).pokazKlienta(custID); 
    245  
    246                 Hide(); 
    247  
    248                 ClientsForm.getClientsForm((MDIBazaReklam)MdiParent).Show(); 
    249             } 
     238            if (zastawienieKontaktowBindingSource.Current == null) return; 
     239            DataRowView row = (DataRowView) zastawienieKontaktowBindingSource.Current; 
     240 
     241            if(row["CustomerId"] is DBNull) return; 
     242 
     243            int custID = Convert.ToInt32(row["CustomerId"]); 
     244 
     245            ClientsForm.getClientsForm((MDIBazaReklam) MdiParent).pokazKlienta(custID); 
     246 
     247            Hide(); 
     248 
     249            ClientsForm.getClientsForm((MDIBazaReklam) MdiParent).Show(); 
    250250        } 
    251251