private void button3_Click(object sender, EventArgs e) { if (KontrolEt()) { Kullanici k = new Kullanici() { TC = txt_TC.Text, AdSoyad = txt_adsoyad.Text, KullaniciAdi = txt_kullaniciadi.Text, Sifre = txt_sifre.Text, Yetki = checkBox_yetki.Checked, DogumYeri = txt_dogumyeri.Text, DogumTarihi = dateTimePicker_dogumtarihi.Value, AnneAdi = txt_anneadi.Text, BabaAdi = txt_baba.Text, Cinsiyet = comboBox_cinsiyet.SelectedItem.ToString(), MedeniHal = comboBox_medenihal.SelectedItem.ToString(), KanGrubu = comboBox_kangrubu.SelectedItem.ToString(), Maas = Convert.ToDouble(txt_maas.Text), Tel = txt_telno.Text, Adres = txt_adres.Text, Unvan = comboBox_Unvan.SelectedItem.ToString(), IseBaslamaTarihi = dateTimePicker_isebaslama.Value }; KullaniciProvider.Ekle(k); button3.Enabled = false; MessageBox.Show("Eklendi!"); SorguDoldur(); } }
private void button5_Click(object sender, EventArgs e) { DialogResult result = MessageBox.Show("Hastayı Silmek istiyormusunuz ?", "Hasta Silme", MessageBoxButtons.YesNoCancel); if (result == DialogResult.Yes) { KullaniciProvider.Sil(Convert.ToInt32(lbl_kod.Text)); MessageBox.Show("Hasta Silindi !!!!"); Temizle(); SorguDoldur(); } }
void SorguDoldur() { txt_Sorgu.AutoCompleteCustomSource.Clear(); if (comboBox_Kriter.SelectedIndex == 0) { txt_Sorgu.AutoCompleteCustomSource.AddRange(KullaniciProvider.GetAllTC().ToArray()); } else { txt_Sorgu.AutoCompleteCustomSource.AddRange(KullaniciProvider.GetAllDosyaNo().ToArray()); } txt_Sorgu.Text = ""; txt_Sorgu.Focus(); }
private void button1_Click(object sender, EventArgs e) { if (txt_KullaniciAdi.Text != "" || txt_Sifre.Text != "") { if (KullaniciProvider.Login(txt_KullaniciAdi.Text, txt_Sifre.Text)) { AnaForm a = new AnaForm(); a.Show(); this.Hide(); } } else { MessageBox.Show("Lütfen alanları boş borakmayınız"); txt_Sifre.Text = ""; } }
private void button2_Click(object sender, EventArgs e) { Kullanici k = null; try { if (comboBox_Kriter.SelectedIndex == 0) { k = KullaniciProvider.GetKullanici("select * from Kullanici where Tc=" + txt_Sorgu.Text); } else { k = KullaniciProvider.GetKullanici("select * from Kullanici where Kodu=" + txt_Sorgu.Text); } } catch (Exception) { MessageBox.Show("Bulunamadı !!!!!!"); return; } txt_Sorgu.Focus(); lbl_kod.Text = k.Kodu.ToString(); txt_adres.Text = k.Adres; txt_adsoyad.Text = k.AdSoyad; txt_anneadi.Text = k.AnneAdi; txt_baba.Text = k.BabaAdi; txt_dogumyeri.Text = k.DogumYeri; dateTimePicker_dogumtarihi.Value = k.DogumTarihi; txt_kullaniciadi.Text = k.KullaniciAdi; txt_maas.Text = k.Maas.ToString(); txt_sifre.Text = k.Sifre; txt_TC.Text = k.TC; txt_telno.Text = k.Tel; comboBox_Unvan.SelectedItem = k.Unvan; checkBox_yetki.Checked = k.Yetki; comboBox_medenihal.SelectedItem = k.MedeniHal; comboBox_kangrubu.SelectedItem = k.KanGrubu; comboBox_cinsiyet.SelectedItem = k.Cinsiyet; }
public KullaniciIslemleri() { InitializeComponent(); txt_Sorgu.AutoCompleteCustomSource.AddRange(KullaniciProvider.GetAllTC().ToArray()); comboBox_cinsiyet.SelectedIndex = comboBox_kangrubu.SelectedIndex = comboBox_Kriter.SelectedIndex = comboBox_medenihal.SelectedIndex = comboBox_Unvan.SelectedIndex = 0; }