Exemplo n.º 1
0
        private async Task ShowCampaigns()
        {
            //If the current campaign is older then seven days, don't show it.
            if ((DateTime.UtcNow - Campaigns.Current.DateUTC).TotalDays > 7)
            {
                return;
            }
            List <Campaign> cookieCampaigns;

            if (await LocalStorage.ContainKeyAsync(Campaigns.CookieName))
            {
                cookieCampaigns = await LocalStorage.GetItemAsync <List <Campaign> >(Campaigns.CookieName);
            }
            else
            {
                cookieCampaigns = new List <Campaign>();
            }


            if (cookieCampaigns.Count == 0 ||
                cookieCampaigns.Last().DateUTC != Campaigns.Current.DateUTC)
            {
                await MatDialogService.OpenAsync(typeof(DialogWithPaypal),
                                                 new MatDialogOptions
                {
                    Attributes = new Dictionary <string, object> {
                        ["Campaign"] = Campaigns.Current
                    }
                });

                await LocalStorage.SetItemAsync(Campaigns.CookieName, Campaigns.All);
            }
        }
Exemplo n.º 2
0
        async Task OpenAddPersonaDialog()
        {
            await MatDialogService.OpenAsync(typeof(AddPersona), null);

            await FetchData();

            StateHasChanged();
        }
Exemplo n.º 3
0
        async Task OpenUpdatePersonaDialog(string DNI)
        {
            await MatDialogService.OpenAsync(typeof(UpdatePersona), new MatDialogOptions { Attributes = new Dictionary <string, object>()
                                                                                           {
                                                                                               { "DNI", DNI }
                                                                                           } });

            await FetchData();

            StateHasChanged();
        }