Exemplo n.º 1
0
 public void EtapEkle(Etap etap)
 {
     con.Open();
     cmd.CommandText = ("INSERT INTO Games(Questions,Answers) VALUES('" + etap.Soru + "','" + etap.Cevap + "')");
     cmd.ExecuteNonQuery();
     con.Close();
 }
Exemplo n.º 2
0
 private bool etapVarmi(Etap etap, List <Etap> etaplar)
 {
     foreach (Etap item in etaplar)
     {
         if (item.Id == etap.Id)
         {
             return(true);
         }
     }
     return(false);
 }
Exemplo n.º 3
0
        private Etap etapGetir(int harfSayisi)
        {
            Etap etap = null;

            con.Open();
            cmd.CommandText = "SELECT * FROM Games WHERE LEN(Answers)=" + harfSayisi + " ORDER BY NEWID()";
            dr = cmd.ExecuteReader();
            if (dr.Read())
            {
                etap = new Etap(int.Parse(dr[0].ToString()), dr[1].ToString().Trim(), dr[2].ToString().Trim().ToUpper());
            }
            con.Close();
            return(etap);
        }
Exemplo n.º 4
0
        private void button1_Click(object sender, EventArgs e)
        {
            string soru  = tbSoru.Text.Trim();
            string cevap = tbCevap.Text.Trim();

            if (soru.Length >= 15 && (cevap.Length >= 4 && cevap.Length <= 10) && !cevap.Contains(" "))
            {
                Etap etap = new Etap(0, soru, cevap);
                db.EtapEkle(etap);
                MessageBox.Show("Soru eklendi.");
            }
            else
            {
                MessageBox.Show("Soru eklenemedi.");
            }
        }
Exemplo n.º 5
0
 private void sonrakiEtap()
 {
     if (!oyun.oyunBittiMi())
     {
         mevcutEtap = oyun.sonrakiSoru();
         if (mevcutEtap == null)
         {
             OyunBitti();
         }
         else
         {
             ekranGuncelle();
             btn_harfal.Enabled  = true;
             btn_cevapla.Enabled = true;
         }
     }
 }