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

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.Web.UI.MobileControls;
  14. using System.Collections.Generic;
  15. public partial class linminchao_bbs_lt_lookOne : System.Web.UI.Page
  16. {
  17.     protected void Page_Load(object sender, EventArgs e)
  18.     {
  19.         users loginuser = Session["loginuser"] as users;
  20.         if (loginuser == null)
  21.         {
  22.             this.Response.Write(string.Format(GetRedirect.ALLREDIRECT, "../../login.aspx"));
  23.         }
  24.         else
  25.         {
  26.             IList<bbsrevert> brIlist;
  27.             string page = this.Request["page"];
  28.             int id = Int32.Parse(this.Request.QueryString["bbs_id"]);//帖子编号
  29.             string where = "br_bbs_id='{0}'";
  30.             where = string.Format(where, id);
  31.             IList<bbsrevert> brIlists = bbsrevertBLL.Select(where);
  32.             bbs bb = bbsBLL.Select(id);
  33.             bb.bbs_id = id;
  34.             bb.bbs_reads = bb.bbs_reads + 1;
  35.             bb.bbs_reverts = brIlists.Count;
  36.             bbsBLL.Update(bb);
  37.             //总页数
  38.             int count = brIlists.Count;
  39.             float countd = count;
  40.             double weiy = Math.Ceiling(countd / 2);
  41.             int weiye = Int32.Parse(weiy.ToString());
  42.             int pages = 1;
  43.             int shangpage = 1;
  44.             int xiapage = 1;
  45.             if (page == null)
  46.             {
  47.                 brIlist = bbsrevertBLL.Select(2, 1, where);//
  48.                 shangpage = pages;
  49.                 xiapage = 2;
  50.             }
  51.             else
  52.             {
  53.                 pages = Int32.Parse(page);
  54.                 shangpage = pages - 1;
  55.                 xiapage = pages + 1;
  56.                 brIlist = bbsrevertBLL.Select(2, pages, where);
  57.             }
  58.             //作者查询
  59.             users user = usersBLL.Select(Int32.Parse(bb.bbs_author));
  60.             //部门查询
  61.             department depm = departmentBLL.Select(user.u_dept_id);
  62.             //档案查询
  63.             employee em = employeeBLL.Select(user.u_em_id);
  64.             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='410' height='21' valign='baseline'><div align='right'><form action='' method='post' name='form11' id='form11' onsubmit='return dis1()'><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='89' valign='baseline'><div align='center'><a href='lt_lookbbs.aspx'>论坛首页</a></div></td><td width='137' valign='top'><div align='center'><a href='lt_addlt.aspx'><img src='../img/new.gif' width='113' height='23' border='0'></a></div></td><td width='132' valign='top'><div align='center'><a href='lt_addHF.aspx?zhuti=" + bb.bbs_title + "&bbs_id=" + bb.bbs_id + "'><img src='../img/hui.gif' width='113' height='23' border='0'></a></div></td></tr><tr><td colspan='5'></td></tr></table></div>");
  65.             this.Response.Write("<div align='center'><div align='center'><table width='760' border='0' cellpadding='0' cellspacing='0' background='../img/bw/line.gif'></table><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='100%' border='0' cellpadding='5' cellspacing='1' bgcolor='#5AAE18'><tr bgcolor='#FFFFFF'><td height='21' align='center' valign='top' bgcolor='#FFFFFF'>&nbsp;</td><td width='834' valign='top' bgcolor='#FFFFFF'><table width='99%' border='0' cellspacing='0' cellpadding='0'><tr><td width='528'><span class='style4'>主题:<span style='font-weight: bold'>" + bb.bbs_title + "</span></span></td><td width='277'><a href='#' title='IP:192.168.1.106'><img src='../img/bbs_ip.gif' width='13' height='15' border='0'></a> 更新:<font color='#FF0000'>2008-7-6 11:11:37</font></td></tr></table></td></tr>");
  66.             this.Response.Write("<tr bgcolor='#FFFFFF' style='word-break:break-all;Width:fixed'><td width='116' height='160' align='center' valign='top'><br><img src='../" + em.em_photo + " ' width='100' height='120' border='0'></a><br><a href='#' title='" + depm .dept_department+ "'>"+user.u_username+"<br><p></p></td><td valign='top'><p>" + bb.bbs_content + "</p><p align='right'><br><br><br><br></p> <table width='100%' border='0' cellpadding='0' cellspacing='0' bgcolor='#FFFFFF'><tr><td><img src='../img/sigline.gif' width='406' height='16'></td></tr></table><p align='right'> <span class='style9'>2008-7-6 11:10:39</span>  <br><br>");
  67.             //管理员权限
  68.             string wheres = "op_u_id='{0}'";
  69.             wheres = string.Format(wheres, loginuser.u_id);
  70.             //帖子回复查询
  71.             IList<operate> oplist = operateBLL.Select(wheres);
  72.             foreach(operate o in oplist){
  73.                 if (o.op_pop_id > 2)
  74.                 {
  75.                     this.Response.Write("<img src='../img/update.gif' width='12' height='13'/><A HREF='lt_update.aspx?id=" + bb.bbs_id + "')'>修改本帖</A>");
  76.                     this.Response.Write("<img src='../img/del.gif' width='12' height='13'/><A HREF='lt_delelt.aspx?id=" + bb.bbs_id + "')'>删除本帖</A>");
  77.                 }
  78.             }
  79.             this.Response.Write("</td></tr>");
  80.             int lll = pages * 2 - 1;
  81.             foreach (bbsrevert br in brIlist)
  82.             {
  83.                 users u = usersBLL.Select(br.br_u_id);
  84.                 this.Response.Write("<tr bgcolor='#FFFFFF' style='word-break:break-all;Width:fixed'><td width='116' height='160' align='center' valign='top'><br><img src='../"+em.em_photo+"' width='100' height='120' border='0'><br><a href='#' title='"+depm.dept_department+"'>"+u.u_username+"</a><br>第<font color='red'><strong>" + lll + "</strong></font>楼<br> <p></p></td>");
  85.                 this.Response.Write("</td><td valign='top'><p>" + br.br_revertcontent + "</p><p align='right'><br><br><br><br></p> <table width='100%' border='0' cellpadding='0' cellspacing='0' bgcolor='#FFFFFF'><tr><td><img src='../img/sigline.gif' width='406' height='16'></td></tr></table><p align='right'> <span class='style9'>" + br.br_reverttime + "</span>");
  86.                 //权限 管理员 本人
  87.                 foreach (operate o in oplist)
  88.                 {
  89.                     if (o.op_pop_id > 2 )
  90.                     {
  91.                         this.Response.Write("<p align='right'> <br><br><img src='../img/update.gif' width='16' height='16'> <a href='lt_updateHF.aspx?id=" + br.br_id + "&bbs_id=" + id + "&bt=" + bb.bbs_title + "' title='更新本帖..'>修改</a>");
  92.                     }
  93.                 }
  94.                 //权限 管理员
  95.                 foreach (operate o in oplist)
  96.                 {
  97.                     if (o.op_pop_id > 2)
  98.                     {
  99.                         this.Response.Write(" <img src='../img/del.gif' width='12' height='13'><a href='lt_delmyhuifu.aspx?id=" + br.br_id + "&bbs_id=" + id + "' onClick='return confirm('您确定要删除帖子吗?')' title='删除本帖..'>删除</a></p> </td></tr>");
  100.                     }
  101.                 }
  102.                 lll = lll + 1;
  103.             }
  104.             this.Response.Write("<tr bgcolor='#FFFFFF' ><td></td><td colspan='1' style='width: 175px; height: 21px; text-align: left;' colspan='2'><div  align='center'>");
  105.             //分页
  106.             if (shangpage == pages || shangpage == 0)
  107.             {
  108.                 this.Response.Write("首页");
  109.             }
  110.             else
  111.             {
  112.                 this.Response.Write("<a href='lt_lookOne.aspx?bbs_id=" + id + "&page=" + shangpage + "'>上一页</a>");
  113.             }
  114.             if (pages == weiye || weiye == 0 || weiye == 1)
  115.             {
  116.                 this.Response.Write("&nbsp; &nbsp; &nbsp; 尾页");
  117.             }
  118.             else
  119.             {
  120.                 this.Response.Write("&nbsp; &nbsp; &nbsp; <a href='lt_lookOne.aspx?bbs_id=" + id + "&page=" + xiapage + "'>下一页</a>");
  121.             }
  122.             this.Response.Write("<p>&nbsp; (总共" + count + "条帖子)</p></div></td></tr>");
  123.             //作者是当前登陆拥护u_id
  124.             this.Response.Write("</table><table width='100%' border='0' cellpadding='0' cellspacing='0'><tr><td><form name='form1 runat='server' method='post' action='lt_kuaisu.aspx?bbs_id=" + bb.bbs_id + "' onSubmit='return dis()'><table width='100%' border='0' cellpadding='0' cellspacing='1' bgcolor='#5AAE18'><tr bgcolor='#FFFFFF'><td width='165' valign='top'><div align='right'><br><span class='style9'>快速回复:</span></div></td><td width='804'><table width='100' border='0' cellpadding='0' cellspacing='0'><tr><td>&nbsp;</td><td>&nbsp;</td><td><textarea name='content' cols='70' rows='8' id='content'></textarea></td></tr></table><br><input  runat='server' name='submit' type='submit' id='submit' name='submita' style='FONT-SIZE: 12px; HEIGHT: 27px' onclick='return check()'  value= ' 回 帖 '/><br><br></td></tr></table></form></td></tr></table>");
  125.             this.Response.Write("<span class='style8'><img src='../img/up.gif' width='17' height='12'><a href='javascript:history.go(-1)'>返 回</a></span></div>");
  126.         }
  127.     }
  128. }