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


namespace KstCMS.KstCMS_Manager
{
    public partial class MenuBar : KstCmsBase.WebPage.BasePage
    {
        protected void Page_Load(object sender, EventArgs e)
        {

            ShowMenu();
        }

        void ShowMenu()
        {
           
            string TableHtml = "<table cellpadding=\"0\" cellspacing=\"0\" border=\"0\">\r\n";
            TableHtml += "<tr>\r\n";
            string TableTd = "";
            SysMenuCollection SysMasterMenu = SysMenu.Get_SysMasterMenu(User.Identity.Name);
            foreach (SysMenuEntity item in SysMasterMenu)
            {
                string icon = item.MENU_IMAGE.Trim();
                if (!string.IsNullOrEmpty(icon) && icon != "")
                {
                    icon = "<img src=\"images/menu/" + icon + ".gif\"  align=\"absbottom\" /> ";
                }
                TableTd += "<td class=\"menutd2\" onMouseOver=\"this.className='menutd1';\" onMouseOut=\"this.className='menutd2';\" OnClick=\"OpenMenu('" + item.MENU_ID.Trim() + "','" + SysRootUrl + "/KstCMS_Manager/" + item.MENU_CODE.Trim() + "');\">" + icon + item.MENU_NAME.Trim() + "</td>\r\n";


            }
            TableTd += "<td class=\"menutd2\" onMouseOver=\"this.className='menutd1';\" onMouseOut=\"this.className='menutd2';\" OnClick=\"OpenDialog('about.aspx',500,300);\"><img src=\"images/menu/help.gif\" align=\"absbottom\" /> 关 于</td>\r\n";
            TableHtml += TableTd + "\r\n" + "</tr>\r\n" + "</table>";
            LitMenu.Text = TableHtml;
       

        }
    }
    
}