Exemplo n.º 1
0
        private void button2_Click(object sender, EventArgs e)
        {
            int    index = kelimeview.CurrentRow.Index;
            string a     = kelimeview.Rows[index].Cells[3].Value.ToString();
            string kayit = "update kelime set tipi=1,test_tipi=1 where id=" + a;

            baglan.update(kayit);
            baglan.kayitGetir("select Turkce,Ing,turu,id from kelime where tipi=1", ogrenilenview);
        }
Exemplo n.º 2
0
 private void cevapla(string cevap, string dcevap)
 {
     if (i == soru.Count)//soru bittigi zaman elemanları saklıyor
     {
         Soru.Text = "Bugünlük bu kadar yarın tekrar SORU  ekliyoruz";
         A.Hide();
         B.Hide();
         C.Hide();
         D.Hide();
     }
     string[] strliste = (string[])this.soru[this.i - 1];
     if (cevap == dcevap)
     {
         int      testtip = Convert.ToInt32(strliste[4].ToString());
         string[] tarih   = strliste[2].Split('.');
         int      yıl     = Convert.ToInt32(tarih[2].Remove(4, 9));//gereksiz bilgi tamizligi
         int      ay      = Convert.ToInt32(tarih[1]);
         int      gun     = Convert.ToInt32(tarih[0]);
         DateTime tarih2  = DateTime.Today;
         DateTime dt      = new DateTime((int)yıl, ay, gun);
         if (testtip == 1)
         {
             tarih2 = dt.AddDays(6);
         }
         else if (testtip == 2)
         {
             tarih2 = dt.AddDays(23);
         }
         else if (testtip == 3)
         {
             tarih2 = dt.AddDays(60);
         }
         else
         {
             tarih2 = DateTime.Today;
         }
         int    id  = Convert.ToInt32(strliste[3]);
         string trh = String.Format("{0:yyyy-MM-dd}", tarih2);
         testtip += 1;
         baglan.update("update kelime set test_tipi=" + testtip + ",Tarih='" + trh + "' where id=" + id + "");
         MessageBox.Show("cevabınız dogru.yeni soruya geçiniz");
     }
     else
     {
         int      testtip = 1;
         int      id      = Convert.ToInt32(strliste[3]);
         DateTime tarih2  = DateTime.Today.AddDays(1);
         string   trh     = String.Format("{0:yyyy-MM-dd}", tarih2);
         baglan.update("update kelime set test_" +
                       "tipi=" + testtip + ",Tarih='" + trh + "' where id=" + id + "");
         MessageBox.Show("cevabınız yanlış.bu kelimeye ait testiniz 1.gün testinden tekrar baslayacaktır ");
     }
 }