private void _ObtenerCierreX(TSPrint respuesta) { TSPrintApp.ObtenerCierreX -= _ObtenerCierreX; Device.BeginInvokeOnMainThread(async() => { if (respuesta.EstadoRespuesta == PrintEstado.InformacionNoObtenida) { await DisplayAlert("Aviso", "No se encontró cierre X", "Aceptar"); return; } if (respuesta.EstadoRespuesta == PrintEstado.ErrorSistema) { await DisplayAlert("Aviso", "Hubo un problema en la comunicación con el servidor, por favor intente después.", "Aceptar"); return; } if (respuesta.EstadoRespuesta == PrintEstado.InformacionObtenida) { var result = respuesta.vRespuesta; var base64encodepdf = Convert.FromBase64String(result.base64encodepdf); if (base64encodepdf != null) { string URL = await DependencyService.Get <IFeatureService>().SaveFile("ReporteX", base64encodepdf); PdfDocView.Uri = URL; busyindicator.IsVisible = false; } } }); }
private void TSPrintApp_RegistraDepositos(TSPrint respuesta) { TSPrintApp.RegistraGriferoCara -= TSPrintApp_RegistraDepositos; Device.BeginInvokeOnMainThread(async () => { if (respuesta.EstadoRespuesta == PrintEstado.ErrorSistema) { await DisplayAlert("Aviso", "Hubo un problema en la comunicación con el servidor, por favor intente después.", "Aceptar"); await Navigation.PopAsync(); return; } if (respuesta.EstadoRespuesta == PrintEstado.InformacionObtenida) { await DisplayAlert("Aviso", "Se guardaron los cambios correctamente", "Aceptar"); await Navigation.PopAsync(); Guardado(); return; } if (respuesta.EstadoRespuesta == PrintEstado.InformacionNoObtenida) { await DisplayAlert("Aviso", respuesta.vMensaje.mensaje, "Aceptar"); await Navigation.PopAsync(); return; } }); }
private void _ImprimirUltimoDoc(TSPrint respuesta) { TSPrintApp.UltimoDocumento -= _ImprimirUltimoDoc; Device.BeginInvokeOnMainThread(async() => { if (respuesta.EstadoRespuesta == PrintEstado.ImpresionIncorrecto) { contexto.IsSearchEnd("Ocurrio un error al imprimir"); return; } if (respuesta.EstadoRespuesta == PrintEstado.ErrorSistema) { contexto.IsSearchEnd("Hubo un problema en la comunicación con el servidor, por favor intente después."); return; } if (respuesta.EstadoRespuesta == PrintEstado.ImpresionCorrecto) { if (IsEvent) { await Navigation.PopAsync(); return; } App.Current.MainPage = new NavigationPage(new SemiAutomatic()); return; } }); }
private void TSPrintApp_ObtenerInicioDia(TSPrint respuesta) { TSPrintApp.ObtenerInicioDia -= TSPrintApp_ObtenerInicioDia; Device.BeginInvokeOnMainThread(async() => { if (respuesta.EstadoRespuesta == PrintEstado.ErrorSistema) { await DisplayAlert("Aviso", "Hubo un problema en la comunicación con el servidor, por favor intente después.", "Aceptar"); return; } if (respuesta.EstadoRespuesta == PrintEstado.InformacionObtenida) { if (respuesta.vInicioDia.Mensaje.Ok == false) { await DisplayAlert("Aviso", respuesta.vInicioDia.Mensaje.mensaje, "Aceptar"); App.Current.MainPage = new Home(); return; } else { IndicadorDeCarga.IsVisible = false; Grilla.IsVisible = true; TSSalesApp.vTerminal = respuesta.vInicioDia.vTerminal; } } }); }
private void _TSPrintApp_ObtenerDepositos(TSPrint respuesta) { TSPrintApp.ObtenerDepositos -= _TSPrintApp_ObtenerDepositos; Device.BeginInvokeOnMainThread(async() => { if (respuesta.EstadoRespuesta == PrintEstado.ErrorSistema) { await DisplayAlert("Aviso", "Hubo un problema en la comunicación con el servidor, por favor intente después.", "Aceptar"); return; } if (respuesta.EstadoRespuesta == PrintEstado.InformacionObtenida) { if (respuesta.vDepositos.cDepositos.Length > 0) { this.listView.ItemsSource = respuesta.vDepositos.cDepositos; this.listView.HeightRequest = respuesta.vDepositos.cDepositos.Count() * (this.listView.ItemSize + 1); decimal soles = 0; decimal dolares = 0; foreach (var item in respuesta.vDepositos.cDepositos) { soles += item.mtosoles; dolares += item.mtodolares; } this.txtTotalSoles.Text = soles.ToString(); this.txtTotalDolares.Text = dolares.ToString(); this.gridSinDepositos.IsVisible = false; this.gridConDepositos.IsVisible = true; this.frmlista.IsVisible = true; } else { this.txtTotalSoles.Text = "0.00"; this.txtTotalDolares.Text = "0.00"; this.gridSinDepositos.IsVisible = true; this.gridConDepositos.IsVisible = false; this.frmlista.IsVisible = false; } this.busyindicator.IsVisible = false; return; } if (respuesta.EstadoRespuesta == PrintEstado.InformacionNoObtenida) { await DisplayAlert("Aviso", respuesta.vDepositos.cMensaje.mensaje, "Aceptar"); return; } }); }
private static void _CONSULTAR_DEPOSITOSCompleted(TS_BEDepositos Result) { if (Result == null) { ObtenerDepositos(new TSPrint(PrintEstado.ErrorSistema)); return; } if (Result.cMensaje.Ok == false) { CurrentResultado = new TSPrint(PrintEstado.InformacionNoObtenida, Result); ObtenerDepositos(CurrentResultado); return; } if (Result.cMensaje.Ok == true) { CurrentResultado = new TSPrint(PrintEstado.InformacionObtenida, Result); ObtenerDepositos(CurrentResultado); return; } }
private static void _OBTENER_CIERRE_XCompleted(TS_BERespuesta Result) { if (Result == null) { ObtenerCierreX(new TSPrint(PrintEstado.ErrorSistema)); return; } if (Result.respuesta == "OK") { CurrentResultado = new TSPrint(PrintEstado.InformacionObtenida, Result); ObtenerCierreX(CurrentResultado); return; } if (Result.respuesta != "OK") { CurrentResultado = new TSPrint(PrintEstado.InformacionNoObtenida, Result); ObtenerCierreX(CurrentResultado); return; } }
private static void _OBTENER_INICIO_DIACompleted(TS_BEInicioDiaOutput Result) { if (Result == null) { ObtenerInicioDia(new TSPrint(PrintEstado.ErrorSistema)); return; } if (Result.Mensaje == null) { CurrentResultado = new TSPrint(PrintEstado.ErrorSistema); ObtenerInicioDia(CurrentResultado); return; } if (Result.Mensaje != null) { CurrentResultado = new TSPrint(PrintEstado.InformacionObtenida, Result); ObtenerInicioDia(CurrentResultado); return; } }
private static void _OBTENER_CAMBIO_TURNOCompleted(TS_BEMensaje Result) { if (Result == null) { ObtenerCambioTurno(new TSPrint(PrintEstado.ErrorSistema)); return; } if (Result.Ok == true) { CurrentResultado = new TSPrint(PrintEstado.InformacionObtenida); ObtenerCambioTurno(CurrentResultado); return; } if (Result.Ok == false) { CurrentResultado = new TSPrint(PrintEstado.InformacionNoObtenida, Result); ObtenerCambioTurno(CurrentResultado); return; } }
private static void _REGISTRAR_DEPOSITOCompleted(TS_BEMensaje Result) { if (Result == null) { RegistraDepositos(new TSPrint(PrintEstado.ErrorSistema)); return; } if (Result.Ok == true) { CurrentResultado = new TSPrint(PrintEstado.InformacionObtenida); RegistraDepositos(CurrentResultado); return; } if (Result.Ok == false) { CurrentResultado = new TSPrint(PrintEstado.InformacionNoObtenida, Result); RegistraDepositos(CurrentResultado); return; } }
private static void _OBTENER_VENDEDORESCompleted(TS_BEVendedores Result) { if (Result == null) { ObtenerGrifero(new TSPrint(PrintEstado.ErrorSistema)); return; } if (Result.Mensaje.Ok == true) { CurrentResultado = new TSPrint(PrintEstado.InformacionObtenida, Result); ObtenerGrifero(CurrentResultado); return; } if (Result.Mensaje.Ok == false) { CurrentResultado = new TSPrint(PrintEstado.InformacionNoObtenida, Result); ObtenerGrifero(CurrentResultado); return; } }
private static void _REGISTRAR_GRIFERO_LADOSCompleted(TS_BEMensaje Result) { if (Result == null) { RegistraGriferoCara(new TSPrint(PrintEstado.ErrorSistema)); return; } if (Result.Ok == true) { CurrentResultado = new TSPrint(PrintEstado.InformacionObtenida); RegistraGriferoCara(CurrentResultado); return; } if (Result.Ok == false) { CurrentResultado = new TSPrint(PrintEstado.InformacionNoObtenida, Result); RegistraGriferoCara(CurrentResultado); return; } }
private static void _OBTENER_GRIFERO_LADOSCompleted(TS_BELados Result) { if (Result == null) { ObtenerGriferoCara(new TSPrint(PrintEstado.ErrorSistema)); return; } if (Result.Mensaje.Ok == true) { CurrentResultado = new TSPrint(PrintEstado.InformacionObtenida, Result); ObtenerGriferoCara(CurrentResultado); return; } if (Result.Mensaje.Ok == false) { CurrentResultado = new TSPrint(PrintEstado.InformacionNoObtenida, Result); ObtenerGriferoCara(CurrentResultado); return; } }
private static void _LISTAR_DOCUMENTOS_REIMPRESIONCompleted(TS_BEReimpresionLOutput Result) { if (Result == null) { ListarDocumentos(new TSPrint(PrintEstado.ErrorSistema)); return; } if (Result.Mensaje.Ok == true) { CurrentResultado = new TSPrint(PrintEstado.InformacionObtenida, Result); ListarDocumentos(CurrentResultado); return; } if (Result.Mensaje.Ok == false) { CurrentResultado = new TSPrint(PrintEstado.InformacionNoObtenida, Result); ListarDocumentos(CurrentResultado); return; } }
private void TSPrintApp_EliminarGriferoCara(TSPrint respuesta) { TSPrintApp.EliminarGriferoCara -= TSPrintApp_EliminarGriferoCara; Device.BeginInvokeOnMainThread(async() => { if (respuesta.EstadoRespuesta == PrintEstado.ErrorSistema) { await DisplayAlert("Aviso", "Hubo un problema en la comunicación con el servidor, por favor intente después.", "Aceptar"); return; } if (respuesta.EstadoRespuesta == PrintEstado.InformacionObtenida) { ObtenerReporteGriferoCara(); busyindicator.IsVisible = false; } if (respuesta.EstadoRespuesta == PrintEstado.InformacionNoObtenida) { await DisplayAlert("Aviso", respuesta.vMensaje.mensaje, "Aceptar"); return; } }); }
private void TSPrintApp_ListarDocumentos(TSPrint respuesta) { TSPrintApp.ListarDocumentos -= TSPrintApp_ListarDocumentos; Device.BeginInvokeOnMainThread(async() => { busyindicator.IsVisible = false; if (respuesta.EstadoRespuesta == PrintEstado.InformacionObtenida) { this.listView.ItemsSource = respuesta.vReImpresion.Documentos; } if (respuesta.EstadoRespuesta == PrintEstado.InformacionNoObtenida) { await DisplayAlert("Aviso", respuesta.vReImpresion.Mensaje.mensaje, "Aceptar"); return; } if (respuesta.EstadoRespuesta == PrintEstado.ErrorSistema) { await DisplayAlert("Aviso", "Hubo un problema en la comunicación con el servidor, por favor intente después.", "Aceptar"); return; } }); }
private void TSPrintApp_ObtenerGrifero(TSPrint respuesta) { TSPrintApp.ObtenerGrifero -= TSPrintApp_ObtenerGrifero; Device.BeginInvokeOnMainThread(async() => { if (respuesta.EstadoRespuesta == PrintEstado.InformacionNoObtenida) { await DisplayAlert("Aviso", String.IsNullOrEmpty(((respuesta.vVendedores.Mensaje == null ? "" : respuesta.vVendedores.Mensaje.mensaje) ?? "").Trim()) ? "No hay vendedores registrados" : respuesta.vVendedores.Mensaje.mensaje, "Aceptar"); return; } if (respuesta.EstadoRespuesta == PrintEstado.ErrorSistema) { await DisplayAlert("Aviso", "Hubo un problema en la comunicación con el servidor, por favor intente después.", "Aceptar"); return; } if (respuesta.EstadoRespuesta == PrintEstado.InformacionObtenida) { cboVendedor.DataSource = respuesta.vVendedores.cVendedores; ObtenerListNroPos(); return; } }); }
private void _TSPrintApp_ObtenerCambioTurno(TSPrint respuesta) { TSPrintApp.ObtenerCambioTurno -= _TSPrintApp_ObtenerCambioTurno; Device.BeginInvokeOnMainThread(async() => { if (respuesta.EstadoRespuesta == PrintEstado.ErrorSistema) { await DisplayAlert("Aviso", "Hubo un problema en la comunicación con el servidor, por favor intente después.", "Aceptar"); return; } if (respuesta.EstadoRespuesta == PrintEstado.InformacionObtenida) { this.IndicadorDeCarga.IsVisible = false; this.Grilla.IsVisible = true; } if (respuesta.EstadoRespuesta == PrintEstado.InformacionNoObtenida) { await DisplayAlert("Aviso", respuesta.vMensaje.mensaje, "Aceptar"); App.Current.MainPage = new Home(); return; } }); }
private void _TSPrintApp_ObtenerDepositos(TSPrint respuesta) { TSPrintApp.ObtenerGriferoCara -= _TSPrintApp_ObtenerDepositos; Device.BeginInvokeOnMainThread(async() => { if (respuesta.EstadoRespuesta == PrintEstado.ErrorSistema) { await DisplayAlert("Aviso", "Hubo un problema en la comunicación con el servidor, por favor intente después.", "Aceptar"); return; } if (respuesta.EstadoRespuesta == PrintEstado.InformacionObtenida) { if (respuesta.vGriferoCara.cLados.Length > 0) { this.listView.ItemsSource = respuesta.vGriferoCara.cLados; listView.HeightRequest = respuesta.vGriferoCara.cLados.Count() * (listView.ItemSize + 1); gridSinDepositos.IsVisible = false; gridConDepositos.IsVisible = true; frmlista.IsVisible = true; } else { gridSinDepositos.IsVisible = true; gridConDepositos.IsVisible = false; frmlista.IsVisible = false; } busyindicator.IsVisible = false; return; } if (respuesta.EstadoRespuesta == PrintEstado.InformacionNoObtenida) { await DisplayAlert("Aviso", respuesta.vDepositos.cMensaje.mensaje, "Aceptar"); return; } }); }
private void _ReImprimirDocumento(TSPrint respuesta) { TSPrintApp.ReimprimirDocumentos -= _ReImprimirDocumento; Device.BeginInvokeOnMainThread(async() => { if (respuesta.EstadoRespuesta == PrintEstado.ImpresionIncorrecto) { await DisplayAlert("Aviso", "Ocurrio un error al imprimir", "Aceptar"); await Navigation.PopAsync(); return; } if (respuesta.EstadoRespuesta == PrintEstado.ErrorSistema) { await DisplayAlert("Aviso", "Hubo un problema en la comunicación con el servidor, por favor intente después.", "Aceptar"); await Navigation.PopAsync(); return; } if (respuesta.EstadoRespuesta == PrintEstado.ImpresionCorrecto) { await Navigation.PopAsync(); return; } }); }
private void _ObtenerCierreX(TSPrint respuesta) { TSPrintApp.ObtenerCierreX -= _ObtenerCierreX; Device.BeginInvokeOnMainThread(async() => { if (respuesta.EstadoRespuesta == PrintEstado.InformacionNoObtenida) { await DisplayAlert("Aviso", respuesta.vRespuesta.respuesta, "Aceptar"); App.Current.MainPage = new NavigationPage(new ReporteCierreX()); return; } if (respuesta.EstadoRespuesta == PrintEstado.ErrorSistema) { await DisplayAlert("Aviso", "Hubo un problema en la comunicación con el servidor, por favor intente después.", "Aceptar"); App.Current.MainPage = new NavigationPage(new ReporteCierreX()); return; } if (respuesta.EstadoRespuesta == PrintEstado.InformacionObtenida) { App.Current.MainPage = new NavigationPage(new ReporteCierreX()); return; } }); }