using SteamWare;
using System;
using System.Web.UI;

namespace NKC_WF.WebUserControls
{
    public partial class cmp_homeButtons : BaseUserControl
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                updateTreeMenu();
            }
        }
        /// <summary>
        /// aggiornamento del menù
        /// </summary>
        private void updateTreeMenu()
        {
            try
            {
                if (string.IsNullOrEmpty(user_std.UtSn.mappaSito))
                {
                    Response.Redirect("Default", false);
                }
                XmlMenu.Data = user_std.UtSn.mappaSito;
                XmlMenu.XPath = "mainMenu/menu";
                XmlMenu.DataBind();
            }
            catch
            {
                Response.Redirect("Default", false);
            }
        }
        /// <summary>
        /// Wrapper traduzione termini
        /// </summary>
        /// <param name="lemma"></param>
        /// <returns></returns>
        public string traduci(string lemma)
        {
            return SteamWare.user_std.UtSn.Traduci(lemma);
        }
    }
}