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

C#编程

开发平台:

C#

  1. <%@ Import namespace="System.Data.SqlClient"%>
  2. <%@ Import namespace="System"%>
  3. <%@ Import namespace="System.Data"  %>
  4. <%@ Page language="c#" Codebehind="StaffData.aspx.cs" AutoEventWireup="false" Inherits="UDS.SubModule.WorkAttendance.StaffData" %>
  5. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
  6. <HTML>
  7. <HEAD>
  8. <title>StaffData</title>
  9. <meta name="GENERATOR" Content="Microsoft Visual Studio 7.0">
  10. <meta name="CODE_LANGUAGE" Content="C#">
  11. <meta name="vs_defaultClientScript" content="JavaScript">
  12. <meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5">
  13. <LINK href="../../Css/BasicLayout.css" type="text/css" rel="stylesheet">
  14. <script language="C#" runat="server">
  15. string GetMemo(object id)
  16. {
  17. if(id.ToString()=="") return "";
  18. UDS.Components.Database db = new UDS.Components.Database();
  19. SqlParameter[] prams =  {
  20. db.MakeInParam("@id",SqlDbType.BigInt,8,Int64.Parse(id.ToString())),
  21. db.MakeOutParam("@result",SqlDbType.VarChar,300)
  22. };
  23. db.RunProc("sp_WA_GetMemo",prams);
  24. return(prams[1].Value.ToString());
  25. }
  26. string GetTime(object day)
  27. {
  28. if(day.ToString()=="")
  29. return "";
  30. else
  31. {
  32. return(DateTime.Parse(day.ToString()).ToShortTimeString());
  33. }
  34. }
  35. </script>
  36. </HEAD>
  37. <body onload="window." leftmargin="0" topmargin="0">
  38. <form id="StaffData" method="post" runat="server">
  39. <FONT face="宋体">
  40. <table border="0" cellpadding="0" cellspacing="0" style="BORDER-COLLAPSE: collapse" bordercolor="#111111"
  41. width="100%" height="1">
  42. <tr height="30">
  43. <td width="3%" bgcolor="#c0d9e6" class="GbText" background="../../Images/treetopbg.jpg"><font color="#006699" size="3"></font></td>
  44. <td bgcolor="#c0d9e6" class="GbText" background="../../Images/treetopbg.jpg"><b>考勤信息</b></td>
  45. </tr>
  46. </table>
  47. <TABLE id="Table1" cellSpacing="0" cellPadding="0" width="100%" border="0" class="gbtext">
  48. <TR>
  49. <TD style="WIDTH: 155px" height="40">&nbsp; 姓名:
  50. <asp:Literal id="ltlname" runat="server"></asp:Literal></TD>
  51. <TD style="WIDTH: 235px" height="40">查询开始时间:
  52. <asp:Literal id="ltlbegintime" runat="server"></asp:Literal></TD>
  53. <TD style="WIDTH: 223px" height="40">查询结束时间:
  54. <asp:Literal id="ltlendtime" runat="server"></asp:Literal></TD>
  55. <TD height="40">状态:
  56. <asp:Literal id="lbltype" runat="server"></asp:Literal></TD>
  57. </TR>
  58. <TR>
  59. <TD colSpan="4">
  60. <asp:DataGrid id="grdStaff" runat="server" AutoGenerateColumns="False" Width="100%" BorderColor="#93BEE2"
  61. BorderWidth="1px" CellPadding="3" CssClass="gbtext">
  62. <HeaderStyle BackColor="#E8F4FF"></HeaderStyle>
  63. <Columns>
  64. <asp:TemplateColumn HeaderText="日期">
  65. <ItemTemplate>
  66. <%# DateTime.Parse(((DataRowView)Container.DataItem)["WorkDate"].ToString()).ToString("yyyy-MM-dd") %>
  67. </ItemTemplate>
  68. </asp:TemplateColumn>
  69. <asp:TemplateColumn HeaderText="上班时间">
  70. <ItemTemplate>
  71. <%# GetTime(((DataRowView)Container.DataItem)["OnDuty"]) %>
  72. <asp:Literal id="Literal1" Runat="server"></asp:Literal>
  73. </ItemTemplate>
  74. </asp:TemplateColumn>
  75. <asp:TemplateColumn HeaderText="上班备注">
  76. <ItemTemplate>
  77. <%# GetMemo(((DataRowView)Container.DataItem)["OnDuty_MemoID"])%>
  78. </ItemTemplate>
  79. </asp:TemplateColumn>
  80. <asp:TemplateColumn HeaderText="下班时间">
  81. <ItemTemplate>
  82. <%# GetTime(((DataRowView)Container.DataItem)["OffDuty"])%>
  83. <asp:Literal id="Literal2" Runat="server"></asp:Literal>
  84. </ItemTemplate>
  85. </asp:TemplateColumn>
  86. <asp:TemplateColumn HeaderText="下班备注">
  87. <ItemTemplate>
  88. <%# GetMemo(((DataRowView)Container.DataItem)["OffDuty_MemoID"])%>
  89. </ItemTemplate>
  90. </asp:TemplateColumn>
  91. </Columns>
  92. </asp:DataGrid></TD>
  93. </TR>
  94. </TABLE>
  95. </FONT>
  96. </form>
  97. </body>
  98. </HTML>