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

namespace KstCMS.KstCMS_Manager.SystemSet.SoftFace.Menu
{
    public partial class AddNewMasterMenu : KstCmsBase.WebPage.FrmControl
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            Button1.Click += new EventHandler(Button1_Click);
            if (!IsPostBack)
            {
                Set_Validator();
                Button1.Enabled = isAdmin;
            }

            


        }

        void Button1_Click(object sender, EventArgs e)
        {
            
            System.Threading.Thread.Sleep(500);
            
            string[] SysMenuFieldValues = new string[]{
                MENU_ID.Text.Trim(),
                MENU_NAME.Text.Trim(),
                MENU_IMAGE.Text.Trim(),
                MENU_URL.Text.Trim()
            };
            KstCmsBase.DAL.SysMenu.SysMenu_Insert(SysMenuFieldValues, "MENU_ID", "MENU_NAME", "MENU_IMAGE", "MENU_URL");
            ShowMsgModle("增加成功！", "parent.document.location.reload();");



        }

        private void Set_Validator()
        {
            string[] Attr = new string[5];
            Attr[0] = "菜单代码~2f:int!";
            Attr[1] = "菜单名称~!";
            Attr[2] = "菜单图标~noChinese!";

            base.Set_Control(Attr, MENU_ID, MENU_NAME, MENU_IMAGE);
        }
    }
}