rlzy_grkq.aspx
上传用户:lishan0805
上传日期:2019-12-08
资源大小:12048k
文件大小:9k
源码类别:

OA系统

开发平台:

C#

  1. <%@ Page Language="C#" AutoEventWireup="true" CodeFile="rlzy_grkq.aspx.cs" Inherits="wc_rlzy_rlzy_grkq" %>
  2. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  3. <html xmlns="http://www.w3.org/1999/xhtml" >
  4. <head>
  5. <meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
  6. <title>个人考勤记录</title>
  7. <link href="../css/link.css"rel="stylesheet" type="text/css" />
  8. <style type="text/css">
  9. <!--
  10. .style1 {
  11. color: #FFFFFF;
  12. font-weight: bold;
  13. }
  14. .style13 {color: #5EAE19}
  15. .style14 {font-size: 12px}
  16. .style22 {font-size: 14px}
  17. .style23 {color: #999999}
  18. .style24 {color: #999999; font-size: 12px; }
  19. .style2 {color: #FF0000}
  20. .style21 {font-weight: bold; color: #5EAE19;}
  21. -->
  22. </style>
  23. <script type="text/javascript" language="javascript">
  24.   function check()//表单判断
  25.   {
  26.    var str="";
  27.    var j=0;
  28.    var el=document.form1.getElementsByTagName("input")
  29.    for(i=0;i<el.length;i++){
  30.     if(el[i].type=="checkbox"){
  31.      if((el[i].checked)&&(el[i].name.indexOf("deletecheck")!='-1')){
  32.       j++;
  33.      }
  34.     }
  35.    }
  36.    if(j > 10000 || j<1)
  37.    {
  38.     alert("最少必须选择一项,最多不能超过100项!rt你现在选择了"+j+"项");
  39.     return false;
  40.    }
  41.    
  42.      if(!confirm('您确定要删除该记录吗?'))
  43.  {
  44. return false
  45. else 
  46. document.form1.submit
  47. }
  48. function CheckAll(form)
  49. {
  50.     for (var i=0;i<form.elements.length;i++){
  51.         var e = form.elements[i];
  52.         if (e.name != 'chkAll')
  53.         {
  54.             e.checked = form.chkAll.checked;
  55.         }
  56.          
  57.       }
  58. </script>
  59. </head>
  60. <body>
  61. <form id="form1" name="form1" method="post" onsubmit="return check();" action="rlzy_kqsc.aspx">
  62. <% COM.OA.Entity.users loginuser =Session["loginuser"] as COM.OA.Entity.users;
  63.         if (loginuser == null)
  64.         {
  65.             this.Response.Write(string.Format(GetRedirect.ALLREDIRECT, "../login.aspx"));
  66.         }
  67.         else
  68.         { %>
  69. <%
  70.     string grid = this.Request["grid"];
  71.     string whereid = "u_id=" + grid;
  72.     System.Collections.Generic.IList<COM.OA.Entity.users> gerenilist = COM.OA.BLL.usersBLL.Select(whereid);
  73.     System.Collections.Generic.List<COM.OA.Entity.users> gerenlist = (System.Collections.Generic.List<COM.OA.Entity.users>)gerenilist;
  74.     COM.OA.Entity.users u = new COM.OA.Entity.users();
  75.     u = gerenlist[0];
  76.     int emid = u.u_em_id;
  77.     string emwhere = "em_id=" + emid;
  78.     System.Collections.Generic.IList<COM.OA.Entity.employee> emilist = COM.OA.BLL.employeeBLL.Select(emwhere);
  79.     System.Collections.Generic.List<COM.OA.Entity.employee> emlist = (System.Collections.Generic.List<COM.OA.Entity.employee>)emilist;
  80.     COM.OA.Entity.employee em = new COM.OA.Entity.employee();
  81.     em = emlist[0];
  82.     string emName = em.em_name;
  83.     
  84. %>
  85. <div align="center">
  86.   <table width="100%" border="0" cellpadding="0" cellspacing="0" bgcolor="#5EAE19">
  87.     <tr>
  88.       <td bgcolor="#FFFFFF">
  89.       <div align="center">
  90.         <table width="600"  height="21" border="0" cellpadding="0" cellspacing="0" background="../images/images_wc/line.gif" >
  91.           <tr>
  92.             <td><div align="center" class="style1"><%=emName%>  考勤记录</div></td>
  93.           </tr>
  94.           </table>
  95.        </div>
  96.        </td>
  97.     </tr>
  98.    </table>
  99.         <table width="600"  border="0" cellpadding="2" cellspacing="1" bgcolor="#669900">
  100.             <tr bgcolor="#FFFFFF">
  101.               <td width="17%">
  102.               <div align="center"><strong>
  103.               <input  type="submit" name="Submit" font-bold="True"  value="删除" />
  104.                </strong>&nbsp;</div></td>
  105.               <td width="17%"><div align="center"><strong>日  期</strong></div></td>
  106.               <td width="14%"><div align="center"><strong>星 期</strong></div></td>
  107.               <td width="26%"><div align="center"><strong>时 间</strong></div></td>
  108.               <td width="16%"><div align="center"><strong>姓 名</strong></div></td>
  109.             </tr>
  110.             <%
  111.                 string where = "att_u_id=" + grid;
  112.                 System.Collections.Generic.IList<COM.OA.Entity.attendance> il = COM.OA.BLL.attendanceBLL.Select(where);
  113.                 System.Collections.Generic.List<COM.OA.Entity.attendance> list = (System.Collections.Generic.List<COM.OA.Entity.attendance>)il;
  114.                 list.Reverse();
  115.                             
  116.             %>
  117.             <%foreach(COM.OA.Entity.attendance l in list) %>
  118.             <%{ %>
  119.             <%
  120.               
  121.                 string t = l.att_date.ToString("yyy-MM-dd");//取日期部分
  122.                 string weekstr = l.att_date.DayOfWeek.ToString();
  123.                 switch (weekstr)
  124.                 {
  125.                     case "Monday": weekstr = "星期一"; break;
  126.                     case "Tuesday": weekstr = "星期二"; break;
  127.                     case "Wednesday": weekstr = "星期三"; break;
  128.                     case "Thursday": weekstr = "星期四"; break;
  129.                     case "Friday": weekstr = "星期五"; break;
  130.                     case "Saturday": weekstr = "星期六"; break;
  131.                     case "Sunday": weekstr = "星期日"; break;
  132.                 }
  133.                 //上午时间 判断
  134.                 string swshijian = l.att_forenoontime.ToString("HH:mm:ss");//取时间部分 HH24小时 hh12小时
  135.                 DateTime shangwu = DateTime.Parse(swshijian);
  136.                 DateTime chidao = DateTime.Parse(8 + ":" + 30 + ":" + 0 + 0);
  137.                 string sss = "";
  138.                 if (swshijian.Equals("00:00:00"))
  139.                 {
  140.                     sss = "上午未考勤";
  141.                 }
  142.                 else
  143.                 {
  144.                     if (shangwu > chidao)
  145.                     {
  146.                         sss = "上午迟到";
  147.                     }
  148.                     else
  149.                     {
  150.                         sss = shangwu.ToString("HH:mm:ss");
  151.                     }
  152.                 }
  153.                
  154.                 //下午时间判断
  155.                 string xwshijian = l.att_afternoontime.ToString("HH:mm:ss");
  156.                 DateTime xiawu = DateTime.Parse(xwshijian);
  157.                 DateTime chidao1 = DateTime.Parse(17 + ":" + 30 + ":" + 0 + 0);
  158.                 string xxx = "";
  159.                 if (xwshijian.Equals("00:00:00"))
  160.                 {
  161.                     xxx = "下午未考勤";
  162.                 }
  163.                 else
  164.                 {
  165.                     if (xiawu > chidao1)
  166.                     {
  167.                          xxx = "下午迟到";
  168.                     }
  169.                     else
  170.                     {
  171.                          xxx = xiawu.ToString("HH:mm:ss");
  172.                     }
  173.                 }
  174.                 
  175.                 //用户名 当前登录用户
  176.                 
  177.                 
  178.             %>
  179.             <tr  bgcolor="#FFFFFF" onmouseover = "this.style.backgroundColor = '#EEEEEE'" onmouseout = "this.style.backgroundColor = ''">
  180.             <td width="17%" height="28"><div align="center">
  181.                   <input type="checkbox" name="deletecheck" value="<%=l.att_id %>" /></div></td>
  182.               <td width="17%" height="28"><div align="center"><span class="style13"><%=t%></span></div></td>
  183.               <td width="14%" height="28"><div align="center" class="style13"><%=weekstr%>
  184.               </div></td>
  185.               <td width="26%"><div align="center" class="style14">
  186.                 <div align="left">                  
  187.                   <table width="100%" border="0" cellpadding="0" cellspacing="0">
  188.                     <tr>
  189.                       <td width="49%"><div align="center">
  190.                          <span class="style2"><%=sss%></span>      
  191.                           </div>  
  192.                         </td>
  193.                       <td width="1%"><div align="center"><span class="style13">|</span></div></td>
  194.                       <td width="50%"><div align="center"><span class="style2"><%=xxx%></span> </div></td>
  195.                     </tr>
  196.                   </table>
  197.                 </div>
  198.               </div>
  199.               </td>
  200.               <td width="16%" height="28"><div align="center"><span class="style13"><%=emName%></span></div></td>
  201.            </tr>
  202.            <%} %>
  203.              <tr bgcolor="#FFFFFF">
  204.             <td width="17%" height="28">
  205.                   <input name="chkAll" type="checkbox" onclick="CheckAll(this.form)" /></td>
  206.             <td width="17%" height="28">全选</td>  
  207.             <td width="14%" height="28"></td>
  208.             <td width="17%" height="28"></td>  
  209.             <td width="17%" height="28"></td> 
  210.            </tr>
  211.            </table>
  212.     <table width="433" border="0" cellpadding="0" cellspacing="0" >
  213.         <tr>
  214.         <td width="170">总共  <%=list.Count%> <%} %> 条记录</td>
  215.         <td width="64"><a href="javascript:history.go(-1)"><img alt="" src="../images/images_wc/back.gif" width="37" height="45" border="0" /></a></td>
  216.         </tr>
  217.     </table>
  218.   <br/>
  219. <table border="0" width="50%" align="center">
  220.   <tr>
  221.     <td width="23%" align="center">
  222.     </td>
  223.     <td width="31%" align="center">
  224.     </td>
  225.     <td width="23%" align="center">
  226.     </td>
  227.     <td width="23%" align="center">
  228.     </td>
  229.   </tr>
  230. </table>
  231. </div>
  232. </form>
  233. </body>
  234. </html>