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_menuMov : 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)
        {
            // scrive label e text bottoni
            btn1.Text = string.Format("{0}\n[Alt+{1}]", traduci("btnTermInterrMov"), 1);
            btn1.AccessKey = "1";
            btn2.Text = string.Format("{0}\n[Alt+{1}]", traduci("btnTermHome"), 3);
            btn2.AccessKey = "3";
            btn3.Text = string.Format("{0}\n[Alt+{1}]", traduci("btnTermMakeMov"), 7);
            btn3.AccessKey = "7";
            btn4.Text = string.Format("{0}\n[Alt+{1}]", traduci("btnTermDelibLog"), 9);
            btn4.AccessKey = "9";
        }

        protected void btn1_Click(object sender, EventArgs e)
        {
            resetAllData();
            Response.Redirect("interrMov.aspx");
        }
        /// <summary>
        /// resetta dati barcode
        /// </summary>
        private static void resetAllData()
        {
            //memLayer.ML.emptySessionVal("IdxCella_sel");
            //memLayer.ML.emptySessionVal("codCella_sel");
            //memLayer.ML.emptySessionVal("UDC_sel");
            memLayer.ML.emptySessionVal("codCella4det_sel");
            memLayer.ML.emptySessionVal("UDC4det_sel");
            GMW_data.TermClass.Ter.resetScanBarcode(true, true, false);
        }

        protected void btn2_Click(object sender, EventArgs e)
        {
            resetAllData();
            Response.Redirect("Home.aspx");
        }

        protected void btn3_Click(object sender, EventArgs e)
        {
            resetAllData();
            Response.Redirect("makeMov.aspx");
        }
        protected void btn4_Click(object sender, EventArgs e)
        {
            resetAllData();
            Response.Redirect("delibLog.aspx");
        }
    }
}