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

namespace NKC_WF.WebUserControls
{
    public partial class cmp_KS_Bin : BaseUserControl
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                fixVisibility();
            }
        }

        /// <summary>
        /// Bin selezionato
        /// </summary>
        public int BinID
        {
            get
            {
                return cmp_KS_currBin.CurrId;
            }
            set
            {
                cmp_KS_currBin.CurrId = value;
            }
        }
        protected bool binOk
        {
            get
            {
                return BinID > 0;
            }
        }

        private void fixVisibility()
        {
            // controllo visualizazione in base ai dati presenti
            cmp_KS_currBin.Visible = binOk;
            cmp_KS_OkibBin.Visible = binOk;
        }

        public void doUpdate()
        {
            fixVisibility();
            if (binOk)
            {
                cmp_KS_OkibBin.doUpdate();
            }
        }

        /// <summary>
        /// Matrix Bin selezionato
        /// </summary>
        public string BinDtmx
        {
            get
            {
                return cmp_KS_currBin.Dtmx;
            }
            set
            {
                cmp_KS_currBin.Dtmx = value;
                cmp_KS_OkibBin.Dtmx = value;
            }
        }
        /// <summary>
        /// Descrizione BIN selezionato (ord ext code)
        /// </summary>
        public string BinDesc
        {
            get
            {
                return cmp_KS_currBin.Description;
            }
            set
            {
                cmp_KS_currBin.Description = value;
            }
        }

    }
}