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

namespace GMW_Term
{
    public partial class Barcode : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            // imposto valori visibilità barcode specifici (nascondo testo...)
            mod_barcode1.showHeaderText = true;
            mod_barcode1.showNoteText = true;
            // imposto controllo valori scansionati
            mod_barcode1.eh_scannedListaPrelievo += new EventHandler(mod_barcode1_eh_scannedListaPrelievo);
            mod_barcode1.eh_scannedParticolare += new EventHandler(mod_barcode1_eh_scannedParticolare);
            mod_barcode1.eh_scannedUdc += new EventHandler(mod_barcode1_eh_scannedUdc);
            mod_barcode1.eh_scannedUser += new EventHandler(mod_barcode1_eh_scannedUser);
            mod_barcode1.eh_scannedCella += new EventHandler(mod_barcode1_eh_scannedCella);
            mod_barcode1.eh_resetUser += new EventHandler(mod_barcode1_eh_resetUser);
            checkVisibility();
            // imposto btnHome
            mod_barcode1.homeBtnText = "btnTermMenuLDP";
            mod_barcode1.homeBtnLink = "~/menuLDP.aspx";
        }
        /// <summary>
        /// controlla visibilità lista di prelievo (se non c'è user ins essione non mostra LDP)
        /// </summary>
        private void checkVisibility()
        {
            // se non c'è utente non mostra controlli packing list
            if (string.IsNullOrEmpty(user_std.UtSn.utente))
            {
                mod_processPackList1.Visible = false;
            }
        }

        void mod_barcode1_eh_scannedCella(object sender, EventArgs e)
        {
            Response.Redirect("~/Cella.aspx");
        }

        void mod_barcode1_eh_resetUser(object sender, EventArgs e)
        {
            Response.Redirect("~/Barcode.aspx");
        }

        void mod_barcode1_eh_scannedUser(object sender, EventArgs e)
        {
            Response.Redirect("~/Home.aspx");
        }

        void mod_barcode1_eh_scannedUdc(object sender, EventArgs e)
        {
            Response.Redirect("~/UDC.aspx");
        }

        void mod_barcode1_eh_scannedParticolare(object sender, EventArgs e)
        {
            Response.Redirect("~/Particolare.aspx");
        }

        void mod_barcode1_eh_scannedListaPrelievo(object sender, EventArgs e)
        {
            Response.Redirect("~/ListePrelievo.aspx");
        }
    }
}
