using AppData;
using NKC_SDK;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

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

        public int BatchId
        {
            get
            {
                int answ = 0;
                int.TryParse(hfBatchId.Value, out answ);
                return answ;
            }
            set
            {
                hfBatchId.Value = $"{value}";
            }
        }

        public int SelOrderId
        {
            get
            {
                int answ = 0;
                int.TryParse(grView.SelectedDataKey["OrdID"].ToString(), out answ);
                return answ;
            }
        }

        #endregion Public Properties

        #region Protected Methods

        protected void grView_SelectedIndexChanged(object sender, EventArgs e)
        {
            // sollevo evento selezione...
            raiseEvent();
        }

        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                doUpdate();
            }
        }

        #endregion Protected Methods

        #region Public Methods

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

        #endregion Public Methods
    }
}