protected void Page_Load(object sender, EventArgs e)
    {
        // user has selected a support ticket to be viewed. this page displays messages and information regarding support ticket selected


        //checks if user has logged in
        if (Session["admin"] == null) // if user is not logged in, redirect to login page
        {
            Response.Redirect("Login.aspx");
            return;
        }

        // checks if support ticket is selected
        if (Request.QueryString["ticketID"] == null) // if nothing selected, redirect back to SupportTicketList page
        {
            Response.Redirect("~/SupportTicketList.aspx");
        }
        else // if support ticket is selected, display the correct information and meessages related to it
        {
            List <MessageSupportTicket> supportTicketMsg = MessageSupportTicketDB.getMessage(SupportTicketDB.getSupportTicketbyID(Request.QueryString["ticketID"].ToString()));
            rptMessages.DataSource = supportTicketMsg;
            rptMessages.DataBind();


            List <SupportTicket> supportTicketList = new List <SupportTicket>();

            supportTicketList.Add(SupportTicketDB.getSupportTicketbyID(Request.QueryString["ticketID"].ToString()));


            rptMemberInfoRedirect.DataSource = supportTicketList;
            rptMemberInfoRedirect.DataBind();
        }
    }
Exemple #2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        // check if user is logged in
        if (Session["user"] == null)
        {
            Session["pageRedirectAfterLogin"] = Request.RawUrl;
            Response.Redirect("Login.aspx"); // not logged in, go to login page
            return;
        }

        if (Request.QueryString["ticketID"] == null)       // check if ticket is selected
        {
            Response.Redirect("~/SupportTicketList.aspx"); // if not selected, go back to list
        }
        else
        {
            if (SupportTicketDB.isTicketforMemberPresent(Request.QueryString["ticketID"].ToString(), MemberDB.getMemberbyEmail(Session["user"].ToString()).MemberID))
            {
                List <SupportTicket> ticketInfo = new List <SupportTicket>();
                ticketInfo.Add(SupportTicketDB.getSupportTicketbyID(Request.QueryString["ticketID"]));
                rptInfo.DataSource = ticketInfo;
                rptInfo.DataBind();

                if (ticketInfo[0].Status == "Closed")
                {
                    btnSubmit.Visible   = false;
                    txtMsg.Visible      = false;
                    lblMessages.Visible = false;
                }

                // display messages for support ticket
                List <MessageSupportTicket> supportTicketMsg = MessageSupportTicketDB.getMessage(SupportTicketDB.getSupportTicketbyID(Request.QueryString["ticketID"].ToString()));
                rptMessages.DataSource = supportTicketMsg;
                rptMessages.DataBind();
            }
            else
            {
                btnSubmit.Visible   = false;
                txtMsg.Visible      = false;
                lblMessages.Visible = false;
                ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('Inaccessible Page!')", true);
            }
        }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Session["user"] == null)
        {
            Session["pageRedirectAfterLogin"] = Request.RawUrl;
            Response.Redirect("Login.aspx");
            return;
        }

        if (Request.QueryString["ticketID"] == null)
        {
            Response.Redirect("~/SupportTicketList.aspx");
        }
        else
        {
            List <MessageSupportTicket> supportTicketMsg = MessageSupportTicketDB.getMessage(SupportTicketDB.getSupportTicketbyID(Request.QueryString["ticketID"].ToString()));
            rptMessages.DataSource = supportTicketMsg;
            rptMessages.DataBind();
        }
    }