コード例 #1
0
 private void frmBuscarGrupos_Load(object sender, EventArgs e)
 {
     if (state == false)
     {
         btnModificar.Visible = false;
         try
         {
             dgvNiveles.DataSource = GruposDB.TodosLosGrupos();
         }
         catch (Exception ex)
         {
             MessageBox.Show(ex.Message, "Aviso", MessageBoxButtons.OK, MessageBoxIcon.Error);
         }
     }
     else
     {
         btnModificar.Visible = true;
         try
         {
             dgvNiveles.DataSource = GruposDB.TodosLosGrupos();
         }
         catch (Exception ex)
         {
             MessageBox.Show(ex.Message, "Aviso", MessageBoxButtons.OK, MessageBoxIcon.Error);
         }
     }
 }
コード例 #2
0
 private void frmMenu_Load(object sender, EventArgs e)
 {
     try
     {
         // TODO: esta línea de código carga datos en la tabla 'celyDBDataSet.VerGruposwHorario' Puede moverla o quitarla según sea necesario.
         this.verGruposwHorarioTableAdapter.Fill(this.celyDBDataSet.VerGruposwHorario);
         dgvNiveles.DataSource = GruposDB.TodosLosGrupos();
         Console.Write("Digite su nombre: ");
         string nombre = Console.ReadLine();
         Console.WriteLine();
         Console.Write("Digite la contraseña: ");
         string contraseña = Console.ReadLine();
         Console.WriteLine();
         Console.WriteLine("Presione una tecla para salir");
         ControlBox  = false;
         MinimizeBox = false;
         MaximizeBox = false;
         btnBuscarEstudiante.Visible = false;
         tContador.Start();
         tReloj.Start();
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }
コード例 #3
0
 private void tContador_Tick(object sender, EventArgs e)
 {
     try
     {
         dgvNiveles.DataSource = GruposDB.TodosLosGrupos();
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message, Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
コード例 #4
0
 private void frmRegistrodeGruposyNiveles_Load(object sender, EventArgs e)
 {
     if (IDg != null)
     {
         btnGuardar.Enabled = false;
         try
         {
             pGS                   = GruposDB.ObtenerGrupos(int.Parse(IDg));
             pHs                   = HorariosDB.ObtenerHorario(int.Parse(pGS.Horario));
             txtHorario.Text       = pHs.Dias + " " + pHs.Hora;
             txtNivel.Text         = pGS.Nivel;
             txtProfesor.Text      = pGS.Profesor;
             dtpFechaInicio.Value  = Convert.ToDateTime(pGS.Fecha_Inicio);
             cbAula.Text           = pGS.Aula;
             dgvNiveles.DataSource = GruposDB.TodosLosGrupos();
         }
         catch (Exception ex)
         {
             MessageBox.Show(ex.Message, "Aviso", MessageBoxButtons.OK, MessageBoxIcon.Error);
         }
     }
     else
     {
         txtProfesor.Enabled = false;
         txtHorario.Enabled  = false;
         MaximizeBox         = false;
         try
         {
             dgvNiveles.DataSource = GruposDB.TodosLosGrupos();
         }
         catch (Exception ex)
         {
             MessageBox.Show(ex.Message, "Aviso", MessageBoxButtons.OK, MessageBoxIcon.Error);
         }
         btnGuardar.Enabled   = false;
         btnEliminar.Enabled  = false;
         btnModificar.Enabled = false;
     }
 }
コード例 #5
0
        private void frmRegistro_Load(object sender, EventArgs e)
        {
            if (IDEstudiante != null)
            {
                try
                {
                    EstudianteSeleccionado   = IDEstudiante;
                    txtNombre.Text           = EstudianteSeleccionado.Nombre;
                    txtApellido.Text         = EstudianteSeleccionado.Apellido;
                    txtDireccion.Text        = EstudianteSeleccionado.Direccion;
                    cbD_Idioma.Text          = EstudianteSeleccionado.D_Idioma;
                    txtEdad.Text             = EstudianteSeleccionado.Edad;
                    txtEmail.Text            = EstudianteSeleccionado.E_Mail;
                    txtNivel.Text            = EstudianteSeleccionado.NivelA;
                    cbN_Academico.Text       = EstudianteSeleccionado.N_Academico;
                    txtOcupacion.Text        = EstudianteSeleccionado.Ocupacion;
                    txtSector.Text           = EstudianteSeleccionado.Sector;
                    txtTelefono.Text         = EstudianteSeleccionado.Telefono;
                    dtpFechaActual.Value     = Convert.ToDateTime(EstudianteSeleccionado.Fecha_Ins);
                    dtpFechaNacimiento.Value = Convert.ToDateTime(EstudianteSeleccionado.Fecha_N);
                    dgvNiveles.DataSource    = GruposDB.TodosLosGrupos();
                    btnRegistrar.Enabled     = false;
                    txtNivel.Enabled         = false;
                    if (EstudianteSeleccionado.Modo_Pago == "Mensual")
                    {
                        rbMensual.Checked = true;
                    }
                    else
                    {
                        rbSemanal.Checked = true;
                    }
                    if (EstudianteSeleccionado.VIP == "Si")
                    {
                        cbVIP.Checked = true;
                    }
                    else
                    {
                        cbVIP.Checked = false;
                    }

                    btnRegistrar.Visible    = false;
                    lblBuscarAlumno.Visible = false;
                    lblTitulo.Text          = "Estudiante";
                    btnModificar.Visible    = true;
                    btnEliminar.Visible     = true;
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.Message, "Aviso", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
            else
            {
                // TODO: esta línea de código carga datos en la tabla 'celyDBDataSet.VerGruposwHorario' Puede moverla o quitarla según sea necesario.
                this.verGruposwHorarioTableAdapter.Fill(this.celyDBDataSet.VerGruposwHorario);
                try
                {
                    txtNivel.Enabled = false;
                    this.txtNombre.Focus();
                    ControlBox              = false;
                    MinimizeBox             = true;
                    MaximizeBox             = false;
                    btnEliminar.Visible     = false;
                    btnModificar.Visible    = false;
                    lblBuscarAlumno.Visible = true;
                    dgvNiveles.DataSource   = GruposDB.TodosLosGrupos();
                    btnRegistrar.Enabled    = false;
                }
                catch (Exception ex)
                {
                    MessageBox.Show("Error: " + ex.Message, "Registro Estudiantil", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
        }