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

namespace NKC_WF.WebUserControls
{
    public partial class cmp_searchItems : BaseUserControl
    {
        #region Public Properties

        public string itemDtmx
        {
            get
            {
                return hfItemDtmx.Value;
            }
            set
            {
                if (!string.IsNullOrEmpty(value))
                {
                    hfItemDtmx.Value = value;
                    frmView.DataBind();
                }
                else
                {
                    frmView.Visible = false;
                }
            }
        }

        #endregion Public Properties

        #region Protected Methods

        protected void lbtSetScrap_Click(object sender, EventArgs e)
        {
            int ItemId = 0;
            // recupero button
            try
            {
                LinkButton lbt = (LinkButton)sender;
                int.TryParse(lbt.CommandArgument, out ItemId);
            }
            catch
            { }
            //int.TryParse(grView.SelectedValue.ToString(), out ItemId);
            if (ItemId > 0)
            {
                // SCRAP x item selezionato...
                DLMan.taIL.updateStatus(ItemId, 990, PlaceCod);
                lgInfo($"cmp_searchItem | SCRAP | Status --> 990 | itemIdSelected: {ItemId} | PlaceCod: {PlaceCod}");
                raiseEvent();
            }
        }

        protected void Page_Load(object sender, EventArgs e)
        {
            PlaceCod = "ND";
        }

        #endregion Protected Methods
    }
}