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;
            }
        }
Example #2
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;
            }
        }
Example #3
0
        /// <summary>
        /// Executes the LoadLeadsCommand.
        /// </summary>
        public async void ExecuteLoadLeadsCommand()
        {
            if (IsBusy)
            {
                return;
            }

            IsBusy = true;
            LoadLeadsCommand.ChangeCanExecute();

            Leads.Clear();
            Leads.AddRange(await _DataClient.GetAccountsAsync(true));

            IsBusy = false;
            LoadLeadsCommand.ChangeCanExecute();
        }
Example #4
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;
        }