Exemplo n.º 1
0
        private void btnBuscar_Click(object sender, EventArgs e)
        {
            BusquedaClienteRespuesta respuesta = new BusquedaClienteRespuesta();
            string cedula = txtCedula.Text;

            if (cedula != "")
            {
                respuesta = Service.BuscarxCedula(cedula);

                if (respuesta.Cliente != null)
                {
                    txtCedula.Text   = respuesta.Cliente.CedulaCliente;
                    txtNombre.Text   = respuesta.Cliente.NombreCliente;
                    txtApellido.Text = respuesta.Cliente.ApellidoCliente;
                    txtCelular.Text  = respuesta.Cliente.CelularCliente;
                    txtEmail.Text    = respuesta.Cliente.Email;

                    MessageBox.Show(respuesta.Mensaje, "Busqueda", MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
                else
                {
                    MessageBox.Show(respuesta.Mensaje, "Busqueda", MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
            }
            else
            {
                MessageBox.Show("Por favor digite un numero de Cedula", "Datos", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }
Exemplo n.º 2
0
        private void button1_Click(object sender, EventArgs e)
        {
            BusquedaClienteRespuesta respuesta = new BusquedaClienteRespuesta();
            string cliente_id = txtIdentificacion.Text;

            if (cliente_id != "")
            {
                respuesta = clienteService.BuscarxIdentificacion(cliente_id);

                if (respuesta.cliente != null)
                {
                    txtNombreCliente.Text = respuesta.cliente.PrimerNombre;
                    correo = respuesta.cliente.Email;
                    MessageBox.Show(respuesta.Mensaje, "Busqueda", MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
                else
                {
                    MessageBox.Show(respuesta.Mensaje, "Busqueda", MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
            }
            else
            {
                MessageBox.Show("Por favor digite una identificación", "Datos", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }
Exemplo n.º 3
0
        private Factura MapearFactura()
        {
            factura.NumeroFactura = txtNumeroFactura.Text;
            factura.TotalFactura  = decimal.Parse(txtTotal.Text);
            factura.Fecha         = DateTime.Parse(this.Fecha.Text);
            BusquedaClienteRespuesta respuesta = new BusquedaClienteRespuesta();
            string cedula = txtCedula.Text;

            respuesta       = clienteService.BuscarxCedula(cedula);
            factura.cliente = respuesta.Cliente;


            return(factura);
        }
Exemplo n.º 4
0
        private void txtId_KeyPress(object sender, KeyPressEventArgs e)
        {
            if ((int)e.KeyChar == (int)Keys.Enter)
            {
                Cliente cliente = new Cliente();
                BusquedaClienteRespuesta consulta = new BusquedaClienteRespuesta();
                consulta = clienteService.BuscarPorIdentificacion(txtId.Text);
                if (!consulta.Error)
                {
                    cliente = consulta.Cliente;
                    cmboTipo.SelectedItem = cliente.TipoIdentificacion;
                    txtname.Text          = cliente.Nombre;
                    txtApellido.Text      = cliente.Apellidos;
                    txtBarrio.Text        = cliente.Barrio;
                    txtDirecciòn.Text     = cliente.Direccion;
                    txtTelefono.Text      = cliente.Telefono;
                    txtEmail.Text         = cliente.Email;
                }
                else
                {
                    MessageBox.Show("Cliente no esta registrado ", " Atención", MessageBoxButtons.OKCancel, MessageBoxIcon.Information);
                    Limpiar();
                }
            }



            if (!Char.IsDigit(e.KeyChar) &&
                e.KeyChar != (char)Keys.Back &&
                e.KeyChar != '-')
            {
                e.Handled = true;
            }
            else
            {
                if (e.KeyChar == '-')
                {
                    if (((TextBox)sender).Text.Contains('-'))
                    {
                        e.Handled = true;
                    }
                    else
                    {
                        e.Handled = false;
                    }
                }
            }
        }
Exemplo n.º 5
0
        private void txtCedula_TextChanged(object sender, EventArgs e)
        {
            BusquedaClienteRespuesta respuesta = new BusquedaClienteRespuesta();
            string cedula = txtCedula.Text;

            if (cedula != "")
            {
                respuesta = clienteService.BuscarxCedula(cedula);

                if (respuesta.Cliente != null)
                {
                    txtNombre.Text   = respuesta.Cliente.NombreCliente;
                    txtApellido.Text = respuesta.Cliente.ApellidoCliente;
                    txtCelular.Text  = respuesta.Cliente.CelularCliente;
                }
            }
        }
Exemplo n.º 6
0
        private void btnConsultar_Click(object sender, EventArgs e)
        {
            Cliente cliente = new Cliente();
            BusquedaClienteRespuesta consulta = new BusquedaClienteRespuesta();

            consulta = service.BuscarPorIdentificacion(txtNumeroDoc.Text);
            if (!consulta.Error)
            {
                cliente = consulta.Cliente;
                txtNombreCliente.Text   = cliente.Nombre;
                txtApellido.Text        = cliente.Apellidos;
                txtBarrioCliente.Text   = cliente.Barrio;
                txtDireccion.Text       = cliente.Direccion;
                txtTelefonoCliente.Text = cliente.Telefono;
            }
            else
            {
                MessageBox.Show("Cliente no esta registrado ", " Atención", MessageBoxButtons.OKCancel, MessageBoxIcon.Information);
                txtNumeroDoc.Text = "";
            }
        }
Exemplo n.º 7
0
        private void butBuscar_Click(object sender, EventArgs e)
        {
            string tipo = comboTipo.Text;

            if (tipo == "Cliente")
            {
                BusquedaClienteRespuesta respuesta = new BusquedaClienteRespuesta();
                string cliente_id = txtIdentificacion.Text;
                if (cliente_id != "")
                {
                    respuesta = clienteService.BuscarxIdentificacion(cliente_id);

                    if (respuesta.cliente != null)
                    {
                        txtPrimerNombreText.Text   = respuesta.cliente.PrimerNombre;
                        txtSegundoNombreText.Text  = respuesta.cliente.SegundoNombre;
                        txtPrimerApellidoText.Text = respuesta.cliente.PrimerApellido;
                        txtSegundoApellido.Text    = respuesta.cliente.SegundoApellido;
                        txtCiudad.Text             = respuesta.cliente.Ciudad;
                        txtBarrio.Text             = respuesta.cliente.Barrio;
                        txtCasa.Text     = respuesta.cliente.N_Casa;
                        txtComuna.Text   = respuesta.cliente.Comuna;
                        txtTelefono.Text = respuesta.cliente.Telefono;
                        txtCorreo.Text   = respuesta.cliente.Email;
                        comboTipo.Text   = "Cliente";
                        MessageBox.Show(respuesta.Mensaje, "Busqueda", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    }
                    else
                    {
                        MessageBox.Show(respuesta.Mensaje, "Busqueda", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    }
                }
                else
                {
                    MessageBox.Show("Por favor digite una identificación", "Datos", MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
            }
            else
            {
                BusquedaTrabajadorRespuesta respuesta = new BusquedaTrabajadorRespuesta();
                string trabajador_id = txtIdentificacion.Text;
                if (trabajador_id != "")
                {
                    respuesta = trabajadorService.BuscarxIdentificacionTrab(trabajador_id);

                    if (respuesta.trabajador != null)
                    {
                        txtPrimerNombreText.Text   = respuesta.trabajador.PrimerNombre;
                        txtSegundoNombreText.Text  = respuesta.trabajador.SegundoNombre;
                        txtPrimerApellidoText.Text = respuesta.trabajador.PrimerApellido;
                        txtSegundoApellido.Text    = respuesta.trabajador.SegundoApellido;
                        txtTelefono.Text           = respuesta.trabajador.Telefono;
                        comboCargo.Text            = respuesta.trabajador.Cargo;
                        txtCiudad.Text             = respuesta.trabajador.Ciudad;
                        txtBarrio.Text             = respuesta.trabajador.Barrio;
                        txtCasa.Text   = respuesta.trabajador.N_Casa;
                        txtComuna.Text = respuesta.trabajador.Comuna;
                        txtCorreo.Text = respuesta.trabajador.Email;
                        comboTipo.Text = "Trabajador";
                        MessageBox.Show(respuesta.Mensaje, "Busqueda", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    }
                    else
                    {
                        MessageBox.Show(respuesta.Mensaje, "Busqueda", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    }
                }
                else
                {
                    MessageBox.Show("Por favor digite una identificación", "Datos", MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
            }
        }