-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathEditSchool.aspx
70 lines (60 loc) · 2.77 KB
/
EditSchool.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
<%@ Page Title="" Language="C#" MasterPageFile="~/coord.master" AutoEventWireup="true" CodeBehind="EditSchool.aspx.cs" Inherits="CapstoneFinal.EditSchool" %>
<asp:Content ID="Content1" ContentPlaceHolderID="nestedFirst" runat="server">
<fieldset style="margin:20px; padding:20px; display:inline" >
<legend style="color:#450084; font-size:x-large;">View/Edit School</legend>
<asp:Label ID="lbSearch" runat="server" Text="Search:"></asp:Label>
<asp:TextBox ID="tbSearch" runat="server"></asp:TextBox>
<asp:Button ID="searchB" runat="server" Text="Search" OnClick="Search_Click" />
<br />
<br />
<asp:DetailsView ID="dvSchool" Height="400px" Width="200px"
DataSourceID="srcSchools"
DataKeyNames="SchoolID"
AllowPaging = "true"
PageSize ="15"
AutoGenerateEditButton="true"
AutoGenerateRows="false"
PagerSettings-Mode="NumericFirstLast"
EmptyDataText="No Events Found"
runat="server">
<Fields>
<asp:BoundField DataField="SchoolID"
HeaderText="School ID"
ReadOnly="true"
InsertVisible="false" />
<asp:BoundField DataField="Name"
HeaderText="School Name" />
<asp:BoundField DataField="PrimaryContactName"
HeaderText="Primary Contact Name" />
<asp:BoundField DataField="PhoneNumber"
HeaderText="Phone Number" />
<asp:BoundField DataField="Address1"
HeaderText="Address 1" />
<asp:BoundField DataField="Address2"
HeaderText="Address 2" />
<asp:BoundField DataField="City"
HeaderText="City" />
<asp:BoundField DataField="State"
HeaderText="State" />
<asp:BoundField DataField="Zip"
HeaderText="ZIP Code" />
</Fields>
</asp:DetailsView>
</fieldset>
<asp:SqlDataSource
ID="srcSchools"
ConnectionString="<%$ connectionStrings:lab4 %>"
runat="server"
SelectCommand="SELECT * FROM School"
FilterExpression="Name like '%{0}%' OR PrimaryContactName like '%{0}%'"
UpdateCommand="UPDATE School SET Name=@Name, PhoneNumber=@PhoneNumber, PrimaryContactName=@PrimaryContactName, Address1=@Address1, Address2=@Address2, City=@City, State=@State, Zip=@Zip WHERE SchoolID=@SchoolID"
DeleteCommand="DELETE School WHERE SchoolID=@SchoolID">
<FilterParameters>
<asp:ControlParameter
Name="FirstOrLastName"
ControlID="tbSearch" />
</FilterParameters>
</asp:SqlDataSource>
<br />
<br />
</asp:Content>