Display.aspx.cs
上传用户:jdb8708888
上传日期:2013-05-29
资源大小:19971k
文件大小:12k
源码类别:

WEB源码(ASP,PHP,...)

开发平台:

C#

  1. using System;
  2. using System.Collections;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Data.SqlClient;
  6. using System.Drawing;
  7. using System.Web;
  8. using System.Web.SessionState;
  9. using System.Web.UI;
  10. using System.Web.UI.WebControls;
  11. using System.Web.UI.HtmlControls;
  12. using UDS.Components;
  13. namespace UDS.SubModule.UnitiveDocument.BBS
  14. {
  15. /// <summary>
  16. /// Display 的摘要说明。
  17. /// </summary>
  18. public class Display : System.Web.UI.Page
  19. {
  20. private  int itemid;//贴子ID
  21. private  int boardid;//板块id
  22. protected  bool isboardmaster;//是本版斑竹
  23. protected  string username;//用户名
  24. protected System.Web.UI.WebControls.Literal sendtime;
  25. protected System.Web.UI.WebControls.Literal browsetime;
  26. protected System.Web.UI.WebControls.Literal sendman;
  27. protected System.Web.UI.WebControls.Literal replaytimes;
  28. protected System.Web.UI.WebControls.Literal replaytime;
  29. protected System.Web.UI.WebControls.Literal replayer;
  30. protected System.Web.UI.WebControls.Repeater replaylist;
  31. protected System.Web.UI.HtmlControls.HtmlInputButton cmdOK;
  32. protected System.Web.UI.HtmlControls.HtmlTextArea Content;
  33. protected System.Web.UI.HtmlControls.HtmlTableCell itemcontent;
  34. protected System.Web.UI.WebControls.Label lblTitle;
  35. protected System.Web.UI.WebControls.Panel pnlReplayOp;
  36. protected System.Web.UI.HtmlControls.HtmlInputFile hif;
  37. protected System.Web.UI.WebControls.DropDownList ddl_FileType;
  38. protected System.Web.UI.WebControls.Button btn_UpAtt;
  39. protected System.Web.UI.WebControls.CheckBox cbx_DeskTop;
  40. protected System.Web.UI.WebControls.CheckBox cbx_sysBulletin;
  41. protected System.Web.UI.WebControls.CheckBox cbx_boardBulletin;
  42. protected string title = "";
  43. private void Page_Load(object sender, System.EventArgs e)
  44. {
  45. if(!Page.IsPostBack)
  46. {
  47. username = Request.Cookies["Username"].Value;
  48. itemid = (Request.QueryString["ItemID"]==null)?0:Int32.Parse(Request.QueryString["ItemID"].ToString());
  49. boardid = (Request.QueryString["BoardID"]==null)?0:Int32.Parse(Request.QueryString["BoardID"].ToString());
  50. ViewState["username"] = username;
  51. ViewState["itemid"] = itemid;
  52. ViewState["boardid"] = boardid;
  53. ViewState["isboardmaster"] = isboardmaster;
  54. BBSClass bbsclass = new BBSClass();
  55. BBSForumItem bbsforumitem = new BBSForumItem();
  56. bbsforumitem.ItemID = itemid;
  57. SqlDataReader dr = null;
  58. dr = bbsclass.ReadBBSForumItem(bbsforumitem);
  59. //判断是否是斑竹
  60. isboardmaster = bbsclass.IsBoardMaster(boardid,username);
  61. if(isboardmaster)
  62. cbx_boardBulletin.Visible = true;
  63. else
  64. cbx_boardBulletin.Visible = false;
  65. if(Request.Cookies["UDSBBSAdmin"]!=null)
  66. {
  67. if(Request.Cookies["UDSBBSAdmin"].Value=="1")
  68. cbx_sysBulletin.Visible = true;
  69. else
  70. cbx_sysBulletin.Visible = false;
  71. }
  72. else
  73. {
  74. cbx_sysBulletin.Visible = false;
  75. cbx_sysBulletin.Visible = false;
  76. }
  77. while(dr.Read())
  78. {
  79. this.title = lblTitle.Text = dr["title"].ToString();
  80. sendtime.Text = dr["send_time"].ToString();
  81. browsetime.Text = dr["hit_times"].ToString();
  82. replaytimes.Text = dr["replay_times"].ToString();
  83. sendman.Text = dr["sender"].ToString();
  84. //判断是否是系统公告,如果是只有管理员能够操作
  85. if(Boolean.Parse(dr["sysbulletin"].ToString()))
  86. {
  87. if(Request.Cookies["UDSBBSAdmin"]!=null)
  88. {
  89. if(Request.Cookies["UDSBBSAdmin"].Value=="1")
  90. {
  91. itemcontent.InnerHtml += "<b>操