using System;
using System.Data;
using System.Data.SqlClient;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.IO;
using System.Drawing;
using System.Configuration;
using System.Web.Security;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
public partial class TalepEkle : System.Web.UI.Page
{
Fonksiyon system = new Fonksiyon();
protected void Page_Load(object sender, EventArgs e)
{
}
protected void btnEkle_Click(object sender, EventArgs e)
{
if (Session["GuvenlikKelimesi"] == null)
{
Response.Write("Session bulunamadı. Yorumunuz ile ilgili işlem yapılamadı.");
return;
}
if (txGuvenlikKelimesi.Text == Session["GuvenlikKelimesi"].ToString())
{
Response.Write("Güvenlik kelimesi onaylandı. Yorumunuz ile ilgili işlem başarıyla tamamlandı.");
SqlConnection baglanti = system.baglan();
SqlCommand cmdKaydet = new SqlCommand("Insert into SitedenTalepler(Tarih,FiyatAraligi,Tel,Email) " +
"values(@Tarih,@FiyatAraligi,@Tel,@Email)", baglanti);
cmdKaydet.Connection = baglanti;
cmdKaydet.Parameters.Add("Tel", txtTel.Text);
cmdKaydet.Parameters.Add("Tarih", DateTime.Now.ToString());
cmdKaydet.Parameters.Add("FiyatAraligi", txtFiyatAraligi.Text);
cmdKaydet.Parameters.Add("Notlar", txtDetay.Content);
cmdKaydet.Parameters.Add("Email", txtEmail.Text);
cmdKaydet.ExecuteNonQuery();
cmdKaydet.Dispose();
baglanti.Close();
}
else
Response.Write("Güvenlik kelimesi onaylanamadı. Yorumunuz ile ilgili işlem yapılmadı.");
}
}Şeklinde değiştirdiğiniz zaman olacaktır.