Example #1
0
        private void toolStripButton2_Click(object sender, EventArgs e)
        {
            ///sumary
            ///Metodo para actualizar un encardado
            ///sumary
            ///
            groupBox1.Visible = true;
            //Actualizar
            Refrescar();
            txtIdentificacion.ReadOnly = true;
            dgvEncargado.Visible       = true;
            btnCancelar.Enabled        = true;
            btnAceptar.Enabled         = true;
            //Obtener el id de la fila seleccionada
            if (dgvEncargado.SelectedRows.Count > 0)
            {
                var encargado = (Encargado)dgvEncargado.SelectedRows[0].DataBoundItem;
                txtIdentificacion.Text    = encargado.Identificacion.ToString();
                txtNombreCompleto.Text    = encargado.NombreCompleto;
                txtOcupacion.Text         = encargado.Ocupacion;
                txtParentesco.Text        = encargado.Parentesco;
                txtCorreoElectronico.Text = encargado.CorreoElectronico;


                // groupBox1.Visible = true;
                logica.SeleccionarPorId(encargado.Identificacion);
            }
            else
            {
                MessageBox.Show("Debe seleccionar un encargado a actualizar");
            }
        }
Example #2
0
        private void btnBuscarEncargado_Click(object sender, EventArgs e)
        {
            string identificadorEncargado = txtIdentificadorEnc.Text.ToString();

            encargado = logicaencargado.SeleccionarPorId(identificadorEncargado);
            if (encargado != null)
            {
                txtEncargadoResultado.Text = encargado.NombreCompleto;
            }
            else
            {
                txtEncargadoResultado.Text = "El Id del encargado no fue encontrado";
            }
        }