Exemplo n.º 1
0
        private void btnGetClientDetials_Click(object sender, EventArgs e)
        {
            // get the selected client
            var selectedClient = lstClients.SelectedItem as Client;

            if (selectedClient == null)
            {
                MessageBox.Show("Please select a client");
                btnTrackedLinks.Enabled = false;
                btnLeads.Enabled = false;
                return;
            }

            var auth = new BasicAuthentication(txtUserName.Text, txtPassword.Text);

            var restClient = new WowClient(_baseUrl, auth, 2, "Test Client");

            var client = restClient.GetClientDetails(selectedClient.Id.ToString());

            txtName.Text = client.Name;
            txtId.Text = client.Id;
            txtVisitsMonth.Text = client.CompanyVisitsThisMonth.ToString();
            txtVisitsToday.Text = client.CompanyVisitsToday.ToString();
            txtExpires.Text = client.AccountExpiry.ToString();

            btnTrackedLinks.Enabled = true;
            btnLeads.Enabled = true;
        }
Exemplo n.º 2
0
        private void btnMarkProcessed_Click(object sender, EventArgs e)
        {
            var take = int.Parse(valueTake.Text);
            var auth = new BasicAuthentication(UserName, Password);
            Guid processId = Guid.Parse(txtProcessId.Text);

            var restClient = new WowClient(_baseUrl, auth, 2, "Test Client");

            var trackedLinks = restClient.MarkTrackedLinksProcessed(ClientId, processId);

            dataTrackedLinks.DataSource = null;
            dataTrackedLinks.Refresh();
        }
Exemplo n.º 3
0
        private void btnGetTrackedLinks_Click(object sender, EventArgs e)
        {
            var take = int.Parse(valueTake.Text);
            var auth = new BasicAuthentication(UserName, Password);

            var restClient = new WowClient(_baseUrl, auth, 2, "Test Client");

            var trackedLinks = restClient.GetTrackedLinks(ClientId, take);

            txtProcessId.Text = trackedLinks.ProcessId.ToString();

            dataTrackedLinks.DataSource = trackedLinks.TrackedLinks;
            dataTrackedLinks.Refresh();
        }
Exemplo n.º 4
0
 private async void Leads_Load(object sender, EventArgs e)
 {
     var auth = new BasicAuthentication(UserName, Password);
     var restClient = new WowClient(_baseUrl, auth, 2, "Test Client");
     await restClient.GetLeadTypesAsync()
         .ContinueWith(t =>
         {
             //cbLeadTypes.Items.AddRange(t.Result.ToArray()) 
             BeginInvoke((Action)(() =>
             {
                 var data = t.Result.ToArray();
                 cbLeadTypes.Items.AddRange(data);
             }));
         });
 }
Exemplo n.º 5
0
        private async void btnGetClientDetails_Click(object sender, EventArgs e)
        {
            var auth = new BasicAuthentication(txtUserName.Text, txtPassword.Text);

            var restClient = new WowClient(_baseUrl, auth, 2, "Test Client");

            var clients = await restClient.ClientsAsync();


            var clientResult = clients;

            lstClients.DataSource = clientResult;
            lstClients.DisplayMember = "Name";


        }
Exemplo n.º 6
0
        private async void btnGetLeads_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(cbLeadTypes.Text))
            {
                return;
            }

            var auth = new BasicAuthentication(UserName, Password);
            var restClient = new WowClient(_baseUrl, auth, 2, "Test Client");

            await restClient.GetLeadsAsync(ClientId, cbLeadTypes.Text, DateTime.Now.AddDays(-1), DateTime.Now, 1, 100)
                .ContinueWith(t =>
                {
                    //cbLeadTypes.Items.AddRange(t.Result.ToArray()) 
                    BeginInvoke((Action)(() =>
                    {
                        txtLeads.Text = Newtonsoft.Json.JsonConvert.SerializeObject(t.Result, Formatting.Indented);
                    }));
                });
        }