Beispiel #1
0
        async Task ExecuteLoadLeadsCommand()
        {
            if (IsBusy)
            {
                return;
            }

            IsBusy = true;

            try
            {
                Leads.Clear();
                var leads = await DataStore.GetLeadsAsync(true);

                foreach (var lead in leads)
                {
                    Leads.Add(new LeadDetailViewModel(nav, lead));
                }
            }
            catch (Exception ex)
            {
                Debug.WriteLine(ex);
            }
            finally
            {
                IsBusy = false;
            }
        }
        private async Task LoadProjectLeads()
        {
            if (IsBusy)
            {
                return;
            }

            IsBusy = true;

            try
            {
                Leads.Clear();
                var projectLeads = await ApiClient.Instance.GetProjectLeads(Project.uuid);

                foreach (var lead in projectLeads)
                {
                    Leads.Add(new ProjectLeadDto
                    {
                        Uuid        = lead["uuid"],
                        Ip          = lead["ip"],
                        Posted      = lead["posted"],
                        Data        = lead,
                        Display     = lead.ContainsKey("Email") ? $"Email: {lead["Email"]}" : $"Uuid: {lead["uuid"]}",
                        ProjectUuid = Project.uuid
                    });
                }
            }
            catch (Exception ex)
            {
            }
            finally
            {
                IsBusy = false;
            }
        }
Beispiel #3
0
        private async Task ExecuteLoadLeadsCommand()
        {
            if (IsBusy)
            {
                return;
            }

            IsBusy = true;

            Leads.Clear();
            IEnumerable <Account> accounts = await dataManager.GetAccountsAsync(true);

            foreach (var account in accounts)
            {
                Leads.Add(account);
            }

            IsBusy = false;
        }