<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System" %>
<%@ Import Namespace="System.Web" %>
<%@ Register TagPrefix="Diss_Cate" Namespace="Diss_cs" Assembly="Diss_cs" %>
<%@ Import Namespace="DissData_cs" %>
	<script language="c#" runat="server">
	void Page_load( Object sender, EventArgs e){
		GetCate.ServerName=Session["NowSQLServer"].ToString();
		GetCate.Uid=Session["Nowuid"].ToString();
		GetCate.Pass=Session["NowPassword"].ToString();
		GetCate.DBName=Session["NowDBName"].ToString();
		Session["NowCateID"]=Request.QueryString["NowCateID"];
		Session["NowCate"]=Request.QueryString["NowCate"];
		NowCate1.Text=Request.QueryString["NowCateID"];//目前类别ID
		Session["StartDate"]=Request.QueryString["StartDate"];
		GetCate.StartDate=Convert.ToDateTime(Request.QueryString["StartDate"]);
		GetCate.EndDate=Convert.ToDateTime(Request.QueryString["StartDate"]).AddDays(6);//设定起迄日期
		int y=Convert.ToInt32(Request.QueryString["CID"]);//文章ID
		GetCate.FirstLoad=true;
		DissSql NewDiss = (DissSql)Session["NowDissSql"];
		int ReID = (int)NewDiss.GetReplyID(y.ToString());//取得回复ID
		ReplyID.Text=ReID.ToString();//置于隐藏控件
		DataRow Row;
		Row=NewDiss.GetArticleRow(y);//取得文章记录
		Cname.Text=Row["send"].ToString();//显示相关信息
		Subj.Text=Row["subject"].ToString();
		nowtime.Text=Row["nowtime"].ToString();
		Body.Text=Row["body"].ToString();
		Session["NowRow"]=Row;
	}
	void Rep_Click( Object sender, EventArgs e){
		Response.Redirect("Reply.aspx?NowCateID=" + Session["NowCateID"] + "&NowCate=" + Session["NowCate"] + "&NowAID=" + ReplyID.Text);
	}
	void ToNew_Click(Object sender, EventArgs e){
		Response.Redirect("WriteNew.aspx");
	}
	void Get_Click(Object sender, CommandEventArgs e){
		if(GetCate.NowSelect.ToString()==NowCate1.Text){
			Response.Redirect("Showsbj.aspx?NowCateID=" + Session["NowCateID"].ToString() + "&GetSession=True&StartDate=" + Session["StartDate"].ToString());
		}
		else{
			Response.Redirect("Showsbj.aspx?NowCateID=" + GetCate.NowSelect.ToString() + "&StartDate=" + Session["StartDate"].ToString());
		}
	}
	</script>
</head>
<body background="../../../../images/winback.gif">
<form runat="server">
<p><Diss_Cate:GetCate ID="GetCate" oncommand="Get_Click" Runat="server" />
<p><asp:LinkButton Text="发表新意见" id="ToNew" onclick="ToNew_Click" runat="server" />　<asp:LinkButton Text="回复本信" id="Rep" onclick="Rep_Click" runat="server" /><p>
<table><tr><td width="70">发信人:</td><td><asp:label ID="Cname" Runat="server" /></td></tr>
<tr><td>主题:</td><td><asp:Label ID="Subj" Runat="server" /></td></tr>
<tr><td>时间:</td><td><asp:Label ID="nowtime" Runat="server" /></td></tr>
<tr><td valign="top">本文:</td><td><asp:Label ID="Body" Runat="server" /></td></tr>

</table>
<asp:Label id="Msg" Runat="server" />
<asp:Label id="NowCate1" Visible="false" Runat="server" />
<asp:Label id="ReplyID" Visible="false" Runat="server" />
</form>
</body>