protected void ConnectToCAP()
        {
            JobTracker jobtracker = new JobTracker();

            PanelLogin.Visible = jobtracker.CanConnectToCAP();
            Panel_Error.Visible = !jobtracker.CanConnectToCAP();
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            JobTracker jobtracker = new JobTracker();
            if (!isValidUser() || (!jobtracker.CanConnectToCAP()))
                Response.Redirect("Login.aspx");
            if (!HasAccess())
                Response.Redirect("Dashboard.aspx");
            HttpContext.Current.Session["siteSubHeader"] = "Report";
            HttpContext.Current.Session["selectedTab"] = "Report";

            if (!IsPostBack)
            {
                InitializeRepeater();
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            JobTracker jobtracker = new JobTracker();
            if (!isValidUser() || (!jobtracker.CanConnectToCAP()))
                Response.Redirect("Login.aspx");
            GetMyAccessRights();
            if (myAccessRights == null)
                Response.Redirect("Dashboard.aspx");
            HttpContext.Current.Session["siteSubHeader"] = "Setup";
            HttpContext.Current.Session["selectedTab"] = "Setup";

            if (!IsPostBack)
            {
                modalTxtBoxMessage.Attributes.Add("onchange", "DefaultValue();");
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            JobTracker jobtracker = new JobTracker();
            if (!isValidUser() || (!jobtracker.CanConnectToCAP()))
                Response.Redirect("Login.aspx");
            GetMyAccessRights();
            if (myAccessRights == null)
                Response.Redirect("Dashboard.aspx");
            HttpContext.Current.Session["siteSubHeader"] = "Setup";
            HttpContext.Current.Session["selectedTab"] = "Setup";

            if (!IsPostBack)
            {
                modalTxtBoxStartDate.Attributes.Add("readonly", "readonly"); //prevents user from typing on calendar textbox
                InitializeDropDownDepartment();
                InitializeGridUser();
                calendarExtenderStartDate.EndDate = DateTime.Today;
                calendarExtenderPatternStartDate.EndDate = DateTime.Today;
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            JobTracker jobtracker = new JobTracker();
            if (!isValidUser() || (!jobtracker.CanConnectToCAP()))
                Response.Redirect("Login.aspx");
            GetMyAccessRights();
            if (myAccessRights == null)
                Response.Redirect("Dashboard.aspx");
            HttpContext.Current.Session["siteSubHeader"] = "Setup";
            HttpContext.Current.Session["selectedTab"] = "Setup";

            if (!IsPostBack)
            {
                InitializeDropDownDepartment();
                InitializeGridUser();
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            JobTracker jobtracker = new JobTracker();
            if (!isValidUser() || (!jobtracker.CanConnectToCAP()))
                Response.Redirect("Login.aspx");
            HttpContext.Current.Session["siteSubHeader"] = "JobOverview";
            HttpContext.Current.Session["selectedTab"] = "JobOverview";

            if (!IsPostBack)
            {
                txtBoxStartDate.Attributes.Add("readonly", "readonly");
                txtBoxEndDate.Attributes.Add("readonly", "readonly");
                InitializeStartDate();
                InitializeEndDate();
                //GenerateDynamicGrid();
            }
            GenerateDynamicGrid();
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            JobTracker jobtracker = new JobTracker();
            if (!isValidUser() || (!jobtracker.CanConnectToCAP()))
                Response.Redirect("Login.aspx");
            HttpContext.Current.Session["siteSubHeader"] = "Dashboard";
            HttpContext.Current.Session["selectedTab"] = "Dashboard";

            if (!IsPostBack)
            {
                txtBoxBottomFromDate.Attributes.Add("readonly", "readonly");
                txtBoxBottomToDate.Attributes.Add("readonly", "readonly");
                calExtBottomFromDate.SelectedDate = DateTime.Now;
                calExtBottomFromDate.EndDate = DateTime.Now;
                txtBoxBottomFromDate.Text = DateTime.Now.ToString("dd MMM yyyy");
                calExtBottomToDate.SelectedDate = DateTime.Now;
                calExtBottomToDate.StartDate = DateTime.Now;
                calExtBottomToDate.EndDate = DateTime.Now;
                txtBoxBottomToDate.Text = DateTime.Now.ToString("dd MMM yyyy");

                if (!isSupervisor())
                {
                    gridLeftChkBoxSelectAll.Checked = false;
                    tabPanelLeft1.Visible = false;
                }
                InitializeGridViewLeftPanel1(new List<string>());
                InitializeGridViewLeftPanel2();
                InitializeGridViewLeftPanel3();
                InitializeBottomDropDownDepartment();
                InitializeBottomDropDownPersonel();
                InitializeGridViewBottom();
                InitializeGridViewBottom2();
            }
        }
 protected void Page_Load(object sender, EventArgs e)
 {
     JobTracker jobtracker = new JobTracker();
     if (!isValidUser() || (!jobtracker.CanConnectToCAP()))
         Response.Redirect("Login.aspx");
     GetMyAccessRights();
     if (myAccessRights == null)
         Response.Redirect("Dashboard.aspx");
     HttpContext.Current.Session["siteSubHeader"] = "Report";
     HttpContext.Current.Session["selectedTab"] = "Report";
     //ScriptManager scriptManager = ScriptManager.GetCurrent(this.Page);
     //scriptManager.RegisterPostBackControl(this.hiddenButton);
     if (!IsPostBack)
     {
         txtBoxFrom.Attributes.Add("readonly", "readonly"); //prevents user from typing on calendar textbox
         txtBoxTo.Attributes.Add("readonly", "readonly"); //prevents user from typing on calendar textbox
         txtBoxFrom.Text = DateTime.Today.ToString("dd MMM yyyy");
         txtBoxTo.Text = DateTime.Today.ToString("dd MMM yyyy");
         calendarExtenderFrom.SelectedDate = DateTime.Today;
         calendarExtenderFrom.EndDate = DateTime.Today;
         calendarExtenderTo.SelectedDate = DateTime.Today;
         calendarExtenderTo.StartDate = DateTime.Today;
         calendarExtenderTo.EndDate = DateTime.Today;
         if (Session["LaborCostReport"] == null)
         {
             btnDownload.Visible = false;
             lblReadyForDownload.Visible = false;
         }
         else
         {
             lblReadyForDownload.Text = "Report Ready For Download : " + (string)Session["LaborCostReportName"];
         }
     }
 }
        protected void Page_Load(object sender, EventArgs e)
        {
            JobTracker jobtracker = new JobTracker();
            if (!isValidUser() || (!jobtracker.CanConnectToCAP())) //Check if the user is properly login and if the system can connect to CAP database
                Response.Redirect("Login.aspx"); //Redirects the user to login page
            HttpContext.Current.Session["siteSubHeader"] = "JobTrack";
            HttpContext.Current.Session["selectedTab"] = "JobTrack";

            if (!IsPostBack)
            {
                //makesure that the alertmodalpopup is on top
                string script = "<script type=\"text/javascript\"> //<![CDATA[Sys.Application.add_load(function(){setTimeout(function(){ var popup = $find(\"<%=programmaticAlertModalPopup.ClientID %>\"); popup._backgroundElement.style.zIndex = 10010; popup._foregroundElement.style.zIndex = 10011;},0);}0;//]]></script>";
                ClientScript.RegisterStartupScript(Page.GetType(), "OnLoad", script, false); //function to register new script
                txtBoxDate.Attributes.Add("readonly", "readonly"); //prevents user to manualy key in dates
                calendarExtenderDate.SelectedDate = DateTime.Now; //Initialize the selected date to be the current date
                calendarExtenderDate.EndDate = DateTime.Now;
                txtBoxDate.Text = DateTime.Now.ToString("dd MMM yyyy");
                labelDay.Text = DateTime.Now.DayOfWeek.ToString()+", "+DateTime.Today.ToString("dd MMM yyyy");
                InitializeLabelTimeClock(DateTime.Today);
                InitializeWorkingHours();
                InitializeGrid();
            }
        }