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();
        }
    }
 // gets messages regarding supoprt ticket selected
 protected string retrieveMessage(string memberID, string staffID, string reply, string datePosted)
 {
     if (MemberDB.getMemberbyID(memberID).Email == SupportTicketDB.getSupportTicketbyID(Request.QueryString["ticketID"].ToString()).Member.Email)
     {
         return(" <div class='item'> \n " +
                " <div class='text'> \n " +
                " <div class='heading'> \n " +
                " <a class='text-success' href='#'>" + MemberDB.getMemberbyID(memberID).Name + "</a> \n " +
                " <span class='date'>" + Convert.ToString(datePosted) + "</span> \n " +
                " </div> \n " +
                reply +
                " </div> \n " +
                " </div> \n ");
     }
     else
     {
         return(" <div class='item'> \n " +
                " <div class='text'> \n " +
                " <div class='heading'> \n " +
                " <a href='#'> <Strong> (Staff) " + StaffDB.getStaffbyID(staffID).Name + " </strong> </a> \n " +
                " <span class='date'>" + Convert.ToString(datePosted) + "</span> \n " +
                " </div> \n " +
                reply +
                " </div> \n " +
                " </div> \n ");
     }
 }
Exemple #3
0
    // adds support ticket to database
    protected void btnSubmit_Click(object sender, EventArgs e)
    {
        int ticketIdentity = SupportTicketDB.insertTicket(tbxTitle.Text, txtArea.InnerText, DateTime.Now, "Pending", ddlUrgency.SelectedValue, MemberDB.getMemberbyEmail(Session["user"].ToString()).MemberID);


        string ticketID;

        ticketID = Utility.convertIdentitytoPK("TIC", ticketIdentity);

        MessageSupportTicketDB.insertMemberMessage(txtArea.InnerText, DateTime.Now, SupportTicketDB.getSupportTicketbyID(ticketID), MemberDB.getMemberbyEmail(Session["user"].ToString()).MemberID);
        Response.Redirect("ViewSupportTicket.aspx?ticketID=" + ticketID);
    }
Exemple #4
0
    protected void btnSubmit_Click(object sender, EventArgs e)
    {
        int ticketIdentity = SupportTicketDB.insertTicket(tbxTitle.Text, txtArea.InnerText, DateTime.Now, "Pending", ddlUrgency.SelectedValue, MemberDB.getMemberbyEmail(Session["user"].ToString()).MemberID);


        string ticketID = "TIC";

        for (int x = 0; x < 9 - ticketIdentity.ToString().Length; x++)
        {
            ticketID += "0";
        }
        ticketID += ticketIdentity.ToString();

        MessageSupportTicketDB.insertMemberMessage(txtArea.InnerText, DateTime.Now, SupportTicketDB.getSupportTicketbyID(ticketID), MemberDB.getMemberbyEmail(Session["user"].ToString()).MemberID);
        Response.Redirect("ViewSupportTicket.aspx?ticketID=" + ticketID);
    }
Exemple #5
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);
            }
        }
    }
Exemple #6
0
    // insert support ticket into database
    protected void btnSubmit_Click(object sender, EventArgs e)
    {
        MessageSupportTicketDB.insertMemberMessage(txtMsg.InnerText, DateTime.Now, SupportTicketDB.getSupportTicketbyID(Request.QueryString["ticketID"]), MemberDB.getMemberbyEmail(Session["user"].ToString()).MemberID);

        Response.Redirect(Request.RawUrl);
    }
 // allows user to send messages
 protected void btnSend_Click(object sender, EventArgs e)
 {
     MessageSupportTicketDB.insertAdminMessage(txtMsg.InnerText, DateTime.Now, SupportTicketDB.getSupportTicketbyID(Request.QueryString["ticketID"].ToString()), StaffDB.getStaffbyEmail(Session["admin"].ToString()).StaffID);
     Response.Redirect(Request.RawUrl);
 }
    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();
        }
    }