-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathHome1.aspx.cs
86 lines (57 loc) · 2.05 KB
/
Home1.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
79
80
81
82
83
84
85
86
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data.SqlClient;
using System.Data;
using System.Configuration;
public partial class home1 : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
SqlConnection conn = new SqlConnection(ConfigurationManager.ConnectionStrings["db"].ToString());
conn.Open();
SqlDataAdapter da = new SqlDataAdapter("SELECT TOP 6 * FROM ProductInfo where flag='" + "1" + "' And ProductCategory='" + "BigDealOfDay"+"' ", conn);
DataTable dt = new DataTable();
da.Fill(dt);
conn.Close();
listView.DataSource = dt;
listView.DataBind();
if (!IsPostBack)
{
}
else
{
}
}
protected void btnAdd13_Click(object sender, EventArgs e)
{
Control c = sender as Control;
if (c == null) return;
Label hdnId = c.Parent.FindControl("id") as Label;
String id1 = hdnId.Text;
// Int32 id = Convert.ToInt16(id1);
ShoppingCart.Instance.AddItem(hdnId.Text);
Response.Redirect("Home.aspx");
}
protected void btnAdd14_Click(object sender, EventArgs e)
{
Control c = sender as Control;
if (c == null) return;
Label hdnId = c.Parent.FindControl("id") as Label;
Session["pid"] = hdnId.Text;
Response.Redirect("ViewDetails.aspx");
}
protected void listView_SelectedIndexChanged(object sender, EventArgs e)
{
//Control c = sender as Control;
//if (c == null) return;
//LinkButton hdnId = c.Parent.FindControl("LinkButton1") as LinkButton;
//String id1 = hdnId.Text;
//Int32 id = Convert.ToInt16(id1);
//ShoppingCart.Instance.AddItem(id);
////Response.Redirect("NewHome.aspx");
}
}