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(); }
// //////////////////////////////////////////////////////////////////////// // 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 wucMySupportTicket.ascx"); } // Tag page hdfCompanyId.Value = Session["companyID"].ToString(); // Prepare initial data HttpContext.Current.Session.Remove("dashboardMySupportTicketDataTableDummy"); HttpContext.Current.Session.Remove("dashboardMySupportTicketOnHoldDataTableDummy"); ArrayList arrayListWidgetData = (ArrayList)HttpContext.Current.Session["mySupportTicketWidget"]; ArrayList arrayListWidgetDataOnHold = (ArrayList)HttpContext.Current.Session["mySupportTicketOnHoldWidget"]; // 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); string state = "%"; if (ddlStateMySupportTicket.SelectedValue != "(All)") state = ddlStateMySupportTicket.SelectedValue; // ... For Grid int companyId = Int32.Parse(hdfCompanyId.Value); dashboardMySupportTicketTDS = new DashboardTDS(); DashboardMySupportTicket model = new DashboardMySupportTicket(dashboardMySupportTicketTDS); DashboardMySupportTicketOnHold modelOnHold = new DashboardMySupportTicketOnHold(dashboardMySupportTicketTDS); if (HttpContext.Current.Session["mySupportTicketWidget"] != null) { ddlStateMySupportTicket.SelectedIndex = Convert.ToInt32(arrayListWidgetData[1].ToString()); if (ddlStateMySupportTicket.SelectedValue != "(All)") state = ddlStateMySupportTicket.SelectedValue; } // ... Load support ticket // ... ...Load for admin if (!Convert.ToBoolean(Session["sgLFS_ITTST_SUPPORTTICKET_ADMIN"])) { // ... Load for assigned employee model.LoadMyCurrentSupportTicketByCreatedByIdState(employeeId, state, companyId); modelOnHold.LoadMyCurrentSupportTicketOnHoldByCreatedById(employeeId, companyId); } else { // ... ... Loads all (current) model.LoadCurrentSupportTicketByState(state, companyId); modelOnHold.LoadCurrentSupportTicketOnHold(companyId); } // ... Store datasets HttpContext.Current.Session.Add("dashboardMySupportTicketTDS", dashboardMySupportTicketTDS); } } else { // Prepare initial data HttpContext.Current.Session.Remove("dashboardMySupportTicketDataTableDummy"); HttpContext.Current.Session.Remove("dashboardMySupportTicketOnHoldDataTableDummy"); // Restore dataset dashboardMySupportTicketTDS = (DashboardTDS)HttpContext.Current.Session["dashboardMySupportTicketTDS"]; } }