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 Search : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            // imposto valori visibilità barcode specifici (nascondo testo...)
            mod_barcode1.valoreScan = "";
            mod_barcode1.showHeaderText = true;
            mod_barcode1.showNoteText = true;
            // imposto controllo valori scansionati
            mod_barcode1.eh_scannedParticolare += new EventHandler(mod_barcode1_eh_scannedParticolare);
            if (!Page.IsPostBack)
            {
                mod_searchRes1.Visible = false;
                memLayer.ML.emptySessionVal("Particolare_sel");
                memLayer.ML.emptySessionVal("idxBlocco_sel");
                memLayer.ML.emptySessionVal("UDC4det_sel");
            }
            checkVisibility();
            mod_barcode1.setFocusBarcode();
        }
        /// <summary>
        /// scansionato particolare --> mostro magazzini contenenti!
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        void mod_barcode1_eh_scannedParticolare(object sender, EventArgs e)
        {
            GMW_data.TermClass.Ter.resetScanBarcode(true, true, false);
            mod_barcode1.Visible = false;
            mod_searchRes1.Visible = true;
        }
        /// <summary>
        /// controllo visibilità dati valori in sessione
        /// </summary>
        private void checkVisibility()
        {
            bool filtMag = memLayer.ML.isInSessionObject("Particolare_sel");
            mod_barcode1.Visible = !filtMag;
        }
    }
}
