コード例 #1
0
        protected void ButtonMobilAra_Click(object sender, EventArgs e)
        {
            try
            {
                if (TextBoxMobilAra.Text == "" && DropDownList_mSiniflar.SelectedValue == "sinifYok")
                {
                    return;
                }

                if (TextBoxMobilAra.Text.Length > 40)
                {
                    return;
                }

                ad = new accessDatabase();
                if (TextBoxMobilAra.Text == "")
                {
                    getMsinif = DropDownList_mSiniflar.SelectedItem.ToString();
                }

                ad.ekle("insert into aramaIstatistik (tarih,arananlar) values ('" + string.Format("{0:dd.MM.yyyy HH:mm:ss}", TimeZoneInfo.ConvertTime(DateTime.Now, TimeZoneInfo.FindSystemTimeZoneById("Turkey Standard Time"))) + "', '" + (TextBoxMobilAra.Text == "" ? getMsinif + "." : TextBoxMobilAra.Text + ".") + "')");
                Response.Redirect("Arama.aspx?gelen=" + TextBoxMobilAra.Text + "&sinif=" + DropDownList_mSiniflar.SelectedValue + "&detayliArama=" + DropDownList_mDetayliAra.SelectedValue);
            }
            catch
            {
            }
        }
コード例 #2
0
        protected void btnYorumEkle_Click(object sender, EventArgs e)
        {
            try
            {
                if (TextBoxGuvenlikSorusu.Text == Session["sonuc"].ToString() &&
                    TextAreaMesaj.InnerText != "" &&
                    TextBoxAdsoyad.Text != "" &&
                    TextBoxAdsoyad.Text.Length <= 40)
                {
                    ad = new accessDatabase();

                    ad.ekle("INSERT INTO Yorumlar (adSoyad,yorum,tarih,makaleid,ipAdres) VALUES ('" + TextBoxAdsoyad.Text + "','" + TextAreaMesaj.InnerText + "','" + string.Format("{0:dd.MM.yyyy HH:mm}", TimeZoneInfo.ConvertTime(DateTime.Now, TimeZoneInfo.FindSystemTimeZoneById("Turkey Standard Time"))) + "'," + Request.QueryString["konu"] + ",'" + getIpAdress() + "')");
                    ad.gridViewDoldur(rpt_yorumlar, "Yorumlar", "select * from Yorumlar where makaleid=" + Request.QueryString["konu"] + " order by yorumid desc");
                    Page.Response.Redirect(Page.Request.Url.ToString(), false);
                }
                else
                {
                    LabelYorumDurum.Text = "Kutucukları boş geçmeyiniz!";
                }
            }
            catch
            {
            }
        }