示例#1
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            if (IsValid())
            {
                if (IsValidDrCedula(txtcedula.Text))
                {
                    _context.Edit(Convert.ToInt32(txtId.Text), txtName.Text, txtcedula.Text, TLaborar.Text, Convert.ToInt32(PorComision.Value), dateIngreso.Value, rdstatus.Checked);

                    this.Close();
                    MessageBox.Show("El empleado fue editado con exito", "Actualizado", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    empleado.EmpleaDataGrid.DataSource = _context.Getlist();
                }
                else
                {
                    MessageBox.Show("La cedula es invalida, coloque un identificacion valida.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    txtcedula.Focus();
                }
            }
        }