using AppData;
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.site
{
    public partial class PlannerReports : BasePage
    {
        #region Protected Properties

        protected int savedBatchId
        {
            get
            {
                return ComLib.getCurrBatchId(PlaceCod);
            }
        }

        #endregion Protected Properties

        #region Public Properties

        /// <summary>
        /// Batch corrente...
        /// </summary>
        public int BatchId
        {
            get
            {
                int answ = 0;
                if (!string.IsNullOrEmpty(memLayer.ML.QSS("BatchId")))
                {
                    answ = memLayer.ML.QSI("BatchId");
                }
                else
                {
                    answ = savedBatchId;
                }
                return answ;
            }
        }

        /// <summary>
        /// Limite orario preview...
        /// </summary>
        public int MaxHour
        {
            get
            {
                int answ = -1;
                if (!string.IsNullOrEmpty(memLayer.ML.QSS("MaxHour")))
                {
                    answ = memLayer.ML.QSI("MaxHour");
                }
                return answ;
            }
        }

        #endregion Public Properties

        #region Protected Methods

        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                ((SiteMaster)this.Master).showSearch = false;
                doUpdate();
            }
        }

        #endregion Protected Methods

        #region Public Methods

        /// <summary>
        /// Update interfaccia
        /// </summary>
        public void doUpdate()
        {
            // Imposto BatchID...
            cmp_SheetsStats.BatchID = BatchId;
            cmp_SheetsStats.MaxHour = MaxHour;
        }

        #endregion Public Methods
    }
}