コード例 #1
0
ファイル: Form1.cs プロジェクト: nijasnazar33/API_GUI_Tool
 private void btnCallAPI_Click(object sender, EventArgs e)
 {
     if (tbAuthToken.Text == "")
     {
         NotifyForm frm = new NotifyForm("Please provide AuthToken", "Message");
         frm.Show();
     }
     else
     {
         string[] APIResponse = new string[2];
         Cursor.Current = Cursors.WaitCursor;
         APIResponse    = APIAccess.CallFieldAPI(tbAuthToken.Text.ToString(), cbFieldAPIList.Text.ToString(),
                                                 tbAPIField.Text.ToString(), tbAPIActivity.Text.ToString());
         Cursor.Current = Cursors.Default;
         if (APIResponse[0] == "error")
         {
             NotifyForm frm = new NotifyForm(APIResponse[1], "Message");
             frm.Show();
         }
         else
         {
             rtbAPIResult.Text = APIResponse[1];
             fieldAPIURL       = APIResponse[0];
         }
     }
 }
コード例 #2
0
ファイル: Form1.cs プロジェクト: nijasnazar33/API_GUI_Tool
 private void btnViewAPIURL_Click(object sender, EventArgs e)
 {
     if (fieldAPIURL == null)
     {
         NotifyForm frm = new NotifyForm("No API Called.", "Message");
         frm.Show();
     }
     else
     {
         Clipboard.SetText(fieldAPIURL);
         NotifyForm frm = new NotifyForm("Copied API call to clipboard.", "Message");
         frm.Show();
     }
 }
コード例 #3
0
ファイル: Form1.cs プロジェクト: nijasnazar33/API_GUI_Tool
        private void btnSaveInfo_Click(object sender, EventArgs e)
        {
            Cursor.Current = Cursors.WaitCursor;
            StreamWriter writer = new StreamWriter("config_file.txt");

            using (writer)
            {
                writer.WriteLine(tbAccessKey.Text);
                writer.WriteLine(tbSecretKey.Text);
                writer.WriteLine(tbEmailID.Text);
                writer.WriteLine(tbReportLocation.Text);
            }
            Cursor.Current = Cursors.Default;
            NotifyForm frm = new NotifyForm("Saved successfully", "Message");

            frm.Show();
        }
コード例 #4
0
ファイル: Form1.cs プロジェクト: nijasnazar33/API_GUI_Tool
 private void btnRenewKey_Click(object sender, EventArgs e)
 {
     if (tbEmailID.Text == "")
     {
         NotifyForm frm = new NotifyForm("Please update registered Email address", "Message");
         frm.Show();
     }
     else if (tbSecretKey.Text == "")
     {
         NotifyForm frm = new NotifyForm("Please update Secret key", "Message");
         frm.Show();
     }
     else
     {
         ConfirmationForm cnf = new ConfirmationForm(tbSecretKey.Text.ToString(), tbEmailID.Text.ToString());
         cnf.Show();
     }
 }
コード例 #5
0
 private void btnRenewAccessKeyYes_Click(object sender, EventArgs e)
 {
     string[] APIResponse = new string[2];
     Cursor.Current = Cursors.WaitCursor;
     APIResponse    = APIAccess.RenewAccessKey(this.secretKey, this.emailID);
     Cursor.Current = Cursors.Default;
     if (APIResponse[0] == "error")
     {
         NotifyForm frm = new NotifyForm(APIResponse[1], "Message");
         frm.Show();
     }
     else
     {
         NotifyForm frm = new NotifyForm("Success! Check your mail.", "Message");
         frm.Show();
     }
     //NotifyForm frm = new NotifyForm("Success! Check your mail.", "Message");
     //frm.Show();
     this.Close();
 }
コード例 #6
0
ファイル: Form1.cs プロジェクト: nijasnazar33/API_GUI_Tool
 private void btnGetAccess_Click(object sender, EventArgs e)
 {
     string[] APIResponse = new string[2];
     Cursor.Current = Cursors.WaitCursor;
     APIResponse    = APIAccess.GetTenantAccess(tbAccessKey.Text.ToString(),
                                                tbSecretKey.Text.ToString(),
                                                tbShortCode.Text.ToString(),
                                                tbIPAddress.Text.ToString(),
                                                tbReason.Text.ToString());
     Cursor.Current = Cursors.Default;
     if (APIResponse[0] == "error")
     {
         NotifyForm frm = new NotifyForm(APIResponse[1], "Message");
         frm.Show();
     }
     else
     {
         tbURL.Text      = APIResponse[0];
         tbResponse.Text = APIResponse[1];
     }
 }