private void dgvPersoneller_CellMouseClick(object sender, DataGridViewCellMouseEventArgs e) { var secilenPersonelId = Convert.ToInt32(dgvPersoneller.CurrentRow.Cells[0].Value); if (secilenPersonelId == 0) { return; } _secilenPersonel = _personelService.GetPersonelFindById(secilenPersonelId); txtTCKimlikNo.Text = _secilenPersonel.TCKimlikNo; txtPersonelAd.Text = _secilenPersonel.Ad; txtPersonelSoyad.Text = _secilenPersonel.Soyad; txtPersonelEmail.Text = _secilenPersonel.Email; txtPersonelCepTel.Text = _secilenPersonel.CepTel; txtPersonelEvTel.Text = _secilenPersonel.EvTel; txtPersonelAdres.Text = _secilenPersonel.Adres; txtSicilNo.Text = _secilenPersonel.SicilNo; try { var bulunanKlinikIndex = _klinikRepo.GetList().TakeWhile(item => item.KlinikAd != _secilenPersonel.Klinikler.KlinikAd).Count(); cbKlinikler.selectedIndex = bulunanKlinikIndex; } catch (Exception exception) { cbKlinikler.selectedIndex = _klinikRepo.GetKlinikCount(); } try { var unvan = _unvanRepo.GetList(); var bulunanUnvanIndex = unvan.TakeWhile(item => item.PersonelUnvan != _secilenPersonel.Unvanlar.PersonelUnvan).Count(); cbUnvanlar.selectedIndex = bulunanUnvanIndex; } catch (Exception) { // ignored } dtpPersonelDogumTarihi.Value = _secilenPersonel.DogumTarihi.Date; }