-
Notifications
You must be signed in to change notification settings - Fork 1
/
ManageProduct.aspx
311 lines (299 loc) · 18.3 KB
/
ManageProduct.aspx
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
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
<%--ID#: 1401375
Developer: Lomar Lilly
Module: Enterprise Computing--%>
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="ManageProduct.aspx.cs" Inherits="ManageProduct" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Manage Products | Buy Products</title>
<link href="App_Theme/css/bootstrap.css" rel="stylesheet" />
<link href="App_Theme/css/style.css" rel="stylesheet" />
<script src="App_Theme/js/jquery-1.9.0.min.js"></script>
</head>
<body>
<form id="form1" runat="server">
<%--Header--%>
<div class="header">
<div class="wrap">
<div class="header_top">
<div class="logo">
<a href="#">
<img src="App_Theme/images/logo.png" /></a>
</div>
<div class="header_top_right">
<asp:HyperLink ID="hlManageProduct" NavigateUrl="~/Default.aspx" runat="server">Home</asp:HyperLink>
</div>
<div class="clear"></div>
</div>
</div>
</div>
<%----------%>
<div class="wrap">
<%--Bottom Nav-bar for Category listings--%>
<nav class="navbar navbar-expand-md navbar-dark fixed-bottom bg-dark">
<div class="navbar-header">
<a href="#" class="navbar-brand">Categories</a>
</div>
<div class="collapse navbar-collapse" id="myNavbar">
<ul class="navbar-nav mr-auto">
<li class="nav-item active">
<asp:LinkButton ID="lbAntiMalware" class="nav-link" OnClick="getAntiMalwareSoftware" runat="server">Anti-Malware</asp:LinkButton>
</li>
<li class="nav-item">
<asp:LinkButton ID="lbBusinessAntivirus" class="nav-link" OnClick="getBusinessAntivirusSoftware" runat="server">Business Antivirus</asp:LinkButton>
</li>
<li class="nav-item">
<asp:LinkButton ID="lbBackup" class="nav-link" OnClick="getBackupSoftware" runat="server">Backup</asp:LinkButton>
</li>
<li class="nav-item">
<asp:LinkButton ID="lbDeveloper" class="nav-link" OnClick="getDeveloperSoftware" runat="server">Developer</asp:LinkButton>
</li>
<li class="nav-item">
<asp:LinkButton ID="lbDrivers" class="nav-link" OnClick="getDriverSoftware" runat="server">Drivers</asp:LinkButton>
</li>
<li class="nav-item">
<asp:LinkButton ID="lbFileTransfer" class="nav-link" OnClick="getDeveloperSoftware" runat="server">File Transfer</asp:LinkButton>
</li>
<li class="nav-item">
<asp:LinkButton ID="lbMultimedia" class="nav-link" OnClick="getMultimediaSoftware" runat="server">Multimedia</asp:LinkButton>
</li>
<li class="nav-item">
<asp:LinkButton ID="lbOfficeNews" class="nav-link" OnClick="getOfficeNewsSoftware" runat="server">Office / News</asp:LinkButton>
</li>
<li class="nav-item">
<asp:LinkButton ID="lbNetworking" class="nav-link" OnClick="getNetworkingSoftware" runat="server">Networking</asp:LinkButton>
</li>
<li class="nav-item">
<asp:LinkButton ID="lbSecurity" class="nav-link" OnClick="getSecuritySoftware" runat="server">Security</asp:LinkButton>
</li>
<li class="nav-item">
<asp:LinkButton ID="lbSystemTuning" class="nav-link" OnClick="getSystemTuningSoftware" runat="server">System Tuning</asp:LinkButton>
</li>
<li class="nav-item">
<asp:LinkButton ID="lbVPNs" class="nav-link" OnClick="getVPNsSoftware" runat="server">VPNs</asp:LinkButton>
</li>
</ul>
</div>
</nav>
<%--------------------------%>
<%--Content Wrapper--%>
<div class="preview-page">
<%--List view of Software Categories--%>
<div class="contact-form">
<h3 style="width: 1150px;">Browse Software</h3>
<asp:ListView ID="lvManageProducts" runat="server" DataSourceID="odsSoftware" InsertItemPosition="LastItem" DataKeyNames="SoftwareID">
<AlternatingItemTemplate>
<tr style="">
<td>
<asp:Button ID="DeleteButton" runat="server" CommandName="Delete" Text="Delete" />
<asp:Button ID="EditButton" runat="server" CommandName="Edit" Text="Edit" />
</td>
<td>
<asp:Label ID="SoftwareIDLabel" runat="server" Text='<%# Eval("SoftwareID") %>' />
</td>
<td>
<asp:Label ID="CategoryIDLabel" runat="server" Text='<%# Eval("CategoryID") %>' />
</td>
<td>
<asp:Label ID="SoftwareNameLabel" runat="server" Text='<%# Eval("SoftwareName") %>' />
</td>
<td>
<asp:Label ID="SoftwareSizeLabel" runat="server" Text='<%# Eval("SoftwareSize") %>' />
</td>
<td>
<asp:Label ID="SoftwareCostLabel" runat="server" Text='<%# Eval("SoftwareCost") %>' />
</td>
<td>
<asp:Label ID="SoftwareDescriptionLabel" runat="server" Text='<%# Eval("SoftwareDescription") %>' />
</td>
<td>
<asp:Image ID="SoftwareImage" runat="server" Height="100" Width="300" ImageUrl='<%#"data:Image/jpg;base64," + Convert.ToBase64String((byte[])Eval("SoftwareImage")) %>' />
</td>
</tr>
</AlternatingItemTemplate>
<EditItemTemplate>
<tr style="">
<td>
<asp:Button ID="UpdateButton" runat="server" CommandName="Update" Text="Update" />
<asp:Button ID="CancelButton" runat="server" CommandName="Cancel" Text="Cancel" />
</td>
<td>
<asp:Label ID="SoftwareIDLabel1" runat="server" Text='<%# Eval("SoftwareID") %>' />
</td>
<td>
<asp:TextBox ID="CategoryIDTextBox" runat="server" Text='<%# Bind("CategoryID") %>' />
</td>
<td>
<asp:TextBox ID="SoftwareNameTextBox" runat="server" Text='<%# Bind("SoftwareName") %>' />
</td>
<td>
<asp:TextBox ID="SoftwareSizeTextBox" runat="server" Text='<%# Bind("SoftwareSize") %>' />
</td>
<td>
<asp:TextBox ID="SoftwareCostTextBox" runat="server" Text='<%# Bind("SoftwareCost") %>' />
</td>
<td>
<asp:TextBox ID="SoftwareDescriptionTextBox" runat="server" Text='<%# Bind("SoftwareDescription") %>' />
</td>
</tr>
</EditItemTemplate>
<EmptyDataTemplate>
<table runat="server" style="">
<tr>
<td>No data was returned.</td>
</tr>
</table>
</EmptyDataTemplate>
<InsertItemTemplate>
<tr style="">
<td>
<asp:Button ID="InsertButton" runat="server" CommandName="Insert" Text="Insert" />
<asp:Button ID="CancelButton" runat="server" CommandName="Cancel" Text="Clear" />
</td>
<td> </td>
<td>
<asp:TextBox ID="CategoryIDTextBox" runat="server" Text='<%# Bind("CategoryID") %>' />
</td>
<td>
<asp:TextBox ID="SoftwareNameTextBox" runat="server" Text='<%# Bind("SoftwareName") %>' />
</td>
<td>
<asp:TextBox ID="SoftwareSizeTextBox" runat="server" Text='<%# Bind("SoftwareSize") %>' />
</td>
<td>
<asp:TextBox ID="SoftwareCostTextBox" runat="server" Text='<%# Bind("SoftwareCost") %>' />
</td>
<td>
<asp:TextBox ID="SoftwareDescriptionTextBox" runat="server" Text='<%# Bind("SoftwareDescription") %>' />
</td>
</tr>
</InsertItemTemplate>
<ItemTemplate>
<tr style="">
<td>
<asp:Button ID="DeleteButton" runat="server" CommandName="Delete" Text="Delete" />
<asp:Button ID="EditButton" runat="server" CommandName="Edit" Text="Edit" />
</td>
<td>
<asp:Label ID="SoftwareIDLabel" runat="server" Text='<%# Eval("SoftwareID") %>' />
</td>
<td>
<asp:Label ID="CategoryIDLabel" runat="server" Text='<%# Eval("CategoryID") %>' />
</td>
<td>
<asp:Label ID="SoftwareNameLabel" runat="server" Text='<%# Eval("SoftwareName") %>' />
</td>
<td>
<asp:Label ID="SoftwareSizeLabel" runat="server" Text='<%# Eval("SoftwareSize") %>' />
</td>
<td>
<asp:Label ID="SoftwareCostLabel" runat="server" Text='<%# Eval("SoftwareCost") %>' />
</td>
<td>
<asp:Label ID="SoftwareDescriptionLabel" runat="server" Text='<%# Eval("SoftwareDescription") %>' />
</td>
<td>
<asp:Image ID="SoftwareImage" runat="server" Height="100" Width="300" ImageUrl='<%#"data:Image/jpg;base64," + Convert.ToBase64String((byte[])Eval("SoftwareImage")) %>' />
</td>
</tr>
</ItemTemplate>
<LayoutTemplate>
<table runat="server">
<tr runat="server">
<td runat="server">
<table id="itemPlaceholderContainer" runat="server" border="0" style="">
<tr runat="server" style="">
<th runat="server"></th>
<th runat="server">ID</th>
<th runat="server">Cat-ID</th>
<th runat="server">Name</th>
<th runat="server">Size</th>
<th runat="server">Cost</th>
<th runat="server">Description</th>
</tr>
<tr id="itemPlaceholder" runat="server">
</tr>
</table>
</td>
</tr>
<tr runat="server">
<td runat="server" style=""></td>
</tr>
</table>
</LayoutTemplate>
<SelectedItemTemplate>
<tr style="">
<td>
<asp:Button ID="DeleteButton" runat="server" CommandName="Delete" Text="Delete" />
<asp:Button ID="EditButton" runat="server" CommandName="Edit" Text="Edit" />
</td>
<td>
<asp:Label ID="SoftwareIDLabel" runat="server" Text='<%# Eval("SoftwareID") %>' />
</td>
<td>
<asp:Label ID="CategoryIDLabel" runat="server" Text='<%# Eval("CategoryID") %>' />
</td>
<td>
<asp:Label ID="SoftwareNameLabel" runat="server" Text='<%# Eval("SoftwareName") %>' />
</td>
<td>
<asp:Label ID="SoftwareSizeLabel" runat="server" Text='<%# Eval("SoftwareSize") %>' />
</td>
<td>
<asp:Label ID="SoftwareCostLabel" runat="server" Text='<%# Eval("SoftwareCost") %>' />
</td>
<td>
<asp:Label ID="SoftwareDescriptionLabel" runat="server" Text='<%# Eval("SoftwareDescription") %>' />
</td>
</tr>
</SelectedItemTemplate>
</asp:ListView>
</div>
<%------------------------------------%>
<%--Control for Category ID--%>
<asp:TextBox ID="txtCategory" runat="server" Visible="False"></asp:TextBox>
<%--------------------------%>
<%--Image Update--%>
<asp:Label ID="lblInstruction" runat="server" Text="Update Software Images"></asp:Label><br />
<asp:Label ID="lblSoftwareID" runat="server" Text="Software ID:"></asp:Label>
<asp:TextBox ID="txtSoftwareID" runat="server"></asp:TextBox>
<br />
<asp:Label ID="lblImage" runat="server" Text="Software Image:"></asp:Label>
<asp:FileUpload ID="fuImagePath" runat="server" ToolTip="Select a Images" />
<br />
<asp:Label ID="lblmessage" runat="server"></asp:Label>
<div style="margin-bottom: 60px">
<asp:Button ID="btnSubmit" runat="server" CssClass="btn btn-success" class="" Text="SUBMIT" OnClick="btnSubmit_Click" />
</div>
<%---------------%>
</div>
<%--------------------%>
<%--Object Data Source--%>
<asp:ObjectDataSource ID="odsSoftware" runat="server" InsertMethod="Software_Insert" OldValuesParameterFormatString="{0}" SelectMethod="Software_SelectByCategory_IEnumerable" TypeName="BusinessClass" DeleteMethod="Software_DeleteById" UpdateMethod="Software_UpdateById">
<DeleteParameters>
<asp:Parameter Name="SoftwareID" Type="Int32" />
</DeleteParameters>
<InsertParameters>
<asp:Parameter Name="CategoryID" Type="Int32" />
<asp:Parameter Name="SoftwareName" Type="String" />
<asp:Parameter Name="SoftwareSize" Type="String" />
<asp:Parameter Name="SoftwareCost" Type="String" />
<asp:Parameter Name="SoftwareDescription" Type="String" />
</InsertParameters>
<SelectParameters>
<asp:ControlParameter ControlID="txtCategory" DefaultValue="1" Name="CategoryId" PropertyName="Text" Type="Int32" />
</SelectParameters>
<UpdateParameters>
<asp:Parameter Name="SoftwareID" Type="Int32" />
<asp:Parameter Name="CategoryID" Type="Int32" />
<asp:Parameter Name="SoftwareName" Type="String" />
<asp:Parameter Name="SoftwareSize" Type="String" />
<asp:Parameter Name="SoftwareCost" Type="String" />
<asp:Parameter Name="SoftwareDescription" Type="String" />
</UpdateParameters>
</asp:ObjectDataSource>
<%--------------------------------%>
</div>
</form>
</body>
</html>