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 System.Data.OleDb;

public partial class admini_SiteInfo : BasePage
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!CheckLogin()) return;
        AjaxPro.Utility.RegisterTypeForAjax(typeof(admini_SiteInfo));

        s = base.getSiteInfo();
    }
    public SiteInfo s=null;

    [AjaxPro.AjaxMethod]
    public string UpdateInfo(string name, string key, string desc,string tName,string tUrl,string sBeiAn)
    {
        try
        {
            string sql = "Update siteInfo set sitename=@ANAME,siteKeys = @Key,siteDesc=@Desc,tName=@tName,turl = @tUrl,siteBeiAn=@siteBeiAn";
            OleDbParameter[] dbParms = new OleDbParameter[] { new OleDbParameter("@ANAME", OleDbType.VarChar, 50), new OleDbParameter("@Key", OleDbType.VarChar, 200), new OleDbParameter("@Desc", OleDbType.VarChar, 200), new OleDbParameter("@tName", OleDbType.VarChar, 50), new OleDbParameter("@tUrl", OleDbType.VarChar, 200), new OleDbParameter("@siteBeiAn", OleDbType.VarChar, 200) };
            dbParms[0].Value = name;
            dbParms[1].Value = key;
            dbParms[2].Value = desc;
            dbParms[3].Value = tName;
            dbParms[4].Value = tUrl;
            dbParms[5].Value = sBeiAn;
            int t = SqlHelper.ExecuteSql(sql);
            if (t > 0)
            {
                WebClass.ReMoveCacheByKey("SITEINFO");
                return "1";
            }
            else
                return "0";
        }
        catch (Exception ex)
        {
            return ex.Message;
        }
    }
}
