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

            if (!IsPostBack)
            {
                // Security check
                if (!Convert.ToBoolean(Session["sgLFS_RESOURCES_EMPLOYEES_ADMIN"]))
                {
                    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 employees_personal_agency.aspx");
                }

                // Tag Page
                hdfCompanyId.Value = Session["companyID"].ToString();
                hdfUpdate.Value = "yes";
                Session.Remove("personalAgencyInformationDummy");
                Session.Remove("personalAgencyInformation");

                ViewState["update"] = Request.QueryString["update"];

                // ... Load personalAgency to edit
                personalAgencyInformationTDS = new PersonalAgencyInformationTDS();

                PersonalAgencyInformationGateway personalAgencyInformationGateway = new PersonalAgencyInformationGateway(personalAgencyInformationTDS);
                personalAgencyInformationGateway.Load(Int32.Parse(hdfCompanyId.Value.Trim()));

                // ... Store datasets
                Session["personalAgencyInformationTDS"] = personalAgencyInformationTDS;
                Session["personalAgencyInformation"] = personalAgencyInformationTDS.PersonalAgencyInformation;
            }
            else
            {
                // Restore datasets
                personalAgencyInformationTDS = (PersonalAgencyInformationTDS)Session["personalAgencyInformationTDS"];
                personalAgencyInformation = personalAgencyInformationTDS.PersonalAgencyInformation;
            }
        }