ModifyInfo1.aspx
上传用户:cha0314
上传日期:2014-03-02
资源大小:12522k
文件大小:11k
源码类别:

C#编程

开发平台:

C#

  1. <%@ Page language="c#" Codebehind="ModifyInfo1.aspx.cs" AutoEventWireup="false" Inherits="UDS.SubModule.Staff.ModifyInfo" %>
  2. <%@ Import namespace="System.Data"  %>
  3. <%@ Import namespace="System"%>
  4. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
  5. <HTML>
  6. <HEAD>
  7. <title>ModifyInfo</title>
  8. <meta content="Microsoft Visual Studio 7.0" name="GENERATOR">
  9. <meta content="C#" name="CODE_LANGUAGE">
  10. <meta content="JavaScript" name="vs_defaultClientScript">
  11. <meta content="http://schemas.microsoft.com/intellisense/ie5" name="vs_targetSchema">
  12. <LINK href="../../Css/BasicLayout.css" type="text/css" rel="stylesheet">
  13. <script language="javascript">
  14. //全选checkbox
  15. function SelectItem()
  16. {
  17. var i = 0;
  18. var e;
  19. for( i = 0 ; i < ListView.elements.length ; i ++ )
  20. {
  21. e = ListView.elements[ i ];
  22. if( e.type == "checkbox" ) e.checked = !e.checked;
  23. }
  24. }
  25. // 高亮背景
  26. function high( which )
  27. which.style.background = "#C0D9E6";
  28. which.style.font.color = "red";
  29. // 取消背景高亮
  30. function low( which )
  31. which.style.background = "#FFFFFF";
  32. which.style.font.color = "black";
  33. }
  34. </script>
  35. <script language="csharp" runat="server">
  36. public string GetSex(string sex,string id)
  37. {
  38. if(id!="")
  39. return((sex=="True")?"女":"男");
  40. else
  41. return("");
  42. }
  43. public string GetAge(string birthday)
  44. {
  45. if((birthday!="")&&(DateTime.Parse(birthday)!=DateTime.Parse("1900-1-1")))
  46. return(((int)(DateTime.Now.Year-(DateTime.Parse(birthday)).Year)+1).ToString());
  47. else
  48. return("");
  49. }
  50. public int GetSexList(string sex,string id)
  51. {
  52. if(id!="")
  53. {
  54. return((sex=="True")?1:0);
  55. }
  56. else
  57. return(0);
  58. }
  59. </script>
  60. </HEAD>
  61. <body text="#000000" leftMargin="2" topMargin="0" rightMargin="0" marginheight="0" marginwidth="0">
  62. <form id="ListView" runat="server">
  63. <table id="AutoNumber1" style="BORDER-COLLAPSE: collapse" borderColor="#ccccc" height="13" cellSpacing="0" cellPadding="0" width="100%" border="0">
  64. <tr>
  65. <td style="HEIGHT: 185px" width="100%" colSpan="8" height="185">
  66. <table id="AutoNumber2" style="BORDER-COLLAPSE: collapse" borderColor="#cccccc" height="55" cellSpacing="0" cellPadding="0" width="100%" border="0">
  67. <tr>
  68. <td width="100%" colSpan="8">
  69. <table id="AutoNumber4" style="BORDER-COLLAPSE: collapse" borderColor="#111111" height="1" cellSpacing="0" cellPadding="0" width="100%" border="0">
  70. <tr>
  71. <td class="GbText" width="3%" bgColor="#c0d9e6"><IMG height="16" src="../../Images/icon/07.gif" width="16"></td>
  72. <td class="GbText" width="16%" bgColor="#c0d9e6" height="1"><b><A title="刷新" href="javascript:location.reload()">人力资源列表</A>
  73. </b>
  74. </td>
  75. <td class="GbText" width="5%" bgColor="#c0d9e6"><b><A title="返回主界面" href="../UnitiveDocument/index.asp" target="main">返回</A></b></td>
  76. <td width="21%" background="../../images/line1.gif" height="1">&nbsp;
  77. </td>
  78. <td width="96%" height="1">
  79. <table id="AutoNumber5" style="BORDER-COLLAPSE: collapse" borderColor="#111111" height="1" cellSpacing="0" cellPadding="0" width="100%" border="0">
  80. <tr>
  81. <td align=middle width="8%" 
  82.                       bgColor='<% if(displaytype==false) Response.Write("#C0D9E6");%>' 
  83.                       >
  84. <P><FONT face="宋体"><A title="显示在职人员列表" href="ModifyInfo.aspx?displayType=0">在职人员</A></FONT></P>
  85. </td>
  86. <td align=middle width="8%" 
  87.                       bgColor='<% if(displaytype==true) Response.Write("#C0D9E6");%>' 
  88.                       height=1><FONT face="宋体"><A title="显示离职人员列表" href="ModifyInfo.aspx?displayType=1">离职人员</A></FONT>
  89. </td>
  90. </tr>
  91. </table>
  92. </td>
  93. </tr>
  94. </table>
  95. </td>
  96. </tr>
  97. <tr bgColor="#c0d9e6">
  98. <td width="100%" colSpan="8"><asp:datagrid id="StaffList" runat="server" PageSize="20" AutoGenerateColumns="False" Width="100%" AllowPaging="True" DataKeyField="Staff_ID">
  99. <ItemStyle Font-Size="Smaller" ForeColor="Black"></ItemStyle>
  100. <HeaderStyle Font-Size="Smaller" Font-Names="宋体" HorizontalAlign="Center" ForeColor="Blue" VerticalAlign="Bottom" BackColor="LightBlue"></HeaderStyle>
  101. <Columns>
  102. <asp:BoundColumn DataField="Staff_ID" ReadOnly="True" HeaderText="ID"></asp:BoundColumn>
  103. <asp:TemplateColumn HeaderText="用户名">
  104. <ItemTemplate>
  105. <asp:Label runat="server" Text='<%# DataBinder.Eval(Container, "DataItem.staff_name") %>'>
  106. </asp:Label>
  107. </ItemTemplate>
  108. </asp:TemplateColumn>
  109. <asp:TemplateColumn>
  110. <ItemStyle Width="10%"></ItemStyle>
  111. <HeaderTemplate>
  112. 真实姓名
  113. </HeaderTemplate>
  114. <ItemTemplate>
  115. <%# ((DataRowView)Container.DataItem)["RealName"]%>
  116. </ItemTemplate>
  117. <EditItemTemplate>
  118. <asp:TextBox ID="realname" TextMode=SingleLine Text='<%# ((DataRowView)Container.DataItem)["RealName"]%>' Columns="10" Runat=server>
  119. </asp:TextBox>
  120. </EditItemTemplate>
  121. </asp:TemplateColumn>
  122. <asp:TemplateColumn>
  123. <ItemStyle Width="10%"></ItemStyle>
  124. <HeaderTemplate>
  125. 手机
  126. </HeaderTemplate>
  127. <ItemTemplate>
  128. <%# ((DataRowView)Container.DataItem)["Mobile"]%>
  129. </ItemTemplate>
  130. <EditItemTemplate>
  131. <asp:TextBox ID="mobile" TextMode=SingleLine Text='<%# ((DataRowView)Container.DataItem)["Mobile"]%>' Columns="15" Runat=server>
  132. </asp:TextBox>
  133. </EditItemTemplate>
  134. </asp:TemplateColumn>
  135. <asp:TemplateColumn HeaderText="年龄">
  136. <ItemTemplate>
  137. <asp:Literal ID="old" Runat="server" Text='<%# GetAge(((DataRowView)Container.DataItem)["Birthday"].ToString()) %>'>
  138. </asp:Literal>
  139. </ItemTemplate>
  140. </asp:TemplateColumn>
  141. <asp:TemplateColumn HeaderText="性别">
  142. <ItemStyle Width="5%"></ItemStyle>
  143. <ItemTemplate>
  144. <asp:Literal ID="sex" Runat="server" Text='<%# GetSex(((DataRowView)Container.DataItem)["sex"].ToString(),((DataRowView)Container.DataItem)["Staff_ID"].ToString()) %>'>
  145. </asp:Literal>
  146. </ItemTemplate>
  147. <EditItemTemplate>
  148. <asp:DropDownList id="gender" Runat="server" SelectedIndex = '<%# GetSexList(((DataRowView)Container.DataItem)["sex"].ToString(),((DataRowView)Container.DataItem)["Staff_ID"].ToString()) %>'>
  149. <asp:ListItem Value="false">男</asp:ListItem>
  150. <asp:ListItem Value="true">女</asp:ListItem>
  151. </asp:DropDownList>
  152. </EditItemTemplate>
  153. </asp:TemplateColumn>
  154. <asp:TemplateColumn>
  155. <ItemStyle Width="10%"></ItemStyle>
  156. <HeaderTemplate>
  157. EMAIL
  158. </HeaderTemplate>
  159. <ItemTemplate>
  160. <%#((DataRowView)Container.DataItem)["Email"]%>
  161. </ItemTemplate>
  162. <EditItemTemplate>
  163. <asp:TextBox ID="email" Text='<%#((DataRowView)Container.DataItem)["Email"]%>' Columns="15" Runat=server>
  164. </asp:TextBox>
  165. </EditItemTemplate>
  166. </asp:TemplateColumn>
  167. <asp:TemplateColumn>
  168. <ItemStyle Width="10%"></ItemStyle>
  169. <HeaderTemplate>
  170. 所在部门
  171. </HeaderTemplate>
  172. <ItemTemplate>
  173. <%#((DataRowView)Container.DataItem)["Department_Name"]%>
  174. </ItemTemplate>
  175. <EditItemTemplate>
  176. <asp:DropDownList ID="department" Runat="server"></asp:DropDownList>
  177. </EditItemTemplate>
  178. </asp:TemplateColumn>
  179. <asp:TemplateColumn>
  180. <ItemStyle Width="20%"></ItemStyle>
  181. <HeaderTemplate>
  182. 注册日期
  183. </HeaderTemplate>
  184. <ItemTemplate>
  185. <%#((DataRowView)Container.DataItem)["RegistedDate"]%>
  186. </ItemTemplate>
  187. </asp:TemplateColumn>
  188. <asp:BoundColumn Visible="False" DataField="Department_ID" ReadOnly="True"></asp:BoundColumn>
  189. <asp:EditCommandColumn ButtonType="LinkButton" UpdateText="修改" CancelText="" EditText="选择"></asp:EditCommandColumn>
  190. </Columns>
  191. <PagerStyle Visible="False" Font-Size="Smaller" Font-Names="宋体" HorizontalAlign="Right" Mode="NumericPages"></PagerStyle>
  192. </asp:datagrid></td>
  193. </tr>
  194. </table>
  195. </td>
  196. </tr>
  197. <tr bgColor="#c0d9e6">
  198. <td class="GbText" style="HEIGHT: 31px" width="83%" bgColor="#c0d9e6" height="31">&nbsp;<input class="ButtonCss" id="btn_Go" style="WIDTH: 36px; HEIGHT: 20px" type="button" value="转到" name="btn_Go" runat="server">
  199. 第<asp:textbox id="txb_PageNo" Width="20" Runat="server" CssClass="BORDER-RIGHT: #ffffff 1px solid; BORDER-TOP: #fffffb 1px solid; BORDER-LEFT: #ffffff 1px solid; COLOR: #5e5e5e; BORDER-BOTTOM: #ffffff 1px solid; TEXT-ALIGN: center" TextMode="SingleLine"></asp:textbox>
  200. 页,每页显示<asp:textbox id="txb_ItemPerPage" onmouseover="high( this );" onmouseout="low( this );" Width="20" Runat="server" CssClass="BORDER-RIGHT: #ffffff 1px solid; BORDER-TOP: #fffffb 1px solid; BORDER-LEFT: #ffffff 1px solid; COLOR: #5e5e5e; BORDER-BOTTOM: #ffffff 1px solid; TEXT-ALIGN: center" TextMode="SingleLine"></asp:textbox>条记录,共有
  201. <asp:label id="lbl_totalrecord" runat="server" Width="10px" Height="8px"></asp:label>页记录.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  202. </td>
  203. <td style="HEIGHT: 31px" width="3%" height="31"><asp:imagebutton id="btn_first" runat="server" Width="23" Height="23" BorderWidth="0" ImageUrl="../../Images/top.gif" CommandArgument="first" ToolTip="第一页"></asp:imagebutton></td>
  204. <td style="HEIGHT: 31px" width="3%" height="31"><asp:imagebutton id="btn_pre" Width="23" Runat="server" BorderWidth="0" ImageUrl="../../Images/prev.gif" CommandArgument="pre" ToolTip="前一页"></asp:imagebutton></td>
  205. <td class="GbText" style="HEIGHT: 31px" align="middle" width="8%" height="31"><asp:label id="lbl_curpage" runat="server">Label</asp:label>/
  206. <asp:label id="lbl_totalpage" runat="server">Label</asp:label></td>
  207. <td style="HEIGHT: 31px" width="3%" height="31"><asp:imagebutton id="btn_next" Width="23" Runat="server" Height="23" BorderWidth="0" ImageUrl="../../Images/next.gif" CommandArgument="next" ToolTip="下一页"></asp:imagebutton></td>
  208. <td style="HEIGHT: 31px" width="3%" height="31"><asp:imagebutton id="btn_last" Width="23" Runat="server" Height="23" BorderWidth="0" ImageUrl="../../Images/end.gif" CommandArgument="last" ToolTip="最后一页"></asp:imagebutton></td>
  209. </tr>
  210. <tr>
  211. <td width="100%" colSpan="8">
  212. <table cellSpacing="0" cellPadding="0" width="100%" border="0">
  213. <tr>
  214. <td></td>
  215. <td align="right"><IMG height="25" src="../../images/endbott.gif" width="279"></td>
  216. </tr>
  217. </table>
  218. </td>
  219. </tr>
  220. </table>
  221. </form>
  222. </body>
  223. </HTML>