-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathApplications.aspx
162 lines (155 loc) · 8.87 KB
/
Applications.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
<%@ Page Title="Applications" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true"
CodeFile="Applications.aspx.cs" Inherits="Applications" %>
<asp:Content ID="HeaderContent" runat="server" ContentPlaceHolderID="HeadContent">
</asp:Content>
<asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="MainContent">
<!-- Busqueda -->
<script type="text/javascript" src="Scripts/jquery-1.7.2.js">
</script>
<script type="text/javascript">
$(document).ready(function () {
//
// Client Side Search (Autocomplete)
// Get the search Key from the TextBox
// Iterate through the 1st Column.
// td:nth-child(1) - Filters only the 1st Column
// If there is a match show the row [$(this).parent() gives the Row]
// Else hide the row [$(this).parent() gives the Row]
$('#MainContent_filterTextBox').keyup(function (event) {
var searchKey = $(this).val().toLowerCase();
var exists = false;
var showrow = false;
var number = 0;
//alert('Dentro');
$("#MainContent_GridView1 tr:not(:first-child)").each(function () {
//alert('Fila');
//alert($(this).children("td").text());
$(this).children("td").each(function () {
//alert($(this).text());
var cellText = $(this).text().toLowerCase();
if (cellText.indexOf(searchKey) >= 0) {
showrow = true;
}
else {
}
});
//alert(showrow);
if (!showrow) {
$(this).hide();
showrow = false;
}
else {
$(this).show();
showrow = false;
number++;
var mod = number % 2;
//alert(mod == 1);
if (mod == 1)
$(this).css("background", "#EFEFEF");
else
$(this).css("background", "white");
}
});
});
});
</script>
<!-- Fin de Busqueda-->
<h2>
Applications
</h2>
<p>
List of applications
</p>
<!-- Aqui va la parte del pop up para añadir las aplicaciones -->
<asp:linkbutton ID="AddButton" runat="server" class="AddButton" OnClick="AddButton_Click"> Add </asp:linkbutton>
<asp:Panel runat="server" id="ModalApplicationRelease" class="modalDialogApplication" Visible="false">
<div>
<asp:LinkButton runat="server" id="CloseButton" class="close" OnClick="CloseButton_Click" CausesValidation="false">X</asp:LinkButton>
<h2>Add Application</h2>
<p>
</p>
<asp:SqlDataSource ID="SqlDataSourceAddApplication" runat="server"
ConnectionString="<%$ ConnectionStrings:ApplicationServices%>"
insertcommand="Insert Into aspnet_Applications ([ApplicationName], [LoweredApplicationName], [Description]) VALUES (@ApplicationName, @LoweredApplicationName, @Description)"
oninserted="SqlDataSourceAddApplication_Inserted">
<InsertParameters>
<asp:Parameter Name="ApplicationName" ConvertEmptyStringToNull="true" />
<asp:Parameter Name="LoweredApplicationName" ConvertEmptyStringToNull="true" />
<asp:Parameter Name="Description" ConvertEmptyStringToNull="true" />
</InsertParameters>
</asp:SqlDataSource>
<asp:FormView ID="AddApplication" DefaultMode="Insert"
DataSourceID="SqlDataSourceAddApplication"
runat="server" Enabled="True" OnItemInserted="AddApplication_ItemInserted">
<InsertItemTemplate>
<table>
<tr>
<td class="textBoxLabel" style="width:130px">Application Name:</td>
<td>
<asp:TextBox CssClass="TextBox" id="ApplicationName" runat="server" Text='<%# Bind("ApplicationName") %>' BorderStyle="NotSet" Width="300" MaxLength="50" />
<asp:RequiredFieldValidator runat="server"
ControlToValidate="ApplicationName"
ErrorMessage="*"
ForeColor="Red" SetFocusOnError="True" />
<asp:CustomValidator ID="AppNameCV" runat="server"
ErrorMessage="Unique" ForeColor="Red" OnServerValidate="AppNameCV_ServerValidate"
ControlToValidate="ApplicationName" ValidateEmptyText="true" SetFocusOnError="true" >
</asp:CustomValidator>
</td>
</tr>
<tr>
<td class="textBoxLabel" style="width:130px">Short Name:</td>
<td>
<asp:TextBox CssClass="TextBox" id="LoweredApplicationName" runat="server" Text='<%# Bind("LoweredApplicationName") %>' BorderStyle="NotSet" Width="300" MaxLength="25" />
<asp:RequiredFieldValidator runat="server"
ControlToValidate="LoweredApplicationName"
ErrorMessage="*"
ForeColor="Red" SetFocusOnError="True" />
<asp:CustomValidator ID="LoweredAppNameCV" runat="server"
ErrorMessage="Unique" ForeColor="Red" OnServerValidate="LoweredAppNameCV_ServerValidate"
ControlToValidate="LoweredApplicationName" ValidateEmptyText="true" SetFocusOnError="true" >
</asp:CustomValidator>
</td>
</tr>
<tr>
<td class="textBoxLabel">Description:</td>
<td><asp:TextBox id="Description" runat="server" Text='<%# Bind("Description") %>' BorderStyle="NotSet" Width="300" MaxLength="256" TextMode="MultiLine" Height="100" CssClass="TextArea" /></td>
</tr>
<tr>
</table>
<p>
<asp:LinkButton ID="InsertButton" Text=" Save " CommandName="Insert" RunAt="server" class="SaveButton" />
</p>
</InsertItemTemplate>
</asp:FormView>
</div>
</asp:Panel>
<!-- Final Pop Up -->
<p>Search:
<asp:TextBox ID="filterTextBox" runat="server"></asp:TextBox>
</p>
<p>
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$ ConnectionStrings:ApplicationServices %>"
SelectCommand="SELECT aspnet_Applications.* FROM aspnet_Applications WHERE aspnet_Applications.ApplicationId != 'eac1e9cc-ebe7-46fe-a3c5-9ef9d9a2067a'" >
</asp:SqlDataSource>
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False"
DataKeyNames="ApplicationId" DataSourceID="SqlDataSource1" Width="100%"
AllowSorting="True" CssClass="gridView"
onselectedindexchanged="GridView1_SelectedIndexChanged">
<Columns>
<asp:BoundField DataField="ApplicationId" HeaderText="Id"
SortExpression="ApplicationId" ItemStyle-CssClass="boundfield-hidden" HeaderStyle-CssClass="boundfield-hidden"/>
<asp:BoundField DataField="ApplicationName" HeaderText="Name"
SortExpression="ApplicationName" ItemStyle-Width="200"/>
<asp:BoundField DataField="LoweredApplicationName" HeaderText="Short Name"
SortExpression="LoweredApplicationName" ItemStyle-Width="100"/>
<asp:BoundField DataField="Description" HeaderText="Description"
SortExpression="Description" ItemStyle-Width="500"/>
<asp:CommandField ShowSelectButton="true" ButtonType="Link" Visible="true"
SelectText="<img src='images/Ok.png' />" ItemStyle-HorizontalAlign="Center" ItemStyle-Width="50"/>
</Columns>
<HeaderStyle BackColor="#546E96" CssClass="gridViewHeader" ForeColor="White" />
</asp:GridView>
</p>
</asp:Content>