温馨提示:代码在线浏览功能只能做为源码浏览参考,不能展示项目的全部,如果想更进一步了解该代码请下载:某市人口普查系统源码
当前文件路径:RenKouPuCha/Code/Record.aspx

1<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Record.aspx.cs" Inherits="Code_Stat" %> 2
3
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 4
5
<html xmlns="http://www.w3.org/1999/xhtml" > 6
<head runat="server"> 7
<title>无标题页</title> 8
</head> 9
<body background="../image/bg1.jpg" scroll="auto" style="font-family: Times New Roman"> 10
<form id="form1" runat="server" > 11
<div style="text-align: center"> 12
<table> 13
<tr> 14
<td colspan="3" style="height: 21px; width: 896px;"> 15
<span style="font-size: 16pt"><strong>人口信息</strong></span></td> 16
</tr> 17
<tr> 18
<td colspan="3" style="width: 896px"> 19
<asp:GridView ID="GridView1" runat="server" AllowPaging="True" AutoGenerateColumns="False" 20
BorderWidth="2px" DataKeyNames="idfield" DataSourceID="SqlDataSource1" 21
EmptyDataText="没有人口信息" Font-Bold="False" Font-Overline="False" 22
OnRowCommand="GridView1_RowCommand" Width="901px" OnRowDataBound="GridView1_RowDataBound" BorderColor="Maroon" BorderStyle="Solid" CellPadding="2" CellSpacing="2"> 23
<Columns> 24
<asp:BoundField DataField="idfield" HeaderText="身份证号" ReadOnly="True" SortExpression="idfield" > 25
<ItemStyle Width="80px" Wrap="False"/> 26
<ControlStyle Width="80px" /> 27
</asp:BoundField> 28
<asp:BoundField DataField="namefield" HeaderText="姓名" SortExpression="namefield" > 29
<ItemStyle Width="80px" Wrap="False" /> 30
<ControlStyle Width="80px" /> 31
</asp:BoundField> 32
<asp:BoundField DataField="age" HeaderText="年龄" SortExpression="age" > 33
<ItemStyle Width="60px" Wrap="False" /> 34
<ControlStyle Width="60px" /> 35
</asp:BoundField> 36
<asp:BoundField DataField="sex" HeaderText="性别" SortExpression="sex"> 37
<ItemStyle Width="60px" /> 38
<ControlStyle Width="60px" /> 39
</asp:BoundField> 40
<asp:BoundField DataField="nation" HeaderText="国籍" SortExpression="nation" > 41
<ItemStyle Width="80px" Wrap="False" /> 42
<ControlStyle Width="80px" /> 43
</asp:BoundField> 44
<asp:BoundField DataField="marriage" HeaderText="婚否" SortExpression="marriage" > 45
<ItemStyle Width="80px" Wrap="False" /> 46
</asp:BoundField> 47
<asp:BoundField DataField="profession" HeaderText="职业" SortExpression="profession" > 48
<ItemStyle Width="100px" Wrap="False" /> 49
<ControlStyle Width="100px" /> 50
</asp:BoundField> 51
<asp:BoundField DataField="edgLevel" HeaderText="文化水平" SortExpression="edgLevel" > 52
<ItemStyle Width="120px" Wrap="False" /> 53
<ControlStyle Width="120px" /> 54
</asp:BoundField> 55
<asp:BoundField DataField="polity" HeaderText="政治面貌" SortExpression="polity" > 56
<ItemStyle Width="120px" Wrap="False" /> 57
<ControlStyle Width="120px" /> 58
</asp:BoundField> 59
<asp:BoundField DataField="incom" HeaderText="年收入" SortExpression="incom" > 60
<ItemStyle Width="60px" Wrap="False" /> 61
<ControlStyle Width="60px" /> 62
</asp:BoundField> 63
<asp:TemplateField HeaderText="编辑" ShowHeader="False"> 64
<EditItemTemplate> 65
<asp:LinkButton ID="UpdateButton1" runat="server" CausesValidation="True" CommandName="Update" 66
Text="更新" OnClientClick="return confirm('确定要更新人口信息?')" ></asp:LinkButton> 67
<asp:LinkButton ID="CancelButton2" runat="server" CausesValidation="False" CommandName="Cancel" 68
Text="取消" OnClientClick="return confirm('确定取消更新?')"></asp:LinkButton> 69
</EditItemTemplate> 70
<ItemTemplate> 71
<asp:LinkButton ID="EditButton" runat="server" CausesValidation="False" CommandName="Edit" 72
Text="编辑"></asp:LinkButton> 73
</ItemTemplate> 74
<ItemStyle Width="100px" Wrap="False" /> 75
<ControlStyle Width="80px" /> 76
</asp:TemplateField> 77
<asp:TemplateField HeaderText="删除" ShowHeader="False"> 78
<ItemTemplate> 79
<asp:LinkButton ID="DeleteButton" runat="server" CausesValidation="False" CommandName="Delete" 80
Text="删除" OnClientClick="return confirm('确定要删除这条人口信息?')"></asp:LinkButton> 81
</ItemTemplate> 82
<ItemStyle Width="80px" Wrap="False" /> 83
</asp:TemplateField> 84
</Columns> 85
</asp:GridView> 86
</td> 87
</tr> 88
<tr> 89
<td colspan="3" style="width: 896px"> 90
<asp:Button ID="addButton" runat="server" Height="30px" OnClick="addButton_Click" 91
Text="添加" Width="79px" /> 92
<asp:Button ID="backButton" runat="server" Height="28px" OnClick="backButton_Click" 93
Text="返回" Width="81px" /></td> 94
</tr> 95
</table> 96
97
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="Data Source=(local);Initial Catalog=Censuse;Persist Security Info=True;User ID=sa;Password=sa" 98
DeleteCommand="DELETE FROM [tRkry] WHERE [idfield] = @idfield" InsertCommand="INSERT INTO [tRkry] ([idfield], [namefield], [age], [profession], [sex], [edgLevel], [nation], [polity], [marriage], [incom]) VALUES (@idfield, @namefield, @age, @profession, @sex, @edgLevel, @nation, @polity, @marriage, @incom)" 99
ProviderName="System.Data.SqlClient" SelectCommand="SELECT [idfield], [namefield], [age], [profession], [sex], [edgLevel], [nation], [polity], [marriage], [incom] FROM [tRkry]" 100
UpdateCommand="UPDATE [tRkry] SET [namefield] = @namefield, [age] = @age, [profession] = @profession, [sex] = @sex, [edgLevel] = @edgLevel, [nation] = @nation, [polity] = @polity, [marriage] = @marriage, [incom] = @incom WHERE [idfield] = @idfield"> 101
<DeleteParameters> 102
<asp:Parameter Name="idfield" Type="String" /> 103
</DeleteParameters> 104
<UpdateParameters> 105
<asp:Parameter Name="namefield" Type="String" /> 106
<asp:Parameter Name="age" Type="Int32" /> 107
<asp:Parameter Name="profession" Type="String" /> 108
<asp:Parameter Name="sex" Type="String" /> 109
<asp:Parameter Name="edgLevel" Type="String" /> 110
<asp:Parameter Name="nation" Type="String" /> 111
<asp:Parameter Name="polity" Type="String" /> 112
<asp:Parameter Name="marriage" Type="String" /> 113
<asp:Parameter Name="incom" Type="Int64" /> 114
<asp:Parameter Name="idfield" Type="String" /> 115
</UpdateParameters> 116
<InsertParameters> 117
<asp:Parameter Name="idfield" Type="String" /> 118
<asp:Parameter Name="namefield" Type="String" /> 119
<asp:Parameter Name="age" Type="Int32" /> 120
<asp:Parameter Name="profession" Type="String" /> 121
<asp:Parameter Name="sex" Type="String" /> 122
<asp:Parameter Name="edgLevel" Type="String" /> 123
<asp:Parameter Name="nation" Type="String" /> 124
<asp:Parameter Name="polity" Type="String" /> 125
<asp:Parameter Name="marriage" Type="String" /> 126
<asp:Parameter Name="incom" Type="Int64" /> 127
</InsertParameters> 128
</asp:SqlDataSource> 129
130
</div> 131
</form> 132
</body> 133
</html> 134



