Esempio n. 1
0
 private void buttonVerificar_Click(object sender, EventArgs e)
 {
     if (string.IsNullOrEmpty(textBox_afil_numero.Text))
     {
         MessageBox.Show("Debe ingresar el número de Afiliado a validar.", "Hay campos incompletos",
                         MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
     else
     {
         String nombreAfiliado = AfiliadoRol.verificarQueExistaElAfiliado(textBox_afil_numero.Text);
         if (nombreAfiliado != "")
         {
             if (AfiliadoRol.validarHabilitacion(textBox_afil_numero.Text))
             {
                 labelStatus.Text            = "El afiliado " + nombreAfiliado + " se encuentra actualmente habilitado.";
                 button_habilitar.Enabled    = false;
                 button_deshabilitar.Enabled = true;
             }
             else
             {
                 labelStatus.Text            = "El afiliado " + nombreAfiliado + " se encuentra actualmente inhabilitado.";
                 button_habilitar.Enabled    = true;
                 button_deshabilitar.Enabled = false;
             }
         }
         else
         {
             labelStatus.Text            = "El afiliado Nº " + textBox_afil_numero.Text + " no pertenece al sistema.";
             button_habilitar.Enabled    = false;
             button_deshabilitar.Enabled = false;
         }
     }
 }
Esempio n. 2
0
 private void buttonDatos_Click(object sender, EventArgs e)
 {
     if (string.IsNullOrEmpty(textBox_afil_numero.Text))
     {
         MessageBox.Show("Debe ingresar el número de Afiliado a modificar.", "Hay campos incompletos",
                         MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
     else
     {
         String nombreAfiliado = AfiliadoRol.verificarQueExistaElAfiliado(textBox_afil_numero.Text);
         if (nombreAfiliado != "")
         {
             labelStatus.Text = "";
             permitirControles(true);
             traerDatosAfiliado();
             llenarComboPlan();
             llenarComboEstadoCivil();
             textBox_afil_telefono.Text  = afiliado.telefono.ToString();
             textBox_afil_mail.Text      = afiliado.mail;
             textBox_afil_Direccion.Text = afiliado.direccion;
         }
         else
         {
             labelStatus.Text = "El afiliado Nº " + textBox_afil_numero.Text + " no pertenece al sistema.";
             permitirControles(false);
             textBox_afil_telefono.Text              = "";
             textBox_afil_mail.Text                  = "";
             textBox_afil_Direccion.Text             = "";
             comboBox_afil_plan.SelectedIndex        = -1;
             comboBox_afil_estadoCivil.SelectedIndex = -1;
         }
     }
 }