Exemplo n.º 1
0
        private void button3_Click(object sender, EventArgs e)
        {
            try
            {
                string id = textID.Text.Trim();

                if (textID.Text.Equals(""))
                {
                    MessageBox.Show("Digite identificación");
                }
                else
                {
                    if (resp.Error is false)
                    {
                        // MessageBox.Show(resp.Mensaje, "Prueba", MessageBoxButtons.OK, MessageBoxIcon.Information);
                        string identificacion = textID.Text.Trim();
                        resp = empleadoService.ConsultarIdentificacion(identificacion);
                        Mapear(resp.empleado);
                    }
                    else
                    {
                        MessageBox.Show(resp.Mensaje, "Prueba", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    }

                    textID.Text = "";
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("Identificacion no encontrada", "Datos no validos", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Exemplo n.º 2
0
        private void BtnBuscar_Click(object sender, EventArgs e)
        {
            RespuestaConsultarIdentificacion respuesta = new RespuestaConsultarIdentificacion();

            respuesta = usuarioService.ConsultarIdentificacion(TxtIdentificacion.Text.Trim());


            if (respuesta.Error == true)
            {
                MessageBox.Show(respuesta.Mensaje, "Información", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            else
            {
                TxtUsuario.Text    = respuesta.Usuario.NombreUsuario;
                TxtContraseña.Text = respuesta.Usuario.Contraseña;
                TxtEmail.Text      = respuesta.Usuario.Email;

                MessageBox.Show(respuesta.Mensaje, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            if (TxtEmail.Text != "")
            {
                TxtIdentificacion.Enabled = false;
                BtnEliminar.Enabled       = true;
                BtnEditar.Enabled         = true;
                BtnAgregar.Enabled        = false;
            }
        }
Exemplo n.º 3
0
        private void MapearParcial()
        {
            indice = TblEmpleados.Rows.Add();

            RespuestaConsultarIdentificacion resp = new RespuestaConsultarIdentificacion();

            resp = empleadoService.ConsultarIdentificacion(textID.Text.Trim());

            empleado = resp.empleado;

            TblEmpleados.Rows[indice].Cells[0].Value = resp.empleado.Cedula;
            TblEmpleados.Rows[indice].Cells[1].Value = resp.empleado.PrimerNombre;
            TblEmpleados.Rows[indice].Cells[2].Value = resp.empleado.PrimerApellido;
        }
Exemplo n.º 4
0
        private void button1_Click(object sender, EventArgs e)
        {
            List <Empleado> lista;
            RespuestaConsultarIdentificacion resp = new RespuestaConsultarIdentificacion();
            string id = textName.Text.Trim();

            resp = empleadoService.ConsultarIdentificacion(id);

            if (textName.Text.Equals(""))
            {
                ConsultaPersonaRespuesta respuesta = new ConsultaPersonaRespuesta();
                respuesta = empleadoService.Consultar();
                if (respuesta.Error is false)
                {
                    TblEmpleados.DataSource = null;
                    empleados = null;

                    TblEmpleados.DataSource = null;
                    empleados = respuesta.Empleados.ToList();
                    TblEmpleados.DataSource = respuesta.Empleados;
                    MessageBox.Show(respuesta.Mensaje, "Informacion", MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
                else
                {
                    MessageBox.Show(respuesta.Mensaje, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
            else
            {
                if (resp.Error is false)
                {
                    MessageBox.Show(resp.Mensaje, "Prueba", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    string identificacion = textID.Text.Trim();
                    resp  = empleadoService.ConsultarIdentificacion(identificacion);
                    lista = new List <Empleado>();
                    lista.Add(resp.empleado);
                    TblEmpleados.DataSource = lista;
                }
                else
                {
                    MessageBox.Show(resp.Mensaje, "Prueba", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
        }
Exemplo n.º 5
0
 private void button1_Click(object sender, EventArgs e)
 {
     resp = empleadoService.GuardarLlegada(resp.empleado);
     MessageBox.Show(resp.Mensaje, "Reporte de estado", MessageBoxButtons.OK, MessageBoxIcon.Information);
 }