Example #1
0
        private void button5_Click(object sender, EventArgs e)
        {
            var item = Adibahce.Shift.ToList();

            Yil.DataSource = item;
            Yil.Refresh();
            Adibahce.SaveChanges();
        }
Example #2
0
        private void button2_Click(object sender, EventArgs e)
        {
            AdibahceContainer adb = new AdibahceContainer();
            
            if (textBox5.Text==textBox7.Text)
            {
                Kullanici k = new Kullanici();
                k.Id = adb.Kullanici.Count() + 1;
                k.KullaniciAdi = textBox6.Text;
                k.KullaniciSifre = textBox5.Text;
                k.AdminMi = Convert.ToBoolean(textBox4.Text);
                adb.Kullanici.Add(k);
                adb.SaveChanges();
                MessageBox.Show("Yeni Kullanıcı Tanımlandı", "Mesaj");

                Yenile();

            }
            else
            {
                MessageBox.Show("Parolalar Eşleşmiyor,Lütfen Doğru Yazdığınızdan Emin Olun", "Uyarı");
            }
           

        }
Example #3
0
 private void button3_Click(object sender, EventArgs e)
 {
     AdibahceContainer adb = new AdibahceContainer();
     var model = adb.Kullanici.Where(x => x.KullaniciAdi == comboBox1.Text).Select(x => x.Id).ToList().FirstOrDefault();
     Kullanici k = adb.Kullanici.First(x => x.Id == model);
     k.KullaniciAdi = textBox1.Text;
     k.KullaniciSifre = textBox2.Text;
     k.AdminMi = Convert.ToBoolean(textBox3.Text);
     adb.SaveChanges();
     MessageBox.Show("Güncelleme İşlemi Başarıyla Tamamlandı", "Mesaj");
 }
Example #4
0
        private void button4_Click(object sender, EventArgs e)
        {
            AdibahceContainer adb = new AdibahceContainer();
            var model = adb.Kullanici.Where(x => x.KullaniciAdi == comboBox1.Text).Select(x => x.Id).ToList().FirstOrDefault();
            Kullanici k = adb.Kullanici.First(x => x.Id == model);
            adb.Kullanici.Remove(k);
            DialogResult d = MessageBox.Show("Silmek İstediğinize Eminmisiniz?", "Uyarı", MessageBoxButtons.YesNo);
            if(d==DialogResult.Yes)
            {
                adb.SaveChanges();
                Yenile();
            }
            else
            {
                MessageBox.Show("Silme İşlemi İptal Edildi", "Mesaj");
            }

        }