// ////////////////////////////////////////////////////////////////////////
        // EVENTS
        //
        protected void Page_Load(object sender, EventArgs e)
        {
            // Register client scripts
            this.RegisterClientScripts();

            if (!IsPostBack)
            {
                // Security check
                if (!(Convert.ToBoolean(Session["sgLFS_ITTST_SUPPORTTICKET_ADMIN"])))
                {
                    if (!(Convert.ToBoolean(Session["sgLFS_ITTST_SUPPORTTICKET_VIEW"]) && Convert.ToBoolean(Session["sgLFS_ITTST_SUPPORTTICKET_EDIT"])))
                    {
                        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 wucSupportTicketAssignedToMe.ascx");
                }

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

                // Prepare initial data
                HttpContext.Current.Session.Remove("dashboardSupportTicketAssignedToMeDataTableDummy");
                HttpContext.Current.Session.Remove("dashboardSupportTicketAssignedToMeOnHoldDataTableDummy");
                ArrayList arrayListWidgetData = (ArrayList)HttpContext.Current.Session["mySupportTicketAssignedToMeWidget"];
                ArrayList arrayListWidgetDataOnHold = (ArrayList)HttpContext.Current.Session["mySupportTicketAssignedToMeOnHoldWidget"];

                // If coming from
                // ... Out
                if (Request.QueryString["source_page"] == "out")
                {
                    int loginId = Convert.ToInt32(Session["loginID"]);
                    EmployeeGateway employeeGateway = new EmployeeGateway(new DataSet());
                    int employeeId = employeeGateway.GetEmployeIdByLoginId(loginId);

                    // ... For Grid
                    int companyId = Int32.Parse(hdfCompanyId.Value);

                    dashboardSupportTicketAssignedToMeTDS = new DashboardTDS();
                    DashboardSupportTicketAssignedToMe model = new DashboardSupportTicketAssignedToMe(dashboardSupportTicketAssignedToMeTDS);
                    DashboardSupportTicketAssignedToMeOnHold modelOnHold = new DashboardSupportTicketAssignedToMeOnHold(dashboardSupportTicketAssignedToMeTDS);

                    // ... Load support ticket
                    model.LoadCurrentSupportTicketAssignedToMeByEmployeeId(employeeId, companyId);
                    modelOnHold.LoadSupportTicketAssignedToMeOnHoldByEmployeeId(employeeId, companyId);

                    // ... Store datasets
                    HttpContext.Current.Session.Add("dashboardSupportTicketAssignedToMeTDS", dashboardSupportTicketAssignedToMeTDS);
                }
            }
            else
            {
                // Prepare initial data
                HttpContext.Current.Session.Remove("dashboardSupportTicketAssignedToMeDataTableDummy");
                HttpContext.Current.Session.Remove("dashboardSupportTicketAssignedToMeOnHoldDataTableDummy");

                // Restore dataset
                dashboardSupportTicketAssignedToMeTDS = (DashboardTDS)HttpContext.Current.Session["dashboardSupportTicketAssignedToMeTDS"];
            }
        }
 /// <summary>
 /// InitData. 
 /// </summary>
 protected override void InitData()
 {
     _data = new DashboardTDS();
 }
        private void LoadData()
        {
            dashboardMySupportTicketTDS = new DashboardTDS();
            DashboardMySupportTicket model = new DashboardMySupportTicket(dashboardMySupportTicketTDS);
            DashboardMySupportTicketOnHold modelOnHold = new DashboardMySupportTicketOnHold(dashboardMySupportTicketTDS);

            EmployeeGateway employeeGateway = new EmployeeGateway(new DataSet());

            int companyId = Int32.Parse(hdfCompanyId.Value);
            int loginId = Convert.ToInt32(Session["loginID"]);
            int employeeId = employeeGateway.GetEmployeIdByLoginId(loginId);
            string state = "%"; if (ddlStateMySupportTicket.SelectedValue != "(All)") state = ddlStateMySupportTicket.SelectedValue;

            // ... Load support ticket
            // ... ...Load for admin
            if (!Convert.ToBoolean(Session["sgLFS_ITTST_SUPPORTTICKET_ADMIN"]))
            {
                if (state == "New & In Progress")
                {
                    model.LoadMyNewAndInProgressSupportTicketByCreated(employeeId, companyId);
                }
                else
                {
                    // ... ... Load for assigned employee
                    model.LoadMyCurrentSupportTicketByCreatedByIdState(employeeId, state, companyId);
                }

                modelOnHold.LoadMyCurrentSupportTicketOnHoldByCreatedById(employeeId, companyId);
            }
            else
            {
                if (state == "New & In Progress")
                {
                    model.LoadNewAndInProgressSupportTicket(companyId);
                }
                else
                {
                    // ... ... Loads all (current)
                    model.LoadCurrentSupportTicketByState(state, companyId);
                }

                modelOnHold.LoadCurrentSupportTicketOnHold(companyId);
            }

            HttpContext.Current.Session.Add("dashboardMySupportTicketTDS", dashboardMySupportTicketTDS);

            Page.DataBind();
        }