/// <summary>
        /// UpdateForDashboard
        /// </summary>        
        /// <param name="companyId">companyId</param>
        private void UpdateForDashboard(int companyId)
        {
            foreach (DashboardTDS.DashboardSupportTicketAssignedToMeRow row in (DashboardTDS.DashboardSupportTicketAssignedToMeDataTable)Table)
            {
                int supportTicketId = row.SupportTicketID;

                SupportTicketInformationActivityInformation supportTicketInformationActivityInformation = new SupportTicketInformationActivityInformation();
                supportTicketInformationActivityInformation.LoadAllBySupportTicketId(supportTicketId, companyId);

                int lastRefId = supportTicketInformationActivityInformation.GetLastAssignedUserRefId();

                if (row.RefID != lastRefId)
                {
                    row.Delete();
                }
            }
        }
        private void LoadActivityData(int supportTicketId, int companyId)
        {
            SupportTicketInformationActivityInformation supportTicketInformationActivityInformation = new SupportTicketInformationActivityInformation();
            supportTicketInformationActivityInformation.LoadAllBySupportTicketId(supportTicketId, companyId);
            int lastRefId = supportTicketInformationActivityInformation.GetLastAssignedUserRefId();

            SupportTicketInformationActivityInformationGateway supportTicketInformationActivityInformationGateway = new SupportTicketInformationActivityInformationGateway(supportTicketInformationActivityInformation.Data);
            supportTicketInformationActivityInformationGateway.LoadAllBySupportTicketId(supportTicketId, companyId);

            if (supportTicketInformationActivityInformationGateway.Table.Rows.Count > 0)
            {
                // For last assigned user
                tbxAssignedUser.Text = supportTicketInformationActivityInformationGateway.GetEmployeeFullName(supportTicketId, lastRefId);
                hdfAssignedUser.Value = supportTicketInformationActivityInformationGateway.GetEmployeeID(supportTicketId, lastRefId).ToString();
            }
        }
        // ////////////////////////////////////////////////////////////////////////
        // 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) || ((string)Request.QueryString["supportTicket_id"] == null) || ((string)Request.QueryString["action"] == null))
                {
                    Response.Redirect("./../../error_page.aspx?error=" + "Invalid query string in supportTicket_activity.aspx");
                }

                // Tag Page
                hdfCompanyId.Value = Session["companyID"].ToString();
                hdfSupportTicketId.Value = Request.QueryString["supportTicket_id"].ToString();
                hdfAction.Value = Request.QueryString["action"].ToString();
                hdfDashboard.Value = Request.QueryString["dashboard"].ToString();

                // If coming from
                int companyId = Int32.Parse(hdfCompanyId.Value.Trim());
                int currentSupportTicketId = Int32.Parse(hdfSupportTicketId.Value.ToString());

                Session.Remove("activityInformationDummyForST");

                // ... supportTicket_navigator2.aspx
                if (Request.QueryString["source_page"] == "supportTicket_navigator2.aspx")
                {
                    StoreNavigatorState();
                    supportTicketInformationTDS = new SupportTicketInformationTDS();
                    activityInformation = new SupportTicketInformationTDS.ActivityInformationDataTable();

                    SupportTicketInformationBasicInformation supportTicketInformationBasicInformation = new SupportTicketInformationBasicInformation(supportTicketInformationTDS);
                    supportTicketInformationBasicInformation.LoadAllBySupportTicketId(currentSupportTicketId, companyId);

                    SupportTicketInformationBasicInformationGateway supportTicketInformationBasicInformationGatewayForState = new SupportTicketInformationBasicInformationGateway(supportTicketInformationBasicInformation.Data);
                    string state = supportTicketInformationBasicInformationGatewayForState.GetState(currentSupportTicketId);
                    if (state == "Completed") hdfCompleted.Value = "True";

                    SupportTicketInformationActivityInformation supportTicketInformationActivityInformation = new SupportTicketInformationActivityInformation(supportTicketInformationTDS);
                    supportTicketInformationActivityInformation.LoadAllBySupportTicketId(currentSupportTicketId, companyId);

                    // Store dataset
                    Session["supportTicketInformationTDS"] = supportTicketInformationTDS;
                    Session["activityInformationForST"] = activityInformation;
                }

                // ... supportTicket_summary.aspx or supportTicket_edit.aspx
                if ((Request.QueryString["source_page"] == "supportTicket_summary.aspx") || (Request.QueryString["source_page"] == "supportTicket_edit.aspx"))
                {
                    StoreNavigatorState();
                    ViewState["update"] = Request.QueryString["update"];

                    // Restore dataset
                    supportTicketInformationTDS = (SupportTicketInformationTDS)Session["supportTicketInformationTDS"];
                    activityInformation = (SupportTicketInformationTDS.ActivityInformationDataTable)Session["activityInformationForST"];

                    if (ViewState["update"].ToString().Trim() == "yes")
                    {
                        SupportTicketInformationBasicInformation supportTicketInformationBasicInformation = new SupportTicketInformationBasicInformation(supportTicketInformationTDS);
                        supportTicketInformationBasicInformation.LoadAllBySupportTicketId(currentSupportTicketId, companyId);

                        SupportTicketInformationBasicInformationGateway supportTicketInformationBasicInformationGatewayForState = new SupportTicketInformationBasicInformationGateway(supportTicketInformationBasicInformation.Data);
                        string state = supportTicketInformationBasicInformationGatewayForState.GetState(currentSupportTicketId);
                        if (state == "Completed") hdfCompleted.Value = "True";

                        SupportTicketInformationActivityInformation supportTicketInformationActivityInformation = new SupportTicketInformationActivityInformation(supportTicketInformationTDS);
                        supportTicketInformationActivityInformation.LoadAllBySupportTicketId(currentSupportTicketId, companyId);

                        // Store dataset
                        Session["supportTicketInformationTDS"] = supportTicketInformationTDS;
                        Session["activityInformationForST"] = activityInformation;
                    }
                }

                // Prepare initial data
                // ... for subject
                SupportTicketInformationBasicInformationGateway supportTicketInformationBasicInformationGateway = new SupportTicketInformationBasicInformationGateway();
                supportTicketInformationBasicInformationGateway.LoadAllBySupportTicketId(currentSupportTicketId, companyId);
                lblTitleSubjectName.Text = " " + supportTicketInformationBasicInformationGateway.GetSubject(currentSupportTicketId);

                // ... Data for current to do list
                LoadSupportTicketData(currentSupportTicketId, companyId);
            }
            else
            {
                // Restore datasets
                supportTicketInformationTDS = (SupportTicketInformationTDS)Session["supportTicketInformationTDS"];
                activityInformation = (SupportTicketInformationTDS.ActivityInformationDataTable)Session["activityInformationForST"];
            }
        }