private async void Save()
        {
            place.Nombre = txtNombre.Text;
            int response = await Places.save(place);

            if (response > 0)
            {
                CloureManager.GoBack(new CloureParam("place_id", response));
            }
        }
예제 #2
0
        public async void LoadData()
        {
            grdLoader.Visibility = Visibility.Visible;
            GenericResponse genericResponse = await Places.GetList(Filter, OrderBy, OrderType, Page);

            TotalPages = genericResponse.TotalPages;

            if (genericResponse.Items.Count > 0)
            {
                grdNoRegisters.Visibility = Visibility.Collapsed;
            }
            else
            {
                grdNoRegisters.Visibility = Visibility.Visible;
            }

            lstItems.ItemsSource = genericResponse.Items;
            grdLoader.Visibility = Visibility.Collapsed;

            if (Page == 1)
            {
                btnFirst.IsEnabled    = false;
                btnPrevious.IsEnabled = false;
            }
            if (Page > 1)
            {
                btnFirst.IsEnabled    = true;
                btnPrevious.IsEnabled = true;
            }
            if (Page < TotalPages)
            {
                btnNext.IsEnabled = true;
                btnLast.IsEnabled = true;
            }
            if (Page == TotalPages)
            {
                btnNext.IsEnabled = false;
                btnLast.IsEnabled = false;
            }

            txtRegister.Text = "Mostrando página " + Page.ToString() + " de " + TotalPages.ToString();
        }
예제 #3
0
        private async void DisplayDeleteDialog(int id)
        {
            ContentDialog deleteFileDialog = new ContentDialog
            {
                Title             = "¿Está seguro que desea eliminar este registro?",
                Content           = "El registro se borrará de forma permanente",
                PrimaryButtonText = "Borrar",
                CloseButtonText   = "Cancelar"
            };

            ContentDialogResult result = await deleteFileDialog.ShowAsync();

            // Delete the file if the user clicked the primary button.
            /// Otherwise, do nothing.
            if (result == ContentDialogResult.Primary)
            {
                bool api_result = await Places.Delete(id);

                if (api_result)
                {
                    LoadData();
                }
            }
        }
        private async void LoadData(int id)
        {
            place = await Places.Get(id);

            txtNombre.Text = place.Nombre;
        }