Exemple #1
0
 public IActionResult Delete(Guid?id)
 {
     if (id.HasValue)
     {
         return(View(ProductViewModel.DeleteProduct(_repository, (Guid)id)));
     }
     return(NotFound());
 }
Exemple #2
0
        async void OnDelete_Tapped(object sender, System.EventArgs e)
        {
            var confirm = await dialogService.ShowConfirmedAsync("Are you sure to delete this product ?", "Confirmation", "OK", "Cancel");

            if (confirm)
            {
                bool result = await viewModel.DeleteProduct();

                if (!result)
                {
                    await dialogService.ShowAlertAsync("You're not allowed to delete this product. Please contact administrator", "Warning", "OK");
                }
                else
                {
                    dialogService.ShowToast("Product deleted successfully!");
                }
            }
            productList.ResetSwipe();
        }
 public void Execute(object parameter)
 {
     _viewModel.DeleteProduct();
 }