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 description : 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_descript();
            }
        }

        void Button1_Click(object sender, EventArgs e)
        {
            string[] data = new string[] { elm1.Value.Trim() };
            KstCmsBase.DAL.Product.ProductType.Field2_Update(data, Convert.ToInt32(FieldId), "FieldValue");
            ShowMsgModle("更新成功！", "$(pageInit);window.close();");
        }
        void Get_descript()
        {
            KstCmsBase.DAL.Access db = new KstCmsBase.DAL.Access();
            Literal1.Text = db.getFieldValue(string.Format("select FieldName from ProductField2 where FieldId={0}", FieldId));
            elm1.Value = db.getFieldValue(string.Format("select FieldValue from ProductField2 where FieldId={0}", FieldId));
            db.Dispose();
        }
    }
}