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

OA系统

开发平台:

C#

  1. <%@ Page Language="C#" AutoEventWireup="true" CodeFile="rlzy_plsckq.aspx.cs" Inherits="wc_rlzy_rlzy_plsckq" %>
  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. <script type="text/javascript" language="javascript">
  25.   function check()//表单判断
  26.   {
  27.    var str="";
  28.    var j=0;
  29.    var el=document.form1.getElementsByTagName("input")
  30.    for(i=0;i<el.length;i++){
  31.     if(el[i].type=="checkbox"){
  32.      if((el[i].checked)&&(el[i].name.indexOf("deletecheck")!='-1')){
  33.       j++;
  34.      }
  35.     }
  36.    }
  37.    if(j > 10000 || j<1)
  38.    {
  39.     alert("最少必须选择一项,最多不能超过100项!rt你现在选择了"+j+"项");
  40.     return false;
  41.    }
  42.    
  43.      if(!confirm('您确定要删除该记录吗?'))
  44.  {
  45. return false
  46. else 
  47. document.form1.submit
  48. }
  49. function CheckAll(form)
  50. {
  51.     for (var i=0;i<form.elements.length;i++){
  52.         var e = form.elements[i];
  53.         if (e.name != 'chkAll')
  54.         {
  55.             e.checked = form.chkAll.checked;
  56.         }
  57.          
  58.       }
  59. </script>
  60. </head>
  61. <body>
  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. <form id="Form1" name="form1" method="post" onsubmit="return check();" action="rlzy_kqsc.aspx">
  68. <div align="center">
  69.   <table width="100%" border="0" cellpadding="0" cellspacing="0">
  70.     <tr>
  71.       <td width="6" height="21"><img alt="" src="../images/images_wc/leftlin.gif"width="6" height="21" /></td>
  72.       <td width="936" bgcolor="#5AAE18"><div align="center"><span class="style1">删  除 考 勤 记 录</span></div></td>
  73.       <td width="6" height="21"><img alt="" src="../images/images_wc/rightlin.gif" width="6" height="21" /></td>
  74.     </tr>
  75.   </table>
  76.   <div class="style14">
  77.   <table width="100%"  border="0" cellpadding="2" cellspacing="1" bgcolor="#5EAE19"> 
  78.     <tr bgcolor="#FFFFFF">
  79.       <td width="17%"><div align="center"><strong>
  80.       <input  type="submit" name="Submit" value="删除" />
  81.       </strong>&nbsp;</div></td>
  82.       <td width="11%"><div align="center" class="style5">日 期</div></td>
  83.       <td width="10%"><div align="center"><strong>星 期</strong></div></td>
  84.       <td width="25%"><div align="center"><strong> 时 间</strong></div></td>
  85.       <td width="11%"><div align="center"><strong>姓 名</strong></div></td>
  86.       <td width="19%"><div align="center"><strong>部 门</strong></div></td>
  87.     </tr>
  88.     
  89.        <% 
  90.                 string page=this.Request["page"];
  91.                 
  92.                 System.Collections.Generic.IList<COM.OA.Entity.attendance> il;
  93.                 string where = "1=1";
  94.                 il = COM.OA.BLL.attendanceBLL.Select(where);
  95.                 int count = il.Count;
  96.                 float countd=count;
  97.                 double weiy = Math.Ceiling(countd/10);
  98.                 int weiye = Int32.Parse(weiy.ToString());
  99.                 int pages=1;
  100.                 int shangpage=0;
  101.                 int xiapage=0;
  102.                 if (page == null)
  103.                 {
  104.                     
  105.                     il = COM.OA.BLL.attendanceBLL.Select(10, 1, where);
  106.                     shangpage = 1;
  107.                     xiapage = 2;
  108.                 }
  109.                 else
  110.                 {
  111.                     pages = Int32.Parse(page);
  112.                     shangpage=pages - 1;
  113.                     xiapage = pages + 1;
  114.                     il = COM.OA.BLL.attendanceBLL.Select(10, pages, where);
  115.                 }
  116.                 if (il.Count != 0)
  117.                 {
  118.                     foreach (COM.OA.Entity.attendance l in il)
  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 = "星期一"; 
  126.                    break;
  127.                case "Tuesday": weekstr = "星期二"; 
  128.                    break;
  129.                case "Wednesday": weekstr = "星期三"; 
  130.                    break;
  131.                case "Thursday": weekstr = "星期四";
  132.                    break;
  133.                case "Friday": weekstr = "星期五"; 
  134.                    break;
  135.                case "Saturday": weekstr = "星期六";
  136.                    break;
  137.                case "Sunday": weekstr = "星期日";                                     break;
  138.            }
  139.            //上午时间 判断
  140.            string swshijian = l.att_forenoontime.ToString("HH:mm:ss");//取时间部分 HH24小时 hh12小时
  141.            DateTime shangwu = DateTime.Parse(swshijian);
  142.            DateTime chidao = DateTime.Parse(8 + ":" +30 + ":" + 0 + 0);
  143.            string sss = "";
  144.            if (swshijian.Equals("00:00:00"))
  145.            {
  146.                sss = "上午未考勤";
  147.            }
  148.            else if (shangwu > chidao)
  149.            {
  150.                sss = "上午迟到";
  151.            }
  152.            else
  153.            {
  154.                sss = shangwu.ToString("HH:mm:ss");
  155.            }
  156.            //下午时间判断
  157.            string xwshijian =l.att_afternoontime.ToString("HH:mm:ss");
  158.            DateTime xiawu = DateTime.Parse(xwshijian);
  159.            DateTime chidao1 = DateTime.Parse(17 + ":" +30 + ":" + 0 + 0);
  160.            string xxx = "";
  161.            if(xwshijian.Equals("00:00:00"))
  162.            {
  163.                xxx = "下午未考勤";
  164.            }
  165.            else if (xiawu > chidao1)
  166.            {
  167.                xxx = "下午迟到";
  168.            }
  169.            else 
  170.            {
  171.                xxx = xiawu.ToString("HH:mm:ss");
  172.            }
  173.            
  174.            //用户名
  175.            int userid = l.att_u_id;
  176.            string whereuser = "u_id=" + userid;
  177.            
  178.             System.Collections.Generic.IList<COM.OA.Entity.users> 
  179.             ilist = COM.OA.BLL.usersBLL.Select(whereuser);
  180.            string username = "";
  181.            foreach (COM.OA.Entity.users user in ilist)
  182.            {
  183.                username = user.u_username;
  184.            }
  185.            //部门
  186.            int bumen = l.att_dept_id;
  187.            string w = "dept_id=" + bumen;                      System.Collections.Generic.IList<COM.OA.Entity.department> i = COM.OA.BLL.departmentBLL.Select(w);
  188.            string dept = "";
  189.            foreach (COM.OA.Entity.department d in i)
  190.            {
  191.                dept = d.dept_department;
  192.            } 
  193.        %>
  194.        <tr bgcolor="#FFFFFF" onmousedown= "this.style.backgroundColor = '#EEEEEE'">
  195.        <td width="17%" height="28"><div align="center">
  196.           <input type="checkbox" name="deletecheck" value="<%=l.att_id %>" />
  197.        </div></td>
  198.       <td width="11%" height="28"><div align="center"><%=t %></div></td>
  199.       <td width="10%" height="28"><div align="center"><%=weekstr %></div></td>
  200.       <td width="25%"><div align="center" class="style14">
  201.         <div align="left">          
  202.           <table width="100%" border="0" cellpadding="0" cellspacing="0">
  203.             <tr>
  204.               <td width="49%"><div align="center"><span class="style2"><%=sss %></span></div></td>
  205.         
  206.               <td width="1%"><div align="center"><span class="style13">|</span></div></td>
  207.               <td width="50%"><div align="center"><span class="style2"><%=xxx %></span></div></td>
  208.             </tr>
  209.           </table></div>
  210.           </div>
  211.        </td>
  212.       <td width="11%" height="28"><div align="center"><%=username %></div></td>
  213.       <td width="19%" height="28"><div align="center"><%=dept %></div></td> 
  214.     </tr>
  215.     <%} %>
  216.     <tr bgcolor="#FFFFFF">
  217.        <td width="17%" height="28">
  218.              <input name="chkAll" type="checkbox" onclick="CheckAll(this.form)" /></td>
  219.        <td width="17%" height="28">全选</td>  
  220.        <td width="14%" height="28"></td>
  221.        <td width="17%" height="28"></td>  
  222.        <td width="17%" height="28"></td> 
  223.        <td width="17%" height="28"></td>
  224.     </tr>
  225.   <%} %> 
  226.   </table></div>
  227.   <br />
  228.   <table width="726" border="0" cellpadding="0" cellspacing="0">
  229.     <tr>
  230.       <td width="203"><span class="style14">(总共 <%=il.Count%> 条记录)</span>  </td>
  231.       <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>
  232.     </tr>
  233.   </table>
  234.   <br />
  235.   <br />
  236. <table border="0" width="50%" align="center">
  237.   
  238. </table>
  239. <br />
  240. <p>&nbsp;</p>
  241. </div>
  242. </form>
  243. </body>
  244. </html>