Default.aspx
上传用户:xuming1973
上传日期:2014-02-27
资源大小:17511k
文件大小:6k
源码类别:

WEB源码(ASP,PHP,...)

开发平台:

C#

  1. <%@ Import namespace="System.Data.SqlClient"%>
  2. <%@ Import namespace="System.Data"  %>
  3. <%@ Import namespace="System"%>
  4. <%@ Page language="c#" Codebehind="Default.aspx.cs" AutoEventWireup="false" Inherits="UDS.SubModule.WorkAttendance._Default" %>
  5. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
  6. <HTML>
  7. <HEAD>
  8. <title>Default</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>
  15. //获取时间
  16. function Timer(span)
  17. {
  18. var tmp = new Date();
  19. var milsecs=Date.parse(tmp.getMonth()+"-"+tmp.getDay()+"-"+tmp.getFullYear()+" "+document.getElementById('lbl_Hour').innerText+":"+document.getElementById('lbl_Minute').innerText+":"+document.getElementById('lbl_Second').innerText);
  20. var timer = new Date(milsecs+span);
  21. var seconds,minutes,hours;
  22. if(timer.getSeconds()<10)
  23. seconds = "0"+timer.getSeconds();
  24. else
  25. seconds = timer.getSeconds();
  26. if(timer.getMinutes()<10)
  27. minutes = "0"+timer.getMinutes();
  28. else
  29. minutes = timer.getMinutes();
  30. if(timer.getHours()<10)
  31. hours = "0"+timer.getHours();
  32. else
  33. hours = timer.getHours();
  34. document.getElementById('lbl_Second').innerText = seconds;
  35. document.getElementById('lbl_Minute').innerText = minutes;
  36. document.getElementById('lbl_Hour').innerText = hours;
  37. }
  38. //得到服务器时间每隔updatespan分钟校验一次,每秒更新一次本地时钟
  39. function GetServerTime(updatespan)
  40. {
  41. var clientspan = 1*1000;
  42. //更新本地时钟
  43. setInterval("Timer("+clientspan+")",clientspan);
  44. //同步服务器时钟
  45. setInterval("window.location.href='Default.aspx'",updatespan);
  46. }
  47. //-->
  48. </script>
  49. <script language="C#" runat="server">
  50. string GetMemo(object id)
  51. {
  52. if(id.ToString()=="") return "";
  53. UDS.Components.Database db = new UDS.Components.Database();
  54. SqlParameter[] prams =  {
  55. db.MakeInParam("@id",SqlDbType.BigInt,8,Int64.Parse(id.ToString())),
  56. db.MakeOutParam("@result",SqlDbType.VarChar,300)
  57. };
  58. db.RunProc("sp_WA_GetMemo",prams);
  59. return(prams[1].Value.ToString());
  60. }
  61. string GetTime(object day)
  62. {
  63. if(day.ToString()=="")
  64. return "";
  65. else
  66. {
  67. return(DateTime.Parse(day.ToString()).ToShortTimeString());
  68. }
  69. }
  70. </script>
  71. </HEAD>
  72. <body leftmargin="0" topmargin="0" onload="GetServerTime(15*60*1000)">
  73. <form method="post" runat="server">
  74. <table border="0" cellpadding="0" cellspacing="0" style="BORDER-COLLAPSE: collapse" bordercolor="#111111"
  75. width="100%" height="1">
  76. <tr height="30">
  77. <td width="3%" bgcolor="#c0d9e6" class="GbText" background="../../Images/treetopbg.jpg"><font color="#006699" size="3"><img src="../..//DataImages/page2.gif" width="16" height="16"></font></td>
  78. <td bgcolor="#c0d9e6" class="GbText" background="../../Images/treetopbg.jpg"><b>我的考勤</b></td>
  79. </tr>
  80. </table>
  81. <TABLE id="Table1" style="HEIGHT: 258px" cellSpacing="1" cellPadding="1" width="100%" border="0"
  82. class="gbtext">
  83. <TR>
  84. <TD align="center" height="50">
  85. <asp:Label id="lblDutyMessage" runat="server">考勤信息</asp:Label>
  86. <asp:label id="lbl_Time" runat="server" Font-Size="X-Small"></asp:label>
  87. <asp:label id="lbl_Hour" runat="server" Font-Size="X-Small">Label</asp:label>:<asp:label id="lbl_Minute" runat="server" Font-Size="X-Small">Label</asp:label>:<asp:label id="lbl_Second" runat="server" Font-Size="X-Small">Label</asp:label>
  88. <TR>
  89. <TD align="center">
  90. <asp:TextBox id="txtAttendanceMemo" runat="server" TextMode="MultiLine" Height="150px" Width="500px"
  91. Visible="False"></asp:TextBox></TD>
  92. </TR>
  93. <TR>
  94. <TD align="center" height="40">
  95. <asp:Button id="btnCheckAttendance" CommandArgument="" runat="server" CssClass="buttoncss" Width="80px"></asp:Button></TD>
  96. </TR>
  97. <TR>
  98. <TD><FONT face="宋体">
  99. <asp:DataGrid id="grdWeekAttendanceData" runat="server" Width="100%" AutoGenerateColumns="False"
  100. CellPadding="3" BorderWidth="1px" CssClass="gbtext" BorderColor="#93BEE2" PageSize="5" AllowPaging="True">
  101. <HeaderStyle ForeColor="Black" BackColor="#E8F4FF"></HeaderStyle>
  102. <Columns>
  103. <asp:TemplateColumn HeaderText="日期">
  104. <ItemTemplate>
  105. <%# DateTime.Parse(((DataRowView)Container.DataItem)["WorkDate"].ToString()).ToShortDateString()%>
  106. </ItemTemplate>
  107. </asp:TemplateColumn>
  108. <asp:TemplateColumn HeaderText="上班时间">
  109. <ItemTemplate>
  110. <%# GetTime(((DataRowView)Container.DataItem)["OnDuty"])%>
  111. </ItemTemplate>
  112. </asp:TemplateColumn>
  113. <asp:TemplateColumn HeaderText="上班备注">
  114. <ItemTemplate>
  115. <%# GetMemo(((DataRowView)Container.DataItem)["OnDuty_MemoID"])%>
  116. </ItemTemplate>
  117. </asp:TemplateColumn>
  118. <asp:TemplateColumn HeaderText="下班时间">
  119. <ItemTemplate>
  120. <%# GetTime(((DataRowView)Container.DataItem)["OffDuty"])%>
  121. <asp:Literal id="Literal2" Runat="server"></asp:Literal>
  122. </ItemTemplate>
  123. </asp:TemplateColumn>
  124. <asp:TemplateColumn HeaderText="下班备注">
  125. <ItemTemplate>
  126. <%# GetMemo(((DataRowView)Container.DataItem)["OffDuty_MemoID"])%>
  127. </ItemTemplate>
  128. </asp:TemplateColumn>
  129. </Columns>
  130. <PagerStyle NextPageText="下周考勤记录" PrevPageText="上周考勤记录" HorizontalAlign="Center"></PagerStyle>
  131. </asp:DataGrid></FONT></TD>
  132. </TR>
  133. </TABLE>
  134. </form>
  135. </body>
  136. </HTML>