Exemplo n.º 1
0
        private void AgregarPresente_Click(object sender, EventArgs e)
        {
            if (EstudianteComboBox.Text.Trim().Length > 0) //Si no esta vacio el combobox
            {
                if (DetalledataGridView.DataSource != null)
                {
                    this.Detalle = (List <EstudianteDetalle>)DetalledataGridView.DataSource;
                }

                this.Detalle.Add(
                    new EstudianteDetalle(
                        Id: 0,
                        AsistenciaId: (int)AsistenciaIdnumericUpDown.Value,
                        Nombres: EstudianteComboBox.Text,
                        Presente: PresenteCheckBox.Checked
                        )
                    );
                CargarGrid();
                CantidadtextBox.Text     = DetalledataGridView.Rows.Count.ToString();
                EstudianteComboBox.Text  = "";
                PresenteCheckBox.Checked = false;
            }
            else
            {
                MyerrorProvider.Clear();
                MyerrorProvider.SetError(EstudianteComboBox, "No hay ningún estudiante seleccionado");
                EstudianteComboBox.Focus();
            }
        }
Exemplo n.º 2
0
        private bool Validar()
        {
            bool paso = true;

            MyerrorProvider.Clear();

            if (string.IsNullOrWhiteSpace(AsignaturaComboBox.Text))
            {
                MyerrorProvider.SetError(AsignaturaComboBox, "Debe seleccionar una asignatura");
                AsignaturaComboBox.Focus();
                paso = false;
            }
            if (string.IsNullOrWhiteSpace(EstudianteComboBox.Text))
            {
                MyerrorProvider.SetError(EstudianteComboBox, "Debe seleccionar un estudiante");
                EstudianteComboBox.Focus();
                paso = false;
            }

            if (this.Detalle.Count == 0)
            {
                MyerrorProvider.SetError(DetalledataGridView, "Debe agregar algun registr de asistencia");
                EstudianteComboBox.Focus();
                paso = false;
            }

            return(paso);
        }
        private void AgregarAsistenciaButton_Click(object sender, EventArgs e) //Agrega elementos al data grid view
        {
            if (EstudianteComboBox.Text.Trim().Length <= 0)
            {
                return;
            }

            if (EstudiantesDataGridView.DataSource != null)
            {
                this.detalle = (List <DetalleEstudiante>)EstudiantesDataGridView.DataSource;
            }


            this.detalle.Add(

                new DetalleEstudiante(
                    id: 0,
                    asistenciaid: (int)IDNumericUpDown.Value,
                    nombre: EstudianteComboBox.Text,
                    presente: AsistenciaCheckBox.Checked
                    )
                );

            CargarGrid();
            EstudianteComboBox.Focus();
            EstudianteComboBox.Text = string.Empty;

            CantidadTextBox.Text = EstudiantesDataGridView.Rows.Count.ToString();
        }
        private bool Validar()
        {
            bool paso = true;

            MyErrorProvider.Clear();

            if (string.IsNullOrWhiteSpace(EstudianteComboBox.Text))
            {
                MyErrorProvider.SetError(EstudianteComboBox, "El campo Estudiante no puede estar vacio");
                EstudianteComboBox.Focus();
                paso = false;
            }

            if (PrecioCreditoNumericUpDown.Value == 0)
            {
                MyErrorProvider.SetError(PrecioCreditoNumericUpDown, "Debes elegir el precio de los creditos");
                PrecioCreditoNumericUpDown.Focus();
                paso = false;
            }

            if (Detalle.Count == 0)
            {
                MyErrorProvider.SetError(AsignaturaComboBox, "La inscripcion tiene que tener 1 0 mas asignaturas");
                AsignaturaComboBox.Focus();
                paso = false;
            }


            return(paso);
        }
Exemplo n.º 5
0
        private bool Validar()
        {
            bool paso = true;

            MyErrorProvider.Clear();

            if (this.Detalle.Count == 0)
            {
                MyErrorProvider.SetError(DetalleDataGridView, "Debe agregar algun estudiante");
                EstudianteComboBox.Focus();
                paso = false;
            }

            if (AsignaturaComboBox.Items.Count == 0)
            {
                MyErrorProvider.SetError(AsignaturaComboBox, "Debe de agregar una asignatura para completar la asistencia");
                AsignaturaComboBox.Focus();
                paso = false;
            }

            if (AsignaturaComboBox.Text.Trim().Length == 0)
            {
                MyErrorProvider.SetError(AsignaturaComboBox, "Debe de seleccionar una asignatura para completar la asistencia");
                AsignaturaComboBox.Focus();
                paso = false;
            }

            return(paso);
        }
Exemplo n.º 6
0
        private void AgregarEstudianteDataButton_Click(object sender, EventArgs e)
        {
            if (EstudianteComboBox.Text.Trim().Length != 0)
            {
                if (DetalleDataGridView.DataSource != null)
                {
                    this.Detalle = (List <EstudiantesDetalle>)DetalleDataGridView.DataSource;
                }

                this.Detalle.Add(
                    new EstudiantesDetalle(
                        estudianteId: 0,
                        asistenciaId: Convert.ToInt32(AsistenciasIdNumericUpDown.Value),
                        nombre: EstudianteComboBox.Text,
                        presencia: PresenteCheckBox.Checked
                        )
                    );

                CargarGrid();
                EstudianteComboBox.Focus();
                EstudianteComboBox.Text = "";

                CantidadTextBox.Text = DetalleDataGridView.Rows.Count.ToString();
            }
            else
            {
                MessageBox.Show("Debe de seleccionar un estudiante.");
            }
        }
Exemplo n.º 7
0
        private void AgregarAsistenciaButton_Click(object sender, EventArgs e)
        {
            if (EstudiantesDataGridView.DataSource != null)
            {
                this.Detalle = (List <EstudiantesDetalle>)EstudiantesDataGridView.DataSource;
            }

            this.Detalle.Add(
                new EstudiantesDetalle(
                    estudianteId: 0,
                    asistenciaId: (int)IDNumericUpDown.Value,
                    nombre: EstudianteComboBox.Text,
                    presente: PresenteCheckBox.Checked
                    )
                );

            CargarGrid();
            EstudianteComboBox.Focus();
            EstudianteComboBox.Text = string.Empty;

            CantidadTextBox.Text = EstudiantesDataGridView.Rows.Count.ToString();
        }