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.Manager.Link.lb
{
    public partial class EditFrm : KstCmsBase.WebPage.FrmControl
    {
        string lbid = System.Web.HttpContext.Current.Request.QueryString.Get("LbID");
        protected void Page_Load(object sender, EventArgs e)
        {
            OkBtn.Click += new EventHandler(OkBtn_Click);
            if (!IsPostBack)
            {
                GetInfo();
                SetControl();
            }
        }

        void OkBtn_Click(object sender, EventArgs e)
        {
            string[] data = new string[] { txt_LbName.Text.Trim(), txt_SortNo.Text.Trim() };
            KstCmsBase.DAL.Link.FLink.LinkLB_Update(Convert.ToInt32(lbid), data, "LbName", "SortNo");
            ShowMsgModle("修改成功！", "parent.document.location.reload();");
        }

        void SetControl()
        {
            string[] Cons = new string[] { "类别名称~!", "排序~int!" };
            base.Set_Control(Cons, txt_LbName, txt_SortNo);
            txt_SortNo.Attributes.Add("onkeydown", "IsDigit();");
            
        }

        void GetInfo()
        {
            KstCmsBase.Entities.Link.LinkLB lb = KstCmsBase.DAL.Link.FLink.Get_LinkLbInfo(Convert.ToInt32(lbid));
            txt_LbName.Text = lb.LbName;
            txt_SortNo.Text = lb.SortNo.ToString();
        }
    }
}