Beispiel #1
0
 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];
         }
     }
 }
Beispiel #2
0
 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();
     }
 }
Beispiel #3
0
        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();
        }
Beispiel #4
0
 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();
     }
 }
 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();
 }
Beispiel #6
0
 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];
     }
 }