public async void LoadData() { CompanyBranchResponse companyBranchResponse = await CompanyBranches.getList(); List <CompanyBranch> items = companyBranchResponse.Items; lstItems.ItemsSource = items; }
private async void LoadData(int branch_id) { companyBranch = await CompanyBranches.Get(branch_id); txtNombre.Text = companyBranch.Name; txtDireccion.Text = companyBranch.Address; txtTelefono.Text = companyBranch.Phone; }
private async void Save() { companyBranch.Name = txtNombre.Text; companyBranch.Address = txtDireccion.Text; companyBranch.Phone = txtTelefono.Text; int res = await CompanyBranches.save(companyBranch); if (res > 0) { CloureManager.GoBack(); } }
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 CompanyBranches.Delete(id); if (api_result) { LoadData(); } } }