Article_Add.aspx.cs
资源名称:moban.rar [点击查看]
上传用户:szraylite
上传日期:2018-06-06
资源大小:11546k
文件大小:2k
源码类别:
软件测试
开发平台:
Java
- using System;
- using System.Data;
- using System.Configuration;
- using System.Collections;
- using System.Web;
- using System.Web.Security;
- using System.Web.UI;
- using System.Web.UI.WebControls;
- using System.Web.UI.WebControls.WebParts;
- using System.Web.UI.HtmlControls;
- using ENTERPRISE.BusinessLogicLayer;
- using ENTERPRISE.DataAccessHelper;
- using ENTERPRISE.DataAccessLayer;
- public partial class admin_Article_Add : System.Web.UI.Page
- {
- protected void Page_Load(object sender, EventArgs e)
- {
- InitData();
- }
- public void InitData()
- {
- DataSet ds = ArticleClass.Queryclass();
- ddl_ArticleClass.DataSource = ds.Tables[0];
- ddl_ArticleClass.DataTextField = "column_name";
- ddl_ArticleClass.DataValueField = "id";
- ddl_ArticleClass.DataBind();
- }
- protected void add_Click(object sender, EventArgs e)
- {
- NoSortHashtable ht = new NoSortHashtable();
- ht.Add("title", SqlStringFormat.GetQuotedString(txb_Title.Text));
- ht.Add("content", System.Web.HttpUtility.HtmlEncode(SqlStringFormat.GetQuotedString(FreeTextBox1.Text)));
- ht.Add("reporter", SqlStringFormat.GetQuotedString(txb_Author.Text));
- ht.Add("notetime", SqlStringFormat.GetQuotedString(System.DateTime.Now.ToString()));
- ht.Add("belong_column", SqlStringFormat.GetQuotedString(ddl_ArticleClass.Text));
- Article article = new Article();
- article.Add(ht);
- Response.Write(System.Web.HttpUtility.HtmlEncode(SqlStringFormat.GetQuotedString(FreeTextBox1.Text)));
- }
- }