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_binDetIRK : BaseUserControl
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        /// <summary>
        /// BIN selezionato
        /// </summary>
        public int BinID
        {
            get
            {
                int answ = 0;
                int.TryParse(hfBinID.Value, out answ);
                return answ;
            }
            set
            {
                hfBinID.Value = value.ToString();
            }
        }

        protected string ItemExtCode
        {
            get
            {
                string answ = "";
                if (grView.SelectedIndex >= 0)
                {
                    answ = grView.SelectedValue.ToString();
                }
                return answ;
            }
        }

        public bool checkQty(object _qty)
        {
            bool answ = false;
            int num = 0;
            int.TryParse(_qty.ToString(), out num);
            answ = num > 0;
            return answ;
        }

        public void doUpdate()
        {
            grView.DataBind();
        }

        protected void grView_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (!string.IsNullOrEmpty(ItemExtCode))
            {
#if false
                // esegue la stored di reset delle PART con quel ExtCode nel cart...
                DLMan.taIL.invalidateByPartCart(CartID, ItemExtCode, PlaceId); 
#endif
            }
            grView.DataBind();
        }
    }
}