<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System" %>
<%@ Import Namespace="System.Web" %>
<%@ Import Namespace="DissData_vb" %>
	<script language="vb" runat="server">
	dim NowDissSQL as DissSql
	sub Page_load(sender as object,e as EventArgs)
		Cname.Text=Session("NowMan").ToString()
		NowDissSQL = Ctype(Session("NowDissSQLvb"),DissSql)
		Dim NowTable as DataTable =NowDissSQL.GetAllCate()
		cate.DataSource=NowTable.DefaultView
		cate.DataValueField="id"
		cate.DataTextField="cate"
		cate.DataBind()
	end sub
	sub ok_click(sender as object,e as EventArgs)
		dim x as integer = NowDissSQL.GetMaxID()
		dim k as Boolean =NowDissSQL.SaveToArticle(x,0,Subj.Text,Cname.Text,Body.Text,Convert.ToInt32(cate.SelectedItem.Value),Session("NowID").ToString())
		if k=true then
			Response.Redirect("ShowSbj.aspx?NowCateID=" + cate.SelectedItem.Value)
		else
			Msg.Text="发生错误，无法保存"
		end if
	end sub
	sub cel_click(sender as object,e as EventArgs)
		Response.Redirect("showsbj.aspx?NowCateID=1")
	end sub
	</script>
</head>
<body background="../../../../images/winback.gif">
<form runat="server">
<table><tr><td>大名:</td><td><asp:textbox columns="50" ID="Cname" Runat="server" /></td></tr>
<table><tr><td>主题:</td><td><asp:textbox columns="60" ID="Subj" Runat="server" /></td></tr>
<tr><td>选择类别:</td><td><asp:dropdownlist ID="cate" Runat="server" /></td></tr>
<tr><td valign="top">意见或问题:</td><td><asp:Textbox ID="Body" Rows="7" Columns="45" TextMode="MultiLine" Runat="server" /></td></tr>
<tr><td><asp:button id="ok" runat="server" onclick="ok_click" text="确定" />  <asp:button id="cel" runat="server" onclick="cel_click" text="取消" />
</table>
<asp:Label id="Msg" Runat="server" />
</form>
</body>