Ejemplo n.º 1
0
        private void correoElectronicoWaterMarkTextBox_Validating(object sender, CancelEventArgs e)
        {
            string error = null;

            if (!Validacion.esEmail(correoElectronicoWaterMarkTextBox))
            {
                correoElectronicoWaterMarkTextBox.BackColor = Color.White;
                error    = "Ingrese el correo electronico";
                e.Cancel = true;
                errorProvider1.SetError((Control)sender, error);
            }
            else if (DatosCliente.existeClienteCO(id, correoElectronicoWaterMarkTextBox.Text))
            {
                correoElectronicoWaterMarkTextBox.BackColor = colorOk;
                errorProvider1.SetError(correoElectronicoWaterMarkTextBox, String.Empty);
            }
            else if (DatosCliente.existeCorreoE(correoElectronicoWaterMarkTextBox.Text))
            {
                correoElectronicoWaterMarkTextBox.BackColor = Color.White;
                error    = "El correo electronico ya existe";
                e.Cancel = true;
                errorProvider1.SetError((Control)sender, error);
            }
            else
            {
                correoElectronicoWaterMarkTextBox.BackColor = colorOk;
                errorProvider1.SetError((Control)sender, String.Empty);
            }
        }
Ejemplo n.º 2
0
        public Cliente_Admin(bool cumple)
        {
            InitializeComponent();
            cbox_filtro_producto.SelectedIndex = 0;


            ArrayList lista = new ArrayList();

            // nombre
            if (cbox_filtro_producto.SelectedIndex == 0)
            {
                string buscarse = "and c.nombre like '%%'";
                lista = DatosCliente.getClientes(buscarse);
            }



            for (int x = lista.Count; x > 0; x--)
            {
                if (((Cliente)lista[x - 1]).Nacimiento.Day != DateTime.Today.Day || ((Cliente)lista[x - 1]).Nacimiento.Month != DateTime.Today.Month)
                {
                    lista.RemoveAt(x - 1);
                }
            }
            listaVacia.Clear();
            listaVacia = lista;
            bdd_clientes.DataSource = listaVacia;
        }
 public Ticket()
 {
     setModo(EnumModoTicket.Modo58mm);
     Negocio   = new DatosNegocio();
     Cliente   = new DatosCliente();
     Documento = new DatosDocumento();
 }
Ejemplo n.º 4
0
        //public static string modificarlistactacte(DataTable midata, decimal totalapagar)
        //{
        //    //DatosCliente objcliente = new DatosCliente();

        //    //return objcliente(midata,"");
        //}

        public static string agregaromodificarrecibo(DataTable midata, decimal totalapagar, int codcliente, int idusuario, ref int codrecibo)
        {
            DatosCliente objcliente = new DatosCliente(codcliente);


            return(objcliente.agregarrecibo(ref codrecibo, objcliente, midata, totalapagar, false, idusuario));
        }
Ejemplo n.º 5
0
        public static DataTable Buscar(string buscar)
        {
            DatosCliente Cliente = new DatosCliente();

            Cliente.Buscar = buscar;
            return(Cliente.BuscarCliente(Cliente));
        }
Ejemplo n.º 6
0
        private void numeroCelularWaterMarkTextBox_Validating(object sender, CancelEventArgs e)
        {
            string error = null;

            if (!Validacion.esTelefono(numeroCelularWaterMarkTextBox))
            {
                numeroCelularWaterMarkTextBox.BackColor = Color.White;
                error    = "Ingrese el numero de celular";
                e.Cancel = true;
                errorProvider1.SetError((Control)sender, error);
            }
            else if (DatosCliente.existeClienteNC(id, numeroCelularWaterMarkTextBox.Text))
            {
                numeroCelularWaterMarkTextBox.BackColor = colorOk;
                errorProvider1.SetError(numeroCelularWaterMarkTextBox, String.Empty);
            }
            else if (DatosCliente.existeNumeroCelular(numeroCelularWaterMarkTextBox.Text))
            {
                numeroCelularWaterMarkTextBox.BackColor = Color.White;
                error    = "El numero de celular ya existe";
                e.Cancel = true;
                errorProvider1.SetError((Control)sender, error);
            }
            else
            {
                numeroCelularWaterMarkTextBox.BackColor = colorOk;
                errorProvider1.SetError((Control)sender, String.Empty);
            }
        }
Ejemplo n.º 7
0
        private void cuitWaterMarkTextBox_Validating(object sender, CancelEventArgs e)
        {
            string error = null;

            if (!Validacion.esNumeroCUIT(cuitWaterMarkTextBox))
            {
                cuitWaterMarkTextBox.BackColor = Color.White;
                error    = "Ingrese el numero de CUIL/CUIT, solo 11 numeros";
                e.Cancel = true;
                errorProvider1.SetError((Control)sender, error);
            }
            else if (DatosCliente.existeClienteC(id, cuitWaterMarkTextBox.Text))
            {
                cuitWaterMarkTextBox.BackColor = colorOk;
                errorProvider1.SetError(cuitWaterMarkTextBox, String.Empty);
            }
            else if (DatosCliente.existeC(cuitWaterMarkTextBox.Text))
            {
                cuitWaterMarkTextBox.BackColor = Color.White;
                error    = "El numero de CUIL/CUIT ya existe";
                e.Cancel = true;
                errorProvider1.SetError((Control)sender, error);
            }
            else
            {
                cuitWaterMarkTextBox.BackColor = colorOk;
                errorProvider1.SetError((Control)sender, String.Empty);
            }
        }
Ejemplo n.º 8
0
        private void txtBuscar_KeyUp(object sender, KeyEventArgs e)
        {
            try
            {
                if (txtBuscar.Text == "")
                {
                    clienteBindingSource.DataSource = DatosCliente.getClientes();
                }

                if (cbSelector.SelectedIndex == 0)
                {
                    clienteBindingSource.DataSource = DatosCliente.BuscarNombreCliente(txtBuscar.Text);
                }
                else if (cbSelector.SelectedIndex == 1)
                {
                    clienteBindingSource.DataSource = DatosCliente.BuscarContacto(txtBuscar.Text);
                }
                else if (cbSelector.SelectedIndex == 2)
                {
                    clienteBindingSource.DataSource = DatosCliente.BuscarCuit(txtBuscar.Text);
                }
                else if (cbSelector.SelectedIndex == 3)
                {
                    clienteBindingSource.DataSource = DatosCliente.BuscarZona(txtBuscar.Text);
                }
            }
            catch
            {
                MessageBox.Show("No se encontro nada en su busqueda");
                Actualizar();
            }
        }
Ejemplo n.º 9
0
        public EnviarPedidoDVH(PedidoEcom _Pedido, GetInfoClienteEcomm InfoCliEcom)
        {
            pedidoEcom       = _Pedido;
            infoClienteEcomm = InfoCliEcom;
            DatosCli         = new DatosCliente(pedidoEcom.RUT);
            if (DatosCli.Region == "05")
            {
                Sucursal = "VIÑA DEL MAR";
            }
            else
            {
                Sucursal = "SANTIAGO";
            }
            if (!DatosCli.Bloqueado && DatosCli.EFinanciero.Disponible > _Pedido.Bruto)
            {
                PedidoAlfak.Generate generate = new PedidoAlfak.Generate(_Pedido, Sucursal);
                if (generate.IsSuccess)
                {
                    NroPedido = generate.NroPedido;

                    /*actualizar el nro de pedido en PLABAL*/
                    /*Ingresar en PLABAL.Planificacion*/
                }
                else
                {
                    IsSuccess = false;
                    Mensaje   = generate.Mensaje;
                }
            }
            else
            {
                IsSuccess = false;
                Mensaje   = "El pedido no pudo ser ingresado debido a que el cliente está bloqueado o el cupo disponible no alcanza.";
            }
        }
Ejemplo n.º 10
0
        private void btnEliminar_Click(object sender, EventArgs e)
        {
            try
            {
                Cliente c = (Cliente)clienteBindingSource.Current;
                if (!DatosCliente.enUso(c.Id))
                {
                    c.Activo = false;

                    if (MessageBox.Show("¿Esta seguro de eliminar a " + c.Nombre + "?", "Eliminar", MessageBoxButtons.YesNo) == DialogResult.Yes)
                    {
                        DatosCliente.Modificar(c);
                        Actualizar();
                    }
                }
                else
                {
                    MessageBox.Show("El objeto seleccionado no puede ser eliminado");
                }
            }
            catch
            {
                MessageBox.Show("No seleccionó nada");
            }
        }
Ejemplo n.º 11
0
        public static string Eliminar(int id)
        {
            DatosCliente cliente = new DatosCliente();

            cliente.Idcliente = id;
            return(cliente.Eliminar(cliente));
        }
Ejemplo n.º 12
0
        static void Main(string[] args)
        {
            Console.WriteLine("EMPRESA TERCER NIVEL CÍA. LTDA");
            Console.WriteLine("BIENVENIDO(A)");
            Console.WriteLine();

            DatosCliente datosCliente1 = new DatosCliente("Zúniga Reinoso", "Karla Gabriela", 1351289093, "Cdla Los Eléctricos");
            DatosCliente datosCliente2 = new DatosCliente("Espinales Moreira", "Diego Xavier", 1358897815, "Ciudad Jardín");

            DatosGasolina datosgasolina1 = new DatosGasolina("Extra", 3, 1.50);
            DatosGasolina datosgasolina2 = new DatosGasolina("Super", 5, 2.00);



            Console.WriteLine("Apellidos: {0}\nNombres: {1}\nCédula de Identidad: {2}\nDirección Domiciliaria: {3}", datosCliente1.Apellidos, datosCliente1.Nombres, datosCliente1.Cedula, datosCliente1.Direccion);
            Console.WriteLine();
            Console.WriteLine("Tipo Gasolina: {0}\nCantidad de galones: {1}\nPrecio de la gasolina: ${2}\n\nSubtotal: ${3}\nIVA: ${4}\nTotal: ${5}", datosgasolina1.Tipogasolina, datosgasolina1.Cantidadgalones, datosgasolina1.PrecioVenta, datosgasolina1.Subtotal, datosgasolina1.Iva, datosgasolina1.Total);


            Console.WriteLine("\n*****************************************\n");


            Console.WriteLine("Apellidos: {0}\nNombres: {1}\nCédula de Identidad: {2}\nDirección Domiciliaria: {3}", datosCliente2.Apellidos, datosCliente2.Nombres, datosCliente2.Cedula, datosCliente2.Direccion);
            Console.WriteLine();
            Console.WriteLine("Tipo Gasolina: {0}\nCantidad de galones: {1}\nPrecio de la gasolina: ${2}\n\nSubtotal: ${3}\nIVA: ${4}\nTotal: ${5}", datosgasolina2.Tipogasolina, datosgasolina2.Cantidadgalones, datosgasolina2.PrecioVenta, datosgasolina2.Subtotal, datosgasolina2.Iva, datosgasolina2.Total);

            Console.ReadKey();
        }
Ejemplo n.º 13
0
        private void btnAceptar_Click(object sender, EventArgs e)
        {
            try
            {
                if (!validaciones())
                {
                    return;
                }

                Cliente c = (Cliente)clienteBindingSource.Current;
                c.Zona        = (Zona)cbZona.SelectedItem;
                c.Activo      = true;
                c.FechaInicio = fechaInicioDateTimePicker.Value;
                if (c.Id == 0)
                {
                    DatosCliente.Crear(c);
                }
                else
                {
                    DatosCliente.Modificar(c);
                }
                Close();
            }
            catch
            {
                MessageBox.Show("Complete todos los campos");
            }
        }
Ejemplo n.º 14
0
        public static DataTable BuscarCliente(string busqueda)
        {
            DatosCliente cliente = new DatosCliente();

            cliente.Nombre = busqueda;
            return(cliente.BuscarCliente(cliente));
        }
Ejemplo n.º 15
0
        public static DataTable buscar(string texto)
        {
            DatosCliente cliente = new DatosCliente();

            cliente.BuscarCliente = texto;
            return(cliente.buscarTexto(cliente));
        }
Ejemplo n.º 16
0
        public static DataTable buscarCodigoCliente(string texto, int modo = 6)
        {
            DatosCliente cliente = new DatosCliente();

            cliente.BuscarCliente = texto;
            return(cliente.buscarCodigoCliente(cliente, modo));
        }
Ejemplo n.º 17
0
        public DatosCliente GetIP()
        {
            DatosCliente cli = new DatosCliente();

            try
            {
                string ip = null;
                ip = HttpContext.Current.Request.ServerVariables["HTTP_X_FORWARDED_FOR"];

                if (string.IsNullOrEmpty(ip))
                {
                    ip = HttpContext.Current.Request.ServerVariables["REMOTE_ADDR"];
                }
                else   // Using X-Forwarded-For last address
                {
                    ip = ip.Split(',')
                         .Last()
                         .Trim();
                }
                cli.RemoteAddr = ip;
                var ipClient = HttpContext.Current.Request.ServerVariables["HTTP_CLIENT_IP"];
                cli.ClientIP = ipClient;
                var host = HttpUtility.HtmlEncode(HttpContext.Current.Request.UserHostAddress);
                cli.HostAddr = host;
            }
            catch (Exception e)
            {
            }
            return(cli);
        }
Ejemplo n.º 18
0
        private void Actualizar()
        {
            try
            {
                Cliente c = DatosCliente.getCliente(id);

                provinciaBindingSource.DataSource = DatosProvincia.getProvinciasPorPais(c.Zona.Localidad.Provincia.Pais.Id);

                if (cbProvincia.SelectedValue == null)
                {
                    localidadBindingSource.DataSource = null;
                }
                else
                {
                    localidadBindingSource.DataSource = DatosLocalidad.getLocalidadesPorProvincia(c.Zona.Localidad.Provincia.Id);
                    if (cbLocalidad.SelectedValue == null)
                    {
                        zonaBindingSource.DataSource = null;
                    }
                    else
                    {
                        zonaBindingSource.DataSource = DatosZona.getZonasPorLocalidad(c.Zona.Localidad.Id);
                    }
                }
            }
            catch
            {
            }
        }
Ejemplo n.º 19
0
    protected void FillInformation(DatosCliente _Cli)
    {
        FillDDlEmpresas(DUser.InfoEmpresas);

        Page.Title             = _Cli.Nombre;
        lblCreditoDis.Text     = (_Cli.EFinanciero.Credito + _Cli.EFinanciero.RiesgoPropio).ToString("C0");
        LabelDisponible.Text   = _Cli.EFinanciero.Disponible.ToString("C0");
        Hiddendisponible.Value = _Cli.EFinanciero.Disponible.ToString();
        LblCliente.Text        = "Empresa: " + Cli.Nombre;
        lblUtilizado.Text      = _Cli.EFinanciero.Deuda.ToString("C0");
        CargarMensajes(Cli.Nombre);
        if (_Cli.EFinanciero.Disponible <= 5000)
        {
            BtnCrearPedido.Enabled = false;
            BtnCrearPedido.ToolTip = "No tiene cupo para realizar pedido.";
        }
        else
        {
            BtnCrearPedido.Enabled = true;
        }
        if (_Cli.Bloqueado)
        {
            BtnCrearPedido.Enabled = false;
            BtnCrearPedido.ToolTip = "Cliente Bloqueado, comuníquese con el depto. de Créditos y Cobranzas.";
        }
    }
Ejemplo n.º 20
0
        public static string Eliminar(int idCliente)
        {
            DatosCliente Cliente = new DatosCliente();

            Cliente.IdCliente = idCliente;
            return(Cliente.Eliminar(Cliente));
        }
Ejemplo n.º 21
0
    void master_Page_PreLoad(object sender, EventArgs e)
    {
        Usuario            funcion = new Usuario();
        Infousuario        usuario = funcion.Info;
        HtmlGenericControl span    = new HtmlGenericControl("span")
        {
            InnerHtml = usuario.Nombre
        };
        HtmlGenericControl a;
        var divuser  = loginview.FindControl("DivUsuario");
        var DropMenu = loginview.FindControl("DropMenu");

        divuser.Controls.Add(span);



        if (!IsPostBack)
        {
            // Establecer token Anti-XSRF
            ViewState[AntiXsrfTokenKey]    = Page.ViewStateUserKey;
            ViewState[AntiXsrfUserNameKey] = Context.User.Identity.Name ?? String.Empty;
        }
        else
        {
            // Validar el token Anti-XSRF
            if ((string)ViewState[AntiXsrfTokenKey] != _antiXsrfTokenValue ||
                (string)ViewState[AntiXsrfUserNameKey] != (Context.User.Identity.Name ?? String.Empty))
            {
                throw new InvalidOperationException("Error de validación del token Anti-XSRF.");
            }
        }

        rut = Request.QueryString["RUT"];

        Ainicio.Attributes.Clear();
        Ainicio.Attributes.Add("class", "nav-link text-white");
        Ainicio.Attributes.Add("id", "Ainicio");

        if (!string.IsNullOrEmpty(rut))
        {
            Ainicio.Attributes.Add("onclick", "Loading();");
            Ainicio.Attributes.Add("href", "~/View/Cliente/Default.aspx?RUT=" + rut);
        }
        else
        {
            DUser = new nsCliente.Usuario(Page.User.Identity.Name);
            Cli   = DUser.InfoEmpresas.First();
            rut   = Cli.Rut;
        }
        Ainicio.Attributes.Add("onclick", "Loading();");
        Ainicio.Attributes.Add("href", "~/View/Cliente/");
        a = new HtmlGenericControl("a")
        {
            InnerHtml = "Información de la Empresa"
        };
        a.Attributes.Add("class", "dropdown-item dropdown-item-nav text-white");
        a.Attributes.Add("href", ResolveUrl("~/View/Cliente/Usuario/Info-empresa/Empresa.aspx") + "?RUT=" + rut);
        DropMenu.Controls.Add(a);
    }
Ejemplo n.º 22
0
        public static string Editar(int idCliente, string estado)
        {
            DatosCliente Cliente = new DatosCliente();

            Cliente.IdCliente = idCliente;
            Cliente.Estado    = estado;
            return(Cliente.EditarEstado(Cliente));
        }
Ejemplo n.º 23
0
        public static DataTable consultarClienteTabla(string ciCliente)
        {
            DatosCliente cliente = new DatosCliente();

            cliente.CiCliente = ciCliente;

            return(cliente.consultarClienteTabla(cliente));
        }
Ejemplo n.º 24
0
        public static string buscarCliente(string ciCliente)
        {
            DatosCliente cliente = new DatosCliente();

            cliente.CiCliente = ciCliente;

            return(cliente.buscarCliente(cliente));
        }
Ejemplo n.º 25
0
        public static string eliminarCliente(string ciCliente)
        {
            DatosCliente cliente = new DatosCliente();

            cliente.CiCliente = ciCliente;

            return(cliente.eliminarCliente(cliente));
        }
Ejemplo n.º 26
0
 public static string getSaludo(this DatosCliente data)
 {
     if (data == null)
     {
         return("");
     }
     return("Hola, " + data.FirstName.ToUpperFirstLetter() + " " + data.LastName.ToUpperFirstLetter());
 }
Ejemplo n.º 27
0
    protected void Page_Load(object sender, EventArgs e)
    {
        string User = Page.User.Identity.Name;

        DUser = new nsCliente.Usuario(User);


        if (DUser.HasEmpresa)
        {
            if (DUser.InfoEmpresas.Count > 1)
            {
                PnlBtnToMdlChangeCli.Visible = true;
            }
            else
            {
                PnlBtnToMdlChangeCli.Visible = false;
            }
            if (!IsPostBack)
            {
                rut = Request.QueryString["RUT"];
                if (!string.IsNullOrEmpty(rut))
                {
                    Cli = new DatosCliente(rut);
                }
                else
                {
                    Cli = DUser.InfoEmpresas.First();
                }
                HdnRutCli.Value = Cli.Rut;
                FillInformation(Cli);
            }
            else
            {
            }
        }
        else
        {
            Response.Redirect(Error404.Redireccion(MasterPageFile, User + ", no tienes empresa asignada :(. Por favor comuníquese con el administrador."));
        }



        Thread.CurrentThread.CurrentCulture = new CultureInfo("es-CL");
        FunDetPed    Funcion           = new FunDetPed();
        PlazoEntrega Plazoentregatermo = Funcion.PlazoEntrega("Termo");

        diastermo.Text  = "(" + Plazoentregatermo.Dias.ToString() + " días hábiles)";
        FechaTermo.Text = "Entrega el " + Plazoentregatermo.Fecha.ToShortDateString();
        PlazoEntrega Plazolamina = Funcion.PlazoEntrega("Lamina");

        DiasLaminas.Text  = "(" + Plazolamina.Dias.ToString() + " días hábiles)";
        FechaLaminas.Text = "Entrega el " + Plazolamina.Fecha.ToShortDateString();
        PlazoEntrega Plazoarq = Funcion.PlazoEntrega("Arq");

        DiasArq.Text  = "(" + Plazoarq.Dias.ToString() + " días hábiles)";
        FechaArq.Text = "Entrega el " + Plazoarq.Fecha.ToShortDateString();
    }
Ejemplo n.º 28
0
        public static string actualizarCliente(string ciCliente, string direccionCliente, string telefonoFijoCliente, string telefonoMovilCliente)
        {
            DatosCliente cliente = new DatosCliente();

            cliente.CiCliente            = ciCliente;
            cliente.DireccionCliente     = direccionCliente;
            cliente.TelefonoFijoCliente  = telefonoFijoCliente;
            cliente.TelefonoMovilCliente = telefonoMovilCliente;

            return(cliente.actualizarCliente(cliente));
        }
Ejemplo n.º 29
0
        public static string insertarCliente(string ciCliente, string nombreCliente, string direccionCliente, string telefonoFijoCliente, string telefonoMovilCliente)
        {
            DatosCliente cliente = new DatosCliente();

            cliente.CiCliente            = ciCliente;
            cliente.NombreCliente        = nombreCliente;
            cliente.DireccionCliente     = direccionCliente;
            cliente.TelefonoFijoCliente  = telefonoFijoCliente;
            cliente.TelefonoMovilCliente = telefonoMovilCliente;

            return(cliente.insertarCliente(cliente));
        }
Ejemplo n.º 30
0
    protected void Page_Load(object sender, EventArgs e)
    {
        string User = Page.User.Identity.Name;

        DUser = new nsCliente.Usuario(User);


        if (DUser.HasEmpresa)
        {
            if (DUser.InfoEmpresas.Count > 1)
            {
                PnlBtnToMdlChangeCli.Visible = true;
            }
            else
            {
                PnlBtnToMdlChangeCli.Visible = false;
            }
            rut = Request.QueryString["RUT"];
            if (!string.IsNullOrEmpty(rut))
            {
                Cli         = new DatosCliente(rut);
                ClienteEcom = new GetInfoClienteEcomm(rut);
            }
            else
            {
                Cli         = DUser.InfoEmpresas.First();
                ClienteEcom = new GetInfoClienteEcomm(Cli.Rut);
            }
            if (!IsPostBack)
            {
                HdnRutCli.Value = Cli.Rut;
                FillInformation(Cli);
                Thread.CurrentThread.CurrentCulture = new CultureInfo("es-CL");
                FechasExpress.Get get;
                get               = new FechasExpress.Get("TER", ClienteEcom.DiasDeTrato, 7);
                diastermo.Text    = "(" + get.DiasEntrega.ToString() + " días hábiles)";
                FechaTermo.Text   = "Entrega el " + get.FechaCorte.ToShortDateString();
                get               = new FechasExpress.Get("LAMINA", 7);
                DiasLaminas.Text  = "(" + get.DiasEntrega.ToString() + " días hábiles)";
                FechaLaminas.Text = "Entrega el " + get.FechaCorte.ToShortDateString();
                get               = new FechasExpress.Get("ARQ", 0, 7);
                DiasArq.Text      = "(" + get.DiasEntrega.ToString() + " días hábiles)";
                FechaArq.Text     = "Entrega el " + get.FechaCorte.ToShortDateString();
            }
            else
            {
            }
        }
        else
        {
            Response.Redirect(Error404.Redireccion(MasterPageFile, User + ", no tienes empresa asignada :(. Por favor comuníquese con el administrador."));
        }
    }