using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using SteamWare;

namespace GMW_Term.WebUserControls
{
    public partial class mod_currentTask : System.Web.UI.UserControl
    {

        /// <summary>
        /// wrapper traduzione termini
        /// </summary>
        /// <param name="lemma"></param>
        /// <returns></returns>
        public string traduci(string lemma)
        {
            return user_std.UtSn.Traduci(lemma);
        }

        protected void Page_Load(object sender, EventArgs e)
        {
            string task = memLayer.ML.StringSessionObj("activeTask");
            if (task == "")
            {
                task = "..." +  traduci("waiting") + "...";
            }
            lblTask.Text = task;
            // fix del timer
            setTimer();
            setClock();
        }
        /// <summary>
        /// imposta il tempo di scadenza del timer x il refresh della pagina (della parte top) per evitare che la sessione sul server scada
        /// </summary>
        private void setTimer()
        {
            //Timer1.Interval = SteamWare.memLayer.ML.confReadInt("intUpdatePagina_ms");
        }

        protected void Timer1_Tick(object sender, EventArgs e)
        {
            setClock();
        }
        private void setClock()
        {
            lblDateTime.Text = DateTime.Now.ToString("HH:mm:ss");
        }
    }
}