コード例 #1
0
 protected void btnGiris_Click(object sender, EventArgs e)
 {
     if (txtKullaniciAd.Text != "" && txtParola.Text != "")
     {
         VeriIslem veriIslem = new VeriIslem();
         SQLSorgu  sqlSorgu  = new SQLSorgu();
         if (veriIslem.dataTable(sqlSorgu.yetkiliGiris(txtKullaniciAd.Text, txtParola.Text)).Rows.Count != 0)
         {
             lblAciklama.Text = "Hoşgeldiniz Yetkili " + txtKullaniciAd.Text + " !";
             //  Thread.Sleep(3000);
             Session["userID"] = veriIslem.dataTable(sqlSorgu.getID(txtKullaniciAd.Text, txtParola.Text)).Rows[0][0].ToString();
             Response.Redirect("Anasayfa.aspx");
         }
         else if (veriIslem.dataTable(sqlSorgu.uyeGiris(txtKullaniciAd.Text, txtParola.Text)).Rows.Count != 0)
         {
             lblAciklama.Text  = "Hoşgeldiniz Uye " + txtKullaniciAd.Text + " !";
             Session["userID"] = veriIslem.dataTable(sqlSorgu.getID(txtKullaniciAd.Text, txtParola.Text)).Rows[0][0].ToString();
             Response.Redirect("UAnasayfa.aspx");
         }
         else
         {
             lblAciklama.Text = "Kullanıcı adı veya şifre hatalı.";
         }
     }
     else
     {
         lblAciklama.Text = "Kullanıcı adı veya şifre boş bırakılamaz.";
     }
 }
コード例 #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            DataTable dt = veriIslem.dataTable(sqlSorgu.AllKira()); //Teslimat tarihi null olmayan yani teslim edilmiş kitapları listeler

            gridKitaplar.DataSource = dt;
            gridKitaplar.Width      = 800;
            gridKitaplar.DataBind();
        }
コード例 #3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            Session["kitapID"]      = null;
            Session["yorumKitapID"] = null;

            DataTable dtTarih = veriIslem.dataTable(sqlSorgu.KiralamaforK(Convert.ToInt32(Session["userID"].ToString())));

            if (dtTarih.Rows.Count > 0)
            {
                for (int i = 0; i < dtTarih.Rows.Count; i++)
                {
                    string   format  = "dd.MM.yyyy";
                    DateTime teslim  = Convert.ToDateTime(dtTarih.Rows[i][5].ToString());
                    DateTime current = DateTime.Now;
                    if (current < teslim)
                    {
                        alert2 += dtTarih.Rows[i][7].ToString() + " adlı kitabın son teslim tarihi " + teslim.ToString(format) + " . Lütfen unutmayınız.   \r\n\r\n";
                    }
                    else
                    {
                        string formatDay = "dd";
                        alert += dtTarih.Rows[i][7].ToString() + " adlı kitabın son teslim tarihi " + Convert.ToInt32((current - teslim).ToString(formatDay)) + " gün gecikmiştir. Lütfen en kısa zamanda kitabı teslim ediniz.";
                    }
                }
            }

            string kitapID = Request.QueryString["kitapID"];

            if (!IsPostBack)
            {
                if (!String.IsNullOrEmpty(kitapID))
                {
                    Session["kitapID"] = kitapID;
                    Response.Redirect("KitapInfo.aspx");
                }
                if (dtTarih.Rows.Count > 0)
                {
                    alertWelcome.Visible = true;
                    txtCountDown.Text    = alert;
                    txtCountDown2.Text   = alert2;
                }
            }
            DataTable dt = veriIslem.dataTable(sqlSorgu.KitapListele());

            if (Session["kitapTur"] != null)
            {
                dt = veriIslem.dataTable(sqlSorgu.listAsType(Session["kitapTur"].ToString()));
            }
            gridKitaplar.DataSource = dt;
            gridKitaplar.Width      = 800;
            gridKitaplar.DataBind();
        }
コード例 #4
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         if (Session["userID"] != null) //Güncellenecek olan kişinin bilgileri textbox'a aktarılır. İstenilen veri daha sonra değiştirilir
         {
             DataTable dt = veriIslem.dataTable(sqlSorgu.Bilgilendirme(Convert.ToInt32(Session["userID"].ToString())));
             txtAd.Text    = dt.Rows[0][0].ToString();
             txtSoyad.Text = dt.Rows[0][1].ToString();
             txtNo.Text    = dt.Rows[0][2].ToString();
             txtAdres.Text = dt.Rows[0][3].ToString();
         }
     }
 }
コード例 #5
0
        protected void btnKaydet_Click(object sender, EventArgs e)
        {
            if (txtAd.Text.Equals("") || txtAdres.Text.Equals("") || txtNo.Text.Equals("") || txtParola.Text.Equals("") || txtSoyad.Text.Equals("") || txtuserName.Text.Equals(""))
            {
                lblAciklamaBos.Visible    = true;
                lblAciklamaOlan.Visible   = false;
                lblAciklamaSayi.Visible   = false;
                lblAciklamaParola.Visible = false;
            }
            else if ((!System.Text.RegularExpressions.Regex.IsMatch(txtNo.Text, "[0-9]")) || txtNo.Text.Length != 11)
            {
                lblAciklamaSayi.Visible   = true;
                lblAciklamaBos.Visible    = false;
                lblAciklamaOlan.Visible   = false;
                lblAciklamaParola.Visible = false;
            }
            else if (!GoodPassword(txtParola.Text))
            {
                lblAciklamaBos.Visible    = false;
                lblAciklamaOlan.Visible   = false;
                lblAciklamaSayi.Visible   = false;
                lblAciklamaParola.Visible = true;
            }
            else
            {
                if (veriIslem.dataTable(sqlSorgu.getAyniKullaniciAdi(txtuserName.Text)).Rows.Count != 0)
                {
                    lblAciklamaOlan.Visible   = true;
                    lblAciklamaBos.Visible    = false;
                    lblAciklamaSayi.Visible   = false;
                    lblAciklamaParola.Visible = false;
                }
                else
                {
                    lblAciklamaBos.Visible    = false;
                    lblAciklamaOlan.Visible   = false;
                    lblAciklamaSayi.Visible   = false;
                    lblAciklamaParola.Visible = false;


                    veriIslem.dataTable(sqlSorgu.UyeEkle(txtuserName.Text, txtParola.Text, txtAd.Text, txtSoyad.Text, txtNo.Text, txtAdres.Text));
                    add.Visible      = false;
                    confirm.Visible  = true;
                    confirm2.Visible = true;
                    Session["duzenlenenKullanici"] = Convert.ToInt32(veriIslem.dataTable(sqlSorgu.getID(txtuserName.Text, txtParola.Text)).Rows[0][0].ToString());
                }
            }
        }
コード例 #6
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string pasifID = Request.QueryString["kullaniciID"];

            if (!IsPostBack)
            {
                if (!string.IsNullOrEmpty(pasifID))
                {
                    Session["duzenlenenKullanici"] = pasifID;
                }
                DataTable dt = veriIslem.dataTable(sqlSorgu.kullaniciListePasif());
                gridKullanici.DataSource = dt;
                gridKullanici.Width      = 800;
                gridKullanici.DataBind();
            }
        }
コード例 #7
0
 protected void btnKaydet_Click(object sender, EventArgs e)
 {
     if (txtKitapAd.Text == "" || txtSayfa.Text == "" || txtTarih.Text == "" || txtTur.Text == "" || txtYayinci.Text == "" || txtYazar.Text == "" || imgKitap.ImageUrl == "")
     {
         lblKitapHata.Text    = "Lüfen boş alan bırakmayınız.";
         lblKitapHata.Visible = true;
     }
     else if (!System.Text.RegularExpressions.Regex.IsMatch(txtSayfa.Text, "[0-9]"))
     {
         lblKitapHata.Text    = "Lüfen sayfa sayısını doğru giriniz.";
         lblKitapHata.Visible = true;
     }
     else
     {
         veriIslem.dataTable(sqlSorgu.KitapEkle(txtKitapAd.Text.Replace("\'", "\'\'"), txtYazar.Text, txtYayinci.Text, Convert.ToInt32(txtSayfa.Text), imgKitap.ImageUrl, txtTur.Text, txtTarih.Text, Convert.ToInt32(txtAdet.Text)));
         Session["duzenlenenKitap"] = Convert.ToInt32(veriIslem.dataTable(sqlSorgu.getKitapID(txtKitapAd.Text.Replace("\'", "\'\'"), txtYazar.Text, txtYayinci.Text, Convert.ToInt32(txtSayfa.Text), imgKitap.ImageUrl, txtTur.Text, txtTarih.Text)).Rows[0][0].ToString());
         add.Visible      = false;
         confirm.Visible  = true;
         confirm2.Visible = true;
     }
 }
コード例 #8
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (Session["userID"] != null)
     {
         int       kullaniciID = Convert.ToInt32(Session["userID"].ToString());
         DataTable dt          = veriIslem.dataTable(sqlSorgu.Bilgilendirme(kullaniciID));
         txtname.Text        = dt.Rows[0][0].ToString() + " " + dt.Rows[0][1].ToString();
         txtphoneNo.Text     = dt.Rows[0][2].ToString();
         txtaddress.Text     = dt.Rows[0][3].ToString();
         txtKullaniciId.Text = kullaniciID.ToString();
     }
 }
コード例 #9
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string kitapID = Request.QueryString["kitapID"];

            if (!IsPostBack)
            {
                if (!String.IsNullOrEmpty(kitapID))    //Anasayfada bir kitap seçilmişse kitaba ait bilgilerin bulunduğu Kiralama sayfasına yönlendirilir.
                {
                    Session["kitapID"] = kitapID;
                    Response.Redirect("Kiralama.aspx");
                }
            }
            divTur.Visible = true;
            DataTable dt = veriIslem.dataTable(sqlSorgu.KitapListele()); //Anasayfada kitaplar listelenir

            if (Session["kitapTur"] != null)
            {
                dt = veriIslem.dataTable(sqlSorgu.listAsType(Session["kitapTur"].ToString()));  //Herhangi bir tür seçilmişse o türe ait kitaplar listelenir
            }
            gridKitaplar.DataSource = dt;
            gridKitaplar.Width      = 800;
            gridKitaplar.DataBind();
        }
コード例 #10
0
        protected void Page_Load(object sender, EventArgs e) //Yetkiliye ait bilgilerin listelendiği sayfa
        {
            SQLSorgu  sqlSorgu  = new SQLSorgu();
            VeriIslem veriIslem = new VeriIslem();

            if (Session["userID"] != null)
            {
                int       kullaniciID = Convert.ToInt32(Session["userID"].ToString());
                DataTable dt          = veriIslem.dataTable(sqlSorgu.Bilgilendirme(kullaniciID));
                txtname.Text    = dt.Rows[0][0].ToString() + " " + dt.Rows[0][1].ToString();
                txtphoneNo.Text = dt.Rows[0][2].ToString();
                txtaddress.Text = dt.Rows[0][3].ToString();
            }
        }
コード例 #11
0
        protected void Page_Load(object sender, EventArgs e)
        {
            DataTable dtYorumlar = veriIslem.dataTable(sqlSorgu.getKullaniciYorumlari(Convert.ToInt32(Session["duzenlenenKullanici"].ToString()))); //Yetkili tarafında istenilen kişinin yaptığı yorumların listelenmesi

            if (dtYorumlar.Rows.Count > 0)
            {
                gridYorumlar.DataSource = dtYorumlar;
                gridYorumlar.DataBind();
                gridYorumlar.Visible = true;
            }
            else
            {
                mainPage.Visible = false;
                none.Visible     = true;
            }
        }
コード例 #12
0
        protected void Page_Load(object sender, EventArgs e)
        {
            DataTable dtYorumlar = veriIslem.dataTable(sqlSorgu.getKullaniciYorumlari(Convert.ToInt32(Session["userID"].ToString()))); //Kullanıcının yaptığı yorumları görüntüleyebilmesi

            if (dtYorumlar.Rows.Count > 0)
            {
                gridYorumlar.DataSource = dtYorumlar;
                gridYorumlar.DataBind();
                gridYorumlar.Visible = true;
            }
            else
            {
                none.Visible     = true;
                mainPage.Visible = false;
            }
        }
コード例 #13
0
        protected void Page_Load(object sender, EventArgs e)
        {
            DataTable dt = veriIslem.dataTable(sqlSorgu.KiralamaforK(Convert.ToInt32(Session["userID"].ToString())));

            if (dt.Rows.Count == 0)
            {
                confirm.Visible = true;
                kira.Visible    = false;
            }
            else
            {
                gridKitaplar.DataSource = dt;
                gridKitaplar.Width      = 800;
                gridKitaplar.DataBind();
            }
        }
コード例 #14
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string kitapID      = Request.QueryString["kitapID"];
            string kullaniciID  = Request.QueryString["kullaniciID"];
            string kitapID2     = Request.QueryString["kitapID2"];
            string kullaniciID2 = Request.QueryString["kullaniciID2"];

            if (!IsPostBack)
            {
                if (!String.IsNullOrEmpty(kitapID))
                {
                    Session["kitapID"] = kitapID;
                    Response.Redirect("Kiralama.aspx");
                }
                else if (!String.IsNullOrEmpty(kullaniciID))
                {
                    Session["duzenlenenKullanici"] = kullaniciID;
                    Response.Redirect("KullaniciDuzenle.aspx");
                }
                else if (!String.IsNullOrEmpty(kitapID2) && !string.IsNullOrEmpty(kullaniciID2))
                {
                    int       IDK         = Convert.ToInt32(kullaniciID2);
                    int       ID          = Convert.ToInt32(kitapID2);
                    int       kitapSayisi = Convert.ToInt32(veriIslem.dataTable(sqlSorgu.getKitapSayisi(ID)).Rows[0][0].ToString()) + 1;
                    DataTable dtKira      = veriIslem.dataTable(sqlSorgu.KitapIadeInfo(ID, IDK));
                    veriIslem.dataTable(sqlSorgu.KitapSayiGuncelle(kitapSayisi, ID));
                    veriIslem.dataTable(sqlSorgu.KitapIadeKira(ID, IDK));
                    liste.Visible    = false;
                    mainPage.Visible = false;
                    iade.Visible     = true;
                    lblIade.Text     = veriIslem.dataTable(sqlSorgu.Bilgilendirme(IDK)).Rows[0][0].ToString() + " " + veriIslem.dataTable(sqlSorgu.Bilgilendirme(IDK)).Rows[0][1].ToString() + " adlı kullanıcı "
                                       + veriIslem.dataTable(sqlSorgu.KitapSorguID(ID)).Rows[0][1].ToString() + " kitabını iade etmiştir.";
                }
            }

            DataTable dt = veriIslem.dataTable(sqlSorgu.Kiralama());

            gridKitaplar.DataSource = dt;
            gridKitaplar.Width      = 800;
            gridKitaplar.DataBind();
        }
コード例 #15
0
        protected void ListKitap(object sender, EventArgs e)
        {
            Session["kitapTur"]     = null;
            Session["kitapID"]      = null;
            Session["yorumKitapID"] = null;
            string[] words = kitap.Text.Split(' ');

            if (string.IsNullOrEmpty(kitap.Text))
            {
                kitap.Text = "Bulunamadı..";
            }
            else if ((veriIslem.dataTable(sqlSorgu.KitapSorguAd(words))).Rows.Count > 1)
            {
                Session["arananKitaplar"] = kitap.Text;
                Response.Redirect("KitapInfo.aspx");
            }
            else if ((veriIslem.dataTable(sqlSorgu.KitapSorguAd(words))).Rows.Count == 1)
            {
                int ID = Convert.ToInt32(veriIslem.dataTable(sqlSorgu.KitapSorguAd(words)).Rows[0][0].ToString());
                Session["kitapID"] = ID;
                Response.Redirect("KitapInfo.aspx");
            }
            if ((veriIslem.dataTable(sqlSorgu.KitapSorguYazar(words))).Rows.Count > 1)
            {
                Session["arananKitaplar"] = kitap.Text;
                Response.Redirect("KitapInfo.aspx");
            }
            else if ((veriIslem.dataTable(sqlSorgu.KitapSorguYazar(words))).Rows.Count == 1)
            {
                int ID = Convert.ToInt32(veriIslem.dataTable(sqlSorgu.KitapSorguYazar(words)).Rows[0][0].ToString());
                Session["kitapID"] = ID;
                Response.Redirect("KitapInfo.aspx");
            }
            else
            {
                kitap.Text = "Bulunamadı..";
            }
        }
コード例 #16
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string IDKitap = Request.QueryString["bookID"];

            if (!IsPostBack)
            {
                if (!String.IsNullOrEmpty(IDKitap))
                {
                    Session["yorumKitapID"] = IDKitap;
                    OnlyOne(Convert.ToInt32(IDKitap));
                }
                else if (Session["kitapID"] == null)
                {
                    if (Session["arananKitaplar"] == null)
                    {
                        if (Session["istenen"] == null)
                        {
                        }
                        else
                        {
                            string word = Session["istenen"].ToString();
                            if (veriIslem.dataTable(sqlSorgu.KitapDirektSorguYazar(word)).Rows.Count >= 1)
                            {
                                DataTable dtL = veriIslem.dataTable(sqlSorgu.KitapDirektSorguYazar(word));
                                gridList.DataSource = dtL;
                                MoreThanOne();
                            }
                            else if (veriIslem.dataTable(sqlSorgu.KitapDirektSorguYayinci(word)).Rows.Count >= 1)
                            {
                                DataTable dtL = veriIslem.dataTable(sqlSorgu.KitapDirektSorguYayinci(word));
                                gridList.DataSource = dtL;
                                MoreThanOne();
                            }
                        }
                    }
                    else
                    {
                        string[] words = Session["arananKitaplar"].ToString().Split(' ');
                        if ((veriIslem.dataTable(sqlSorgu.KitapSorguAd(words))).Rows.Count >= 1)
                        {
                            DataTable dtL = veriIslem.dataTable(sqlSorgu.KitapSorguAd(words));
                            gridList.DataSource = dtL;
                            MoreThanOne();
                        }
                        else if ((veriIslem.dataTable(sqlSorgu.KitapSorguYazar(words))).Rows.Count >= 1)
                        {
                            DataTable dtL = veriIslem.dataTable(sqlSorgu.KitapSorguYazar(words));
                            gridList.DataSource = dtL;
                            MoreThanOne();
                        }
                    }
                }

                else if ((veriIslem.dataTable(sqlSorgu.KitapSorguID(Convert.ToInt32(Session["kitapID"].ToString())))).Rows.Count == 1)
                {
                    int ID = Convert.ToInt32(Session["kitapID"].ToString());
                    OnlyOne(ID);
                }
            }
        }
コード例 #17
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string kullaniciID = Request.QueryString["kullaniciID"];

            if (!IsPostBack)
            {
                if (!string.IsNullOrEmpty(kullaniciID))
                {
                    search.Visible   = false;
                    add.Visible      = true;
                    list.Visible     = false;
                    delButon.Visible = false;
                    DataTable dt = veriIslem.dataTable(sqlSorgu.Bilgilendirme(Convert.ToInt32(kullaniciID)));
                    txtAd.Text    = dt.Rows[0][0].ToString();
                    txtSoyad.Text = dt.Rows[0][1].ToString();
                    txtNo.Text    = dt.Rows[0][2].ToString();
                    txtAdres.Text = dt.Rows[0][3].ToString();
                }
                else if (Session["duzenlenenKullanici"] == null)
                {
                    DataTable dt = veriIslem.dataTable(sqlSorgu.kullaniciListe());
                    gridKullanici.DataSource = dt;
                    gridKullanici.Width      = 800;
                    gridKullanici.DataBind();
                }
                else
                {
                    list.Visible     = false;
                    delButon.Visible = false;
                    search.Visible   = false;
                    add.Visible      = true;
                    string ID = null;
                    ID = Session["duzenlenenKullanici"].ToString();
                    if (ID != null)
                    {
                        DataTable dt = veriIslem.dataTable(sqlSorgu.Bilgilendirme(Convert.ToInt32(ID)));
                        txtAd.Text    = dt.Rows[0][0].ToString();
                        txtSoyad.Text = dt.Rows[0][1].ToString();
                        txtNo.Text    = dt.Rows[0][2].ToString();
                        txtAdres.Text = dt.Rows[0][3].ToString();
                    }
                }
            }
        }
コード例 #18
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string kitapIDL         = Request.QueryString["kitapIDL"];
            string kitapIDfromYorum = Request.QueryString["kitapIDYorum"];

            if (!IsPostBack) //kitap sayfasını açar
            {
                if (!string.IsNullOrEmpty(kitapIDfromYorum))
                {
                    Session["kitapID"] = kitapIDfromYorum;
                }
                if (Session["kitapID"] != null)
                {
                    search.Visible = false;
                    add.Visible    = true;
                    int kitap = Convert.ToInt32(Session["kitapID"]);

                    int puan = Convert.ToInt32(veriIslem.dataTable(sqlSorgu.getPuan(kitap)).Rows[0][0].ToString());
                    switch (puan)
                    {
                    case 1:
                        no1.Checked = true;
                        break;

                    case 2:
                        no2.Checked = true;
                        break;

                    case 3:
                        no3.Checked = true;
                        break;

                    case 4:
                        no4.Checked = true;
                        break;

                    case 5:
                        no5.Checked = true;
                        break;
                    }
                    voters.Text = veriIslem.dataTable(sqlSorgu.getPuanlayan(kitap)).Rows[0][0].ToString() + "  kişi puanladı.";
                    DataTable dt = veriIslem.dataTable(sqlSorgu.KitapSorguID(kitap));
                    txtKitapAd.Text   = dt.Rows[0][1].ToString();
                    txtYazar.Text     = dt.Rows[0][2].ToString();
                    txtYayinci.Text   = dt.Rows[0][3].ToString();
                    txtSayfa.Text     = dt.Rows[0][4].ToString();
                    imgKitap.ImageUrl = dt.Rows[0][7].ToString();
                    txtTur.Text       = dt.Rows[0][8].ToString();
                    txtTarih.Text     = dt.Rows[0][9].ToString();
                    txtAktif.Text     = AktifMi(dt.Rows[0][10].ToString());
                    txtAdet.Text      = dt.Rows[0][10].ToString();
                }
                else if (!string.IsNullOrEmpty(kitapIDL))
                {
                    Session["kitapID"] = kitapIDL;
                    if (veriIslem.dataTable(sqlSorgu.AktifKitap(Convert.ToInt32(kitapIDL))).Rows.Count > 0) //aranan kitap birden çoksa liste içerisinde gösterilir.
                    {
                        fillInfo();
                    }
                    else
                    {
                        Session["kitapIDiade"] = Convert.ToInt32(kitapIDL);
                        DataTable dtiade = veriIslem.dataTable(sqlSorgu.kitapKiralayanlar(Convert.ToInt32(kitapIDL)));
                        kira.Visible     = false;
                        add.Visible      = false;
                        liste.Visible    = false;
                        search.Visible   = false;
                        iade.Visible     = false;
                        iadeInfo.Visible = true;
                        for (int i = 0; i < dtiade.Rows.Count; i++)
                        {
                            kullaniciIDiade.Items.Add(dtiade.Rows[i][0].ToString());
                        }
                    }
                }
                else
                {
                }
            }
        }
コード例 #19
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string deleteComment = Request.QueryString["DeleteComment"];
            string updateComment = Request.QueryString["UpdateComment"];
            string yorumdirekt   = Request.QueryString["theYorum"];
            string YorumIDL      = Request.QueryString["YorumIDL"]; //like için
            string YorumIDD      = Request.QueryString["YorumIDD"]; //dislike için
            string YorumLK       = Request.QueryString["YorumLK"];  //likelayanlar
            string YorumDK       = Request.QueryString["YorumDK"];  //dislikers

            if (!IsPostBack)
            {
                if (!string.IsNullOrEmpty(deleteComment))
                {
                    string yorumKitap = Session["yorumKitapID"].ToString();
                    if (veriIslem.dataTable(sqlSorgu.getPuanliYorum(Convert.ToInt32(yorumKitap), Convert.ToInt32(Session["userID"].ToString()))).Rows.Count > 0)
                    {
                        double puan       = Convert.ToDouble(veriIslem.dataTable(sqlSorgu.getPuan(Convert.ToInt32(yorumKitap))).Rows[0][0].ToString());
                        int    puanlayan  = Convert.ToInt32(veriIslem.dataTable(sqlSorgu.getPuanlayan(Convert.ToInt32(yorumKitap))).Rows[0][0].ToString());
                        int    current    = veriIslem.dataTable(sqlSorgu.getPuanliYorum(Convert.ToInt32(yorumKitap), Convert.ToInt32(Session["userID"].ToString()))).Rows.Count - 1;
                        int    eskiPuan   = Convert.ToInt32(veriIslem.dataTable(sqlSorgu.getPuanliYorum(Convert.ToInt32(yorumKitap), Convert.ToInt32(Session["userID"].ToString()))).Rows[current][8]);
                        double toplamPuan = puan * puanlayan - eskiPuan;
                        puan = Math.Round(toplamPuan / (puanlayan - 1));
                        veriIslem.dataTable(sqlSorgu.PuanInfo(Convert.ToInt32(yorumKitap), puan, (puanlayan - 1)));
                    }
                    veriIslem.dataTable(sqlSorgu.deleteYorumbyID(Convert.ToInt32(deleteComment)));
                }


                if (!string.IsNullOrEmpty(yorumdirekt))
                {
                    Session["yorumKitapID"] = yorumdirekt;
                }
                else
                {
                }
                if (!string.IsNullOrEmpty(updateComment))
                {
                    yorum.Visible            = false;
                    updateName.Text          = veriIslem.dataTable(sqlSorgu.getKullaniciAdi(Convert.ToInt32(Session["userID"].ToString()))).Rows[0][0].ToString();
                    updateText.Text          = veriIslem.dataTable(sqlSorgu.getYorumbyID(Convert.ToInt32(updateComment))).Rows[0][0].ToString();
                    updater.Visible          = true;
                    Session["updateComment"] = updateComment;
                }
                else if (!string.IsNullOrEmpty(YorumIDL))
                {
                    int yorumIDL = Convert.ToInt32(YorumIDL);
                    Like_Click(yorumIDL);
                }
                else if (!string.IsNullOrEmpty(YorumIDD))
                {
                    int yorumIDD = Convert.ToInt32(YorumIDD);
                    Dislike_Click(yorumIDD);
                }
                if (!string.IsNullOrEmpty(YorumLK))
                {
                    DataTable likers = veriIslem.dataTable(sqlSorgu.getLikers(1, Convert.ToInt32(YorumLK)));
                    if (likers.Rows.Count > 0)
                    {
                        gridLikers.DataSource = likers;
                        gridLikers.DataBind();
                        whoLiked.Visible = true;
                    }
                    if (Session["alert"] != null)
                    {
                        alert2.Visible = true;
                    }
                    Curuser.Text = veriIslem.dataTable(sqlSorgu.getKullaniciAdi(Convert.ToInt32(Session["userID"].ToString()))).Rows[0][0].ToString();
                    DataTable dtYorumlar = veriIslem.dataTable(sqlSorgu.getDoluYorums(Convert.ToInt32(Session["yorumKitapID"].ToString())));
                    gridComment.DataSource = dtYorumlar;
                    gridComment.DataBind();
                    gridComment.Visible = true;
                    Session["alert"]    = null;
                }
                else if (!string.IsNullOrEmpty(YorumDK))
                {
                    DataTable likers = veriIslem.dataTable(sqlSorgu.getLikers(0, Convert.ToInt32(YorumDK)));
                    if (likers.Rows.Count > 0)
                    {
                        gridLikers.DataSource = likers;
                        gridLikers.DataBind();
                        whoLiked.Visible = true;
                        YorumDK          = null;
                    }
                    if (Session["alert"] != null)
                    {
                        alert2.Visible = true;
                    }
                    Curuser.Text = veriIslem.dataTable(sqlSorgu.getKullaniciAdi(Convert.ToInt32(Session["userID"].ToString()))).Rows[0][0].ToString();
                    DataTable dtYorumlar = veriIslem.dataTable(sqlSorgu.getDoluYorums(Convert.ToInt32(Session["yorumKitapID"].ToString())));
                    gridComment.DataSource = dtYorumlar;
                    gridComment.DataBind();
                    gridComment.Visible = true;
                    Session["alert"]    = null;
                }

                else if (Session["yorumKitapID"] != null)
                {
                    if (Session["alert"] != null)
                    {
                        alert2.Visible = true;
                    }
                    Curuser.Text = veriIslem.dataTable(sqlSorgu.getKullaniciAdi(Convert.ToInt32(Session["userID"].ToString()))).Rows[0][0].ToString();
                    DataTable dtYorumlar = veriIslem.dataTable(sqlSorgu.getDoluYorums(Convert.ToInt32(Session["yorumKitapID"].ToString())));
                    gridComment.DataSource = dtYorumlar;
                    gridComment.DataBind();
                    gridComment.Visible = true;
                    Session["alert"]    = null;
                }
            }
        }
コード例 #20
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string kitapID = Request.QueryString["bookID"];

            if (!IsPostBack)
            {
                if (!String.IsNullOrEmpty(kitapID))
                {
                    Session["duzenlenenKitap"] = kitapID;
                    duzenPage();
                }
                else if (Session["duzenlenenKitap"] == null)
                {
                    DataTable dt = veriIslem.dataTable(sqlSorgu.KitapListele());
                    if (Session["kitapTur"] != null)
                    {
                        dt = veriIslem.dataTable(sqlSorgu.listAsType(Session["kitapTur"].ToString()));
                    }
                    gridKitaplar.DataSource = dt;
                    gridKitaplar.Width      = 800;
                    gridKitaplar.DataBind();
                }

                else
                {
                    duzenPage();
                }
            }
        }
コード例 #21
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string deleteComment = Request.QueryString["DeleteComment"];
            string selectedUser  = Request.QueryString["selectedUser"];
            string selected      = Request.QueryString["yorumKitapID"];
            string YorumLK       = Request.QueryString["YorumLK"]; //likelayanlar
            string YorumDK       = Request.QueryString["YorumDK"]; //dislikers

            if (!IsPostBack)
            {
                if (!string.IsNullOrEmpty(deleteComment))
                {
                    veriIslem.dataTable(sqlSorgu.deleteYorumfromYetkili(Convert.ToInt32(deleteComment)));  //bu sayede sadece yorum silindi kişinin verdiği puan değişmedi(yeniden puanlama yaparsa eski puan güncellenecek)
                }

                if (!string.IsNullOrEmpty(selected))
                {
                    Session["yorumKitapID"] = selected;
                }
                if (selectedUser != null)
                {
                    int selectedUserID = Convert.ToInt32(selectedUser);
                    UserPage(selectedUserID);
                }
                if (!string.IsNullOrEmpty(YorumLK))
                {
                    DataTable likers = veriIslem.dataTable(sqlSorgu.getLikers(1, Convert.ToInt32(YorumLK)));
                    if (likers.Rows.Count > 0)
                    {
                        gridLikers.DataSource = likers;
                        gridLikers.DataBind();
                        whoLiked.Visible = true;
                    }
                    DataTable dtYorumlar = veriIslem.dataTable(sqlSorgu.getDoluYorums(Convert.ToInt32(Session["yorumKitapID"].ToString())));
                    if (dtYorumlar.Rows.Count > 0)
                    {
                        gridComment.DataSource = dtYorumlar;
                        gridComment.DataBind();
                        gridComment.Visible = true;
                        Session["alert"]    = null;
                        YorumLK             = null;
                    }
                    else
                    {
                        empty.Visible = true;
                    }
                }
                else if (!string.IsNullOrEmpty(YorumDK))
                {
                    DataTable likers = veriIslem.dataTable(sqlSorgu.getLikers(0, Convert.ToInt32(YorumDK)));
                    if (likers.Rows.Count > 0)
                    {
                        gridLikers.DataSource = likers;
                        gridLikers.DataBind();
                        whoLiked.Visible = true;
                    }
                    DataTable dtYorumlar = veriIslem.dataTable(sqlSorgu.getDoluYorums(Convert.ToInt32(Session["yorumKitapID"].ToString())));
                    if (dtYorumlar.Rows.Count > 0)
                    {
                        gridComment.DataSource = dtYorumlar;
                        gridComment.DataBind();
                        gridComment.Visible = true;
                        Session["alert"]    = null;
                        YorumDK             = null;
                    }
                    else
                    {
                        empty.Visible = true;
                    }
                }
                else if (Session["yorumKitapID"] != null)
                {
                    DataTable dtYorumlar = veriIslem.dataTable(sqlSorgu.getDoluYorums(Convert.ToInt32(Session["yorumKitapID"].ToString())));
                    if (dtYorumlar.Rows.Count > 0)
                    {
                        gridComment.DataSource = dtYorumlar;
                        gridComment.DataBind();
                        gridComment.Visible = true;
                        Session["alert"]    = null;
                    }
                    else
                    {
                        empty.Visible = true;
                    }
                }
                else
                {
                }
            }
        }