示例#1
0
        private static void _AUTENTICAR_CONFIGURACION_LADOSCompleted(TS_BEMensaje Result)
        {
            if (Result == null)
            {
                LogiConfiguracionLado(new TSLogin(LoginEstado.ErrorSistema));
                return;
            }

            if (Result.mensaje == null && Result.Ok == false)
            {
                LogiConfiguracionLado(new TSLogin(LoginEstado.ErrorSistema));
                return;
            }

            if (Result.Ok == false)
            {
                LogiConfiguracionLado(new TSLogin(LoginEstado.SinAutorizacion, Result));
                return;
            }

            if (Result.Ok == true)
            {
                LogiConfiguracionLado(new TSLogin(LoginEstado.Autorizacion));
                return;
            }
        }
示例#2
0
        private static void _AUTENTICAR_DEPOSITO_GRIFEROCompleted(TS_BEMensaje Result)
        {
            if (Result == null)
            {
                DepositoAuthorize(new TSLogin(LoginEstado.ErrorSistema));
                return;
            }

            if (Result.mensaje == null && Result.Ok == false)
            {
                DepositoAuthorize(new TSLogin(LoginEstado.ErrorSistema));
                return;
            }

            if (Result.Ok == false)
            {
                CurrentResultado = (new TSLogin(LoginEstado.SinAutorizacion, Result));
                DepositoAuthorize(CurrentResultado);
                return;
            }

            if (Result.Ok == true)
            {
                CurrentResultado = new TSLogin(LoginEstado.Autorizacion);
                DepositoAuthorize(CurrentResultado);
                return;
            }
        }
示例#3
0
 private static void _ELIMINAR_LADOCompleted(TS_BEMensaje Result)
 {
     if (Result == null)
     {
         EliminarLado(new TSSales(SalesEstado.ErrorSistema));
         return;
     }
     if (Result == null)
     {
         EliminarLado(new TSSales(SalesEstado.ErrorSistema));
         return;
     }
     if (Result != null)
     {
         EliminarLado(new TSSales(SalesEstado.InformacionObtenida, Result));
         return;
     }
 }
示例#4
0
 private static void GrabarTransaccionPrefijoCompleted(TS_BEMensaje Result)
 {
     if (Result == null)
     {
         GrabarTransaccionPrefijos(new TSSales(SalesEstado.ErrorSistema));
         return;
     }
     if (Result.Ok == false)
     {
         GrabarTransaccionPrefijos(new TSSales(SalesEstado.InformacionNoObtenida, new TS_BEMensaje()
         {
             mensaje = Result.mensaje, Ok = Result.Ok
         }));
         return;
     }
     if (Result.Ok)
     {
         GrabarTransaccionPrefijos(new TSSales(SalesEstado.InformacionObtenida, Result));
         return;
     }
 }
示例#5
0
        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;
            }
        }
示例#6
0
        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;
            }
        }
示例#7
0
        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;
            }
        }
示例#8
0
        private static void _ANULAR_DOCUMENTOCompleted(TS_BEMensaje Result)
        {
            if (Result == null)
            {
                EliminarDocumentos(new TSSales(SalesEstado.ErrorSistema));
                return;
            }
            if (Result.mensaje == null && Result.Ok == false)
            {
                EliminarDocumentos(new TSSales(SalesEstado.ErrorSistema));
                return;
            }
            if (Result.mensaje != null && Result.Ok == false)
            {
                EliminarDocumentos(new TSSales(SalesEstado.RegistroNoEliminado));

                return;
            }
            if (Result.Ok == true)
            {
                EliminarDocumentos(new TSSales(SalesEstado.RegistroEliminado));
                return;
            }
        }
示例#9
0
        private static void _OBTENER_ULTIMO_DOCUMENTO_IMPRESOCompleted(TS_BEMensaje Result)
        {
            if (Result == null)
            {
                UltimoDocumento(new TSPrint(PrintEstado.ErrorSistema));
                return;
            }
            if (Result.mensaje == null && Result.Ok == false)
            {
                UltimoDocumento(new TSPrint(PrintEstado.ErrorSistema));
                return;
            }
            if (Result.mensaje != null && Result.Ok == false)
            {
                UltimoDocumento(new TSPrint(PrintEstado.ImpresionIncorrecto));

                return;
            }
            if (Result.Ok == true)
            {
                UltimoDocumento(new TSPrint(PrintEstado.ImpresionCorrecto));
                return;
            }
        }
示例#10
0
 public TSSales(SalesEstado resultado, TS_BEMensaje respuesta)
 {
     EstadoRespuesta = resultado;
     vMensaje        = respuesta;
 }
        private void OnAceptar(object sender, EventArgs e)
        {
            if (Convert.ToBoolean(TSSalesApp.vParemetros.flg_pideplacatb ?? false) && String.IsNullOrEmpty(contexto.Placa))
            {
                DisplayAlert("Aviso", "La placa es obligatoria", "Aceptar");
                return;
            }


            if ((contexto.Tarjeta_afiliacion_cliente ?? "").Length > 0)
            {
                if (TSCustomerApp.vTarjetasBuscadas.Count == 0)
                {
                    DisplayAlert("Aviso", "Debe buscar la tarjeta seleccionada", "Aceptar");
                    return;
                }
                else
                {
                    foreach (string tarjeta in TSCustomerApp.vTarjetasBloqueadas)
                    {
                        if (tarjeta.Equals(txtTarjetaAfiliacion.Text))
                        {
                            DisplayAlert("Aviso", "La tarjeta descrita en la busqueda esta bloqueada", "Aceptar");
                            return;
                        }
                    }
                    bool isbuscado = false;
                    foreach (string tarjeta in TSCustomerApp.vTarjetasBuscadas)
                    {
                        if ((tarjeta ?? "").Trim().Equals((txtTarjetaAfiliacion.Text ?? "").Trim()))
                        {
                            isbuscado = true;
                        }
                    }
                    if (isbuscado == false)
                    {
                        DisplayAlert("Aviso", "Debe buscar la tarjeta descrita", "Aceptar");
                        return;
                    }
                }
            }
            /**FIN VALIDACIONES DE TARJETAS DE PUNTOS**/

            /** INICIO DE VALIDACIONES DE TIPO DE DOCUMENTO**/

            if ((this.txtCodigo.Text ?? "").Trim().Length == 11 || (this.txtRuc.Text ?? "").Trim().Length == 11)
            {
                TS_BEMensaje validacion = validateFactura();
                if (validacion.Ok == false)
                {
                    DisplayAlert("Aviso", validacion.mensaje, "Aceptar");
                    return;
                }
                if (String.IsNullOrEmpty(contexto.Placa))
                {
                    DisplayAlert("Aviso", "La placa es obligatoria", "Aceptar");
                    return;
                }
            }
            else if ((this.txtCodigo.Text ?? "").Trim().Length != 11 && (this.txtRuc.Text ?? "").Trim().Length != 11)
            {
                TS_BEMensaje validacion = validateBoleta();
                if (validacion.Ok == false)
                {
                    DisplayAlert("Aviso", validacion.mensaje, "Aceptar");
                    return;
                }
            }

            /** FIN DE VALIDACIONES DE TIPO DE DOCUMENTO **/
            /** INICIO DE VALIDACIONES DE TARJETA CREDITO EN CLIENTES **/
            if (TSCustomerApp.vCodigoBloqueado.Count > 0)
            {
                foreach (string tarjeta in TSCustomerApp.vCodigoBloqueado)
                {
                    if (tarjeta.Equals((this.txtCodigo.Text ?? "").Trim()))
                    {
                        DisplayAlert("Aviso", "No puede utilizar una tarjeta credito en pagos al contado", "Aceptar");
                        return;
                    }
                }
            }
            var varVerificaCodigo = (txtCodigo.Text ?? "").Trim();

            if (varVerificaCodigo.Length > 0)
            {
                string creditoCorp  = (TSSalesApp.vParemetros.prefcredcorp ?? "").Trim();
                string creditoLocal = (TSSalesApp.vParemetros.prefcredlocal ?? "").Trim();
                string creditoFlot  = (TSSalesApp.vParemetros.prefflotlocal ?? "").Trim();
                if (varVerificaCodigo.Length >= creditoCorp.Length)
                {
                    if (varVerificaCodigo.Substring(0, creditoCorp.Length).Equals(creditoCorp))
                    {
                        DisplayAlert("Aviso", "No puede pasar una tarjeta coorporativa en ventas al contado", "Aceptar");
                        return;
                    }
                }
                if (varVerificaCodigo.Length >= creditoLocal.Length)
                {
                    if (varVerificaCodigo.Substring(0, creditoLocal.Length).Equals(creditoLocal))
                    {
                        DisplayAlert("Aviso", "No puede pasar una tarjeta de credito local en ventas al contado", "Aceptar");
                        return;
                    }
                }
                if (varVerificaCodigo.Length >= creditoFlot.Length)
                {
                    if (varVerificaCodigo.Substring(0, creditoFlot.Length).Equals(creditoFlot))
                    {
                        DisplayAlert("Aviso", "No puede pasar una tarjeta de flota en ventas al contado", "Aceptar");
                        return;
                    }
                }
            }
            /** FIN DE VALIDACIONES DE TARJETA CREDITO EN CLIENTES **/

            if (Lado.Documento == EDocumento.BoletaFactura)
            {
                Lado.Placa              = String.IsNullOrEmpty(this.txtPlaca.Text) ? this.txtPlaca2.Text : this.txtPlaca.Text;
                Lado.Codigo             = this.txtCodigo.Text;
                Lado.Tarjeta_afiliacion = this.txtTarjetaAfiliacion.Text;
                Lado.Ruc              = this.txtRuc.Text;
                Lado.RazonSocial      = this.txtRscliente.Text;
                Lado.Direccion        = this.txtDireccion.Text;
                Lado.Correo           = this.txtEmail.Text;
                Lado.Telefono         = this.txtTelefono.Text;
                Lado.Odometro         = this.txtOdometro.Text;
                Lado.Marca            = this.txtMarca.Text;
                Lado.Modelo           = this.txtModelo.Text;
                Lado.Fecha_Nacimiento = this.txtfecNac.Date;
                Lado.Pago             = this.txtDetalleTipoPago.Text;
            }
            if (Lado.Documento == EDocumento.Canje)
            {
                Lado.Placa              = String.IsNullOrEmpty(this.txtPlaca.Text) ? this.txtPlaca2.Text : this.txtPlaca.Text;
                Lado.Codigo             = this.txtCodigo.Text;
                Lado.Tarjeta_afiliacion = this.txtTarjetaAfiliacion.Text;
                Lado.Ruc              = this.txtRuc.Text;
                Lado.RazonSocial      = this.txtRscliente.Text;
                Lado.Direccion        = this.txtDireccion.Text;
                Lado.Correo           = this.txtEmail.Text;
                Lado.Telefono         = this.txtTelefono.Text;
                Lado.Odometro         = this.txtOdometro.Text;
                Lado.Marca            = this.txtMarca.Text;
                Lado.Modelo           = this.txtModelo.Text;
                Lado.Fecha_Nacimiento = this.txtfecNac.Date;
                Lado.Pago             = "CANJE DE PROD.";
                Lado.Pagos.Clear();
                Lado.Pagos.Add(new Pago()
                {
                    Codigo = "00001"
                });
            }
            if (Lado.Documento == EDocumento.TranferenciaGratuita)
            {
                Lado.Placa              = String.IsNullOrEmpty(this.txtPlaca.Text) ? this.txtPlaca2.Text : this.txtPlaca.Text;
                Lado.Codigo             = this.txtCodigo.Text;
                Lado.Tarjeta_afiliacion = this.txtTarjetaAfiliacion.Text;
                Lado.Ruc              = this.txtRuc.Text;
                Lado.RazonSocial      = this.txtRscliente.Text;
                Lado.Direccion        = this.txtDireccion.Text;
                Lado.Correo           = this.txtEmail.Text;
                Lado.Telefono         = this.txtTelefono.Text;
                Lado.Odometro         = this.txtOdometro.Text;
                Lado.Marca            = this.txtMarca.Text;
                Lado.Modelo           = this.txtModelo.Text;
                Lado.Fecha_Nacimiento = this.txtfecNac.Date;
                Lado.Pago             = "TRANF. GRATUITA";
                Lado.Pagos.Clear();
                Lado.Pagos.Add(new Pago()
                {
                    Codigo = "00001"
                });
            }

            SaveEvent(Lado);
            Navigation.PopModalAsync();
        }
示例#12
0
        public async Task Start_Automatic(Lado Lado)
        {
            /** COMIENZA REVISION DE VENTAS PENDIENTES **/
            await Task.Run(() =>
            {
                if (Convert.ToBoolean(TSSalesApp.vTerminal.conexion_dispensador ?? 0) == false || Convert.ToBoolean(TSSalesApp.vParemetros.conexiondispensador ?? false) == false)
                {
                    Contexto.Progreso = "CONEXION A DISPENSADOR CERRADA";
                    return;
                }

                string codigo = "XXXXXXXXXXX";

                TS_BECabeceraOutPut vTransaccion = TSSalesApp.SynchronizedGetOPTransaction(Lado.Cara, codigo, false);
                if (vTransaccion.Ok)
                {
                    if (vTransaccion.cDetalleOutPut.Length > 0)
                    {
                        List <TS_BEArticulo> Lista = new List <TS_BEArticulo>(vTransaccion.cDetalleOutPut);
                        if (IsButtonAutomatic == false)
                        {
                            Lista.RemoveAt(Lista.Count - 1);
                        }
                        int Progreso = 0;

                        foreach (TS_BEArticulo Producto in Lista)
                        {
                            Contexto.Mensaje  = "ENVIANDO VENTA";
                            Contexto.Progreso = "PROCESANDO CARA: " + Lado.Cara + "\nPROCESADO " + Progreso + " de " + Lista.Count;
                            var Venta         = new TS_BEArticulo()
                            {
                                item              = Producto.item,
                                dsarticulo        = (Producto.dsarticulo1 ?? "").Trim(),
                                precio            = Producto.precio,
                                cantidad          = Producto.cantidad,
                                cdarticulo        = Producto.cdarticulo,
                                cara              = Producto.cara,
                                hora              = Producto.hora,
                                subtotal          = Producto.subtotal,
                                tipo              = Producto.tipo,
                                mtoimpuesto       = Producto.mtoimpuesto,
                                total             = Producto.total,
                                nrogasboy         = Producto.nrogasboy.Trim(),
                                cdarticulosunat   = Producto.cdarticulosunat,
                                mtodscto          = Producto.mtodscto,
                                cdunimed          = Producto.cdunimed,
                                precio_orig       = Producto.precio_orig,
                                redondea_indecopi = Producto.redondea_indecopi,
                                tpformula         = Producto.tpformula,
                                impuesto          = Producto.impuesto,
                                moverstock        = Producto.moverstock,
                                costo             = Producto.costo,
                                trfgratuita       = Producto.trfgratuita,
                                total_display     = Producto.total_display,
                                impuesto_plastico = Producto.impuesto_plastico,
                                valorconversion   = Producto.valorconversion,
                                cdmedequiv        = Producto.cdmedequiv,
                                tpconversion      = Producto.tpconversion
                            };
                            TS_BEMensaje respuesta = TSSalesApp.SynchronizedSetSale(Lado, Venta);
                            if (respuesta.Ok)
                            {
                                try
                                {
                                    string[] mensaje     = respuesta.mensaje.Split('|');
                                    BindingDocument Item = new BindingDocument()
                                    {
                                        Documento = mensaje[0], Estado = mensaje[1], Respuesta = mensaje[2]
                                    };
                                    Device.BeginInvokeOnMainThread(() => { Contexto.Documentos.Add(Item); });
                                }
                                catch (Exception ex)
                                {
                                }
                            }
                            Progreso++;
                        }
                    }
                }
                else
                {
                    /**
                     * 1 ERROR GENERAL
                     * 2 ERROR DESCUENTOS
                     * 3 ERROR TABLAS DBF
                     * 4 SIN TRANSACCIONES
                     * 5 SIN CONEXION DISPENSADO
                     * 6 TERMINAL SIN CONEXION DISPENSADOR
                     **/
                    if (vTransaccion.Estado == 4)
                    {
                        Contexto.Progreso = "SIN TRANSACCIONES";
                        return;
                    }
                }
            });
        }
示例#13
0
        public async Task Start_Automatic(TerminalSIGES.Models.Lado Lado)
        {
            /** COMIENZA REVISION DE VENTAS PENDIENTES **/
            await Task.Run(() =>
            {
                if (Convert.ToBoolean(TSSalesApp.vTerminal.conexion_dispensador ?? 0) == false || Convert.ToBoolean(TSSalesApp.vParemetros.conexiondispensador ?? false) == false)
                {
                    Lado.Mensaje = "CONEXION A DISPENSADOR CERRADA";
                    return;
                }
                string codigo = Lado.Documento == TerminalSIGES.Models.EDocumento.NotaDespacho         ? Lado.Tarjeta  :
                                Lado.Documento == TerminalSIGES.Models.EDocumento.TranferenciaGratuita ? "XXXXXXXXXXX" :
                                Lado.Documento == TerminalSIGES.Models.EDocumento.Serafin              ? "XXXXXXXXXXX" :
                                Lado.Codigo;

                TS_BECabeceraOutPut vTransaccion = TSSalesApp.SynchronizedGetOPTransaction(Lado.Cara, codigo, true);
                if (vTransaccion.Ok)
                {
                    if (vTransaccion.cDetalleOutPut.Length > 0)
                    {
                        Lado.Mensaje = "ENVIANDO VENTA";
                        var Venta    = new TS_BEArticulo()
                        {
                            item              = vTransaccion.cDetalleOutPut[0].item,
                            dsarticulo        = (vTransaccion.cDetalleOutPut[0].dsarticulo1 ?? "").Trim(),
                            precio            = vTransaccion.cDetalleOutPut[0].precio,
                            cantidad          = vTransaccion.cDetalleOutPut[0].cantidad,
                            cdarticulo        = vTransaccion.cDetalleOutPut[0].cdarticulo,
                            cara              = vTransaccion.cDetalleOutPut[0].cara,
                            hora              = vTransaccion.cDetalleOutPut[0].hora,
                            subtotal          = vTransaccion.cDetalleOutPut[0].subtotal,
                            tipo              = vTransaccion.cDetalleOutPut[0].tipo,
                            mtoimpuesto       = vTransaccion.cDetalleOutPut[0].mtoimpuesto,
                            total             = vTransaccion.cDetalleOutPut[0].total,
                            nrogasboy         = vTransaccion.cDetalleOutPut[0].nrogasboy.Trim(),
                            cdarticulosunat   = vTransaccion.cDetalleOutPut[0].cdarticulosunat,
                            mtodscto          = 0,
                            cdunimed          = vTransaccion.cDetalleOutPut[0].cdunimed,
                            precio_orig       = vTransaccion.cDetalleOutPut[0].precio_orig,
                            redondea_indecopi = vTransaccion.cDetalleOutPut[0].redondea_indecopi,
                            tpformula         = vTransaccion.cDetalleOutPut[0].tpformula,
                            impuesto          = vTransaccion.cDetalleOutPut[0].impuesto,
                            moverstock        = vTransaccion.cDetalleOutPut[0].moverstock,
                            costo             = vTransaccion.cDetalleOutPut[0].costo,
                            trfgratuita       = vTransaccion.cDetalleOutPut[0].trfgratuita,
                            total_display     = vTransaccion.cDetalleOutPut[0].total_display,
                            impuesto_plastico = vTransaccion.cDetalleOutPut[0].impuesto_plastico,
                            valorconversion   = vTransaccion.cDetalleOutPut[0].valorconversion,
                            cdmedequiv        = vTransaccion.cDetalleOutPut[0].cdmedequiv,
                            tpconversion      = vTransaccion.cDetalleOutPut[0].tpconversion
                        };

                        TS_BEMensaje respuesta = TSSalesApp.SynchronizedSetSale(Lado, Venta);
                        if (respuesta.Ok)
                        {
                            Lado.Codigo             = "";
                            Lado.Ruc                = "";
                            Lado.RazonSocial        = "";
                            Lado.Correo             = "";
                            Lado.Direccion          = "";
                            Lado.Placa              = "";
                            Lado.Odometro           = "";
                            Lado.Chofer             = "";
                            Lado.Tarjeta_afiliacion = "";
                            Lado.Pago               = "";
                            Lado.Tarjeta            = "";
                            Lado.Fecha_Nacimiento   = null;
                            Lado.Telefono           = "";
                            Lado.Marca              = "";
                            Lado.Modelo             = "";
                            Lado.Mensaje            = "";
                            Lado.Pago               = "EFECTIVO";
                            Lado.Pagos.Clear();
                            Lado.Documento = TerminalSIGES.Models.EDocumento.BoletaFactura;
                        }
                        else
                        {
                            Lado.Estado.estado = false;
                            Lado.Mensaje       = respuesta.mensaje;
                        }
                    }
                }
                else
                {
                    /**
                     * 1 ERROR GENERAL
                     * 2 ERROR DESCUENTOS
                     * 3 ERROR TABLAS DBF
                     * 4 SIN TRANSACCIONES
                     * 5 SIN CONEXION DISPENSADO
                     * 6 TERMINAL SIN CONEXION DISPENSADOR
                     **/
                    if (vTransaccion.Estado == 4)
                    {
                        Lado.Mensaje = "SIN TRANSACCIONES";
                        return;
                    }
                    Lado.Estado.estado = false;
                    Lado.Mensaje       = vTransaccion.Mensaje;
                }
            });

            /** TERMINA REVISION DE VENTAS PENDIENTES **/
        }
        private void BtnSave_Clicked(object sender, EventArgs e)
        {
            /** INICIO DE VALIDACIONES DE TARJETAS DE ACUMULACION DE PUNTOS **/
            if ((this.txtTarjetaAfiliacion.Text ?? "").Length > 0)
            {
                if (TSCustomerApp.vTarjetasBuscadas.Count == 0)
                {
                    DisplayAlert("Aviso", "Debe buscar la tarjeta seleccionada", "Aceptar");
                    return;
                }
                else
                {
                    foreach (string tarjeta in TSCustomerApp.vTarjetasBloqueadas)
                    {
                        if (tarjeta.Equals(txtTarjetaAfiliacion.Text))
                        {
                            DisplayAlert("Aviso", "La tarjeta descrita en la busqueda esta bloqueada", "Aceptar");
                            return;
                        }
                    }
                    bool isbuscado = false;
                    foreach (string tarjeta in TSCustomerApp.vTarjetasBuscadas)
                    {
                        if ((tarjeta ?? "").Trim().Equals((txtTarjetaAfiliacion.Text ?? "").Trim()))
                        {
                            isbuscado = true;
                        }
                    }
                    if (isbuscado == false)
                    {
                        DisplayAlert("Aviso", "Debe buscar la tarjeta descrita", "Aceptar");
                        return;
                    }
                }
            }
            /**FIN VALIDACIONES DE TARJETAS DE PUNTOS**/

            /** INICIO DE VALIDACIONES DE TIPO DE DOCUMENTO**/

            if ((this.txtCodigo.Text ?? "").Trim().Length == 11 || (this.txtRuc.Text ?? "").Trim().Length == 11)
            {
                TS_BEMensaje validacion = validateFactura();
                if (validacion.Ok)
                {
                    TSCustomerApp.TipoComprobante = TSSalesInput.Factura();
                }
                else
                {
                    DisplayAlert("Aviso", validacion.mensaje, "Aceptar");
                    return;
                }
            }
            else if ((this.txtCodigo.Text ?? "").Trim().Length != 11 && (this.txtRuc.Text ?? "").Trim().Length != 11)
            {
                TS_BEMensaje validacion = validateBoleta();
                if (validacion.Ok)
                {
                    TSCustomerApp.TipoComprobante = TSSalesInput.Boleta();
                }
                else
                {
                    DisplayAlert("Aviso", validacion.mensaje, "Aceptar");
                    return;
                }
            }

            /** FIN DE VALIDACIONES DE TIPO DE DOCUMENTO **/
            /** INICIO DE VALIDACIONES DE TARJETA CREDITO EN CLIENTES **/
            if (TSCustomerApp.vCodigoBloqueado.Count > 0)
            {
                foreach (string tarjeta in TSCustomerApp.vCodigoBloqueado)
                {
                    if (tarjeta.Equals((this.txtCodigo.Text ?? "").Trim()))
                    {
                        DisplayAlert("Aviso", "No puede utilizar una tarjeta credito en pagos al contado", "Aceptar");
                        return;
                    }
                }
            }
            var varVerificaCodigo = (txtCodigo.Text ?? "").Trim();

            if (varVerificaCodigo.Length > 0)
            {
                string creditoCorp  = (TSSalesApp.vParemetros.prefcredcorp ?? "").Trim();
                string creditoLocal = (TSSalesApp.vParemetros.prefcredlocal ?? "").Trim();
                string creditoFlot  = (TSSalesApp.vParemetros.prefflotlocal ?? "").Trim();
                if (varVerificaCodigo.Length >= creditoCorp.Length)
                {
                    if (varVerificaCodigo.Substring(0, creditoCorp.Length).Equals(creditoCorp))
                    {
                        DisplayAlert("Aviso", "No puede pasar una tarjeta coorporativa en ventas al contado", "Aceptar");
                        return;
                    }
                }
                if (varVerificaCodigo.Length >= creditoLocal.Length)
                {
                    if (varVerificaCodigo.Substring(0, creditoLocal.Length).Equals(creditoLocal))
                    {
                        DisplayAlert("Aviso", "No puede pasar una tarjeta de credito local en ventas al contado", "Aceptar");
                        return;
                    }
                }
                if (varVerificaCodigo.Length >= creditoFlot.Length)
                {
                    if (varVerificaCodigo.Substring(0, creditoFlot.Length).Equals(creditoFlot))
                    {
                        DisplayAlert("Aviso", "No puede pasar una tarjeta de flota en ventas al contado", "Aceptar");
                        return;
                    }
                }
            }
            /** FIN DE VALIDACIONES DE TARJETA CREDITO EN CLIENTES **/

            TSCustomerApp.ClientOuput.rscliente      = this.txtRscliente.Text;
            TSCustomerApp.ClientOuput.drcliente      = this.txtDireccion.Text;
            TSCustomerApp.ClientOuput.ruccliente     = this.txtRuc.Text;
            TSCustomerApp.ClientOuput.emcliente      = this.txtEmail.Text;
            TSCustomerApp.ClientOuput.cdcliente      = this.txtCodigo.Text;
            TSCustomerApp.ClientOuput.tarjafiliacion = this.txtTarjetaAfiliacion.Text;
            TSCustomerApp.ClientOuput.puntos         = (this.txtTarjetaAfiliacion.Text ?? "").Equals((cliente.tarjafiliacion ?? "").Trim()) ? cliente.puntos : 0;
            TSCustomerApp.ClientOuput.valoracumula   = (this.txtTarjetaAfiliacion.Text ?? "").Equals((cliente.tarjafiliacion ?? "").Trim()) ? cliente.valoracumula : 0;
            TSCustomerApp.ClientOuput.isafiliacion   = (this.txtTarjetaAfiliacion.Text ?? "").Equals((cliente.tarjafiliacion ?? "").Trim());
            TSSalesApp.vCabecera.nroplaca            = this.txtPlaca.Text;
            TSCustomerApp.FlagSearch = true;
            Navigation.PopAsync();
        }
示例#15
0
 public TSLogin(LoginEstado resultado, TS_BEMensaje _input)
 {
     EstadoRespuesta = resultado;
     vMensaje        = _input;
 }