Beispiel #1
0
 private void BtnCancel_Clicked(object sender, EventArgs e)
 {
     Device.BeginInvokeOnMainThread(async() =>
     {
         var result = await this.DisplayAlert("Alert!", "Do you really want to cancel current trip??", "Yes", "No");
         if (result)
         {
             var statusResult = await apiServices.SetStatusAsync(MainViewModel.Getinstance().Usuario.idEnfermero, 1);
             if (statusResult)
             {
                 var unlinkResult = await apiServices.LinkVentaEnfermero(mainViewModel.Venta.idVenta, 0, false);
                 var saleResult   = await apiServices.ChangeSaleStatus(MainViewModel.Getinstance().Venta.idVenta, false);
                 if (unlinkResult && saleResult)
                 {
                     mainViewModel.Venta  = null;
                     mainViewModel.Ventas = new VentasViewModel();
                     ProfileMainPage.Getinstance().Detail = new NavigationPage(new ProfileMainPageDetail());
                 }
             }
         }
     });
 }