private async Task SelectFacture(FactureViewModel facture) { if (facture == null) { return; } SelectedFacture = null; await _pageService.PushAsync(new FactureDetailPage(facture)); }
private async Task DeleteFacture(FactureViewModel factureViewModel) { if (await _pageService.DisplayAlert("Warning", $"Are you sure you want to delete {factureViewModel.Montant_Facture}?", "Yes", "No")) { ListeFactures.Remove(factureViewModel); var facture = await _factureStore.GetFacture(factureViewModel.Id_Facture); await _factureStore.DeleteFacture(facture); } }
public FactureDetailViewModel(FactureViewModel viewModel, IFactureStore factureStore, IPageService pageService) { if (viewModel == null) { throw new ArgumentNullException(nameof(viewModel)); } _pageService = pageService; _factureStore = factureStore; SaveCommand = new Command(async() => await Save()); facture = new Facture { Id_Facture = viewModel.Id_Facture, Montant_Facture = viewModel.Montant_Facture, type_paiement = viewModel.type_paiement, }; }