-
Notifications
You must be signed in to change notification settings - Fork 0
/
WomanTop.aspx.cs
108 lines (102 loc) · 3.33 KB
/
WomanTop.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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
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;
using System.Configuration;
using System.Globalization;
using System.Threading;
public partial class WomanTop : System.Web.UI.Page
{
public static String CS = ConfigurationManager.ConnectionStrings["EasyBuy123"].ConnectionString;
protected void Page_Load(object sender, EventArgs e)
{
if (Session["Username"] != null)
{
if (!IsPostBack)
{
if (Request.QueryString["BuyNow"] == "YES")
{
}
BindProductRepeater();
BindCartNumber();
}
}
else
{
if (Request.QueryString["BuyNow"] == "YES")
{
Response.Redirect("SignIn.aspx");
}
else
{
Response.Redirect("~/Default.aspx");
}
}
}
private void BindProductRepeater()
{
using (SqlConnection con = new SqlConnection(CS))
{
using (SqlCommand cmd = new SqlCommand("procBindAllProductsWomanTop", con))
{
cmd.CommandType = CommandType.StoredProcedure;
using (SqlDataAdapter sda = new SqlDataAdapter(cmd))
{
DataTable dt = new DataTable();
sda.Fill(dt);
rptrProducts.DataSource = dt;
rptrProducts.DataBind();
if (dt.Rows.Count <= 0)
{
// Label1.Text = "Sorry! Currently no products in this category.";
}
else
{
//Label1.Text = "Showing All Products";
}
}
}
}
}
protected override void InitializeCulture()
{
CultureInfo ci = new CultureInfo("en-IN");
ci.NumberFormat.CurrencySymbol = "₹";
Thread.CurrentThread.CurrentCulture = ci;
base.InitializeCulture();
}
public void BindCartNumber()
{
if (Session["USERID"] != null)
{
string UserIDD = Session["USERID"].ToString();
DataTable dt = new DataTable();
using (SqlConnection con = new SqlConnection(CS))
{
SqlCommand cmd = new SqlCommand("SP_BindCartNumberz", con)
{
CommandType = CommandType.StoredProcedure
};
cmd.Parameters.AddWithValue("@UserID", UserIDD);
using (SqlDataAdapter sda = new SqlDataAdapter(cmd))
{
sda.Fill(dt);
if (dt.Rows.Count > 0)
{
string CartQuantity = dt.Compute("Sum(Qty)", "").ToString();
//CartBadge.InnerText = CartQuantity;
}
else
{
// _ = CartBadge.InnerText == 0.ToString();
//CartBadge.InnerText = "0";
}
}
}
}
}
}