async void DeleteOrder() { if (IsSync) { await dialogService.ShowMessage( "Error", "No puedes borrar un pedido ya sincronizado."); return; } var answer = await dialogService.ShowConfirm( "Confirmación", "¿Está seguro de borrar el pedido?"); if (!answer) { return; } dataService.Delete(this); var ordersViewModel = OrdersViewModel.GetInstance(); ordersViewModel.OrderList.Remove(this); }
async void DeleteOrder() { var answer = await dialogService.ShowConfirm( "Confirmación", "¿Está seguro de eliminar la orden?"); if (!answer) { return; } //if (IsSync == false) //{ // dataService.Delete(this); // var ordersViewModel = OrdersViewModel.GetInstance(); // ordersViewModel.OrderList.Remove(this); //}else{ var mainViewModel = MainViewModel.GetInstance(); var ordersViewModel = OrdersViewModel.GetInstance(); mainViewModel.NewOrder = new NewOrderViewModel(); mainViewModel.NewOrder.RowMod = "D"; mainViewModel.NewOrder.DeleteOrderReceipt(this); mainViewModel.ExecDeleteOrder(); ordersViewModel.RefreshOrders(); //} #endregion }
protected override void OnAppearing() { base.OnAppearing(); var ordersViewModel = OrdersViewModel.GetInstance(); ordersViewModel.RefreshOrders(); }
void RefreshList(object sender, EventArgs args) { var ordersViewModel = OrdersViewModel.GetInstance(); if (ordersViewModel.OrderDate == null) { ordersViewModel.OrderDate = DateTime.Now; } ordersViewModel.RefreshOrders(); }