Exemple #1
0
        private void ticketsList_MouseDoubleClick(object sender, MouseEventArgs e)
        {
            RequestTroubleTicket request = new RequestTroubleTicket();

            request.id = this.ticketsList.SelectedItems[0].SubItems[0].Text;

            //Making the register request
            ResponseTroubleTicket response = (ResponseTroubleTicket)WebRequestPost.makeRequest <ResponseTroubleTicket>("/troubletickets/get", request);

            if (response.error.Equals("1"))
            {
                MessageBox.Show(
                    response.message,
                    "Error",
                    MessageBoxButtons.OK,
                    MessageBoxIcon.Error);
            }
            else if (!response.error.Equals("0"))
            {
                MessageBox.Show(
                    "What??",
                    "Seriously, what?",
                    MessageBoxButtons.OK,
                    MessageBoxIcon.Question);
            }

            viewTicketWorker window = new viewTicketWorker();

            window.changeStatusText(response.state);
            window.changeTitleText(response.title);
            window.changeDescriptionText(response.description);
            window.changeAnswerText(response.answer);
            window.changeDateTextBox(response.date);
            window.changeSolverNameText(response.solverName);
            window.Show();
        }
Exemple #2
0
        private void assignedTicketsList_MouseDoubleClick(object sender, MouseEventArgs e)
        {
            //Creates new window
            showAssignedTicketITSolver wind = new showAssignedTicketITSolver();

            wind.name     = this.name;
            wind.email    = this.email;
            wind.solverid = this.solverid;
            wind.ticketId = this.assignedTicketsList.SelectedItems[0].SubItems[0].Text;
            bool ctrl = false;

            //--------------------------------------------------
            //Request information for the clicked trouble ticket
            //--------------------------------------------------
            RequestTroubleTicket request2 = new RequestTroubleTicket();

            request2.id = this.assignedTicketsList.SelectedItems[0].SubItems[0].Text;

            ResponseTroubleTicket response2 = (ResponseTroubleTicket)WebRequestPost.makeRequest <ResponseTroubleTicket>("/troubletickets/get", request2);

            if (response2.error.Equals("1"))
            {
                MessageBox.Show(
                    response2.message,
                    "Error",
                    MessageBoxButtons.OK,
                    MessageBoxIcon.Error);
            }
            else if (!response2.error.Equals("0"))
            {
                MessageBox.Show(
                    "What??",
                    "Seriously, what?",
                    MessageBoxButtons.OK,
                    MessageBoxIcon.Question);
            }
            //--------------------------------------------

            wind.changeAnswerText(response2.answer);
            if (response2.answer != null)
            {
                if (!response2.answer.Equals(""))
                {
                    wind.makeAnswerTextBoxUnavailable();
                    wind.makeSubmitButtonUclickable();
                    wind.makeSubmitIssueButtonUnclickable();
                    wind.makeRefreshButtonUnclickable();
                }
            }
            wind.changeDescriptionText(response2.description);
            wind.changeStatusText(response2.state);
            wind.changeTitleText(response2.title);
            wind.changeAuthorText(response2.name);
            wind.changeDateText(response2.date);

            //--------------------------------------------
            //Request for secondary questions
            //--------------------------------------------
            RequestSecondaryQuestions request3 = new RequestSecondaryQuestions();

            request3.id = this.assignedTicketsList.SelectedItems[0].SubItems[0].Text;

            ResponseSecondaryQuestions response3 = (ResponseSecondaryQuestions)WebRequestPost.makeRequest <ResponseSecondaryQuestions>("/troubletickets/getsecondaryquestions", request3);

            if (response3.error.Equals("1"))
            {
                MessageBox.Show(
                    response3.message,
                    "Error",
                    MessageBoxButtons.OK,
                    MessageBoxIcon.Error);
            }
            else if (!response3.error.Equals("0"))
            {
                MessageBox.Show(
                    "What??",
                    "Seriously, what?",
                    MessageBoxButtons.OK,
                    MessageBoxIcon.Question);
            }
            //--------------------------------------------

            foreach (TroubleTicket ticket in response3.secondaryQuestions)
            {
                wind.addSubTicket(ticket.id, ticket.title, ticket.state);
                if (ticket.state.Equals("waiting"))
                {
                    ctrl = true;
                }
            }

            if (ctrl == true)
            {
                wind.makeSubmitButtonUclickable();
                wind.makeAnswerTextBoxUnavailable();
            }
            wind.ShowDialog();
            this.refreshButton_Click(sender, e);
        }