Exemple #1
0
        private async void button4_Click(object sender, EventArgs e)
        {
            string query = "";

            query = comboBox1.Text;
            APIClient.RootObject tickets = await _APIClient.APIGet(new APIFunctions.Tickets().GetTickets(),
                                                                   new List <KeyValuePair <string, string> > {
                new KeyValuePair <string, string>("query", query)
            });

            LoadDataView(tickets);
        }
Exemple #2
0
        private async void comboBox1_SelectionChangeCommitted(object sender, EventArgs e)
        {
            string query = "";

            query = ((ComboBox)sender).SelectedValue.ToString();
            APIClient.RootObject tickets = await _APIClient.APIGet(new APIFunctions.Customers().GetCustomers(),
                                                                   new List <KeyValuePair <string, string> > {
                new KeyValuePair <string, string>("query", query)
            });

            //MessageBox.Show(tickets.tickets[0].comments[tickets.tickets[0].comments.Count - 1].body);
        }
Exemple #3
0
        private async Task UpdateTicketInfoAsync(int index = 0)
        {
            textBox_Ticket_Issue.Text = lastTickets.tickets[index].GetInitIssue;
            label_Password.Text       = "Password: "******"query", lastTickets.tickets[index].customer_business_then_name)
            });

            label_Phone.Text = "Phone: " + customers.customers[0].phone;
            label_Email.Text = "Email: " + customers.customers[0].email;
        }
Exemple #4
0
 private bool LoadDataView(APIClient.RootObject tickets)
 {
     try
     {
         ticketsBindingSource.DataSource = tickets;
         ticketsBindingSource.ResetBindings(false);
         return(true);
     }
     catch
     {
         return(false);
     }
 }
Exemple #5
0
        private async void MainWindow_Load(object sender, EventArgs e)
        {
            //Setup the window positioning and size
            this.Left = System.Windows.Forms.Screen.PrimaryScreen.WorkingArea.Right - this.Width;
            this.Top  = System.Windows.Forms.Screen.PrimaryScreen.WorkingArea.Bottom - this.Height;

            //Load the API and then pull the tickets using it
            _APIClient.LoadAPI();
            APIClient.RootObject root = await _APIClient.APIGet(
                new APIFunctions.Tickets().GetTickets(
                    APIFunctions.Tickets.TicketStatusOptions.NotClosed));

            if (LoadDataView(root))
            {
                lastTickets = root;
                UpdateTicketInfoAsync();
            }
            else
            {
                //Error handling
            }
        }
Exemple #6
0
        private async void button_refresh_ClickAsync(object sender, EventArgs e)
        {
            APIClient.RootObject tickets = await _APIClient.APIGet(new APIFunctions.Tickets().GetTickets());

            LoadDataView(tickets);
        }