async Task Save()
        {
            if (string.IsNullOrEmpty(Customer.FirstName) || string.IsNullOrEmpty(Customer.LastName))
            {
                throw new DomainLogicException("Please provide First Name and Last Name!");
            }

            if (!ValidationService.IsEnglishLetters(Customer.FirstName) || !ValidationService.IsEnglishLetters(Customer.LastName) || Customer.FirstName.Length > 20 || Customer.LastName.Length > 30)
            {
                throw new DomainLogicException("Invalid First Name or Last Name!");
            }

            UserDialogs.ShowLoading();

            if (Action == Action.Add)
            {
                await Add();
            }
            else
            {
                await Update();
            }

            UserDialogs.HideLoading();

            await NavigationService.GoBackAsync();
        }
예제 #2
0
        async Task Delete()
        {
            UserDialogs.ShowLoading();

            await ODataClient.Customers().Key(Customer.Id)
            .DeleteEntryAsync();

            UserDialogs.HideLoading();

            await NavigationService.GoBackAsync();
        }
예제 #3
0
        private async Task OnDisplayInsterstitialVideoAd()
        {
            string adsId = string.Empty;

            switch (Device.RuntimePlatform)
            {
            case Device.Android: adsId = "ca-app-pub-3940256099942544/8691691433"; break;

            case Device.iOS: adsId = "ca-app-pub-3940256099942544/5135589807"; break;
            }

            UserDialogs.ShowLoading();
            _admobPlugin.LoadInterstitial(adsId);
            await Task.Delay(2000);

            UserDialogs.HideLoading();
            _admobPlugin.ShowInterstitial();
        }
예제 #4
0
        private async Task OnDisplayRewardedVideoAd()
        {
            string adsId = string.Empty;

            switch (Device.RuntimePlatform)
            {
            case Device.Android: adsId = "ca-app-pub-3940256099942544/5224354917"; break;

            case Device.iOS: adsId = "ca-app-pub-3940256099942544/1712485313"; break;
            }

            UserDialogs.ShowLoading();
            _admobPlugin.LoadRewardedVideo(adsId);
            await Task.Delay(2000);

            UserDialogs.HideLoading();
            _admobPlugin.ShowRewardedVideo();
        }
예제 #5
0
        private async Task OnDisplayInterstitialAd()
        {
            string adsId = string.Empty;

            switch (Device.RuntimePlatform)
            {
            case Device.Android: adsId = "ca-app-pub-3940256099942544/1033173712"; break;

            case Device.iOS: adsId = "ca-app-pub-3940256099942544/4411468910"; break;
            }

            UserDialogs.ShowLoading();
            _admobPlugin.LoadInterstitial(adsId);
            await Task.Delay(2000);

            UserDialogs.HideLoading();
            _admobPlugin.ShowInterstitial();
        }