Exemplo n.º 1
0
 private void btnGuardarDirec_Click(object sender, EventArgs e)
 {
     if (ValidaDire())
     {
         Directivo d1 = new Directivo();
         d1.Nombre           = txtNombre.Text;
         d1.Apellido_Materno = txtApellidoMa.Text;
         d1.Apellido_Paterno = txtApellidoPa.Text;
         d1.Fecha_Nacimiento = txtFechaNacimiento.Value;
         d1.Curp             = txtCurp.Text;
         d1.Rfc                = txtRfc.Text;
         d1.Numero_Empleado    = int.Parse(txtNEmpleadoDirec.Text);
         d1.Fecha_Ingreso      = txtFechaInDirec.Value;
         d1.Profesion          = txtProfesionDirec.Text;
         d1.Puesto             = txtPuestoDirec.Text;
         d1.Cantidad_Empleados = int.Parse(txtCantidadEmDirec.Text);
         if (direc != null)
         {
             d1.Id = direc.Id;
             LDirec.ModificarDirec(d1);
         }
         else
         {
             LDirec.AgregarDire(d1);
         }
         this.Close();
     }
 }