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

OA系统

开发平台:

C#

  1.     <%@ Page Language="C#" AutoEventWireup="true" CodeFile="jieshouxinxi.aspx.cs" Inherits="jieshouxinxi" %>
  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 runat="server">
  5.         <title>接收消息</title>
  6.         <script type="text/javascript" language="javascript">
  7.                 function CheckAll(form){
  8.                     for (var i=0;i<form.elements.length;i++){
  9.                     var e = form.elements[i];
  10.                     if (e.name != 'chkAll')
  11.                     e.checked = form.chkAll.checked;
  12.                 }
  13.         }
  14.         </script>
  15.     <script type="text/javascript" language="javascript">
  16.       function check()//表单判断
  17.       {
  18.        var str="";
  19.        var j=0;
  20.        var el=document.form1.getElementsByTagName("input")
  21.        for(i=0;i<el.length;i++){
  22.         if(el[i].type=="checkbox"){
  23.          if((el[i].checked)&&(el[i].name.indexOf("deletecheck")!='-1')){
  24.           j++;
  25.          }
  26.         }
  27.        }
  28.        if(j > 10000 || j<1)
  29.        {
  30.         alert("最少必须选择一项,最多不能超过100项!rt你现在选择了"+j+"项");
  31.         return false;
  32.        }
  33.        
  34.          if(!confirm('您确定要删除该记录吗?'))
  35.      {
  36.     return false
  37.     } 
  38.     else 
  39.     document.form1.submit
  40.     }
  41.       
  42.       </script>
  43.         <style type="text/css"> 
  44.     div.RoundedCorner{background: #5AAE18} 
  45.     b.rtop, b.rbottom{display:block;background: #FFF} 
  46.     b.rtop b, b.rbottom b{display:block;height: 1px;overflow: hidden; background: #5AAE18} 
  47.     b.r1{margin: 0 4px} 
  48.     b.r2{margin: 0 3px} 
  49.     b.r3{margin: 0 2px} 
  50.     b.rtop b.r4, {margin: 0 1px;height: 1px}
  51.     .style1 {
  52.     font-size: 13px;
  53.     color: #FFFFFF;
  54.     font-weight: bold;
  55.     } 
  56.     </style>
  57.         <link href="../css/textarea.css" rel="stylesheet" type="text/css" />
  58.     <style type="text/css">
  59.     <!--
  60.     body {
  61.     margin-top: 2px;
  62.     }
  63.     -->
  64.     </style>
  65.     </head>
  66.     <body>
  67.         <form name="form1" id="form1" onsubmit="return check();" action="deletejieshoucheck.aspx">
  68.             <table border="0" bgcolor="#5AAE18">
  69.                 <tr bgcolor='#FFFFFF'>
  70.                 <td colspan="6" align="center">
  71.                     <div class="RoundedCorner"> 
  72.     <b class="rtop"><b class="r1"></b><b class="r2"></b><b class="r3"></b><b class="r4"></b></b> <span class="style1">接 收 消 息</span></div></td>
  73.                     
  74.                 </tr>
  75.                 <tr bgcolor='#FFFFFF'>
  76.                     <td style="width: 59px; height: 1px; text-align: center;" align="center">
  77.                         <input  type="submit" name="Submit"  value="删除" />
  78.                         </td>
  79.                     <td style="width: 938px; height: 1px" align="center">
  80.                         标题</td>
  81.                     <td style="width: 103px; height: 1px;" align="center">
  82.                         读否</td>
  83.                      <td style="width: 79px; height: 1px;" align="center">
  84.                          转发</td>
  85.                      <td style="width: 101px; height: 1px;" align="center">
  86.                          接收人</td>
  87.                      <td style="width: 270px; height: 1px;" align="center">
  88.                          时间</td>
  89.                 </tr>
  90.                 <%  
  91.                     //取登陆人信息 
  92.                     COM.OA.Entity.users loginuser =Session["loginuser"] as COM.OA.Entity.users;
  93.                     //如果取不到跳转到登陆页
  94.                     if (loginuser == null)
  95.                     {
  96.                         this.Response.Write(string.Format(GetRedirect.ALLREDIRECT, "../login.aspx"));
  97.                     }
  98.                     else
  99.                     {
  100.                         //取登陆人ID
  101.                         int LoginName = loginuser.u_id;
  102.                         //取当前页
  103.                         string page = this.Request["page"];
  104.                         //声明全局变量
  105.                         System.Collections.Generic.IList<COM.OA.Entity.message> list;
  106.                         //设置where语句
  107.                         string where = " m_u_id='{0}'";
  108.                         where = string.Format(where, LoginName);
  109.                         //查询
  110.                         list = COM.OA.BLL.messageBLL.Select(where);
  111.                         //取数据库相关信息总条数
  112.                         int count = list.Count;
  113.                         //int转换成float类型
  114.                         float countd = count;
  115.                         //调用ceiling方法转换取值并转换成double类型
  116.                         double weiy = Math.Ceiling(countd / 3);
  117.                         //转换成int类型
  118.                         int weiye = Int32.Parse(weiy.ToString());
  119.                         int pages = 1;
  120.                         int shangpage = 0;
  121.                         int xiapage = 0;
  122.                         //判断是否第一次登陆,是就查前3条信息
  123.                         if (page == null)
  124.                         {
  125.                             list = COM.OA.BLL.messageBLL.Select(3, 1, where);
  126.                             shangpage = 1;
  127.                             xiapage = 2;
  128.                         }
  129.                         //不是第一次登陆按页数查询
  130.                         else
  131.                         {
  132.                             pages = Int32.Parse(page);
  133.                             shangpage = pages - 1;
  134.                             xiapage = pages + 1;
  135.                             list = COM.OA.BLL.messageBLL.Select(3, pages, where);
  136.                         }
  137.                         //判断查询出的内容是否为空
  138.                         if (list.Count != 0)
  139.                         {
  140.                             foreach (COM.OA.Entity.message m in list)
  141.                             {
  142.                                 //把ID转换成人名
  143.                                 string where1 = "u_id='{0}'";
  144.                                 where1 = string.Format(where1, m.m_u_id);
  145.                                 System.Collections.Generic.IList<COM.OA.Entity.users> ulist = COM.OA.BLL.usersBLL.Select(where1);
  146.                                 COM.OA.Entity.users u = ulist[0];
  147.                                 int uid = u.u_em_id;
  148.                                 string where2 = "em_id='{0}'";
  149.                                 where2 = string.Format(where2, uid);
  150.                                 System.Collections.Generic.IList<COM.OA.Entity.employee> emlist = COM.OA.BLL.employeeBLL.Select(where2);
  151.                                 COM.OA.Entity.employee em=emlist[0];
  152.                                 
  153.                                 if (m.m_isreturn == 0)
  154.                                 {
  155.                                  %>
  156.                                  <tr bgcolor='#FFFFFF'>
  157.                     <td style="width: 59px; height: 24px;background-color: #ccff99;" align="center" colspan="">
  158.                         <input type="checkbox" name="deletecheck" value="<%=m.m_id %>" /></td>
  159.                     <td style="width: 938px; height: 24px;background-color: #ccff99;" align="center">
  160.                         &nbsp;&nbsp;<a href="chakanjiluneirong.aspx?id=<%=m.m_id %>"><%=m.m_title%></a><img src="../images/wximg/new-028.gif" />
  161.                     <td style="width: 103px; height: 24px;background-color: #ccff99;">
  162.                         &nbsp;&nbsp;否
  163.                     
  164.                     </td>
  165.                      <td style="width: 79px; height: 24px;background-color: #ccff99;">
  166.                       <a href="fasongxiaoxi.aspx?name=<%=LoginName %>&datetime=<%=m.m_releasetime %>">转发</a>
  167.                     </td>
  168.                      <td style="width: 101px; height: 24px;background-color: #ccff99;">
  169.                      <%=em.em_name%>
  170.                     </td>
  171.                      <td style="width: 270px; height: 24px;background-color: #ccff99;">
  172.                      <%=m.m_releasetime%>
  173.                     </td>
  174.                 </tr>
  175.                                  <%
  176.                     }
  177.                     else if (m.m_isreturn == 1)
  178.                     {
  179.                 %>
  180.                 <tr bgcolor='#FFFFFF'>
  181.                     <td style="width: 59px" align="center" colspan="">
  182.                         <input type="checkbox" name="deletecheck" value="<%=m.m_id %>" /></td>
  183.                     <td style="width: 938px" align="center">
  184.                         &nbsp;&nbsp;<a href="chakanjiluneirong.aspx?id=<%=m.m_id %>"><%=m.m_title%></a>
  185.                     <td style="width: 103px">
  186.                         &nbsp;&nbsp;是
  187.                     
  188.                     </td>
  189.                      <td style="width: 79px">
  190.                       <a href="fasongxiaoxi.aspx?name=<%=LoginName %>&datetime=<%=m.m_releasetime %>">转发</a>
  191.                     </td>
  192.                      <td style="width: 101px">
  193.                      <%=em.em_name%>
  194.                     </td>
  195.                      <td style="width: 270px">
  196.                      <%=m.m_releasetime%>
  197.                     </td>
  198.                 </tr>
  199.                 <%
  200.                     }
  201.                 }
  202.                             %>
  203.                             
  204.                                <tr bgcolor='#FFFFFF'>
  205.                     <td colspan="6">
  206.                         <% 
  207.                         if (pages == 1)
  208.                            { %>
  209.                             <a href="jieshouxinxi.aspx?page=1">首页</a>                    
  210.                         
  211.                         <%}
  212.                           else
  213.                           { %>
  214.                         <a href="jieshouxinxi.aspx?page=<%=shangpage %>">上一页</a>
  215.                         <% } %>&nbsp
  216.                          <% if (pages == weiye)
  217.                             {  %> <a href="jieshouxinxi.aspx?page=<%=weiye %>">尾页</a>
  218.                          <% }
  219.                             else
  220.                             {  %> <a href="jieshouxinxi.aspx?page=<%=xiapage %>">下一页</a>
  221.                          <% }%>
  222.                       
  223.                          </td>                
  224.                 </tr>
  225.                             
  226.                             <%
  227.             }
  228.                             %>
  229.             <%   else
  230.             {
  231.               %>
  232.                      <tr bgcolor='#FFFFFF'>
  233.                     
  234.                     <td colspan="6" style="text-align: center">
  235.                         <strong><span style="font-size: 24pt">
  236.                         无接受消息</span></strong></td>
  237.                     
  238.                 </tr>
  239.                 <% } %>       
  240.                 <tr bgcolor='#FFFFFF'>
  241.                     <td style="width: 59px; height: 4px;">
  242.                         <input name="chkAll" type="checkbox" onclick="CheckAll(this.form)" /></td>
  243.                     <td colspan="5">
  244.                         全选</td>
  245.                     
  246.                 </tr>
  247.               
  248.                  <% } %>
  249.                  <tr bgcolor='#FFFFFF'>
  250.                     <td style="width: 59px; height: 4px;"><input  type="submit" name="Submit" value="删除" /></td>
  251.                     <td style="width: 938px; height: 4px">
  252.                         </td>
  253.                     <td style="width: 103px; height: 4px;">
  254.                     </td>
  255.                      <td style="width: 79px; height: 4px;">
  256.                     </td>
  257.                      <td style="width: 101px; height: 4px;">
  258.                     </td>
  259.                      <td style="width: 270px; height: 4px;">
  260.                     </td>
  261.                 </tr>
  262.             </table>            
  263.         </form>     
  264.         
  265.     </body>
  266.     </html>