-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAssets.aspx
More file actions
157 lines (133 loc) · 6.85 KB
/
Assets.aspx
File metadata and controls
157 lines (133 loc) · 6.85 KB
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
<%@ Page Title="" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeFile="Assets.aspx.cs" Inherits="Assets" %>
<%@ Register assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" tagprefix="asp" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" Runat="Server">
<style type="text/css">
.style1
{
width: 100%;
}
</style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" Runat="Server">
<asp:SqlDataSource ID="SqlAssets" runat="server"
ConnectionString="<%$ ConnectionStrings:SQLConnectionString %>"
SelectCommand="usp_GetAssets" SelectCommandType="StoredProcedure"
CacheDuration="5" EnableCaching="True"
FilterExpression="(AssetType Like '%{0}%' and AssetSubType Like '%{1}%' and Name Like '%{2}%')" >
<FilterParameters>
<asp:ControlParameter ControlID="AssetTypeDropDownList" DefaultValue="%"
Name="FilterDropDownList1" PropertyName="SelectedValue" />
<asp:ControlParameter ControlID="AssetSubTypeDropDownList" DefaultValue="%"
Name="FilterDropDownList2" PropertyName="SelectedValue" />
<asp:ControlParameter ControlID="TextBox1" DefaultValue="%"
Name="FilterTextBox1" PropertyName="Text" ConvertEmptyStringToNull="False" />
</FilterParameters>
</asp:SqlDataSource>
<asp:SqlDataSource ID="SqlAssetType" runat="server"
ConnectionString="<%$ ConnectionStrings:SQLConnectionString %>"
SelectCommand="usp_LookupAssetType" SelectCommandType="StoredProcedure">
</asp:SqlDataSource>
<asp:SqlDataSource ID="SqlAssetSubType" runat="server"
ConnectionString="<%$ ConnectionStrings:SQLConnectionString %>"
SelectCommand="usp_LookupAssetSubTypebyName"
SelectCommandType="StoredProcedure">
<SelectParameters>
<asp:ControlParameter ControlID="AssetTypeDropDownList" Name="AssetType"
PropertyName="SelectedValue" Type="String" />
</SelectParameters>
</asp:SqlDataSource>
<asp:Panel ID="Panel1" runat="server">
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<fieldset>
<legend>Filter</legend>
<table class="style1">
<tr>
<td>
Type: </td>
<td>
<asp:DropDownList ID="AssetTypeDropDownList" runat="server" Width="155px"
AppendDataBoundItems="True" AutoPostBack="True" DataSourceID="SqlAssetType"
DataTextField="AssetType" DataValueField="AssetType"
onselectedindexchanged="AssetTypeDropDownList_SelectedIndexChanged">
<asp:ListItem Selected="True" Value="">Please Select</asp:ListItem>
</asp:DropDownList>
</td>
<td>
Sub Type: </td>
<td>
<asp:DropDownList ID="AssetSubTypeDropDownList" runat="server" Width="155px"
AppendDataBoundItems="True" AutoPostBack="True" DataSourceID="SqlAssetSubType"
DataTextField="AssetSubType" DataValueField="AssetSubType">
<asp:ListItem Selected="True" Value="">Please Select</asp:ListItem>
</asp:DropDownList>
</td>
<td>
Name: </td>
<td>
<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
</td>
<td>
</td>
<td>
</td>
<td>
<asp:Button ID="SearchButton" runat="server" Text="Filter" /></td>
</tr>
</table>
</fieldset>
<asp:GridView ID="GridView1" runat="server" AllowPaging="True"
AllowSorting="True" AutoGenerateColumns="False" CellPadding="4"
DataKeyNames="AssetID" DataSourceID="SqlAssets" ForeColor="#333333"
GridLines="None" HorizontalAlign="Center" Width="920px"
onselectedindexchanged="GridView1_SelectedIndexChanged"
onrowdatabound="GridView1_RowDataBound" PageSize="20">
<AlternatingRowStyle BackColor="White" />
<Columns>
<asp:CommandField ShowSelectButton="True">
<ControlStyle CssClass="HiddenColumn" />
<FooterStyle CssClass="HiddenColumn" />
<HeaderStyle CssClass="HiddenColumn" />
<ItemStyle CssClass="HiddenColumn" />
</asp:CommandField>
<asp:TemplateField HeaderText="ID" InsertVisible="False"
SortExpression="AssetID">
<EditItemTemplate>
<asp:Label ID="Label1" runat="server" Text='<%# Eval("AssetID") %>'></asp:Label>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="AssetID_LinkButton" runat="server"
Text='<%# Eval("AssetID") %>' />
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="AssetType" HeaderText="Type"
SortExpression="AssetType" />
<asp:BoundField DataField="AssetSubType" HeaderText="Sub Type"
SortExpression="AssetSubType" />
<asp:BoundField DataField="Name" HeaderText="Name/Serial Number"
SortExpression="Name" />
<asp:BoundField DataField="ClientID" HeaderText="Client Id"
SortExpression="ClientID" />
<asp:BoundField DataField="LabID" HeaderText="Lab Id"
SortExpression="LabID" />
<asp:BoundField DataField="Status" HeaderText="Status"
SortExpression="Status" />
<asp:BoundField DataField="NextServiceDate" DataFormatString="{0:d}"
HeaderText="Next Service Date" SortExpression="NextServiceDate" />
</Columns>
<EditRowStyle BackColor="#2461BF" />
<FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
<HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
<PagerSettings Mode="NextPreviousFirstLast" />
<PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
<RowStyle BackColor="#EFF3FB" HorizontalAlign="Center" />
<SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
<SortedAscendingCellStyle BackColor="#F5F7FB" />
<SortedAscendingHeaderStyle BackColor="#6D95E1" />
<SortedDescendingCellStyle BackColor="#E9EBEF" />
<SortedDescendingHeaderStyle BackColor="#4870BE" />
</asp:GridView>
</ContentTemplate>
</asp:UpdatePanel>
</asp:Panel>
</asp:Content>