Exemplo n.º 1
0
        private async void Save()
        {
            if (bank == null)
            {
                bank    = new Bank();
                bank.Id = 0;
            }
            bank.Name          = txtNombre.Text;
            bank.Web           = txtWeb.Text;
            bank.OnlineBanking = txtOnlineBanking.Text;

            if (await Banks.save(bank))
            {
                CloureManager.GoBack("reload");
            }
        }
        private async void DisplayDeleteDialog(Bank bank)
        {
            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 Banks.Delete(bank.Id);

                if (api_result)
                {
                    LoadData();
                }
            }
        }
        public async void LoadData()
        {
            List <Bank> receipts = await Banks.getList();

            lstItems.ItemsSource = receipts;
        }