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

OA系统

开发平台:

C#

  1. using System;
  2. using System.Data;
  3. using System.Configuration;
  4. using System.Collections;
  5. using System.Web;
  6. using System.Web.Security;
  7. using System.Web.UI;
  8. using System.Web.UI.WebControls;
  9. using System.Web.UI.WebControls.WebParts;
  10. using System.Web.UI.HtmlControls;
  11. using System.Collections.Generic;
  12. using COM.OA.BLL;
  13. using COM.OA.Entity;
  14. public partial class rc_jh_employeeplan : System.Web.UI.Page
  15. {
  16.     protected void Page_Load(object sender, EventArgs e)
  17.     {
  18.         this.Response.Write("<table width='100%' border='0' cellpadding='0' cellspacing='0'><tr><td width='6' height='21'><img src='../images/sj/leftlin1.gif' width='6' height='21'></td><td width='936' bgcolor='#5AAE18'><div align='center'><div align='center' class='style1'><span class='style3 style2 style1 style16'><strong>部 门 计 划 </strong></span></div><span class='style1'></span></div></td><td width='6' height='21'><img src='../images/sj/rightlin1.gif' width='6' height='21'></td></tr></table>");
  19.         //取出所有部门
  20.         IList<department> deptList = departmentBLL.Select();
  21.         if (deptList.Count != 0)
  22.         {
  23.             this.Response.Write("<table width='100%' border='0' cellpadding='2' cellspacing='1' bgcolor='#5AAE18'><tr><td bgcolor='#FFFFFF'>");
  24.             foreach (department d in deptList)
  25.             {
  26.                 this.Response.Write("<a href='jh_deptplan.aspx?dept=" + d.dept_id + "'>" + d.dept_department + "</a>&nbsp;&nbsp;");
  27.             }
  28.             this.Response.Write("</td></tr></table>");
  29.         }
  30.         this.Response.Write("<table width='200' border='0' cellspacing='0' cellpadding='0'><tr><td>&nbsp;</td></tr></table>");
  31.         int to_u_id = 0;
  32.         int deptvalue;
  33.         if (!Page.IsPostBack)
  34.         {
  35.             deptvalue = 1;
  36.         }
  37.         else
  38.         {
  39.             deptvalue = Int32.Parse(this.Request.QueryString["dept"]);
  40.         }
  41.         string sql2 = "u_dept_id='{0}'";
  42.         sql2 = string.Format(sql2, deptvalue);
  43.         IList<users> userList = usersBLL.Select(sql2);
  44.         if (userList.Count != 0)
  45.         {
  46.             foreach (users user in userList)
  47.             {
  48.                 to_u_id = user.u_id;
  49.             }
  50.         }
  51.         string sql = "to_u_id='{0}' and to_state='1'";
  52.         sql = string.Format(sql, to_u_id);
  53.         IList<timeorder> tolist = timeorderBLL.Select(sql,true,false);
  54.         if (tolist.Count != 0)
  55.         {
  56.             this.Response.Write("<table width='100%' border='0' cellpadding='0' cellspacing='0'><tr><td width='6' height='21'><img src='../images/sj/leftlin1.gif' width='6' height='21'></td><td width='936' bgcolor='#5AAE18'><div align='center'><div align='center' class='style1'><span class='style3 style2 style1 style16'><strong>计 划 列 表</strong></span></div><span class='style1'></span></div></td><td width='6' height='21'><img src='../images/sj/rightlin1.gif' width='6' height='21'></td></tr></table>");
  57.             this.Response.Write("<table width='100%' border='0' cellpadding='2' cellspacing='1' bgcolor='#5AAE18'>");
  58.             foreach (timeorder t in tolist)
  59.             {
  60.                 int deptid = t.users.u_dept_id;
  61.                 string dept = "";
  62.                 string sql3 = "dept_id='{0}'";
  63.                 sql3 = string.Format(sql3, deptid);
  64.                 IList<department> deptlist = departmentBLL.Select(sql3);
  65.                 if (deptlist.Count == 1)
  66.                 {
  67.                     foreach (department d in deptlist)
  68.                     {
  69.                         dept = d.dept_department;
  70.                     }
  71.                 }
  72.                 string cont = t.to_content;
  73.                 if (cont.Length > 40)
  74.                 {
  75.                     cont = cont.Substring(0, 40) + ".............";
  76.                 }
  77.                 int userid = t.users.u_em_id;
  78.                 string emname="";
  79.                 string sql4 = "em_id='{0}'";
  80.                 sql4 = string.Format(sql4, userid);
  81.                 IList<employee> emlist = employeeBLL.Select(sql4);
  82.                 if (emlist.Count == 1)
  83.                 {
  84.                     foreach (employee empl in emlist)
  85.                     {
  86.                         emname = empl.em_name;
  87.                     }
  88.                 }
  89.                 this.Response.Write("<tr bgcolor='#E9F3D6'><td width='36'><span class='style14 style17'>标 题</span></td>");
  90.                 this.Response.Write("<td><span class='style10'>" + t.to_title + "<span class='style8 style15'><span class='style1 style17'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" + emname + "<span class='style20'><span class='style17'><span class='style15'><strong>&nbsp;&nbsp;<img src='../images/sj/write1.gif' width='13' height='7'> </strong></span></span></span></span></span></span></td></tr>");
  91.                 this.Response.Write("<tr bgcolor='#FFFFFF'><td width='36' valign='top'><span class='style14 style17'>内 容</span></td><td width='718' class='style3' style='word-break:break-all;Width:fixed'>"+cont+"</td></tr>");
  92.                 this.Response.Write("<tr bgcolor='#FFFFFF'><td>&nbsp;</td><td><table width='100%' border='0' cellspacing='0' cellpadding='0'><tr><td width='15%'><span class='style1 style17'><strong><strong><span class='style17'>&nbsp;&nbsp;&nbsp;&nbsp;<img src='../images/sj/write.gif' width='7' height='13'> </span></strong></strong>发送人</span><span class='style14 style17'>:</span><span class='style1 style17'>" + emname + "</span></td><td width='16%'><span class='style1 style17'>部门:" + dept + "</span></td><td width='69%'><span class='style1 style17'><span class='style17'>时间:" + t.to_sendtime + "</span></span></td></tr></table></td></tr>");
  93.             }
  94.            
  95.             this.Response.Write("</table>");
  96.             this.Response.Write("<div align='center'><p class='style17'> (总共" + tolist.Count.ToString() + "条记录)<br><img alt=''  src='../images/sj/up.gif' width='17' height='12'/><a href='javascript:history.go(-1)'>返回</a></p></div>");
  97.         }       
  98.     }
  99. }