void AramaKriterleriYukle() { if (comboBox1.SelectedIndex == 0) { txt_sorgu.AutoCompleteCustomSource.AddRange(HastaProvider.GetAllDosyaNo().ToArray()); } else { txt_sorgu.AutoCompleteCustomSource.AddRange(HastaProvider.GetAllTC().ToArray()); } txt_sorgu.Text = ""; txt_sorgu.Focus(); comboBox1.SelectedIndex = 0; txt_sorgu.Focus(); Dictionary <string, string> liste = SevkProvider.GetAllIslemler(); foreach (var item in liste) { comboBox_Islem.Items.Add(item.Key); } comboBox_Islem.SelectedIndex = 0; comboBox_Doktor.DataSource = SevkProvider.GetAllDoktorNo(); comboBox_Poliklink.DataSource = SevkProvider.GetAllPoliklink(); }
private void button6_Click(object sender, EventArgs e) { Sevk s = new Sevk() { DosyaNo = h.DosyaNo, Poliklinik = comboBox_Poliklink.SelectedItem.ToString(), Sira = Convert.ToInt32(txt_sirano.Text), Islem = comboBox_Islem.SelectedItem.ToString(), DoktorKod = Convert.ToInt32(comboBox_Doktor.SelectedItem.ToString()), Miktar = Convert.ToInt32(numericUpDown_Miktar.Value), BirimFiyat = Convert.ToInt32(txt_fiyat.Text), Saat = DateTime.Now.Hour.ToString(), SevkTarihi = DateTime.Now, Taburcu = false, }; SevkProvider.Ekle(s); MessageBox.Show("Eklendi"); h = HastaProvider.Get("select * from Hasta where DosyaNo=" + h.DosyaNo.ToString()); lbl_hasta_bilgileri.Text = string.Format("TC:{0} ,DosyaNo:{1},AdSoyad:{2} ", h.TC, h.DosyaNo, h.AdSoyad); List <Sevk> liste = SevkProvider.GetAllSevkler(h.DosyaNo); int toplam = liste.Sum(p => p.Miktar * p.BirimFiyat); lbl_toplamtutar.Text += ": " + toplam.ToString(); dataGridView1.DataSource = liste; }
private void HastaIslemleri_Load(object sender, EventArgs e) { if (Hasta != null) { txt_tc.Text = Hasta.TC; txt_adsoyad.Text = Hasta.AdSoyad; txt_dogumyeri.Text = Hasta.DogumYeri; dateTimePicker_dogumtarihi.Value = Hasta.DogumTarihi; txt_anneadi.Text = Hasta.AnneAdi; txt_babaadi.Text = Hasta.BabaAdi; comboBox_cinsiyet.SelectedItem = Hasta.Cinsiyet; comboBox_medenihal.SelectedItem = Hasta.MedeniHal; txt_tel.Text = Hasta.Tel; txt_kurumadi.Text = Hasta.KurumAdi; txt_kurumsicilno.Text = Hasta.KurumSicilNo; txt_ytel.Text = Hasta.YakiniTelNo; txt_ykurumsicilno.Text = Hasta.YakiniKurumSicilNo; txt_ykurumadi.Text = Hasta.YakiniKurumAdi; txt_Adres.Text = Hasta.Adres; txt_dosyano.Text = Hasta.DosyaNo.ToString(); } else { string a; try { a = HastaProvider.GetLastDosyaNo().ToString(); } catch (Exception) { a = "1"; } txt_dosyano.Text = a; } }
private void comboBox1_SelectedIndexChanged(object sender, EventArgs e) { if (comboBox1.SelectedIndex == 0) { txt_sorgu.AutoCompleteCustomSource.AddRange(HastaProvider.GetAllDosyaNo().ToArray()); } else { txt_sorgu.AutoCompleteCustomSource.AddRange(HastaProvider.GetAllTC().ToArray()); } txt_sorgu.Text = ""; txt_sorgu.Focus(); }
private void button8_Click(object sender, EventArgs e) { DialogResult r = MessageBox.Show("Hasta Silinsin mi", "Hasta Silme", MessageBoxButtons.YesNoCancel); if (r == DialogResult.Yes) { HastaProvider.Sil(h.DosyaNo); MessageBox.Show("Silindi!"); AramaKriterleriYukle(); txt_sorgu.Text = ""; button6.Enabled = false; button7.Enabled = false; button8.Enabled = false; lbl_hasta_bilgileri.Text = ""; dataGridView1.DataSource = null; lbl_toplamtutar.Text = "Toplam Tutar"; } }
private void button1_Click(object sender, EventArgs e) { if (txt_sorgu.Text == "") { return; } if (txt_sorgu.AutoCompleteCustomSource.Contains(txt_sorgu.Text)) { string sorgu = "select * from Hasta where "; if (comboBox1.SelectedIndex == 0) { sorgu += "DosyaNo=" + txt_sorgu.Text; } else { sorgu += "TC='" + txt_sorgu.Text + "'"; } try { h = HastaProvider.Get(sorgu); lbl_hasta_bilgileri.Text = string.Format("TC:{0} ,DosyaNo:{1},AdSoyad:{2} ", h.TC, h.DosyaNo, h.AdSoyad); List <Sevk> liste = SevkProvider.GetAllSevkler(h.DosyaNo); dataGridView1.DataSource = liste; int toplam = liste.Sum(p => p.Miktar * p.BirimFiyat); lbl_toplamtutar.Text += ": " + toplam.ToString(); button6.Enabled = true; button7.Enabled = true; button8.Enabled = true; } catch (Exception) { } } else { MessageBox.Show("Bulanamadı!!!"); } }
private void button1_Click(object sender, EventArgs e) { if (Kontrol()) { Hasta h = new Hasta() { TC = txt_tc.Text, AdSoyad = txt_adsoyad.Text, DogumYeri = txt_dogumyeri.Text, DogumTarihi = dateTimePicker_dogumtarihi.Value, AnneAdi = txt_anneadi.Text, BabaAdi = txt_babaadi.Text, Cinsiyet = comboBox_cinsiyet.SelectedItem.ToString(), MedeniHal = comboBox_medenihal.SelectedItem.ToString(), Tel = txt_tel.Text, KurumAdi = txt_kurumadi.Text, KurumSicilNo = txt_kurumsicilno.Text, YakiniTelNo = txt_ytel.Text, YakiniKurumSicilNo = txt_ykurumsicilno.Text, YakiniKurumAdi = txt_ykurumadi.Text, Adres = txt_Adres.Text, }; if (Hasta == null) { HastaProvider.Ekle(h); MessageBox.Show("Eklendi"); } else { HastaProvider.Guncelle(h); MessageBox.Show("Guncellendi"); this.Hide(); } Temizle(); // this.Hide(); } }