using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace KstCMS.KstCMS_Manager.WebContent.products.protype
{
    public partial class SelectInput : KstCmsBase.WebPage.ValidationPage
    {
        string FieldId = string.Empty;
        protected void Page_Load(object sender, EventArgs e)
        {
            FieldId = Request.QueryString.Get("FieldId");
            Button1.Click += new EventHandler(Button1_Click);
            if (!IsPostBack)
            {
                Get_DefaultValue();
            }
        }

        void Button1_Click(object sender, EventArgs e)
        {
            string[] data = new string[] { KstCmsBase.Common.Fucs.NoHTML(txt_FieldValue.Text.Trim()) };
            KstCmsBase.DAL.Product.ProductType.Field1_Update(data, Convert.ToInt32(FieldId), "FieldValue");
            ShowMsgModle("设置成功！", "CloseWindow();");
        }

        void Get_DefaultValue()
        {
            KstCmsBase.DAL.Access db = new KstCmsBase.DAL.Access();
            Literal1.Text = db.getFieldValue(string.Format("select FieldName from ProductField1 where FieldId={0}", FieldId));
            txt_FieldValue.Text = db.getFieldValue(string.Format("select FieldValue from ProductField1 where FieldId={0}", FieldId));
            db.Dispose();
        }


    }
}