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

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_allFY : 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.             if (this.Request["t"] != null)
  26.             {
  27.                 string page = this.Request["page"];
  28.                 String where = "bbs_dept_id='{0}'";
  29.                 where = string.Format(where, Int32.Parse(this.Request["t"]));
  30.                 IList<bbs> ilist = bbsBLL.Select(where);
  31.                 int count = ilist.Count;
  32.                 float countd = count;
  33.                 double weiy = Math.Ceiling(countd / 2);
  34.                 int weiye = Int32.Parse(weiy.ToString());
  35.                 int pages = 1;
  36.                 int shangpage = 1;
  37.                 int xiapage = 1;
  38.                 IList<bbs> bbsIlist;
  39.                 if (page == null)
  40.                 {
  41.                     bbsIlist = bbsBLL.Select(2, 1, where); ;
  42.                     shangpage = 1;
  43.                     xiapage = 2;
  44.                 }
  45.                 else
  46.                 {
  47.                     pages = Int32.Parse(page);
  48.                     shangpage = pages - 1;
  49.                     xiapage = pages + 1;
  50.                     bbsIlist = bbsBLL.Select(2, pages, where); ;
  51.                 }
  52.                 List<department> deptlist;
  53.                 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>");
  54.                 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>");
  55.                 IList<department> depts = departmentBLL.Select();
  56.                 deptlist = (List<department>)depts;
  57.                 deptlist.Reverse();
  58.                 foreach (department dept in deptlist)//部门查询
  59.                 {
  60.                     this.Response.Write("&nbsp;&nbsp;&nbsp;&nbsp;<a href='lt_lookbbs.aspx?t=" + dept.dept_id + "'>" + dept.dept_department + "</a>");
  61.                 }
  62.                 this.Response.Write("&nbsp; &nbsp; </td></tr></table></td></tr>");
  63.                 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>");
  64.                 foreach (bbs bb in bbsIlist)
  65.                 {
  66.                     int u_id = Int32.Parse(bb.bbs_author);
  67.                     users uu = usersBLL.Select(u_id);
  68.                     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>");
  69.                 }
  70.                 this.Response.Write("<tr bgcolor='#FFFFFF' ><td></td><td colspan='1' style='width: 175px; height: 21px; text-align: left;' colspan='2'><div  align='center'>");
  71.                 if (pages == 1)
  72.                 {
  73.                     this.Response.Write("<a href='lt_allFY.aspx?page=1&t=" + this.Request["t"] + "'>首页</a>");
  74.                 }
  75.                 else
  76.                 {
  77.                     this.Response.Write("<a href='lt_allFY.aspx?page=" + shangpage + "&t=" + this.Request["t"] + "'>上一页</a>");
  78.                 }
  79.                 if (pages == weiye)
  80.                 {
  81.                     this.Response.Write("&nbsp; &nbsp; &nbsp; <a href='lt_allFY.aspx?page=" + weiye + "&t=" + this.Request["t"] + "'>尾页</a>");
  82.                 }
  83.                 else
  84.                 {
  85.                     this.Response.Write("&nbsp; &nbsp; &nbsp; <a href='lt_allFY.aspx?page=" + xiapage + "&t=" + this.Request["t"] + "'>下一页</a>");
  86.                 }
  87.                 this.Response.Write("</div><td></td><td></td><td></td><td></td></tr></table></td></tr></table>");
  88.                 int tiao = ilist.Count;
  89.                 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>");
  90.             }
  91.         }
  92.     }
  93. }