-
Notifications
You must be signed in to change notification settings - Fork 0
/
baby.aspx.cs
78 lines (77 loc) · 2.66 KB
/
baby.aspx.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Data.SqlClient;
namespace AlTarwadaWebStore
{
public partial class baby : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
BindCartNumber();
if (!IsPostBack)
{
SqlConnection myconnect = new SqlConnection(@"Data Source=DHANYA-SUDHA\SQLEXPRESS01;Initial Catalog=Database_class_Data;Integrated Security=True");
myconnect.Open();
string query = "SELECT * FROM Product_det where p_category= 'baby'";
//SqlDataReader result = myconn1.ExecuteReader();
SqlCommand myconn = new SqlCommand(query, myconnect);
using (SqlDataAdapter sda = new SqlDataAdapter(myconn))
{
DataTable dt = new DataTable();
sda.Fill(dt);
rptPro.DataSource = dt;
rptPro.DataBind();
}
myconnect.Close();
}
}
protected void lwork(object sender, EventArgs e)
{
Session["query"] = "Lace";
Response.Redirect("Products.aspx");
}
protected void ework(object sender, EventArgs e)
{
Session["query"] = "Embroidery";
Response.Redirect("Products.aspx");
}
protected void bwork(object sender, EventArgs e)
{
Session["query"] = "Baby bag ";
Response.Redirect("Products.aspx");
}
protected void fwork(object sender, EventArgs e)
{
Session["query"] = "Baby full set";
Response.Redirect("Products.aspx");
}
protected void cwork(object sender, EventArgs e)
{
Session["query"] = "Cradle";
Response.Redirect("Products.aspx");
}
public void BindCartNumber()
{
if (Request.Cookies["CartPID"] != null)
{
string CookiePID = Request.Cookies["CartPID"].Value.Split('=')[1];
string[] ProductArray = CookiePID.Split(',');
int ProductCount = ProductArray.Length;
pcount.InnerText = ProductCount.ToString();
}
else
{
pcount.InnerText = 0.ToString();
}
}
protected void Button2_Click(object sender, EventArgs e)
{
Response.Redirect("Cart.aspx");
}
}
}