protected void Page_Load(object sender, EventArgs e)
    {
        if (Page.IsPostBack == false)
        {
            int id = Convert.ToInt32(Request.QueryString["Kategoriid"]);
            islem = Request.QueryString["islem"];
        }

        SqlCommand    cmd = new SqlCommand(" Select * From Tbl_Kategoriler ", bgl.Connection());
        SqlDataReader dr  = cmd.ExecuteReader();

        DataList1.DataSource = dr;
        DataList1.DataBind();
        Panel2.Visible = false;
        Panel4.Visible = false;


        if (islem == "sil")
        {
            int        id        = Convert.ToInt32(Request.QueryString["Kategoriid"]);
            SqlCommand cmdDelete = new SqlCommand("Delete From Tbl_Kategoriler where kategoriid=@p1", bgl.Connection());
            cmdDelete.Parameters.AddWithValue("@p1", (id > 0 ? id : 0));
            cmdDelete.ExecuteNonQuery();
            bgl.Connection().Close();
        }
    }
Exemplo n.º 2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        int id = Convert.ToInt32(Request.QueryString["Tarifid"]);

        if (Page.IsPostBack == false)
        {
            SqlCommand cmd = new SqlCommand("Select * From Tbl_Tarifler where Tarifid=@p1", bgl.Connection());
            cmd.Parameters.AddWithValue("@p1", (id > 0 ? id : 0));
            SqlDataReader dr = cmd.ExecuteReader();
            while (dr.Read())
            {
                TextBox1.Text = dr[1].ToString();
                TextBox2.Text = dr[2].ToString();
                TextBox3.Text = dr[3].ToString();
                TextBox4.Text = dr[5].ToString();
                TextBox5.Text = dr[6].ToString();
            }
            bgl.Connection().Close();
        }

        if (Page.IsPostBack == false)
        {
            SqlCommand    cmd1 = new SqlCommand("Select * From Tbl_Kategoriler", bgl.Connection());
            SqlDataReader dr1  = cmd1.ExecuteReader();
            DropDownList1.DataTextField  = "KategoriAd";
            DropDownList1.DataValueField = "Kategoriid";
            DropDownList1.DataSource     = dr1;
            DropDownList1.DataBind();
        }
    }
 protected void Page_Load(object sender, EventArgs e)
 {
     Panel2.Visible = false;
     if (Page.IsPostBack == false)
     {
         SqlCommand    cmd = new SqlCommand("Select *From Tbl_Hakkımızda ", bgl.Connection());
         SqlDataReader dr  = cmd.ExecuteReader();
         while (dr.Read())
         {
             TextBox1.Text = dr[0].ToString();
         }
     }
 }
    protected void Page_Load(object sender, EventArgs e)
    {
        SqlCommand    cmd = new SqlCommand("Select *From Tbl_Hakkımızda", bgl.Connection());
        SqlDataReader dr  = cmd.ExecuteReader();

        DataList2.DataSource = dr;
        DataList2.DataBind();
    }
Exemplo n.º 5
0
    protected void Page_Load(object sender, EventArgs e)
    {
        int id = Convert.ToInt32(Request.QueryString["Kategoriid"]);

        if (Page.IsPostBack == false)
        {
            SqlCommand cmd = new SqlCommand(" Select * From Tbl_Kategoriler where Kategoriid=@p1", bgl.Connection());
            cmd.Parameters.AddWithValue("@p1", (id > 0 ? id : 0));
            SqlDataReader dr = cmd.ExecuteReader();
            while (dr.Read())
            {
                TextBox1.Text = dr[1].ToString();
                TextBox2.Text = dr[2].ToString();
            }
            bgl.Connection().Close();
        }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        SqlCommand    cmd = new SqlCommand(" Select * From Tbl_Kategoriler", bgl.Connection());
        SqlDataReader oku = cmd.ExecuteReader();

        DataList1.DataSource = oku;
        DataList1.DataBind();
    }
Exemplo n.º 7
0
    protected void Page_Load(object sender, EventArgs e)
    {
        Panel2.Visible = false;
        SqlCommand    cmd = new SqlCommand("Select * From Tbl_Mesajlar", bgl.Connection());
        SqlDataReader dr  = cmd.ExecuteReader();

        DataList1.DataSource = dr;
        DataList1.DataBind();
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        int id = Convert.ToInt32(Request.QueryString["Yorumid"]);

        if (Page.IsPostBack == false)
        {
            SqlCommand cmd = new SqlCommand(" Select YorumAdSoyad,YorumMail,Yorum,YemekAd From Tbl_Yorum inner join Tbl_Yemeklerr on Tbl_Yorum.Yemekid=Tbl_Yemeklerr.Yemekid where Yorumid=@p1", bgl.Connection());
            cmd.Parameters.AddWithValue("@p1", (id > 0 ? id : 0));
            SqlDataReader dr = cmd.ExecuteReader();
            while (dr.Read())
            {
                txt_adsoyad.Text = dr[0].ToString();
                txt_mail.Text    = dr[1].ToString();
                txt_içerik.Text  = dr[2].ToString();
                txt_yemek.Text   = dr[3].ToString();
            }
            bgl.Connection().Close();
        }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        int id = Convert.ToInt32(Request.QueryString["Mesajid"]);

        if (Page.IsPostBack == false)
        {
            SqlCommand cmd = new SqlCommand("Select MesajGönderen,MesajjBaşlık,MesajMail,Mesajİçerik From Tbl_Mesajlar where Mesajid=@p1 ", bgl.Connection());
            cmd.Parameters.AddWithValue("@p1", (id > 0 ? id : 0));
            SqlDataReader dr = cmd.ExecuteReader();
            while (dr.Read())
            {
                txt_adsoyad.Text = dr[0].ToString();
                txt_baslik.Text  = dr[1].ToString();
                txt_mail.Text    = dr[2].ToString();
                txt_icerik.Text  = dr[3].ToString();
            }
            bgl.Connection().Close();
        }
    }
Exemplo n.º 10
0
    protected void Button1_Click(object sender, EventArgs e)
    {
        SqlCommand cmd = new SqlCommand("insert into Tbl_Mesajlar (MesajGönderen,MesajjBaşlık,MesajMail,Mesajİçerik)values(@p1,@p2,@p3,@p4)", bgl.Connection());

        cmd.Parameters.AddWithValue("@p1", txt_as.Text);
        cmd.Parameters.AddWithValue("@p2", txt_konu.Text);
        cmd.Parameters.AddWithValue("@p3", txt_mailad.Text);
        cmd.Parameters.AddWithValue("@p4", txt_mesaj.Text);
        cmd.ExecuteNonQuery();
        bgl.Connection().Close();
    }
Exemplo n.º 11
0
    protected void Page_Load(object sender, EventArgs e)
    {
        int        yemekid = Convert.ToInt32(Request.QueryString["yemekid"]);
        SqlCommand cmd     = new SqlCommand("Select YemekAd From Tbl_Yemeklerr Where yemekid=@p1", bgl.Connection());

        cmd.Parameters.AddWithValue("@p1", (yemekid > 0 ? yemekid : 0));

        SqlDataReader dr = cmd.ExecuteReader();

        while (dr.Read())
        {
            Label7.Text = dr[0].ToString();
        }
        bgl.Connection().Close();
        SqlCommand cmd2 = new SqlCommand(" Select * From Tbl_Yorum where yemekid=@p2", bgl.Connection());

        cmd2.Parameters.AddWithValue("@p2", yemekid);
        SqlDataReader dr2 = cmd2.ExecuteReader();

        DataList2.DataSource = dr2;
        DataList2.DataBind();
    }
Exemplo n.º 12
0
    protected void Btn_TarifOner_Click(object sender, EventArgs e)
    {
        SqlCommand cmd = new SqlCommand(" insert into Tbl_Tarifler(TarifAd,TarifMalzeme,TarifYapılış,TarifResim,TarifSahip,TarifSahipMail) values (@t1,@t2,@t3,@t4,@t5,@t6)", bgl.Connection());

        cmd.Parameters.AddWithValue("@t1", TxtTarifAd.Text);
        cmd.Parameters.AddWithValue("@t2", TxtMalzemeler.Text);
        cmd.Parameters.AddWithValue("@t3", TxtYapılıs.Text);
        cmd.Parameters.AddWithValue("@t4", FileUpload1.FileName);
        cmd.Parameters.AddWithValue("@t5", TxtTarifOneren.Text);
        cmd.Parameters.AddWithValue("@t6", TxtMail.Text);
        cmd.ExecuteNonQuery();
        bgl.Connection().Close();
        Response.Write("Tarifiniz alınmıştır");
    }
Exemplo n.º 13
0
    protected void Page_Load(object sender, EventArgs e)
    {
        Panel2.Visible = false;
        Panel4.Visible = false;


        if (Page.IsPostBack == false)
        {
            int id = Convert.ToInt32(Request.QueryString["Yemekid"]);
            islem = Request.QueryString["islem"];
            SqlCommand    cmd1 = new SqlCommand("Select * From Tbl_Kategoriler", bgl.Connection());
            SqlDataReader dr1  = cmd1.ExecuteReader();
            DropDownList1.DataTextField  = "KategoriAd";
            DropDownList1.DataValueField = "Kategoriid";
            DropDownList1.DataSource     = dr1;
            DropDownList1.DataBind();
        }
        SqlCommand    cmd = new SqlCommand(" Select * From Tbl_Yemeklerr", bgl.Connection());
        SqlDataReader dr  = cmd.ExecuteReader();

        DataList1.DataSource = dr;
        DataList1.DataBind();


        if (islem == "sil")
        {
            int        id   = Convert.ToInt32(Request.QueryString["Yemekid"]);
            SqlCommand cmd2 = new SqlCommand("select  * from Tbl_Yemeklerr where yemekid=@p1", bgl.Connection());
            cmd2.Parameters.AddWithValue("@p1", id);
            SqlDataReader dr2 = cmd2.ExecuteReader();
            while (dr2.Read())
            {
                Kategorriid = dr2[7].ToString();
            }

            SqlCommand cmdDelete = new SqlCommand("Delete From Tbl_Yemeklerr where Yemekid=@p1", bgl.Connection());
            cmdDelete.Parameters.AddWithValue("@p1", (id > 0 ? id : 0));
            cmdDelete.ExecuteNonQuery();
            bgl.Connection().Close();

            SqlCommand cmddelete1 = new SqlCommand("Update Tbl_Kategoriler set KategoriAdet=KategoriAdet-1 where kategoriid=@p1", bgl.Connection());
            cmddelete1.Parameters.AddWithValue("@p1", Kategorriid);
            cmddelete1.ExecuteNonQuery();
            bgl.Connection().Close();
        }
    }
Exemplo n.º 14
0
    protected void Page_Load(object sender, EventArgs e)
    {
        Panel2.Visible = false;
        Panel4.Visible = false;

        SqlCommand    cmd = new SqlCommand(" select * from Tbl_Yorum where YorumOnay=1", bgl.Connection());
        SqlDataReader dr  = cmd.ExecuteReader();

        DataList1.DataSource = dr;
        DataList1.DataBind();

        SqlCommand    cmd2 = new SqlCommand("select * from Tbl_Yorum where YorumOnay =0", bgl.Connection());
        SqlDataReader dr2  = cmd2.ExecuteReader();

        DataList2.DataSource = dr2;
        DataList2.DataBind();
    }
Exemplo n.º 15
0
    protected void Page_Load(object sender, EventArgs e)
    {
        SqlCommand    cmd = new SqlCommand("Select * From Tbl_Yemeklerr where Durum=1", bgl.Connection());
        SqlDataReader oku = cmd.ExecuteReader();

        DataList2.DataSource = oku;
        DataList2.DataBind();
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        kategoriid = Request.QueryString["Kategoriid"];
        SqlCommand cmd = new SqlCommand(" Select * From Tbl_Yemeklerr where Kategoriid=@p1", bgl.Connection());

        cmd.Parameters.AddWithValue("@p1", kategoriid);
        SqlDataReader dr = cmd.ExecuteReader();

        DataList2.DataSource = dr;
        DataList2.DataBind();
    }
Exemplo n.º 17
0
    protected void Page_Load(object sender, EventArgs e)
    {
        Panel2.Visible = false;
        Panel4.Visible = false;
        SqlCommand    cmd = new SqlCommand("Select * From Tbl_Tarifler where TarifDurum=0", bgl.Connection());
        SqlDataReader dr  = cmd.ExecuteReader();

        DataList1.DataSource = dr;
        DataList1.DataBind();

        SqlCommand    cmd1 = new SqlCommand("Select * From Tbl_Tarifler where TarifDurum=1", bgl.Connection());
        SqlDataReader dr1  = cmd.ExecuteReader();

        DataList2.DataSource = dr1;
        DataList2.DataBind();
    }