Esempio n. 1
0
        private void GetClienteActual(string sCliente)
        {
            try
            {
                objNine             = new DLLGestionCliente9.ClsCliente9();
                objNine.ConexString = System.Configuration.ConfigurationManager.ConnectionStrings["MC_TDAConnectionString"].ToString();
                List <DLLGestionCliente9.Models.Cliente9> objclient = objNine.GetClienteAdm9(sCliente, Contexto.FechaSesion);


                if (objclient.Count > 0)
                {
                    if (objclient.Count == 1)
                    {
                        txtNombre.Text                 = objclient[0].Nombre;
                        txtApellidos.Text              = objclient[0].Apellidos;
                        txtEmail.Text                  = objclient[0].Email;
                        txtFecNac.Text                 = Convert.ToDateTime(objclient[0].FechaNacimiento.ToString()).ToShortDateString();
                        txtTfnoCasa.Text               = objclient[0].Telefono.ToString();
                        txtMovil.Text                  = objclient[0].Movil.ToString();
                        txtNumTarjeta.Text             = objclient[0].NumTarjeta.ToString();
                        hidNumeroTarjetaCliente9.Value = objclient[0].NumTarjeta.ToString();
                        hidIdCliente.Value             = objclient[0].Id_Cliente.ToString();
                        hidEsEmpleado.Value            = objclient[0].esEmpleado.ToString();
                        if (txtNumTarjeta.Text == "")
                        {
                            txtNumTarjeta.Text = "22114005";
                        }
                        ValidaControles();
                    }
                    else
                    {
                        DLLGestionCliente9.Models.Cliente9 objclientAux;
                        objclientAux            = new DLLGestionCliente9.Models.Cliente9();
                        objclientAux.Id_Cliente = -1;
                        objclientAux.Cliente    = "";

                        objclient.Insert(0, objclientAux);
                        LstClientes.DataTextField  = "Cliente";
                        LstClientes.DataValueField = "ID_Cliente";
                        LstClientes.DataSource     = objclient;
                        LstClientes.DataBind();
                        hidIdCliente.Value      = "";
                        hidEsEmpleado.Value     = "";
                        nomcliente.CssClass     = "ocul1";
                        LstClientes.CssClass    = "visi1";
                        this.txtNombre.Text     = "";
                        this.txtApellidos.Text  = "";
                        this.txtEmail.Text      = "";
                        this.txtFecNac.Text     = "";
                        this.txtTfnoCasa.Text   = "";
                        this.txtMovil.Text      = "";
                        this.txtNumTarjeta.Text = "";
                    }
                }
            }
            catch (Exception ex) {
                log.Error("Exception GetClienteActual:" + ex.Message.ToString());
            }
        }
Esempio n. 2
0
        private int CheckCambiosEnCarrito(string idCarrito, string referencias, ref int NumArticulos)
        {
            int result = 0;

            objNine             = new DLLGestionCliente9.ClsCliente9();
            objNine.ConexString = System.Configuration.ConfigurationManager.ConnectionStrings["MC_TDAConnectionString"].ToString();
            result = objNine.ValidaCambiosTJT(idCarrito, referencias, ref NumArticulos);

            return(result);
        }
Esempio n. 3
0
        public int InsertarEnCarrito(NuevoCambioC9 cambioC9, string idEmpleado, string idTerminal, string idTienda, ref string idCarrito, ref int iDuplicado)
        {
            int result = 0;


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

            try
            {
                if (HttpContext.Current == null)
                {
                    idMaquina = "127.0.0.1";     //Si llega HttpContext.Current  (Request) a null, le asignamos el valor del host local para que no salte excepcion
                }
                else
                {
                    idMaquina = (string)System.Web.HttpContext.Current.Request.UserHostAddress;
                }
                objNine             = new DLLGestionCliente9.ClsCliente9();
                objNine.ConexString = System.Configuration.ConfigurationManager.ConnectionStrings["MC_TDAConnectionString"].ToString();
                if (Session["IdCarrito"] != null)
                {
                    idCarrito = Session["IdCarrito"].ToString();
                }
                if (ConfigurationManager.AppSettings["EntornoTR"] != null)
                {
                    if (Request.QueryString["IdCarrito"] != null)
                    {
                        idCarrito = Request.QueryString["IdCarrito"].ToString();
                    }
                }
                result = objNine.InsertaCarritoCambio(cambioC9, idEmpleado, idTerminal, idTienda, idMaquina, ref idCarrito, ref iDuplicado);
            }
            catch (Exception ex)
            {
                log.Error(ex.Message, ex);
                throw ex;
            }
            finally
            {
            }
            return(result);
        }
Esempio n. 4
0
        private void getDatosFacturacion(string sCliente)
        {
            objNine = new DLLGestionCliente9.ClsCliente9();
            int indice   = 0;
            int numItems = 0;

            objNine.ConexString = System.Configuration.ConfigurationManager.ConnectionStrings["MC_TDAConnectionString"].ToString();
            List <DLLGestionCliente9.Models.FacturacionC9> Factclient = objNine.GetDatosFacturacion(sCliente);

            if (Factclient.Count > 0)
            {
                ListDatosFact = Factclient;
                numItems      = CargaDatosCombo(ListDatosFact);
                if (numItems >= 1)
                {
                    indice = 1;
                }
                AsignaDatosFacturacion(indice);
                ListaRFC.SelectedIndex = indice;
            }
        }
Esempio n. 5
0
        private void GetClienteActual(string sCliente)
        {
            try
            {
                objNine             = new DLLGestionCliente9.ClsCliente9();
                objNine.ConexString = System.Configuration.ConfigurationManager.ConnectionStrings["MC_TDAConnectionString"].ToString();
                List <DLLGestionCliente9.Models.Cliente9Gral> objclient = objNine.GetClienteActualizacion(sCliente, Contexto.FechaSesion);


                if (objclient.Count > 0)
                {
                    if (objclient.Count == 1)
                    {
                        txtNombre.Text      = objclient[0].c9.Nombre;
                        txtApellidos.Text   = objclient[0].c9.Apellidos;
                        txtEmail.Text       = objclient[0].c9.Email;
                        txtFecNac.Text      = Convert.ToDateTime(objclient[0].c9.FechaNacimiento.ToString()).ToShortDateString();
                        txtTfnoCasa.Text    = objclient[0].c9.Telefono.ToString();
                        txtMovil.Text       = objclient[0].c9.Movil.ToString();
                        txtCargo.Text       = objclient[0].c9Extent.Cargo.ToString();
                        txtComentarios.Text = objclient[0].c9Extent.Comentarios.ToString();
                        txtContacto.Text    = objclient[0].c9Extent.Contacto.ToString();
                        txtCP.Text          = objclient[0].c9Extent.CP.ToString();
                        txtDireccion.Text   = objclient[0].c9Extent.Direccion.ToString();
                        ListItem itemToSelect = cboEstado.Items.FindByText(objclient[0].c9Extent.Estado.ToString());

                        if (itemToSelect != null)
                        {
                            itemToSelect.Selected = true;
                        }

                        // txtEstado.Text = objclient[0].c9Extent.Estado.ToString();
                        txtFax.Text                    = objclient[0].c9Extent.Fax.ToString();
                        txtPais.Text                   = objclient[0].c9Extent.Pais.ToString();
                        txtPoblacion.Text              = objclient[0].c9Extent.Poblacion.ToString();
                        txtTalla.Text                  = objclient[0].c9Extent.Talla.ToString();
                        txtTfnoTjo.Text                = objclient[0].c9Extent.TfnoTrabajo.ToString();
                        hidEsEmpleado.Value            = objclient[0].c9.esEmpleado.ToString();
                        hidNumeroTarjetaCliente9.Value = objclient[0].c9.NumTarjeta.ToString();
                        hidIdCliente.Value             = objclient[0].c9.Id_Cliente.ToString();

                        ValidaControles();
                    }
                    else
                    {
                        DLLGestionCliente9.Models.Cliente9Gral objclientAux;
                        objclientAux = new DLLGestionCliente9.Models.Cliente9Gral();
                        objclientAux.c9.Id_Cliente = -1;
                        objclientAux.c9.Cliente    = "";

                        objclient.Insert(0, objclientAux);
                        LstClientes.DataTextField  = "Cliente";
                        LstClientes.DataValueField = "ID_Cliente";
                        LstClientes.DataSource     = objclient;
                        LstClientes.DataBind();
                        hidIdCliente.Value     = "";
                        hidEsEmpleado.Value    = "";
                        nomcliente.CssClass    = "ocul1";
                        LstClientes.CssClass   = "visi1";
                        this.txtNombre.Text    = "";
                        this.txtApellidos.Text = "";
                        this.txtEmail.Text     = "";
                        this.txtFecNac.Text    = "";
                        this.txtTfnoCasa.Text  = "";
                        this.txtMovil.Text     = "";
                    }
                }
            }
            catch (Exception ex)
            {
                log.Error("Exception GetClienteActual:" + ex.Message.ToString());
            }
        }