📄 employeeform.aspx
字号:
<%--文件名:EmployeeForm.aspx--%>
<%@ Page Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="EmployeeForm.aspx.cs" Inherits="BaseManage_EmployeeForm" Title="当前位置:基本管理->员工信息管理" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<table style="width: 558px; height: 1px">
<tr>
<td align="left" style="font-size: 0.8em; width: 550px; font-family: 宋体; height: 17px;
background-color: deepskyblue">
请输入需要查询的员工编号:<asp:TextBox ID="TextBox3" runat="server" Width="212px">%%</asp:TextBox>
<asp:Button ID="Button3" runat="server" Text="查询" Width="70px" />
<asp:Button ID="Button4" runat="server" OnClick="Button4_Click" Text="打印" Width="70px" /></td>
</tr>
<tr>
<td align="left" style="font-size: 0.8em; width: 550px; font-family: 宋体; height: 17px;
background-color: lightseagreen">
员工编号:<asp:TextBox ID="TextBox1" runat="server" Width="58px"></asp:TextBox>
员工姓名:<asp:TextBox ID="TextBox2" runat="server" Width="43px"></asp:TextBox>
员工性别:
<asp:DropDownList ID="DropDownList1" runat="server" Width="44px">
<asp:ListItem>男</asp:ListItem>
<asp:ListItem>女</asp:ListItem>
</asp:DropDownList>
所属部门:<asp:TextBox ID="TextBox4" runat="server" Width="90px"></asp:TextBox><br />
主要职责:<asp:TextBox ID="TextBox5" runat="server" Width="108px"></asp:TextBox>
身份证号码:<asp:TextBox ID="TextBox6" runat="server" Width="119px"></asp:TextBox>
联系电话:<asp:TextBox ID="TextBox7" runat="server" Width="75px"></asp:TextBox><br />
移动电话:<asp:TextBox ID="TextBox8" runat="server" Width="94px"></asp:TextBox>
联系地址:<asp:TextBox ID="TextBox9" runat="server" Width="175px"></asp:TextBox>
邮政编码:<asp:TextBox ID="TextBox10" runat="server" Width="45px"></asp:TextBox><br />
补充说明:<asp:TextBox ID="TextBox11" runat="server" Width="313px">暂无</asp:TextBox>
<asp:Button ID="Button1" runat="server" OnClick="Button1_Click" Text="新增" Width="70px" /> <asp:Button
ID="Button2" runat="server" OnClick="Button2_Click" Text="修改" Width="70px" />
</td>
</tr>
<tr>
<td style="overflow: auto; width: 550px; height: 103px; background-color: gainsboro">
<asp:Panel ID="Panel1" runat="server" Height="250px" ScrollBars="Auto" Width="555px">
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" BackColor="White"
BorderColor="White" BorderStyle="Ridge" BorderWidth="2px" CellPadding="3" CellSpacing="1"
DataKeyNames="员工编号" DataSourceID="SqlDataSource1" Font-Names="宋体" Font-Size="Small"
GridLines="None" OnRowCreated="GridView1_RowCreated" OnSelectedIndexChanged="GridView1_SelectedIndexChanged"
Width="1500px">
<FooterStyle BackColor="#C6C3C6" ForeColor="Black" />
<Columns>
<asp:CommandField ButtonType="Button" HeaderText="选择" ShowSelectButton="True" />
<asp:TemplateField HeaderText="删除" ShowHeader="False">
<ItemTemplate>
<asp:Button ID="Button1" runat="server" CausesValidation="False" CommandName="Delete"
Text="删除" />
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="员工编号" HeaderText="员工编号" ReadOnly="True" SortExpression="员工编号" />
<asp:BoundField DataField="员工姓名" HeaderText="员工姓名" SortExpression="员工姓名" />
<asp:BoundField DataField="员工性别" HeaderText="员工性别" SortExpression="员工性别" />
<asp:BoundField DataField="所属部门" HeaderText="所属部门" SortExpression="所属部门" />
<asp:BoundField DataField="主要职责" HeaderText="主要职责" SortExpression="主要职责" />
<asp:BoundField DataField="身份证号码" HeaderText="身份证号码" SortExpression="身份证号码" />
<asp:BoundField DataField="联系电话" HeaderText="联系电话" SortExpression="联系电话" />
<asp:BoundField DataField="移动电话" HeaderText="移动电话" SortExpression="移动电话" />
<asp:BoundField DataField="联系地址" HeaderText="联系地址" SortExpression="联系地址" />
<asp:BoundField DataField="邮政编码" HeaderText="邮政编码" SortExpression="邮政编码" />
<asp:BoundField DataField="补充说明" HeaderText="补充说明" SortExpression="补充说明" />
</Columns>
<RowStyle BackColor="#DEDFDE" ForeColor="Black" />
<SelectedRowStyle BackColor="#9471DE" Font-Bold="True" ForeColor="White" />
<PagerStyle BackColor="#C6C3C6" ForeColor="Black" HorizontalAlign="Right" />
<HeaderStyle BackColor="Navy" Font-Bold="True" ForeColor="#E7E7FF" HorizontalAlign="Center" />
</asp:GridView>
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:MyEateryDBConnectionString %>"
DeleteCommand="DELETE FROM [员工信息] WHERE [员工编号] = @员工编号" InsertCommand="INSERT INTO [员工信息] ([员工编号], [员工姓名], [员工性别], [所属部门], [主要职责], [身份证号码], [联系电话], [移动电话], [联系地址], [邮政编码], [补充说明]) VALUES (@员工编号, @员工姓名, @员工性别, @所属部门, @主要职责, @身份证号码, @联系电话, @移动电话, @联系地址, @邮政编码, @补充说明)"
SelectCommand="SELECT * FROM [员工信息] WHERE ([员工编号] LIKE '%' + @员工编号 + '%')" UpdateCommand="UPDATE [员工信息] SET [员工姓名] = @员工姓名, [员工性别] = @员工性别, [所属部门] = @所属部门, [主要职责] = @主要职责, [身份证号码] = @身份证号码, [联系电话] = @联系电话, [移动电话] = @移动电话, [联系地址] = @联系地址, [邮政编码] = @邮政编码, [补充说明] = @补充说明 WHERE [员工编号] = @员工编号">
<DeleteParameters>
<asp:Parameter Name="员工编号" Type="String" />
</DeleteParameters>
<UpdateParameters>
<asp:ControlParameter ControlID="TextBox2" Name="员工姓名" PropertyName="Text" Type="String" />
<asp:ControlParameter ControlID="DropDownList1" Name="员工性别" PropertyName="SelectedValue"
Type="String" />
<asp:ControlParameter ControlID="TextBox4" Name="所属部门" PropertyName="Text" Type="String" />
<asp:ControlParameter ControlID="TextBox5" Name="主要职责" PropertyName="Text" Type="String" />
<asp:ControlParameter ControlID="TextBox6" Name="身份证号码" PropertyName="Text" Type="String" />
<asp:ControlParameter ControlID="TextBox7" Name="联系电话" PropertyName="Text" Type="String" />
<asp:ControlParameter ControlID="TextBox8" Name="移动电话" PropertyName="Text" Type="String" />
<asp:ControlParameter ControlID="TextBox9" Name="联系地址" PropertyName="Text" Type="String" />
<asp:ControlParameter ControlID="TextBox10" Name="邮政编码" PropertyName="Text" Type="String" />
<asp:ControlParameter ControlID="TextBox11" Name="补充说明" PropertyName="Text" Type="String" />
<asp:ControlParameter ControlID="TextBox1" Name="员工编号" PropertyName="Text" Type="String" />
</UpdateParameters>
<SelectParameters>
<asp:ControlParameter ControlID="TextBox3" Name="员工编号" PropertyName="Text" Type="String" />
</SelectParameters>
<InsertParameters>
<asp:ControlParameter ControlID="TextBox1" Name="员工编号" PropertyName="Text" Type="String" />
<asp:ControlParameter ControlID="TextBox2" Name="员工姓名" PropertyName="Text" Type="String" />
<asp:ControlParameter ControlID="DropDownList1" Name="员工性别" PropertyName="SelectedValue"
Type="String" />
<asp:ControlParameter ControlID="TextBox4" Name="所属部门" PropertyName="Text" Type="String" />
<asp:ControlParameter ControlID="TextBox5" Name="主要职责" PropertyName="Text" Type="String" />
<asp:ControlParameter ControlID="TextBox6" Name="身份证号码" PropertyName="Text" Type="String" />
<asp:ControlParameter ControlID="TextBox7" Name="联系电话" PropertyName="Text" Type="String" />
<asp:ControlParameter ControlID="TextBox8" Name="移动电话" PropertyName="Text" Type="String" />
<asp:ControlParameter ControlID="TextBox9" Name="联系地址" PropertyName="Text" Type="String" />
<asp:ControlParameter ControlID="TextBox10" Name="邮政编码" PropertyName="Text" Type="String" />
<asp:ControlParameter ControlID="TextBox11" Name="补充说明" PropertyName="Text" Type="String" />
</InsertParameters>
</asp:SqlDataSource>
</asp:Panel>
</td>
</tr>
</table>
</asp:Content>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -