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

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 COM.OA.BLL;
  12. using COM.OA.Entity;
  13. using System.Collections.Generic;
  14. public partial class linminchao_xw_lookNews : System.Web.UI.Page
  15. {
  16.     protected void Page_Load(object sender, EventArgs e)
  17.     {
  18.         users loginuser = Session["loginuser"] as users;
  19.         if (loginuser == null)
  20.         {
  21.             this.Response.Write(string.Format(GetRedirect.ALLREDIRECT, "../../login.aspx"));
  22.         }
  23.         else
  24.         {
  25.             IList<news> newsList;
  26.             List<department> deptlist;
  27.             if (this.Request.QueryString["t"] != null)
  28.             {
  29.                 int n_state = 1;
  30.                 int bumen = Int32.Parse(this.Request.QueryString["t"].ToString());
  31.                 String where = "n_dept_id='{0}' and n_state='{1}'";
  32.                 where = string.Format(where, bumen, n_state);
  33.                 newsList = newsBLL.Select(where);
  34.             }
  35.             else
  36.             {
  37.                 int n_state = 1;
  38.                 String where = "n_state='{0}'";
  39.                 where = string.Format(where, n_state);
  40.                 newsList = newsBLL.Select(where);
  41.             }
  42.             this.Response.Write("<div align='center'>");
  43.             this.Response.Write("<table width='100%' border='0' cellspacing='0' cellpadding='0'><tr><td><form name='form1' method='post' action='' onSubmit='return dis()'><table width='96%' border='0' cellspacing='0' cellpadding='0'><tr><td width='32%' valign='middle'>&nbsp;</td><td width='47%' valign='middle'><div align='right'><div align='right'><input name='q' type='text' id='q'><input name='submit' type=submit id='submit' style='FONT-SIZE: 12px; HEIGHT: 24px' value=' 查 询 '></div><td width='4%'><div align='right'><img src='../img/txl/16.gif' width='16' height='16'/></div></td><td width='7%'><a href='xw_addNews.aspx'>发布新闻</a></td><td width='2%'><img src='../img/txl/12.gif' width='16' height='16'></td><td width='8%'><a href='xw_glNews.aspx'>新闻管理</a></td></tr></table></form></td></tr></table>");
  44.             this.Response.Write("<table width='98.8%' border='0' cellpadding='3' cellspacing='1'>");
  45.             this.Response.Write("<tr><td><div class='RoundedCorner'><div align='center'><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></div></td></tr>");
  46.             this.Response.Write("</table>");
  47.             this.Response.Write("</div>");
  48.             IList<department> depts = departmentBLL.Select();
  49.             deptlist = (List<department>)depts;
  50.             deptlist.Reverse();
  51.             this.Response.Write("<div align='center'>");
  52.             this.Response.Write("<table width='98%' border='0' cellpadding='3' cellspacing='1' bgcolor='#5AAE18'>");
  53.             this.Response.Write("<tr bgcolor='#FFFFFF'><td colspan='4'>");
  54.             foreach (department dept in deptlist)
  55.             {
  56.                 this.Response.Write("&nbsp;&nbsp;&nbsp;&nbsp;<a href='xw_lookNews.aspx?t=" + dept.dept_id + "'>" + dept.dept_department + "</a>");
  57.             }
  58.             this.Response.Write("</td></tr>");
  59.             if (newsList.Count != 0)
  60.             {
  61.                 this.Response.Write("<tr bgcolor='#FFFFFF'><td><strong>标 题</strong> </td><td width='8%'><div align='center'><strong>发布人</strong></div></td><td width='8%'><div align='center'><strong>部 门</strong></div></td><td width='20%'><div align='center'><strong>时 间</strong></div></td></tr>");
  62.                 foreach (news d in newsList)
  63.                 {
  64.                     users u = usersBLL.Select(d.n_u_id);
  65.                     department dept = departmentBLL.Select(d.n_dept_id);
  66.                     this.Response.Write("<tr bgcolor='#FFFFFF'><td>&nbsp;&nbsp;&nbsp;&nbsp;<a href='xw_lookOneNews.aspx?newsid=" + d.n_id + "'>" + d.n_title + "</a><font color='#999999'>" + d.n_releasetime + "</font>" + "</td><td width='8%'>" + u.u_username + "</td><td width='8%'>" + dept.dept_department + "</td><td width='20%'>" + d.n_releasetime + "</td>");
  67.                 }
  68.             }
  69.             else
  70.             {
  71.                 this.Response.Write("<tr><td colspan='3' align='left'><span class='style1'>对不起,没有你要查找的数据!!</span></td></tr>");
  72.             }
  73.             this.Response.Write("</table><br><img src='../img/up.gif' width='17' height='12'><a href='javascript:history.go(-1)'>返 回 </a>");
  74.             this.Response.Write("</div>");
  75.         }
  76.     }
  77. }