Beispiel #1
0
 private void Insertar()
 {
     try
     {
         int cp;
         int.TryParse(txtCP.Text, out cp);
         decimal sueldo;
         decimal.TryParse(txtSueldo.Text, out sueldo);
         Trabajador t = new Trabajador();
         t.IDSucursal  = idSucursal[cboSucursal.SelectedIndex];
         t.Puesto      = idPuesto[cboPuesto.SelectedIndex];
         t.Nomina      = txtNumNomina.Text;
         t.Nombre      = txtNombre.Text;
         t.Apellidos   = txtApellidos.Text;
         t.Telefono    = txtTelefono.Text;
         t.Celular     = txtCelular.Text;
         t.Correo      = txtCorreo.Text;
         t.Direccion   = txtDireccion.Text;
         t.Ciudad      = txtCiudad.Text;
         t.Estado      = txtEstado.Text;
         t.CP          = cp;
         t.FechaInicio = dtpFechaInicio.Value;
         t.Imagen      = pcbImagen.Image;
         t.Huella      = huella;
         t.Sueldo      = sueldo;
         t.Insertar();
     }
     catch (MySqlException ex)
     {
         throw ex;
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }