private void runSendAction() { ParametersReader.ReadDefaultNames(); ParametersReader.ReadDefaultVariables(); /* RequestsHandler.requestTypeIndex = requestTypeComboBox.SelectedIndex; * RequestsHandler.entityTypeIndex = entityTypeComboBox.SelectedIndex;*/ RequestsHandler.SendJson(); }
private void button1_Click(object sender, EventArgs e) { string warningMessage = ""; if (customEnvorinmentCheckBox.Checked) { if (environmentTextBox.Text == "") { warningMessage += "'Environment URL' field is not filled\n"; } } if (textBox2.Text == "") { warningMessage += "'Login' field is not filled\n"; } if (textBox3.Text == "") { warningMessage += "'Password' field is not filled\n"; } if (!customEnvorinmentCheckBox.Checked) { selectedEnvironmentLink = ((KeyValuePair <string, string>)environmentComboBox.SelectedItem).Value; selectedEnvironmentKey = ((KeyValuePair <string, string>)environmentComboBox.SelectedItem).Key; } else { selectedEnvironmentLink = environmentTextBox.Text; selectedEnvironmentKey = "Custom"; } if (warningMessage == "") { newLoginValue = textBox2.Text; newPasswordValue = textBox3.Text; ParametersReader.UpdateDefaultCredentials(); RequestsHandler.CreateObject(newLoginValue, newPasswordValue); if (RequestsHandler.ApiToken != null) { this.Hide(); quickAPIMain.Show(); } //TODO: add different messages for different returned status numbers else { Console.Out.WriteLine("API token was not received. Please check your input parameters."); } } else { MessageBox.Show(warningMessage); } }