xw_lookNews.aspx.cs
资源名称:OASystem.rar [点击查看]
上传用户:lishan0805
上传日期:2019-12-08
资源大小:12048k
文件大小:5k
源码类别:
OA系统
开发平台:
C#
- using System;
- using System.Data;
- using System.Configuration;
- using System.Collections;
- using System.Web;
- using System.Web.Security;
- using System.Web.UI;
- using System.Web.UI.WebControls;
- using System.Web.UI.WebControls.WebParts;
- using System.Web.UI.HtmlControls;
- using COM.OA.BLL;
- using COM.OA.Entity;
- using System.Collections.Generic;
- public partial class linminchao_xw_lookNews : System.Web.UI.Page
- {
- protected void Page_Load(object sender, EventArgs e)
- {
- users loginuser = Session["loginuser"] as users;
- if (loginuser == null)
- {
- this.Response.Write(string.Format(GetRedirect.ALLREDIRECT, "../../login.aspx"));
- }
- else
- {
- IList<news> newsList;
- List<department> deptlist;
- if (this.Request.QueryString["t"] != null)
- {
- int n_state = 1;
- int bumen = Int32.Parse(this.Request.QueryString["t"].ToString());
- String where = "n_dept_id='{0}' and n_state='{1}'";
- where = string.Format(where, bumen, n_state);
- newsList = newsBLL.Select(where);
- }
- else
- {
- int n_state = 1;
- String where = "n_state='{0}'";
- where = string.Format(where, n_state);
- newsList = newsBLL.Select(where);
- }
- this.Response.Write("<div align='center'>");
- 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'> </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>");
- this.Response.Write("<table width='98.8%' border='0' cellpadding='3' cellspacing='1'>");
- 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>");
- this.Response.Write("</table>");
- this.Response.Write("</div>");
- IList<department> depts = departmentBLL.Select();
- deptlist = (List<department>)depts;
- deptlist.Reverse();
- this.Response.Write("<div align='center'>");
- this.Response.Write("<table width='98%' border='0' cellpadding='3' cellspacing='1' bgcolor='#5AAE18'>");
- this.Response.Write("<tr bgcolor='#FFFFFF'><td colspan='4'>");
- foreach (department dept in deptlist)
- {
- this.Response.Write(" <a href='xw_lookNews.aspx?t=" + dept.dept_id + "'>" + dept.dept_department + "</a>");
- }
- this.Response.Write("</td></tr>");
- if (newsList.Count != 0)
- {
- 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>");
- foreach (news d in newsList)
- {
- users u = usersBLL.Select(d.n_u_id);
- department dept = departmentBLL.Select(d.n_dept_id);
- this.Response.Write("<tr bgcolor='#FFFFFF'><td> <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>");
- }
- }
- else
- {
- this.Response.Write("<tr><td colspan='3' align='left'><span class='style1'>对不起,没有你要查找的数据!!</span></td></tr>");
- }
- this.Response.Write("</table><br><img src='../img/up.gif' width='17' height='12'><a href='javascript:history.go(-1)'>返 回 </a>");
- this.Response.Write("</div>");
- }
- }
- }