<%@ 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){
		DataRow Row = (DataRow)Session["NowRow"];
		Session["NowAID"]=Request.QueryString["NowAID"];//回复ID
		if(IsPostBack==false){
			Cname.Text=Session["NowMan"].ToString();
			subj.Text="回复：" + Row["subject"].ToString();
			Cate.Text=Request.QueryString["NowCate"];
			oldBody.Text=Row["body"].ToString();
		}
	}
	void ok_click(object sender,EventArgs e){//保存
		DissSql NowDissSQL = (DissSql)Session["NowDissSQL"];
		int x = NowDissSQL.GetMaxID();
		Boolean k=NowDissSQL.SaveToArticle(x,Convert.ToInt32(Session["NowAID"].ToString()),subj.Text,Cname.Text,ReplyBody.Text,Convert.ToInt32(Session["NowCateID"].ToString()),Session["NowID"].ToString());
		if(k==true){
			Response.Redirect("ShowSbj.aspx?NowCateID=" + Session["NowCateID"]);
		}
		else{
			Msg.Text="发生错误，无法保存";
		}
	}
	void cel_click(object sender,EventArgs e){//取消
		Response.Redirect("showsbj.aspx?NowCateID=" + Session["NowCateID"]);
	}
	</script>
</head>
<body background="../../../../images/winback.gif">
<form runat="server"><table><tr><td width="170">大名：<asp:textbox columns="15" ID="Cname" Runat="server" /></td><td width="350">电子邮件地址：<asp:textbox columns="30" ID="Email" Runat="server" /></td></tr>
<tr><td width="350" colspan="2">主旨：<asp:textbox columns="40" ID="subj" Runat="server" /></td></tr>
<tr><td width="250">本文类别：<asp:Label ID="Cate" Runat="server" /></td></tr>
</table>
<hr>
<table>
<tr><td valign="top" width="250" colspan="2">引述内容：<br><asp:label id="oldBody" runat="server" /></td>
<td valign="top">回复内容：<br><asp:Textbox ID="ReplyBody" Rows="15" Columns="45" TextMode="MultiLine" Runat="server" /><br>
<asp:button id="ok" runat="server" onclick="ok_click" text="确定" />  <asp:button id="cel" runat="server" onclick="cel_click" text="取消" />
<br><asp:Label id="Msg" Runat="server" />
</td></tr>
</table>
</form>
</body>