public void anterior() { object obj; do { obj = RondasLector.CurrentRonda.prev(); if (obj == null) { //RondasAdvertenciaManager.sheet = true; //this.Form.App.showCanvas(typeof(AdvertenciaPopUp)); RondasFinalizarPopUp _popUp = new RondasFinalizarPopUp(this, true); if (_popUp.showAsync()) { //Ir al menú principal //AppFrame.Navigate(typeof(MainPage)); Navigated(typeof(MainPage)); } return; } else if (obj is Work && ((Work)obj).isValidForThisState()) { RondasLector.CurrentWork = (Work)obj; this.showActual(); return; } }while (!(obj is Steps)); RondasLector.CurrentWork = (Work)null; RondasLector.Step = (Steps)obj; //this.Form.App.showCanvas(typeof(StateMachine)); //AppFrame.Navigate(typeof(CapturaDatos1)); Navigated(typeof(CapturaDatos1)); }
public void siguiente() { string text1 = this.SelectedValueEstado; if (text1.Length == 0) { MessageDialogError.ImprimirAsync("Usted debe seleccionar un estado"); } else { if ((text1.Equals("OF") || text1.Equals("SF") || text1.Equals("EF")) && this.Comentario.Trim().Length == 0) { MessageDialogWarning.ImprimirAsync("Se sugiere documentar"); //((CapturaDatos1)this.Page).txtCommentary.Focus(FocusState.Programmatic); ((CapturaDatos1)this.Page).txtCommentary.Focus(); } else { RondasLector.Step.SelectedValue = this.SelectedIndexEstado; RondasLector.Step.Commentary = this.Comentario; RondasLector.Step.fechar(); //Ir al siguiente nodo (Paso/Tarea) de la ronda CapturaDatos2ViewModel.INIT_STATE = true; if (RondasLector.Step.Works.Count > 0) { /*//AppFrame.Navigate(typeof(CapturaDatos2)); * Navigated(typeof(CapturaDatos2)); * //CapturaDatos2ViewModel.currentInstance.initPanel();*/ CapturaDatos2ViewModel.navigateNext(this); } else { object obj1 = RondasLector.CurrentRonda.next(); if (obj1 != null) { RondasLector.Step = (Steps)obj1; showActual(); } else { RondasLector.CurrentRonda.Current = RondasLector.Step; RondasLector.EndObj = RondasLector.Step; RondasFinalizarPopUp _popUp = new RondasFinalizarPopUp(this, false); if (_popUp.showAsync()) { //Ir al menú principal //AppFrame.Navigate(typeof(MainPage)); Navigated(typeof(MainPage)); } } } } } }
public static void navigateNext(ViewModelBase viewModel) { INIT_STATE = false; bool prevEquipment = viewModel is CapturaDatos1ViewModel; while (true) { object obj1 = RondasLector.CurrentRonda.next(); if (obj1 == null) { RondasFinalizarPopUp _popUp = new RondasFinalizarPopUp(viewModel, !prevEquipment); if (_popUp.showAsync()) { //Ir al menú principal viewModel.Navigated(typeof(MainPage)); } break; } else if (obj1 is Work && ((Work)obj1).isValidForThisState()) { RondasLector.CurrentWork = (Work)obj1; if (prevEquipment) { NEXT_TRIGGER = false; viewModel.Navigated(typeof(CapturaDatos2)); } else { ((CapturaDatos2ViewModel)viewModel).showActual(); } break; } else if (obj1 is Steps) { RondasLector.CurrentWork = (Work)null; RondasLector.Step = (Steps)obj1; if (prevEquipment) { ((CapturaDatos1ViewModel)viewModel).showActual(); } else { viewModel.Navigated(typeof(CapturaDatos1)); } break; } } }