forums_main_topic.aspx.cs

来自「ASP.NET的一些开发实例,有论坛管理系统等」· CS 代码 · 共 482 行 · 第 1/2 页

CS
482
字号
using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;

namespace WhiteForum.forums
{
	/// <summary>
	/// forums_main_topic 的摘要说明。
	/// </summary>
	public class forums_main_topic : BDStudioBase.FormBase
	{
		protected System.Web.UI.WebControls.DataGrid dbGridMain1;
		protected System.Web.UI.WebControls.Label labMessage1;
		protected System.Web.UI.WebControls.LinkButton linkbPrev1;
		protected System.Web.UI.WebControls.Label labPage1;
		protected System.Web.UI.WebControls.LinkButton linkbNext1;
		protected System.Web.UI.WebControls.LinkButton linkbJump1;
		protected System.Web.UI.WebControls.TextBox txtPageNum1;
		protected System.Web.UI.WebControls.ImageButton ImageButton1;
		protected System.Web.UI.WebControls.Label labPage2;
		protected System.Web.UI.WebControls.ImageButton ImageButton15;
		protected System.Web.UI.WebControls.Label Label6;
		protected System.Web.UI.WebControls.Label Label1;
		protected System.Web.UI.WebControls.Label Label2;
		protected System.Web.UI.WebControls.Label Label3;
		protected System.Web.UI.WebControls.Label Label4;
		protected System.Web.UI.WebControls.Label Label5;
		protected System.Web.UI.WebControls.Label Label7;
		
		int ColumnCount=2;
		string m_num="49";
		private COM_ForumTopics COM_ForumTopics=new COM_ForumTopics() ;
		string forumID="";
		string saveValidity="";
		string deleteTime="";
		string type="";
		
		
		private void Page_Load(object sender, System.EventArgs e)
		{
			// 在此处放置用户代码以初始化页面
			this.o_str_FormName="forums_main_topic";
			this.o_str_FormUrl="forums_main_topic.aspx";
//			this.o_str_FormName="forums_main_public";
//			this.o_str_FormUrl="forums_main_public.aspx";
			this.o_str_InputFile1="forums_main_topic_input1.aspx";
			this.o_str_DisplayFile1 = "forums_main_topic_display.aspx";
			o_str_Pk1="topic_id";
			this.o_str_FormStatusData=this.GetValueFromUserLog(this.o_str_FormName);
			if(Session["clear"]!=null)
			{
				if((string)Session["clear"]=="true")
				{
					this.o_str_FormStatusData="W";
				}
			}
			
			if(!Page.IsPostBack)
			{
				Session["PageNum1"]=0;							
				Session["dv1"]=null;
				Session["i_sort"]="0";
                Session["Search"]="0";
				if (this.o_str_FormStatusData!="W")
				{
					string[] arr_window_value=this.o_str_FormStatusData.Split(new char[]{','});
					Session["PageNum1"]=Int32.Parse(arr_window_value[0]);	
					Session["i_sort"]=arr_window_value[1];
					UserLogClose(this.o_str_FormName);//关闭记录
				}
				/*if(Session["isChildren"].ToString()=="yes")
				{
					type=Session["type"].ToString();
				}
				else
				{
					type=Request.QueryString["type"].ToString();
					Session["type"]=type;

				}*/
				if(Request.QueryString.Count!=0)
				{
					type=Request.QueryString["type"].ToString();
					Session["type"]=type;
					Session["PageNum1"]=0;
				}
				else
				{
					type=Session["type"].ToString();
					
				}
				/*if(Session["type"]==null)
				{
					type=Request.QueryString["type"].ToString();
					Session["type"]=type;
				}
				else
				{
					type=Session["type"].ToString();
					Request.QueryString.
				}*/
				switch(type)
				{
					case "receiveBox":
						Label1.Text="现在位置:"+"收件箱";
						string[]strFieldName1={m_num,"dbGridMain1","receive_emp"};
						string[]strFieldValue1={Session["userid"].ToString()};
						this.o_ds_FormData = this.COM_ForumTopics.GetTopics(strFieldName1,strFieldValue1,Session["userid"].ToString());
						Session["forumID"]=null;
						Session["starttime"]=null;
						break;
					case "sendBox":
						Label1.Text="现在位置:"+"发件箱";
						string[]strFieldName2={m_num,"dbGridMain1","t_author"};
						string[]strFieldValue2={Session["userid"].ToString()};
						this.o_ds_FormData = this.COM_ForumTopics.GetTopics(strFieldName2,strFieldValue2,Session["userid"].ToString());
						Session["forumID"]=null;
						Session["starttime"]=null;
						break;
					case "reply":
						Label1.Text="现在位置:"+"参与区";
						string[]strFieldName3={m_num,"dbGridMain1","r_author"};
						string[]strFieldValue3={Session["userid"].ToString()};
						this.o_ds_FormData = this.COM_ForumTopics.GetTopics(strFieldName3,strFieldValue3,Session["userid"].ToString());
						Session["forumID"]=null;
						Session["starttime"]=null;
						break;
					case "commend":
						Label1.Text="现在位置:"+"他人推荐";
						string[]strFieldName4={m_num,"dbGridMain1","worning_emp"};
						string[]strFieldValue4={Session["userid"].ToString()};
						this.o_ds_FormData = this.COM_ForumTopics.GetTopics(strFieldName4,strFieldValue4,Session["userid"].ToString());
						Session["forumID"]=null;
						Session["starttime"]=null;
						break;
					case "attention":
						Label1.Text="现在位置:"+"重点关注";
						string[]strFieldName5={m_num,"dbGridMain1","acc_res"};
						string[]strFieldValue5={Session["userid"].ToString()};
						this.o_ds_FormData = this.COM_ForumTopics.GetTopics(strFieldName5,strFieldValue5,Session["userid"].ToString());
						Session["forumID"]=null;
						Session["starttime"]=null;
						break;
					case "favorite":
						Label1.Text="现在位置:"+"收藏夹";
						string[]strFieldName6={m_num,"dbGridMain1","stow_emp"};
						string[]strFieldValue6={Session["userid"].ToString()};
						this.o_ds_FormData = this.COM_ForumTopics.GetTopics(strFieldName6,strFieldValue6,Session["userid"].ToString());
						Session["forumID"]=null;
						Session["starttime"]=null;
						break;
					case "primeArea":
						Label1.Text="现在位置:"+"精华区";
						string[]strFieldName7={m_num,"dbGridMain1","t_place"};
						string[]strFieldValue7={"02"};
						this.o_ds_FormData = this.COM_ForumTopics.GetTopics(strFieldName7,strFieldValue7,Session["userid"].ToString());
						Session["forumID"]=null;
						Session["starttime"]=null;
						break;
					case "must":
						Label1.Text = "您必须浏览或回复完以下文章才能进入论坛!";
						//this.ImageButton1.Visible =false;
						this.o_ds_FormData = this.COM_ForumTopics.DsTopicTop((string)Session["userid"]);
						Session["forumID"]=null;
						Session["starttime"]=null;
						break;
                    case "search":
						Label1.Text="搜索状态";
						string startTime="";
						string endTime="";
						string subject="";
						string message="";
						string author="";
						if(Session["starttime"]==null)
						{
							startTime=this.Param_get("as_starttime");
							endTime=this.Param_get("as_endtime");
							subject=this.Param_get("as_subject");
							message=this.Param_get("as_message");
							author=this.Param_get("as_author");
							Session["starttime"]=startTime;
							Session["endtime"]=endTime;
							Session["subject"]=subject;
							Session["message"]=message;
							Session["author"]=author;
						}
						else
						{
							startTime=Session["starttime"].ToString();
							endTime=Session["endtime"].ToString();
							subject=Session["subject"].ToString();
							message=Session["message"].ToString();
							author=Session["author"].ToString();
						}
						string[] searchWhere={startTime,endTime,subject,message,author};
						this.o_ds_FormData=this.COM_ForumTopics.DsSearch(searchWhere);
						Session["forumID"]=null;
						ImageButton1.Visible=false;
						break;
					default:
						Label1.Text="现在位置:"+"公共区";
						ImageButton1.Visible=true;
						if(Session["forumID"]==null)
						{
							forumID=Request.QueryString["as_pk"].ToString();
							saveValidity=Request.QueryString["saveValidity"].ToString();
							deleteTime=Request.QueryString["deleteTime"].ToString();
							Session["forumID"]=forumID;
							Session["saveValidity"]=saveValidity;
							Session["deleteTime"]=deleteTime;
						}
						else
						{
							if(Request.QueryString.Count>0)
							{
								forumID=Request.QueryString["as_pk"].ToString();
								saveValidity=Request.QueryString["saveValidity"].ToString();
								deleteTime=Request.QueryString["deleteTime"].ToString();
								Session["forumID"]=forumID;
								Session["saveValidity"]=saveValidity;
								Session["deleteTime"]=deleteTime;
							}
							else
							{
								forumID=Session["forumID"].ToString();
								//saveValidity=Session["saveValidity"].ToString();
								//deleteTime=Session["deleteTime"].ToString();
							}
						}
						string[] strFieldName8={m_num,"dbGridMain1","forum_id","t_place"};
						string[] strFieldValue8 = {forumID,"01"};
						this.o_ds_FormData = this.COM_ForumTopics.GetTopics(strFieldName8,strFieldValue8,Session["userid"].ToString());
						Session["starttime"]=null;
						break;

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?