lt_lookbbs.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 COM.OA.Entity;
  12. using System.Collections.Generic;
  13. using COM.OA.BLL;
  14. public partial class linminchao_bbs_lt_lookbbs : 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.             string page = this.Request["page"];
  26.             string where = "1=1";
  27.             IList<bbs> ilist = bbsBLL.Select(where);
  28.             int count = ilist.Count;
  29.             float countd = count;
  30.             double weiy = Math.Ceiling(countd / 2);
  31.             int weiye = Int32.Parse(weiy.ToString());//总页数
  32.             int pages = 1;
  33.             int shangpage = 1;
  34.             int xiapage = 1;
  35.             IList<bbs> bbsIlist;
  36.             if (page == null)
  37.             {
  38.                 bbsIlist = bbsBLL.Select(2, 1, where);
  39.                 shangpage = 1;
  40.                 xiapage = 2;
  41.             }
  42.             else
  43.             {
  44.                 pages = Int32.Parse(page);
  45.                 shangpage = pages - 1;
  46.                 xiapage = pages + 1;
  47.                 bbsIlist = bbsBLL.Select(2, pages, where);
  48.             }
  49.             List<department> deptlist;
  50.             this.Response.Write("<div align='center'><table width='100%' height='1' border='0'' cellpadding='0' cellspacing='0'><tr><td colspan='2'></td></tr><tr><td width='15'>&nbsp;</td><td width='627' height='21' valign='baseline'><div align='right'><form name='form1' method='post' action='' onsubmit='return dis()'><input name='q' type='text' id='q' value=''><input name='submit' type=submit id='submit' style='FONT-SIZE: 12px; HEIGHT: 27px'  value= ' 查 询 ' ></form></div></td><td width='114' valign='baseline'><div align='center'><a href=''></a><img src='../img/txl/touxiangman.gif' width='19' height='21'><a href='lt_touxiang.aspx'>上传头像</a></div></td><td width='84' valign='baseline'><div align='center'><img src='../img/face1.gif' width='16' height='14'>&nbsp;<a href='lt_addlt.aspx'>发表帖子</a></div></td><td width='123' valign='baseline'><div align='center'><a href='lt_addlt.aspx'><img src='../img/new.gif' width='113' height='23' border='0'></a></div></td><td width='9'>&nbsp;</td></tr><tr><td colspan='6'></td></tr></table></div><div align='center'><div class='RoundedCorner'> <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><table width='760' border='0' cellpadding='0' cellspacing='0'></table>");
  51.             this.Response.Write("<table width='100%' border='0' cellpadding='0' cellspacing='0' bgcolor=''><tr><td bgcolor='#FFFFFF'><p></p><table width='100%' border='0' cellpadding='5' cellspacing='1' bgcolor='#5AAE18'><tr bgcolor='#FFFFFF'></tr><tr bgcolor='#FFFFFF'> <td colspan='6'><table width='100%' border='0' cellpadding='3' cellspacing='0'><tr><td>");
  52.             IList<department> depts = departmentBLL.Select();
  53.             deptlist = (List<department>)depts;
  54.             deptlist.Reverse();
  55.             foreach (department dept in deptlist)//部门查询
  56.             {
  57.                 this.Response.Write("&nbsp;&nbsp;&nbsp;&nbsp;<a href='lt_allFY.aspx?t=" + dept.dept_id + "'>" + dept.dept_department + "</a>");
  58.             }
  59.             this.Response.Write("&nbsp; &nbsp; </td></tr></table></td></tr>");
  60.             this.Response.Write("<tr bgcolor='#FFFFFF'><td width='20'><img src='../img/folder.gif' width='25' height='23'></td><td width='563'><strong>主 题</strong></td><td width='68'><div align='center'><p><strong>作</strong><strong> 者</strong></p></div></td><td width='48'><div align='center'><strong>回 复</strong></div></td><td width='48'><div align='center'><strong> 查 看</strong></div></td><td width='166'><div align='center'><strong>时 间</strong></div></td></tr>");
  61.             foreach (bbs bb in bbsIlist)
  62.             {
  63.                 int u_id = Int32.Parse(bb.bbs_author);
  64.                 users uu = usersBLL.Select(u_id);
  65.                 this.Response.Write("<tr bgcolor='#FFFFFF' ><td width='20' ><img src='../img/folder.gif' width='25' height='23'></td><td></a><a href='lt_lookOne.aspx?bbs_id=" + bb.bbs_id + "'><font color='blue'>" + bb.bbs_title + "</a></td><td><div align='center'>" + uu.u_username + "</div></td><td><div align='center'>" + bb.bbs_reverts + "</div></td><td><div align='center'>" + bb.bbs_reads + "</div></td><td><div align='center'><font color='#FF0000'>" + bb.bbs_releasetime + "</font></div></td></tr>");
  66.             }
  67.             this.Response.Write("<tr bgcolor='#FFFFFF' ><td></td><td colspan='1' style='width: 175px; height: 21px; text-align: left;' colspan='2'><div  align='center'>");
  68.             if (shangpage == pages || shangpage == 0)
  69.             {
  70.                 this.Response.Write("首页");
  71.             }
  72.             else
  73.             {
  74.                 this.Response.Write("<a href='lt_lookbbs.aspx?page=" + shangpage + "'>上一页</a>");
  75.             }
  76.             if (pages == weiye || weiye == 0 || weiye == 1)
  77.             {
  78.                 this.Response.Write("&nbsp; &nbsp; &nbsp;尾页");
  79.             }
  80.             else
  81.             {
  82.                 this.Response.Write("&nbsp; &nbsp; &nbsp; <a href='lt_lookbbs.aspx?page=" + xiapage + "'>下一页</a>");
  83.             }
  84.             this.Response.Write("</div><td></td><td></td><td></td><td></td></tr></table></td></tr></table>");
  85.             int tiao = ilist.Count;
  86.             this.Response.Write("<p>&nbsp; (总共" + tiao + "条帖子)<br><br><span class='style8'><img src='../img/up.gif' width='17' height='12'><a href='javascript:history.go(-1)'>返 回</a></span>  </p><table border='0' width='31%' align='center'><tr><td width='23%' align='center'></td><td width='31%' align='center'></td> <td width='23%' align='center'></td><td width='23%' align='center'></td></tr></table></div>");
  87.         }
  88.     }
  89. }