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

C#编程

开发平台:

C#

  1. <%@ Page language="c#" Codebehind="ShowDay.aspx.cs" AutoEventWireup="false" Inherits="UDS.SubModule.WorkAttendance.ShowDay" %>
  2. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
  3. <HTML>
  4. <HEAD>
  5. <title>考勤日期设置</title>
  6. <meta content="Microsoft Visual Studio 7.0" name="GENERATOR">
  7. <meta content="C#" name="CODE_LANGUAGE">
  8. <meta content="JavaScript" name="vs_defaultClientScript">
  9. <meta content="http://schemas.microsoft.com/intellisense/ie5" name="vs_targetSchema">
  10. <LINK href="../../Css/BasicLayout.css" type="text/css" rel="stylesheet">
  11. <script language="jscript">
  12. function Click_Cell(object)
  13. {
  14. if(object.style.backgroundColor.toUpperCase()=='<%=indaycolor%>'.toUpperCase()) 
  15. object.style.backgroundColor = '<%=outdaycolor%>';
  16. else 
  17. object.style.backgroundColor = '<%=indaycolor%>';
  18. //alert(object.style.backgroundColor);
  19. //数据格式采用ID:n,{ID:n....}(n双数上班,单数休息)
  20. var innerstring;
  21. innerstring = document.ShowDay.hcellstatus.value;
  22. //遍历ID找到是否存在该ID,如果有就修改VALUE,没有就添加VALUE=0
  23. var arr = innerstring.split(",");
  24. var arrtmp;
  25. var re = /d+/;//匹配id
  26. var re1 = /:w+/;//匹配n
  27. var n,tmpstr;
  28. var havefound = false;//找到了匹配项
  29. for(var i=0;i<arr.length;i++)
  30. {
  31. arrtmp = arr[i].match(re);
  32. // if(arrtmp!=null)
  33. // alert("|"+arrtmp[0]+"|"+object.id+"|");
  34. if((arrtmp != null)&&(arrtmp[0]==object.id))//找到匹配项
  35. {
  36. //alert("找到匹配项"+"|"+arrtmp[0]+"|"+object.id);
  37. n = arr[i].match(re1);
  38. n = n[0].substr(1);
  39. n = ":"+String(parseInt(n)+1);
  40. tmpstr = arr[i].replace(re1,n);
  41. document.ShowDay.hcellstatus.value=innerstring.replace(arr[i],tmpstr);
  42. havefound = true;
  43. break;
  44. }
  45. }
  46. if(!havefound)//没有找到匹配项,添加字符串
  47. {
  48. //alert(object.style.backgroundColor);
  49. if(object.style.backgroundColor.toUpperCase()=='<%=indaycolor%>'.toUpperCase())
  50. innerstring = object.id + ":0,";
  51. else
  52. innerstring = object.id + ":1,";
  53. document.ShowDay.hcellstatus.value += innerstring;
  54. //alert(document.ShowDay.hcellstatus.value);
  55. }
  56. //alert(object.style.backgroundColor);
  57. }
  58. function Top_Click(cellnumber)
  59. {
  60. for(var i=0;i<daytable.rows.length;i++)
  61. {
  62. daytable.rows[i].cells[cellnumber].click();
  63. }
  64. }
  65. </script>
  66. </HEAD>
  67. <body leftmargin="0" topmargin="0">
  68. <form id="ShowDay" method="post" runat="server">
  69. <FONT face="宋体">
  70. <table border="0" cellpadding="0" cellspacing="0" style="BORDER-COLLAPSE: collapse" bordercolor="#111111"
  71. width="100%" height="1">
  72. <tr height="30">
  73. <td width="3%" bgcolor="#c0d9e6" class="GbText" background="../../Images/treetopbg.jpg"><font color="#006699" size="3"><img src="../..//DataImages/page.gif" width="16" height="16"></font></td>
  74. <td bgcolor="#c0d9e6" class="GbText" background="../../Images/treetopbg.jpg"><b>考勤设置</b></td>
  75. </tr>
  76. </table>
  77. <TABLE id="daytable" cellSpacing="0" cellPadding="0" width="100%" align="center" border="1"
  78. runat="server" class="gbtext" style="BORDER-COLLAPSE: collapse" bordercolor="#93bee2">
  79. <TR height="30">
  80. <TD align="center" style="CURSOR: hand" onclick="Top_Click(0)" onmouseover="this.title='点击改变整列'"
  81. title="点击修改整列" bgcolor="#e8f4ff">星期一</TD>
  82. <TD align="center" style="CURSOR: hand" onclick="Top_Click(1)" onmouseover="this.title='点击改变整列'"
  83. bgcolor="#e8f4ff">星期二</TD>
  84. <TD align="center" style="CURSOR: hand" onclick="Top_Click(2)" onmouseover="this.title='点击改变整列'"
  85. bgcolor="#e8f4ff">星期三</TD>
  86. <TD align="center" style="CURSOR: hand" onclick="Top_Click(3)" onmouseover="this.title='点击改变整列'"
  87. bgcolor="#e8f4ff">星期四</TD>
  88. <TD align="center" style="CURSOR: hand" onclick="Top_Click(4)" onmouseover="this.title='点击改变整列'"
  89. bgcolor="#e8f4ff">星期五</TD>
  90. <TD align="center" style="CURSOR: hand" onclick="Top_Click(5)" onmouseover="this.title='点击改变整列'"
  91. bgcolor="#e8f4ff">星期六</TD>
  92. <TD align="center" style="CURSOR: hand" onclick="Top_Click(6)" onmouseover="this.title='点击改变整列'"
  93. bgcolor="#e8f4ff">星期日</TD>
  94. </TR>
  95. </TABLE>
  96. </FONT>
  97. <table border="0" cellpadding="0" cellspacing="0" style="BORDER-COLLAPSE: collapse" width="100%">
  98. <tr height="30">
  99. <td class="GbText">
  100. <TABLE id="Table1" height="24" cellSpacing="0" cellPadding="0" width="200" class="gbtext"
  101. style="BORDER-COLLAPSE: collapse" border="1" bordercolor="#e8e8e8">
  102. <TR>
  103. <TD bgColor="#ebffe5" width="100" align="center"><FONT face="宋体">工作日</FONT></TD>
  104. <TD bgColor="#ffffef" width="100" align="center"><FONT face="宋体">休息日</FONT></TD>
  105. </TR>
  106. </TABLE>
  107. </td>
  108. </tr>
  109. <tr height="30">
  110. <td class="GbText" align="center">
  111. <asp:button id="btnsubmit" runat="server" Text=" 确 认 " CssClass="buttoncss"></asp:button>
  112. <INPUT id="hcellstatus" type="hidden" runat="server">
  113. <asp:button id="lblMessage" runat="server" CssClass="buttoncss" Text="修改成功" Visible="False"
  114. BorderWidth="0px"></asp:button></td>
  115. </tr>
  116. </table>
  117. </form>
  118. </body>
  119. </HTML>