public static void HBFormuKapat() { if (IsOpen()) { hastaBilgileriForm.Close(); hastaBilgileriForm = null; } }
private void textBoxDosyaNo_KeyDown(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Enter) { if (_hastaBilgileri != null) { _hastaBilgileri.Close(); } if (textBoxDosyaNo.Text.Trim() != "") { try { _context = new VeritabanıContext(); int dosyaNo = Convert.ToInt32(textBoxDosyaNo.Text); _hasta = _context.Hasta.SingleOrDefault(x => x.DosyaNo == dosyaNo); if (_hasta == null) { MessageBox.Show("Hasta Kaydı bulunamadi!"); Arayuz_Doldur_Bosalt(); dataGridView1.Rows.Clear(); comboBoxOncekiIslemler.Items.Clear(); labelToplamTutar.Text = "0 TL"; } else { dataGridView1.Rows.Clear(); comboBoxOncekiIslemler.Items.Clear(); Arayuz_Doldur_Bosalt(); Onceki_Islemler_Ekle(); Grid_Guncelle(true); oncekiMi = false; } } catch (Exception ex) { MessageBox.Show(ex.Message); } } else { MessageBox.Show("Dosya No kısmı boş olamaz", "Dosya No giriniz!", MessageBoxButtons.OK, MessageBoxIcon.Warning); } } }