示例#1
0
 private void btnGuardarAdmin_Click(object sender, EventArgs e)
 {
     if (ValidaAmin())
     {
         Administrativo ad = new Administrativo();
         ad.Nombre           = txtNombre.Text;
         ad.Apellido_Materno = txtApellidoMa.Text;
         ad.Apellido_Paterno = txtApellidoPa.Text;
         ad.Fecha_Nacimiento = txtFechaNacimiento.Value;
         ad.Curp             = txtCurp.Text;
         ad.Rfc             = txtRfc.Text;
         ad.Numero_Empleado = int.Parse(txtNEmpleAdmin.Text);
         ad.Fecha_Ingreso   = txtFechaInAdmin.Value;
         ad.Area_Trabajo    = txtAreaTrabaAdmin.Text;
         if (admin == null)
         {
             LAdmin.AgregarAdmin(ad);
         }
         else
         {
             ad.Id = admin.Id;
             LAdmin.ModificarAdmin(ad);
         }
         this.Close();
     }
 }