public Form4(string ad) { InitializeComponent(); tablo.ad = ad; tablo.zaman = DateTime.Now; tablo.durum = true; mustafa.Table1.Add(tablo); mustafa.SaveChanges(); koca = mustafa.Table1.ToList().Last(); label2.Text = koca.Id.ToString(); label4.Text = koca.ad.ToString(); }
private void timer1_Tick(object sender, EventArgs e) { //zamana göre veritabanına bilgi gönderme //çevrimiçi çevrimdışı olduğunu söyleme mustafakoca mustafa = new mustafakoca(); var hello = mustafa.Table1.Where(s => s.Id == koca.Id).FirstOrDefault(); bool durum = mustafa.Database.Exists(); if (durum) { label6.Text = "ÇEVRİMİÇİ"; } else { label6.Text = "ÇEVRİMDIŞI"; } if (hello.kapan == true) { //bunu açarsak program kapatılır... //Process.Start("cmd", "/K shutdown /s"); hello.durum = false; mustafa.SaveChanges(); Close(); } }
private void button1_Click(object sender, EventArgs e) { foreach (var item in mustafa.Tables) { if (item.kullaniciadi == textBox4.Text) { varmi = true; kullanici = item; } } if (varmi == true) { if (kullanici.sifre == textBox1.Text) { if (textBox2.Text == textBox3.Text) { kullanici.sifre = textBox2.Text; kullanici.sifretekrar = textBox3.Text; mustafa.SaveChanges(); MessageBox.Show("ŞİFRE GÜNCELLEMESİ BAŞARILI :)", "UYARI!", MessageBoxButtons.OK, MessageBoxIcon.Information); } else { MessageBox.Show("ŞİFRE GÜNCELLEMESİ BAŞARISIZ :(", "UYARI!", MessageBoxButtons.OK, MessageBoxIcon.Information); } } else { MessageBox.Show("Eksi şifre hatalı"); } } }
private void button1_Click(object sender, EventArgs e) { mustafakoca mustafa = new mustafakoca(); timer2.Enabled = false; string kullanici_adi = comboBox1.SelectedItem.ToString(); Table1 secilen = mustafa.Table1.Where(s => s.ad == kullanici_adi).FirstOrDefault(); secilen.oyun = id; s_id = secilen.Id; tablo.oyun = secilen.Id; mustafa.SaveChanges(); Form8 frm8 = new Form8(id, s_id, "giden"); frm8.ShowDialog(); tablo.oyun = 0; mustafa.SaveChanges(); timer2.Enabled = true; }
private void timer2_Tick(object sender, EventArgs e) { mustafa = new mustafakoca(); tablo = mustafa.Table1.Where(s => s.Id == tablo.Id).FirstOrDefault(); if (tablo.oyun != 0) { timer2.Enabled = false; Form8 frm8 = new Form8(id, s_id, "gelen"); frm8.ShowDialog(); tablo.oyun = 0; mustafa.SaveChanges(); timer2.Enabled = true; } }
private void button1_Click(object sender, EventArgs e) { if (textBox1.Text == "" || textBox2.Text == "" || textBox3.Text == "" || textBox4.Text == "") { MessageBox.Show("BOŞ ALANLARI DOLDURUNUZ!!!!", "UYARI", MessageBoxButtons.OK, MessageBoxIcon.Error); } else { tablemesajj.gonderen = textBox1.Text; tablemesajj.alici = textBox2.Text; tablemesajj.baslik = textBox3.Text; tablemesajj.icerik = textBox4.Text; mustafa.Tablemesajs.Add(tablemesajj); mustafa.SaveChanges(); koca = mustafa.Tablemesajs.ToList().Last(); MessageBox.Show("Mesaj Gönderildi!", "Mesaj", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
private void button1_Click(object sender, EventArgs e) { try { tablo.ad = textBox1.Text; tablo.soyad = textBox2.Text; tablo.kullaniciadi = textBox5.Text; tablo.sifre = textBox4.Text; tablo.sifretekrar = textBox3.Text; if (tablo.sifre == textBox4.Text && tablo.sifretekrar == textBox3.Text) { foreach (var item in mustafa.Tables) { if (item.kullaniciadi == tablo.kullaniciadi) { MessageBox.Show("Kullanıcı adı mevcut. Lütfen başka bir kullanıcı adı giriniz"); kontrol = false; } } if (kontrol == true) { mustafa.Tables.Add(tablo); mustafa.SaveChanges(); MessageBox.Show("KAYIT İŞLEMİ BAŞARILI :)", "UYARI!", MessageBoxButtons.OK, MessageBoxIcon.Information); } kontrol = true; } else { MessageBox.Show("ŞİFRELER AYNI DEĞİL!"); } } catch (Exception hata) { MessageBox.Show(hata.Message); } }
public Form8(int id, int s_id, string nasil) { InitializeComponent(); idd = id; s_idd = s_id; if (nasil == "giden") { game.oturum = s_id; } else if (nasil == "gelen") { game.oturum = id; } game.hamle = ""; mustafa.games.Add(game); mustafa.SaveChanges(); }