Exemplo n.º 1
0
        public static void  CheckPending()
        {
            try
            {
                ws.cls_Cliente9 c9 = new ws.cls_Cliente9();

                String url = System.Configuration.ConfigurationManager.AppSettings["URL_WS_C9"].ToString();

                if (Comun.CheckURLWs(url, 10000))
                {
                    DLLGestionVenta.Models.VENTA _v = new DLLGestionVenta.Models.VENTA();

                    _v.Id_Tienda   = AVE.Contexto.IdTienda;
                    _v.ID_TERMINAL = AVE.Contexto.IdTerminal;
                    _v.IdCajero    = int.Parse(AVE.Contexto.IdEmpleado);
                    _v.Fecha       = AVE.Contexto.FechaSesion;
                    _v.Id_Empleado = int.Parse(AVE.Contexto.IdEmpleado);

                    Cliente9.cls_Cliente9 C9p = new Cliente9.cls_Cliente9(_v);
                    C9p.ConexString = System.Configuration.ConfigurationManager.ConnectionStrings["MC_TDAConnectionString"].ToString();

                    C9p.InvokeWS_OperacionesPendientes(1, String.Empty, true);
                    C9p.InvokeWS_OperacionesPendientes(2, String.Empty, true);
                    C9p.InvokeWS_OperacionesPendientes(3, String.Empty, true);
                }
            }
            catch (Exception sqlEx)
            {
                throw new Exception(string.Format("Excepcion: {0} ---- {1}", sqlEx.Message, sqlEx.StackTrace), sqlEx.InnerException);
            }
        }
Exemplo n.º 2
0
        protected void btnActualizar_Click(object sender, EventArgs e)
        {
            String url      = System.Configuration.ConfigurationManager.AppSettings["URL_WS_C9"].ToString();
            string strWS    = "";
            string IdSocio9 = "0";
            int    error309 = 0;
            int    result   = 0;

            try
            {
                if (hidEsEmpleado.Value == "0")
                {
                    ValidacionesContexto();
                    if (!Comun.CheckURLWs(url, 10000))
                    {
                        ScriptManager.RegisterStartupScript(this, typeof(Page), "CLIENTE 9", "alert('El Servicio de CLIENTE 9 no esta accesible.');", true);
                        return;
                    }
                    AsignaDatosNine();
                    objNine.ConexString = System.Configuration.ConfigurationManager.ConnectionStrings["MC_TDAConnectionString"].ToString();
                    result = objNine.ActualizaDatosCliente(client9, client9Extend, Session["IdEmpleado"].ToString(), Session["IdTienda"].ToString(), Session["IdTerminal"].ToString(), ref strWS, ref IdSocio9, ref error309);
                    if (error309 == 1)
                    {
                        hidMsjError.Value = strWS;
                        ClientScriptManager cs = Page.ClientScript;
                        cs.RegisterStartupScript(this.GetType(), "Numero de Tarjeta No Valido", "ConfirmarTJT('¿Desea actualizar tarjeta en TPV a pesar de mensaje devuelto por C9?');", true);
                    }
                    if (result > 0 && result != 309)
                    {
                        LimpiaControles();
                        reiniciaLstCIF();
                        LimpiaControlesFacturacion();
                        this.nomcliente.Text = "";
                        ListDatosFact        = null;
                        DatosFact            = null;
                        ValidaControles();
                        ScriptManager.RegisterStartupScript(this, typeof(Page), "CLIENTE 9", "alert('El cliente con IdSocio:" + IdSocio9 + " ha sido actualizado en el sistema');", true);
                    }
                    else
                    {
                        ScriptManager.RegisterStartupScript(this, typeof(Page), "CLIENTE 9", "alert('Se produjo un error al actualizar el cliente, en el sistema:" + strWS + "');", true);
                    }
                }
                else
                {
                    ScriptManager.RegisterStartupScript(this, typeof(Page), "CLIENTE 9", "alert('Error, El Cliente es Empleado.');", true);
                }
            }
            catch (Exception ex) {
                log.Error("Exception Actualizar_click:" + ex.Message.ToString());
            }
        }
Exemplo n.º 3
0
        protected int ConsultaBeneficios(NuevoCambioC9 cambC9, ref ws.cls_Cliente9.ConsultaBeneficios cb)
        {
            int result = 0;

            ws.cls_Cliente9 c9 = new ws.cls_Cliente9();
            cb.idTargeta  = cambC9.TarjetaActual;
            cb.idTienda   = AVE.Contexto.IdTienda;
            cb.idTerminal = AVE.Contexto.IdTerminal;

            String url = System.Configuration.ConfigurationManager.AppSettings["URL_WS_C9"].ToString();

            if (!Comun.CheckURLWs(url, 10000))
            {
                ScriptManager.RegisterStartupScript(this, typeof(Page), "CLIENTE 9", "alert('El Servicio de CLIENTE 9 no esta accesible.');", true);
                return(0);
            }

            String ret = c9.InvokeWS_ConsultaBeneficios(ref cb);

            if (!String.IsNullOrEmpty(ret))
            {
                result = 2;
            }
            else
            {
                if (nomcliente.Text.Length == 0)
                {
                    ScriptManager.RegisterStartupScript(this, typeof(Page), "homolagadoZapa", "alert('La tarjeta no esta homolagada en Zapagestion.');", true);
                    return(0);
                }

                if (c9.GetblnHomologadoC9(cambC9.TarjetaActual))     //, Int64.Parse(nomcliente.Text.ToString())))
                {
                    result = 1;
                }
            }
            return(result);
        }
Exemplo n.º 4
0
        protected void btnActivarTjt_Click(object sender, EventArgs e)
        {
            int    result   = 0;
            int    error309 = 0;
            string strWS    = "";


            if (Page.IsValid)
            {
                String url = System.Configuration.ConfigurationManager.AppSettings["URL_WS_C9"].ToString();
                try
                {
                    if (hidEsEmpleado.Value == "")
                    {
                        hidEsEmpleado.Value = "0";
                    }
                    if (hidEsEmpleado.Value == "0")
                    {
                        ValidacionesContexto();
                        if (!Comun.CheckURLWs(url, 10000))
                        {
                            ScriptManager.RegisterStartupScript(this, typeof(Page), "CLIENTE 9", "alert('El Servicio de CLIENTE 9 no esta accesible.');", true);
                            return;
                        }
                        AsignaDatosNine();
                        objNine.ConexString = System.Configuration.ConfigurationManager.ConnectionStrings["MC_TDAConnectionString"].ToString();



                        if (hidIdCliente.Value == "")//NuevoCliente
                        {
                            result = objNine.AniadeNuevoCliente(ref client9, Session["IdEmpleado"].ToString(), Session["IdTienda"].ToString(), Session["IdTerminal"].ToString(), ref error309, ref strWS);
                            if (result > 0)
                            {
                                hidIdCliente.Value = client9.Id_Cliente.ToString();
                            }
                            if (error309 == 1)
                            {
                                hidMsjError.Value = strWS;
                                ClientScriptManager cs = Page.ClientScript;
                                cs.RegisterStartupScript(this.GetType(), "Numero de Tarjeta No Valido", "ConfirmarTJT('¿Desea grabar tarjeta en TPV a pesar de mensaje devuelto por C9?');", true);
                            }
                        }
                        else //Cliente existente que se pasa a cliente 9
                        {
                            result = objNine.UpdateClientetoNine(ref client9, Session["IdEmpleado"].ToString(), Session["IdTienda"].ToString(), Session["IdTerminal"].ToString(), ref error309, ref strWS);
                            if (error309 == 1)
                            {
                                hidMsjError.Value = strWS;
                                ClientScriptManager cs = Page.ClientScript;
                                cs.RegisterStartupScript(this.GetType(), "Numero de Tarjeta No Valido", "ConfirmarTJT('¿Desea grabar tarjeta en TPV a pesar de mensaje devuelto por C9?');", true);
                            }
                        }

                        if (result > 0 && result != 309)
                        {
                            ScriptManager.RegisterStartupScript(this, typeof(Page), "CLIENTE 9", "alert('El cliente con id: " + hidIdCliente.Value + " ha sido añadido al sistema');", true);
                            LimpiaControles();
                            ValidaControles();
                            HabilitaValidaciones();
                        }
                        else
                        {
                            ScriptManager.RegisterStartupScript(this, typeof(Page), "CLIENTE 9", "alert('Se produjo un error al añadir el cliente, al sistema:" + strWS + "');", true);
                        }
                    }
                    else
                    {
                        ScriptManager.RegisterStartupScript(this, typeof(Page), "CLIENTE 9", "alert('Error, El Cliente es Empleado.');", true);
                    }
                }
                catch (Exception ex) {
                    log.Error("Exception btnActivarTjt:" + ex.Message);
                    ScriptManager.RegisterStartupScript(this, typeof(Page), "CLIENTE 9", "alert('Se produjo un error al añadir el cliente, al sistema:" + strWS + "');", true);
                }
            }
        }
Exemplo n.º 5
0
        public static int  SolicitaRedencionDevo(string IdTienda, string IdEmpleado, string terminal, DateTime fechaActual, string Fpago, string Cliente, double importe, ref string strAutorizacion, ref string strTarjeta)
        {
            string tarjetaNine = "";
            int    result      = 0;

            try
            {
                tarjetaNine = GetTarjetaNine(Cliente, fechaActual);
                strTarjeta  = tarjetaNine;
                ws.cls_Cliente9 c9 = new ws.cls_Cliente9();

                String url = System.Configuration.ConfigurationManager.AppSettings["URL_WS_C9"].ToString();

                if (Comun.CheckURLWs(url, 10000))
                {
                    DLLGestionVenta.Models.VENTA _v = new DLLGestionVenta.Models.VENTA();

                    _v.Id_Tienda   = IdTienda;
                    _v.ID_TERMINAL = terminal;
                    _v.IdCajero    = int.Parse(IdEmpleado);
                    _v.Fecha       = fechaActual;
                    _v.Id_Empleado = int.Parse(IdEmpleado);

                    Cliente9.cls_Cliente9 C9p = new Cliente9.cls_Cliente9(_v);
                    C9p.ConexString = System.Configuration.ConfigurationManager.ConnectionStrings["MC_TDAConnectionString"].ToString();

                    ws.cls_Cliente9.SolicitaRedencion sr = new ws.cls_Cliente9.SolicitaRedencion();
                    if (Fpago == "PUNTOS NINE")
                    {
                        sr.intTipo    = 1;
                        sr.strTarjeta = tarjetaNine;
                        sr.dblMonto   = importe * -1;
                        sr.strTienda  = IdTienda;
                        sr.idTerminal = terminal;
                        sr.lngCajero  = int.Parse(IdEmpleado);
                        C9p.InvokeWS_OperacionesPendientes(1, String.Empty, true);
                    }
                    else if (Fpago == "BOLSA 5")
                    {
                        sr.intTipo    = 3;
                        sr.strTarjeta = tarjetaNine;
                        sr.dblMonto   = 0;
                        sr.strTienda  = IdTienda;
                        sr.idTerminal = terminal;
                        sr.lngCajero  = int.Parse(IdEmpleado);

                        C9p.InvokeWS_OperacionesPendientes(3, String.Empty, true);
                    }
                    else if (Fpago == "PAR 9")
                    {
                        sr.intTipo    = 3;
                        sr.strTarjeta = tarjetaNine;
                        sr.dblMonto   = 0;
                        sr.strTienda  = IdTienda;
                        sr.idTerminal = terminal;
                        sr.lngCajero  = int.Parse(IdEmpleado);

                        C9p.InvokeWS_OperacionesPendientes(2, String.Empty, true);
                    }

                    String ret = c9.InvokeWS_SolicitaRedencionDev(ref sr, IdEmpleado, IdTienda, fechaActual);

                    if (sr.strBitRedencionP == "1")
                    {
                        result = 0;
                    }
                    else
                    {
                        strAutorizacion = sr.strNoAutorizacion;
                        result          = 1;
                    }
                }
            }
            catch (Exception sqlEx)
            {
                throw new Exception(string.Format("Excepcion: {0} ---- {1}", sqlEx.Message, sqlEx.StackTrace), sqlEx.InnerException);
            }
            return(result);
        }