/// <summary>
 /// InitData
 /// </summary>
 protected override void InitData()
 {
     _data = new SubcontractorHoursAddTDS();
 }
        // ////////////////////////////////////////////////////////////////////////
        // INITIAL EVENTS
        //
        protected void Page_Load(object sender, EventArgs e)
        {
            // Register client scripts
            this.RegisterClientScripts();

            if (!IsPostBack)
            {
                if (!(Convert.ToBoolean(Session["sgLFS_LABOUR_HOURS_SUBCONTRACTOR_HOURS_ADMIN"])))
                {
                    // Security check
                    if (!(Convert.ToBoolean(Session["sgLFS_LABOUR_HOURS_SUBCONTRACTOR_HOURS_ADD"])))
                    {
                        Response.Redirect("./../../error_page.aspx?error=" + "You are not authorized to view this page. Contact your system administrator.");
                    }

                    // Validate query string
                    if ((string)Request.QueryString["source_page"] == null)
                    {
                        Response.Redirect("./../../error_page.aspx?error=" + "Invalid query string in subcontractor_hours_add_by_client_project.aspx");
                    }
                }

                // Tag page
                Session.Remove("projectSubcontractorCostDummyByClientProject");
                hdfCompanyId.Value = Session["companyID"].ToString();

                // Store datasets
                subcontractorAddTDS = new SubcontractorHoursAddTDS();
                Session["subcontractorAddTDSByClientProject"] = subcontractorAddTDS;
                Session["projectSubcontractorCostByClientProject"] = subcontractorAddTDS.SubcontractorHours;

                StoreNavigatorState();
            }
            else
            {
                // Restore datasets
                subcontractorAddTDS = (SubcontractorHoursAddTDS)Session["subcontractorAddTDSByClientProject"];
                projectSubcontractorCost = subcontractorAddTDS.SubcontractorHours;
                Session["projectSubcontractorCostByClientProject"] = subcontractorAddTDS.SubcontractorHours;
            }
        }