Esempio n. 1
0
        /// <summary>
        /// Invoked method get countries
        /// </summary>
        /// <param name="obj">The object</param>
        async void GetCountries()
        {
            try
            {
                CountriesDetails        = new List <Countries>();
                this.CountriesDetailAux = new ObservableCollection <Countries>();

                var resultCountries = await DataStoreCountries.GetCountriesAsync();

                if (resultCountries.Message == "OK")
                {
                    var result = resultCountries.Data as List <Countries>;
                    result.ForEach(x => CountriesDetailAux.Add(x));
                }

                // SetListCountries();
            }
            catch (Exception ex)
            {
                await UserDialogs.Instance.AlertAsync(ex.Message, "Alerta", "Aceptar");
            }
        }
Esempio n. 2
0
        /// <summary>
        /// Invoked method delete countries
        /// </summary>
        /// <param name="obj">The object</param>
        async void DeleteCountrie(int id)
        {
            try
            {
                var resultCountries = await DataStoreCountries.DeleteItemAsync(id);

                if (resultCountries.Message == "OK")
                {
                    await UserDialogs.Instance.AlertAsync("Registro eliminado con éxito", "Alerta", "Aceptar");

                    GetCountries();
                    ShowPopUp = false;
                }
                else
                {
                    await UserDialogs.Instance.AlertAsync(resultCountries.Message, "Alerta", "Aceptar");
                }
            }
            catch (Exception ex)
            {
                await UserDialogs.Instance.AlertAsync(ex.Message, "Alerta", "Aceptar");
            }
        }
Esempio n. 3
0
        /// <summary>
        /// Invoked method new countries
        /// </summary>
        /// <param name="obj">The object</param>
        async void NewCountrie()
        {
            try
            {
                var resultCountries = await DataStoreCountries.AddCountrieAsync(CurrentCountrie);

                if (resultCountries.Message == "OK")
                {
                    await UserDialogs.Instance.AlertAsync("Datos almacenados con éxito", "Alerta", "Aceptar");

                    GetCountries();
                    ShowPopUp = false;
                }
                else
                {
                    await UserDialogs.Instance.AlertAsync(resultCountries.Message, "Alerta", "Aceptar");
                }
            }
            catch (Exception ex)
            {
                await UserDialogs.Instance.AlertAsync(ex.Message, "Alerta", "Aceptar");
            }
        }