protected async System.Threading.Tasks.Task Grid0RowSelect(CaApp.Models.ConData.Country args)
        {
            var dialogResult = await DialogService.OpenAsync <EditCountry>("Edit Country", new Dictionary <string, object>() { { "CountryID", args.CountryID } });

            await grid0.Reload();

            await InvokeAsync(() => { StateHasChanged(); });
        }
        protected async System.Threading.Tasks.Task Form0Submit(CaApp.Models.ConData.Country args)
        {
            try
            {
                var conDataCreateCountryResult = await ConData.CreateCountry(country : country);

                DialogService.Close(country);
            }
            catch (System.Exception conDataCreateCountryException)
            {
                NotificationService.Notify(NotificationSeverity.Error, $"Error", $"Unable to create new Country!");
            }
        }
Ejemplo n.º 3
0
        public async System.Threading.Tasks.Task <Models.ConData.Country> CreateCountry(Models.ConData.Country country = default(Models.ConData.Country))
        {
            var uri = new Uri(baseUri, $"Countries");

            var httpRequestMessage = new HttpRequestMessage(HttpMethod.Post, uri);

            httpRequestMessage.Content = new StringContent(ODataJsonSerializer.Serialize(country), Encoding.UTF8, "application/json");

            OnCreateCountry(httpRequestMessage);

            var response = await httpClient.SendAsync(httpRequestMessage);

            return(await response.ReadAsync <Models.ConData.Country>());
        }
Ejemplo n.º 4
0
        public async System.Threading.Tasks.Task <HttpResponseMessage> UpdateCountry(int?countryId = default(int?), Models.ConData.Country country = default(Models.ConData.Country))
        {
            var uri = new Uri(baseUri, $"Countries({countryId})");

            var httpRequestMessage = new HttpRequestMessage(HttpMethod.Patch, uri);

            httpRequestMessage.Content = new StringContent(ODataJsonSerializer.Serialize(country), Encoding.UTF8, "application/json");

            OnUpdateCountry(httpRequestMessage);
            return(await httpClient.SendAsync(httpRequestMessage));
        }
 protected async System.Threading.Tasks.Task Load()
 {
     country = new CaApp.Models.ConData.Country()
     {
     };
 }
        protected async System.Threading.Tasks.Task Load()
        {
            var conDataGetCountryByCountryIdResult = await ConData.GetCountryByCountryId(countryId : CountryID);

            country = conDataGetCountryByCountryIdResult;
        }