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 MySql.Data.MySqlClient;

public partial class Step3Class : Page
    {
		MysqlHelp mh = null;
		string createTableSQL = "";
			
		protected void Page_Load(object sender, EventArgs e)
        {
		
        }
		
		protected void btnAdd_Click(object sender, EventArgs e)
        {
			///获取用户输入的新的数据：
			string siteName = this.siteName.Text.Replace("'", "").Replace("select", "").Replace("delete", "").Replace("update", "").Replace("insert", "");
			if(siteName.Length>20)siteName = siteName.Substring(0,20);
			
			string siteTitle = this.siteTitle.Text.Replace("'", "").Replace("select", "").Replace("delete", "").Replace("update", "").Replace("insert", "");
			if(siteTitle.Length>40)siteTitle = siteTitle.Substring(0,40);
			
			string siteKeywords = this.siteKeywords.Text.Replace("'", "").Replace("select", "").Replace("delete", "").Replace("update", "").Replace("insert", "");
			if(siteKeywords.Length>140)siteKeywords = siteKeywords.Substring(0,140);
			
			string siteDescribe = this.siteDescribe.Text.Replace("'", "").Replace("select", "").Replace("delete", "").Replace("update", "").Replace("insert", "");
			if(siteDescribe.Length>200)siteDescribe = siteDescribe.Substring(0,200);
			
			if(siteName!="" && siteTitle!="" && siteKeywords!="" && siteDescribe!="")///如果用户输入的参数没有空项
			{
				string insertSQLStr = "insert into Preference4DeepSoon(siteName,siteTitle,siteKeywords,siteDescribe,siteMain,siteLogoAddr,htmlDir,uploadFileDir,siteCopyRight,WatermarkLogo,urlRule) Values ('"+siteName+"','"+siteTitle+"','"+siteKeywords+"','"+siteDescribe+"','www.DeepSoon.com','System_Img/logo.png','/Html/','/uploadFile/','"+siteTitle+" | 版权所有&bull;侵权必究','/System_Img/WatermarkLogo.png','endWithASPX')";
				mh = new MysqlHelp();
				mh.Runsql(insertSQLStr);
				///站点基础数据配置成功，跳转到下一步：
				Response.Redirect("step4.aspx");
			}
			else {
					this.labelAddInfor.Text="所有项不允许为空，请将配置参数填写完整!";
			}
			
		}///end btnAdd_Click()
		
    }