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

OA系统

开发平台:

C#

  1. <%@ Page Language="C#" AutoEventWireup="true" CodeFile="rlzy_sykq.aspx.cs" Inherits="rlzy_sykq" %>
  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. .style5 {font-weight: bold}
  11. .style10 {color: #5EAE19; font-weight: bold; }
  12. .style13 {color: #5EAE19}
  13. .style14 {font-size: 12px}
  14. .style1 {
  15. color: #FFFFFF;
  16. font-weight: bold;
  17. }
  18. .style2 {color: #FF0000}
  19. .style22 {font-size: 14px}
  20. .style23 {color: #999999}
  21. .style24 {color: #999999; font-size: 12px; }
  22. -->
  23. </style>
  24. </head>
  25. <body>
  26. <%  COM.OA.Entity.users loginuser = Session["loginuser"] as COM.OA.Entity.users;
  27.         if (loginuser == null)
  28.         {
  29.             this.Response.Write(string.Format(GetRedirect.ALLREDIRECT, "../login.aspx"));
  30.         } %>
  31. <div align="center">
  32.   <table width="100%" border="0" cellpadding="0" cellspacing="0">
  33.     <tr>
  34.       <td width="6" height="21"><img alt="" src="../images/images_wc/leftlin1.gif" width="6" height="21" /></td>
  35.       <td width="936" bgcolor="#5AAE18"><div align="center"><span class="style1">所 有 考 勤 记 录</span></div></td>
  36.       <td width="6" height="21"><img alt="" src="../images/images_wc/rightlin.gif" width="6" height="21" /></td>
  37.     </tr>
  38.   </table>
  39.   <div class="style14">
  40.   <table width="100%"  border="0" cellpadding="2" cellspacing="1" bgcolor="#5EAE19"> 
  41.     <tr bgcolor="#FFFFFF">
  42.       <td width="11%"><div align="center" class="style5">日 期</div></td>
  43.       <td width="10%"><div align="center"><strong>星 期</strong></div></td>
  44.       <td width="25%"><div align="center"><strong> 时 间</strong></div></td>
  45.       <td width="11%"><div align="center"><strong>姓 名</strong></div></td>
  46.       <td width="19%"><div align="center"><strong>部 门</strong></div></td>
  47.     </tr>
  48.     
  49.        <% 
  50.                 string page=this.Request["page"];
  51.                 
  52.                 System.Collections.Generic.IList<COM.OA.Entity.attendance> il;
  53.                 string where = "1=1";
  54.                 il = COM.OA.BLL.attendanceBLL.Select(where);
  55.                 int count = il.Count;
  56.                 float countd=count;
  57.                 double weiy = Math.Ceiling(countd/5);
  58.                 int weiye = Int32.Parse(weiy.ToString());
  59.                 int pages=1;
  60.                 int shangpage=0;
  61.                 int xiapage=0;
  62.                 if (page == null)
  63.                 {
  64.                     
  65.                     il = COM.OA.BLL.attendanceBLL.Select(5, 1, where);
  66.                     shangpage = 1;
  67.                     xiapage = 2;
  68.                 }
  69.                 else
  70.                 {
  71.                     pages = Int32.Parse(page);
  72.                     shangpage=pages - 1;
  73.                     xiapage = pages + 1;
  74.                     il = COM.OA.BLL.attendanceBLL.Select(5, pages, where);
  75.                 }
  76.                 if (il.Count != 0)
  77.                 {
  78.                     foreach (COM.OA.Entity.attendance l in il)
  79.                     {
  80.     
  81.            string t = l.att_date.ToString("yyy-MM-dd");//取日期部分
  82.            string weekstr =l.att_date.DayOfWeek.ToString();
  83.            switch (weekstr)
  84.            {
  85.                case "Monday": weekstr = "星期一"; 
  86.                    break;
  87.                case "Tuesday": weekstr = "星期二"; 
  88.                    break;
  89.                case "Wednesday": weekstr = "星期三"; 
  90.                    break;
  91.                case "Thursday": weekstr = "星期四";
  92.                    break;
  93.                case "Friday": weekstr = "星期五"; 
  94.                    break;
  95.                case "Saturday": weekstr = "星期六";
  96.                    break;
  97.                case "Sunday": weekstr = "星期日";                                     break;
  98.            }
  99.            //上午时间 判断
  100.            string swshijian = l.att_forenoontime.ToString("HH:mm:ss");//取时间部分 HH24小时 hh12小时
  101.            DateTime shangwu = DateTime.Parse(swshijian);
  102.            DateTime chidao = DateTime.Parse(8 + ":" +30 + ":" + 0 + 0);
  103.            string sss = "";
  104.            if (swshijian.Equals("00:00:00"))
  105.            {
  106.                sss = "上午未考勤";
  107.            }
  108.            else
  109.            {
  110.                if (shangwu > chidao)
  111.                {
  112.                    sss = "上午迟到";
  113.                }
  114.                else
  115.                {
  116.                    sss = shangwu.ToString("HH:mm:ss");
  117.                }
  118.            }
  119.            //下午时间判断
  120.            string xwshijian =l.att_afternoontime.ToString("HH:mm:ss");
  121.            DateTime xiawu = DateTime.Parse(xwshijian);
  122.            DateTime chidao1 = DateTime.Parse(17 + ":" +30 + ":" + 0 + 0);
  123.            string xxx = "";
  124.            if (xwshijian.Equals("00:00:00"))
  125.            {
  126.                xxx = "下午未考勤";
  127.            }
  128.            else
  129.            {
  130.                xxx = xiawu.ToString("HH:mm:ss");
  131.            }
  132.            //用户名
  133.            int userid = l.att_u_id;
  134.            string whereuser = "u_id=" + userid;
  135.            System.Collections.Generic.IList<COM.OA.Entity.users> ilist= COM.OA.BLL.usersBLL.Select(whereuser);
  136.            System.Collections.Generic.List<COM.OA.Entity.users> list = (System.Collections.Generic.List<COM.OA.Entity.users>)ilist;
  137.            COM.OA.Entity.users u = new COM.OA.Entity.users();
  138.            u = list[0];
  139.            int emid = u.u_em_id;//users表中的em_id 通过查em_name
  140.            string whereem = "em_id=" + emid;
  141.            System.Collections.Generic.IList<COM.OA.Entity.employee> emilist = COM.OA.BLL.employeeBLL.Select(whereem);
  142.            System.Collections.Generic.List<COM.OA.Entity.employee> emlist = (System.Collections.Generic.List<COM.OA.Entity.employee>)emilist;
  143.            COM.OA.Entity.employee em = new COM.OA.Entity.employee();
  144.            em = emlist[0];
  145.            string emName = em.em_name;
  146.            //部门
  147.            int bumen = l.att_dept_id;
  148.            string w = "dept_id=" + bumen;                      System.Collections.Generic.IList<COM.OA.Entity.department> i = COM.OA.BLL.departmentBLL.Select(w);
  149.            string dept = "";
  150.            foreach (COM.OA.Entity.department d in i)
  151.            {
  152.                dept = d.dept_department;
  153.            } 
  154.        %>
  155.        <tr bgcolor="#FFFFFF" onmousedown= "this.style.backgroundColor = '#EEEEEE'">
  156.       <td width="11%" height="28"><div align="center"><%=t %></div></td>
  157.       <td width="10%" height="28"><div align="center"><%=weekstr %></div></td>
  158.       <td width="25%"><div align="center" class="style14">
  159.         <div align="left">          
  160.           <table width="100%" border="0" cellpadding="0" cellspacing="0">
  161.             <tr>
  162.               <td width="49%"><div align="center"><span class="style2"><%=sss %></span></div></td>
  163.         
  164.               <td width="1%"><div align="center"><span class="style13">|</span></div></td>
  165.               <%
  166.                   string xia = "";
  167.                   if (xxx.Equals("00:00:00"))
  168.                   {
  169.                       xia = "下午未考勤";
  170.                   }
  171.                   else
  172.                   {
  173.                       xia = xxx;
  174.                   } 
  175.               %>
  176.               <td width="50%"><div align="center"><span class="style2"><%=xia%></span></div></td>
  177.             </tr>
  178.           </table></div>
  179.           </div>
  180.        </td>
  181.       <td width="11%" height="28"><div align="center"><%=emName%></div></td>
  182.       <td width="19%" height="28"><div align="center"><%=dept %></div></td> 
  183.     </tr>
  184.     <%} %>
  185.     <tr bgcolor="#FFFFFF">
  186.       <td bgcolor="#FFFFFF">
  187.       <% if (pages == 1)
  188.          { %>
  189.       <a href="rlzy_sykq.aspx?page=1">首页</a>                    
  190.       <%}
  191.         else
  192.         { %>
  193.         <a href="rlzy_sykq.aspx?page=<%=shangpage %>">上一页</a><% } %>&nbsp
  194.         <% if (pages == weiye)
  195.            {  %> 
  196.             <a href="rlzy_sykq.aspx?page=<%=weiye %>">尾页</a>
  197.         <% }
  198.            else
  199.            {  %>
  200.             <a href="rlzy_sykq.aspx?page=<%=xiapage %>">下一页</a>
  201.         <% } %>
  202.       </td>                              
  203.   </tr>
  204.   <%} %>
  205.         
  206.   </table></div>
  207.   <br />
  208.   <table width="726" border="0" cellpadding="0" cellspacing="0">
  209.     <tr>
  210.       <td width="116"><a href="rlzy_plsckq.aspx"><span class="style14">批量删除考勤数据</span></a></td>
  211.       <td width="203"><span class="style14">(总共 <%=il.Count%> 条记录)</span>  </td>
  212.       <td width="107"><a href="javascript:history.go(-1)"><img alt="" src="../images/images_wc/back.gif" width="37" height="45" border="0" /></a></td>
  213.     </tr>
  214.   </table>
  215.   <br />
  216.   <br />
  217. <table border="0" width="50%" align="center">
  218.   
  219. </table>
  220. <br />
  221. <p>&nbsp;</p>
  222. </div>
  223. </body>
  224. </html>