-
Notifications
You must be signed in to change notification settings - Fork 0
/
Orders.aspx.cs
173 lines (142 loc) · 6.33 KB
/
Orders.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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Configuration;
using System.Data.SqlClient;
using System.Data;
public partial class Orders : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
{
string connStr = ConfigurationManager.ConnectionStrings["MyDbConn"].ToString();
SqlConnection conn = new SqlConnection(connStr);
SqlCommand cmd = new SqlCommand("reviewOrders", conn);
conn.Open();
SqlDataReader rdr = cmd.ExecuteReader(CommandBehavior.CloseConnection); // its like buffer in java
while (rdr.Read())
{
String order_no = "";
int x1 = rdr.GetOrdinal("order_no");
if (!rdr.IsDBNull(x1))
{
order_no = (rdr.GetInt32(rdr.GetOrdinal("order_no"))).ToString();
}
String order_date = "";
int x11 = rdr.GetOrdinal("order_date");
if (!rdr.IsDBNull(x11))
{
order_date = (rdr.GetDateTime(rdr.GetOrdinal("order_date"))).ToString();
}
String total_amount = "";
int x2 = rdr.GetOrdinal("total_amount");
if (!rdr.IsDBNull(x2))
{
total_amount = (rdr.GetDecimal(rdr.GetOrdinal("total_amount"))).ToString();
}
String cash_amount = "";
int x3 = rdr.GetOrdinal("cash_amount");
if (!rdr.IsDBNull(x3))
{
cash_amount = (rdr.GetDecimal(rdr.GetOrdinal("cash_amount"))).ToString();
}
String credit_amount = "";
int x33 = rdr.GetOrdinal("credit_amount");
if (!rdr.IsDBNull(x33))
{
credit_amount = (rdr.GetDecimal(rdr.GetOrdinal("credit_amount"))).ToString();
}
string payment_type = "";
int x4 = rdr.GetOrdinal("payment_type");
if (!rdr.IsDBNull(x4))
{
payment_type = rdr.GetString(rdr.GetOrdinal("payment_type"));
}
string order_status = "";
int x5 = rdr.GetOrdinal("order_status");
if (!rdr.IsDBNull(x5))
{
order_status = rdr.GetString(rdr.GetOrdinal("order_status"));
}
String remaining_days = "";
int x6 = rdr.GetOrdinal("remaining_days");
if (!rdr.IsDBNull(x6))
{
remaining_days = (rdr.GetInt32(rdr.GetOrdinal("remaining_days"))).ToString();
}
String time_limit = "";
int x7 = rdr.GetOrdinal("time_limit");
if (!rdr.IsDBNull(x7))
{
time_limit = (rdr.GetInt32(rdr.GetOrdinal("time_limit"))).ToString();
}
string customer_name = "";
int x8 = rdr.GetOrdinal("customer_name");
if (!rdr.IsDBNull(x8))
{
customer_name = rdr.GetString(rdr.GetOrdinal("customer_name"));
}
String delivery_id = "";
int x9 = rdr.GetOrdinal("delivery_id");
if (!rdr.IsDBNull(x9))
{
delivery_id = (rdr.GetInt32(rdr.GetOrdinal("delivery_id"))).ToString();
}
string creditCard_number = "";
int x10 = rdr.GetOrdinal("creditCard_number");
if (!rdr.IsDBNull(x10))
{
creditCard_number = rdr.GetString(rdr.GetOrdinal("creditCard_number"));
}
string Gift_Card_code_used = "";
int x12 = rdr.GetOrdinal("Gift_Card_code_used");
if (!rdr.IsDBNull(x12))
{
Gift_Card_code_used = rdr.GetString(rdr.GetOrdinal("Gift_Card_code_used"));
}
Label lbl_pname = new Label();
lbl_pname.Text = "order_no->" + order_no + " , ";
form1.Controls.Add(lbl_pname);
Label lablser = new Label();
lablser.Text = "order_date->" + order_date + " , ";
form1.Controls.Add(lablser);
Label lbl_cat = new Label();
lbl_cat.Text = "total_amount->" + total_amount + " , ";
form1.Controls.Add(lbl_cat);
Label lbl_price = new Label();
lbl_price.Text = "cash_amount->" + cash_amount + " , ";
form1.Controls.Add(lbl_price);
Label lbl_final = new Label();
lbl_final.Text = "credit_amount->" + credit_amount + " , ";
form1.Controls.Add(lbl_final);
Label lbl_color = new Label();
lbl_color.Text = "payment_type->" + payment_type + " , ";
form1.Controls.Add(lbl_color);
Label lbl_ava = new Label();
lbl_ava.Text = "order_status->" + order_status + " , ";
form1.Controls.Add(lbl_ava);
Label lbl_rate = new Label();
lbl_rate.Text = "remaining_days->" + remaining_days + " , ";
form1.Controls.Add(lbl_rate);
Label lbl_custuser = new Label();
lbl_custuser.Text = "time_limit->" + time_limit + " , ";
form1.Controls.Add(lbl_custuser);
Label lbl_custid = new Label();
lbl_custid.Text = "customer_name->" + customer_name + " , ";
form1.Controls.Add(lbl_custid);
Label lvl = new Label();
lvl.Text = "delivery_id->" + delivery_id + " , ";
form1.Controls.Add(lvl);
Label lbl_CCN = new Label();
lbl_CCN.Text = "creditCard_number->" + creditCard_number + " , ";
form1.Controls.Add(lbl_CCN);
Label lbl_desc = new Label();
lbl_desc.Text = " " + "Gift_Card_code_used->" + Gift_Card_code_used + " <br /> <br />"; // new line
form1.Controls.Add(lbl_desc);
}
}
}
}