Esempio n. 1
0
        private void evet_Click(object sender, EventArgs e)
        {
            cevap = 1;

            lblSoru.Text = "";

            //bir kere cevaplanmaya baþladýktan sonra proje deðiþemez
            if (projeDegisemez == false)
            {
                projeDegisemez = true;
            }

            //bir sonra sorulacak soru tanýmlý deðilse hatayý al
            if (evetSonrakiSoru == 0)
            {
                hataGonder.Visible = false;
                aciklama.Visible   = true;
                gonder.Visible     = true;
                evet.Visible       = false;
                hayir.Visible      = false;
            }
            //deðilse yeni soruyu göster
            else
            {
                soruBilgi soru = hWS.sonraki(evetSonrakiSoru);

                lblSoru.Text     = soru.soru;
                evetSonrakiSoru  = soru.evetId;
                hayirSonrakiSoru = soru.hayirId;
                sonSoruId        = soru.id;
            }
        }
Esempio n. 2
0
        public ArrayList listele(uint projeId, bool sade)
        {
            DataSet   ds = new DataSet();
            ArrayList sorular;

            string sql = "SELECT SORU, ID FROM Soru WHERE (PROJEID=" + projeId + ")";

            ds = db.fillDataset(sql);

            if (ds.Tables.Count != 0)
            {
                sorular = new ArrayList(ds.Tables[0].DefaultView.Table.Rows.Count);

                for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
                {
                    string soru1 = ds.Tables[0].DefaultView.Table.Rows[i].ItemArray.GetValue(0).ToString();
                    uint   id1   = Convert.ToUInt32(ds.Tables[0].DefaultView.Table.Rows[i].ItemArray.GetValue(1));

                    soruBilgi soruB = new soruBilgi(id1, soru1);

                    sorular.Add(soruB);
                }
            }
            else
            {
                sorular = new ArrayList();
                //soruBilgi soru1 = new soruBilgi();
                //sorular.Add(soru1);
            }

            return(sorular);
        }
Esempio n. 3
0
        private void hataGonder_Click(object sender, EventArgs e)
        {
            try
            {
                soruBilgi soru = hWS.ilkSoru(projeler.Text);

                if (soru.id != 0)
                {
                    lblSoru.Text     = soru.soru;
                    evetSonrakiSoru  = soru.evetId;
                    hayirSonrakiSoru = soru.hayirId;
                    sonSoruId        = soru.id;

                    evet.Visible  = true;
                    hayir.Visible = true;
                }
                else
                {
                    lblSoru.Text = "Bu projeye daha soru eklenmemiþ, hata gönderemezsiniz";
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
            }
        }
Esempio n. 4
0
        /// <summary>
        /// verilen idli soruyu getirir
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public soruBilgi getir(uint id)
        {
            soruBilgi soruB;
            DataSet   ds = new DataSet();

            string sql = "SELECT SORU, KULLANICINOT, GELISTIRICINOT, ID, EVETID, HAYIRID, ONCEKIID FROM Soru WHERE (ID=" + id + ")";

            ds = db.fillDataset(sql);

            if (ds.Tables.Count != 0)
            {
                string soru1     = ds.Tables[0].DefaultView.Table.Rows[0].ItemArray.GetValue(0).ToString();
                string knot1     = ds.Tables[0].DefaultView.Table.Rows[0].ItemArray.GetValue(1).ToString();
                string gnot1     = ds.Tables[0].DefaultView.Table.Rows[0].ItemArray.GetValue(2).ToString();
                uint   id1       = Convert.ToUInt32(ds.Tables[0].DefaultView.Table.Rows[0].ItemArray.GetValue(3));
                uint   evetid1   = Convert.ToUInt32(ds.Tables[0].DefaultView.Table.Rows[0].ItemArray.GetValue(4));
                uint   hayirid1  = Convert.ToUInt32(ds.Tables[0].DefaultView.Table.Rows[0].ItemArray.GetValue(5));
                uint   oncekiId1 = Convert.ToUInt32(ds.Tables[0].DefaultView.Table.Rows[0].ItemArray.GetValue(6));

                soruB = new soruBilgi(id1, soru1, knot1, gnot1, evetid1, hayirid1, oncekiId1);
            }
            else
            {
                soruB = new soruBilgi();
            }

            return(soruB);
        }
Esempio n. 5
0
    //verilen id li soruyu formda düzgün bir þekilde göstererek oturum deðiþkenlerini ayarlar
    private void soruyuGoster(uint id)
    {
        //bir kere evet veya hayýr denildiðinde artýk proje deðiþtirilemez
        if (projeler.Enabled != false)
        {
            projeler.Enabled = false;
            devam.Visible    = false;
        }

        lblHata.Text = "";

        soruBilgi soruB = sonrakiSoru(id);

        /* bir soru daha sor diye tanýmlanmýþsa yeni soruyu göster */
        if (soruB.id != 0)
        {
            lbl.Text    = soruB.soru;
            lblNot.Text = soruB.kNot;
            Session["soruid_session"]  = soruB.id;
            Session["evetid_session"]  = soruB.evetId;
            Session["hayirid_session"] = soruB.hayirId;
        }
        //yeni soru tanýmlý deðil hatayý al
        else
        {
            pnl.Visible         = true;
            evet.Visible        = false;
            hayir.Visible       = false;
            lblCevapla.Visible  = false;
            lblNot.Visible      = false;
            lblAciklama.Visible = false;
        }
    }
    //veritabanýndan verilen id li soruyu bir soruBilgi nesnesi içinde getirir
    private soruBilgi sonrakiSoru(uint id)
    {
        soruBilgi soruB;

        if (id <= 0)
        {
            soruB = new soruBilgi();
            return(soruB);
        }

        soru s = new soru();

        DataSet ds = new DataSet();

        ds = s.sonraki(id);


        /* evet denilince bir soru daha sor diye tanýmlanmýþsa EVETID için geri dönen bir satýr olacak
         * yeni soruyu göster */
        if (ds.Tables[0].Rows.Count != 0)
        {
            string soru1 = ds.Tables[0].Rows[0].ItemArray[0].ToString();
            string kNot = ds.Tables[0].Rows[0].ItemArray[1].ToString();
            uint   soruId = Convert.ToUInt32(ds.Tables[0].Rows[0].ItemArray[2].ToString());
            uint   evetId, hayirId;

            if (ds.Tables[0].Rows[0].ItemArray[3] != System.DBNull.Value)
            {
                evetId = Convert.ToUInt32(ds.Tables[0].Rows[0].ItemArray[3].ToString());
            }
            else
            {
                evetId = 0;
            }

            if (ds.Tables[0].Rows[0].ItemArray[4] != System.DBNull.Value)
            {
                hayirId = Convert.ToUInt32(ds.Tables[0].Rows[0].ItemArray[4].ToString());
            }
            else
            {
                hayirId = 0;
            }

            soruB = new soruBilgi(soruId, soru1, kNot, evetId, hayirId);
        }
        //yeni soru tanýmlý deðil hatayý al
        else
        {
            soruB = new soruBilgi();
        }


        return(soruB);
    }
    //hayýr denilince bir sonraki soruya geç
    protected void hayir_Click(object sender, EventArgs e)
    {
        Session["cevap"] = 0;

        if (Session["normal_devam"] == null)
        {
            soruBilgi s1 = s.getir(Convert.ToUInt32(soruListesi.SelectedItem.Value));
            Session["hayirid_session"] = s1.hayirId;
            Session["soruid_session"]  = s1.id;
            soruListesi.Visible        = false;
            devam.Visible = false;
        }

        soruyuGoster(Convert.ToUInt32(Session["hayirid_session"]));
    }
Esempio n. 8
0
        /// <summary>
        /// verilen id li soruyu siler
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public bool sil(uint id)
        {
            soruBilgi soruB = getir(id);

            uint oncekiId = soruB.getoncekiId();

            string oncekiniDuzeltSql1 = "UPDATE Soru SET EVETID = 0 WHERE ID = " + oncekiId + " AND EVETID = " + id;
            string oncekiniDuzeltSql2 = "UPDATE Soru SET HAYIRID = 0 WHERE ID = " + oncekiId + " AND HAYIRID = " + id;

            db.executeNonQuery(oncekiniDuzeltSql1);
            db.executeNonQuery(oncekiniDuzeltSql2);

            string soruyuSilSql = "DELETE FROM Soru WHERE ID = " + id;

            return(db.executeNonQuery(soruyuSilSql));
        }
Esempio n. 9
0
        /// <summary>
        /// verilen proje idli projenin mevcut tüm sorularýný listeler
        /// </summary>
        /// <param name="projeId"></param>
        /// <returns></returns>
        public ArrayList listele(uint projeId)
        {
            DataSet   ds = new DataSet();
            ArrayList sorular;

            string sql = "SELECT SORU, KULLANICINOT, GELISTIRICINOT, ID, EVETID, HAYIRID, ONCEKIID FROM Soru WHERE (PROJEID=" + projeId + ")";

            ds = db.fillDataset(sql);

            if (ds.Tables.Count != 0)
            {
                sorular = new ArrayList(ds.Tables[0].DefaultView.Table.Rows.Count);

                for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
                {
                    string soru1     = ds.Tables[0].DefaultView.Table.Rows[i].ItemArray.GetValue(0).ToString();
                    string knot1     = ds.Tables[0].DefaultView.Table.Rows[i].ItemArray.GetValue(1).ToString();
                    string gnot1     = ds.Tables[0].DefaultView.Table.Rows[i].ItemArray.GetValue(2).ToString();
                    uint   id1       = Convert.ToUInt32(ds.Tables[0].DefaultView.Table.Rows[i].ItemArray.GetValue(3));
                    uint   evetid1   = Convert.ToUInt32(ds.Tables[0].DefaultView.Table.Rows[i].ItemArray.GetValue(4));
                    uint   hayirid1  = Convert.ToUInt32(ds.Tables[0].DefaultView.Table.Rows[i].ItemArray.GetValue(5));
                    uint   oncekiid1 = Convert.ToUInt32(ds.Tables[0].DefaultView.Table.Rows[i].ItemArray.GetValue(6));

                    soruBilgi soruB = new soruBilgi(id1, soru1, knot1, gnot1, evetid1, hayirid1, oncekiid1);

                    sorular.Add(soruB);
                }
            }
            else
            {
                sorular = new ArrayList();
                //soruBilgi soru1 = new soruBilgi();
                //sorular.Add(soru1);
            }

            return(sorular);
        }
Esempio n. 10
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            //bu sayfaya sadece web sayfalarýndaki linklerden ulaþýlabilir
            if (Request.ServerVariables["HTTP_REFERER"] == null)
            {
                lblHata.Text   = "Bu sayfaya eriþim izniniz yok";
                panel.Visible  = false;
                Label1.Visible = false;
                ph.Visible     = false;

                return;
            }

            soru s = new soru();

            if (Request.QueryString["id"] != null)
            {
                soruId = Convert.ToUInt32(Request.QueryString["id"]);


                if (soruId <= 0)
                {
                    lblHata.Text  = "Geçersiz girdiler";
                    panel.Visible = false;

                    return;
                }
                else
                {
                    if (Session["tip"].ToString() != "sorumlu")
                    {
                        Response.Redirect("yetkiYok.aspx");
                    }

                    projeIsmi.Text = Session["proje_ismi"].ToString();

                    soruBilgi soruB = s.getir(soruId);

                    if (soruB.id != 0)
                    {
                        soru.Text = soruB.soru;
                        knot.Text = soruB.kNot;
                        gnot.Text = soruB.getgNot();

                        ph.Controls.Clear();

                        if (soruB.evetId == 0)
                        {
                            evetsorusor.Checked = false;
                        }
                        else
                        {
                            evetsorusor.Checked = true;
                            evetsorusor.Enabled = false;

                            HyperLink hl = new HyperLink();
                            hl.NavigateUrl = "SoruDuzenle.aspx?id=" + soruB.evetId;
                            hl.Target      = "_blank";
                            hl.Text        = "Evetse gidilecek soru";

                            Label nl = new Label();
                            nl.Text = "<br>";

                            ph.Controls.Add(hl);
                            ph.Controls.Add(nl);
                        }

                        if (soruB.hayirId == 0)
                        {
                            hayirsorusor.Checked = false;
                        }
                        else
                        {
                            hayirsorusor.Checked = true;
                            hayirsorusor.Enabled = false;

                            HyperLink hl = new HyperLink();
                            hl.NavigateUrl = "SoruDuzenle.aspx?id=" + soruB.hayirId;
                            hl.Target      = "_blank";
                            hl.Text        = "Hayýrsa gidilecek soru";

                            ph.Controls.Add(hl);
                        }
                    }
                    else
                    {
                        lblHata.Text  = "Soru bulunamadý";
                        panel.Visible = false;

                        return;
                    }
                }
            }
        }
        else
        {
            soruId = Convert.ToUInt32(Request.QueryString["id"]);

            soru s = new soru();

            if (evetsorusor.Checked == true && evetsorusor.Enabled == true)
            {
                soruBilgi soruB = s.getir(soruId);

                uint evetId = s.ekle(Convert.ToUInt32(Session["proje_id"]), soruId);

                bool basari = s.duzenleE(soruId, evetId);

                if (basari)
                {
                    ph2.Visible = true;

                    HyperLink evetLink = new HyperLink();
                    Label     soru     = new Label();
                    Label     nl       = new Label();
                    nl.Text = "<br>";

                    evetLink.NavigateUrl = "SoruEkle.aspx?id=" + evetId + "&c=1&o=" + soruId;
                    evetLink.Visible     = true;
                    evetLink.Target      = "_blank";
                    evetLink.Text        = "Evet";
                    evetLink.Font.Bold   = true;
                    evetLink.ForeColor   = System.Drawing.Color.Black;

                    ph2.Controls.Add(evetLink);
                    ph2.Controls.Add(nl);
                }
                else
                {
                    lblHata.Text = "Soru için yer ayrýlamadý";
                }
            }
            if (hayirsorusor.Checked == true && hayirsorusor.Enabled == true)
            {
                soruBilgi soruB = s.getir(soruId);

                uint hayirId = s.ekle(Convert.ToUInt32(Session["proje_id"]), soruId);

                bool basari = s.duzenleH(soruId, hayirId);

                if (basari)
                {
                    ph2.Visible = true;

                    HyperLink hayirLink = new HyperLink();
                    Label     nl        = new Label();
                    nl.Text = "<br>";

                    hayirLink.NavigateUrl = "SoruEkle.aspx?id=" + hayirId + "&c=0&o=" + soruId;
                    hayirLink.Visible     = true;
                    hayirLink.Target      = "_blank";
                    hayirLink.Text        = "Hayýr";
                    hayirLink.Font.Bold   = true;
                    hayirLink.ForeColor   = System.Drawing.Color.Black;

                    ph2.Controls.Add(hayirLink);
                    ph2.Controls.Add(nl);
                }
                else
                {
                    lblHata.Text = "Soru için yer ayrýlamadý";
                }
            }
        }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        evetsorusor.Enabled  = false;
        hayirsorusor.Enabled = false;
        if (!IsPostBack)
        {
            //bu sayfaya sadece web sayfalarýndaki linklerden ulaþýlabilir
            if (Request.ServerVariables["HTTP_REFERER"] == null)
            {
                lblHata.Text  = "Bu sayfaya eriþim izniniz yok";
                panel.Visible = false;
                ph2.Visible   = false;

                return;
            }

            if (Request.QueryString["id"] != null)
            {
                soru s = new soru();

                soruId = Convert.ToUInt32(Request.QueryString["id"]);

                if (soruId > 0)
                {
                    if (Session["tip"].ToString() != "sorumlu")
                    {
                        Response.Redirect("yetkiYok.aspx");
                    }

                    projeIsmi.Text = Session["proje_ismi"].ToString();

                    soruBilgi soruB = s.getir(soruId);

                    if (soruB.id != 0)
                    {
                        soru.Text = soruB.soru;
                        knot.Text = soruB.kNot;
                        gnot.Text = soruB.getgNot();
                    }
                    else
                    {
                        lblHata.Text  = "Soru bulunamadý";
                        panel.Visible = false;

                        return;
                    }
                }
                else
                {
                    lblHata.Text  = "Geçersiz ID";
                    panel.Visible = false;

                    return;
                }
            }
            else
            {
                lblHata.Text  = "Geçersiz çalýþtýrma þekli";
                panel.Visible = false;
                ph2.Visible   = false;
            }
        }
        else
        {
            soruId = Convert.ToUInt32(Request.QueryString["id"]);
        }
    }