Exemplo n.º 1
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 AgregarDetalleButton_Click(object sender, EventArgs e)
        {
            List <InscripcionesDetalle> detalles = new List <InscripcionesDetalle>();
            Repositorio <Asignaturas>   db       = new Repositorio <Asignaturas>(new DAL.Contexto());

            if (AsignaturaComboBox.Text == "")
            {
                MyErrorProvider.SetError(AsignaturaComboBox, "debe Elegir una asignatura o mas");
                AsignaturaComboBox.Focus();
            }
            else
            {
                Asignaturas asignatura = db.Buscar((int)AsignaturaComboBox.SelectedValue);
                if (DetalleDataGridView.DataSource != null)
                {
                    this.Detalle = (List <InscripcionesDetalle>)DetalleDataGridView.DataSource;
                }

                this.Detalle.Add(new InscripcionesDetalle()
                {
                    InscripcionId = (int)IdNumericUpDown.Value,
                    AsignaturaId  = (int)AsignaturaComboBox.SelectedValue,
                    Id            = 0,
                    SubTotal      = (asignatura.Creditos * PrecioCreditoNumericUpDown.Value)
                });

                CargarGrid();
            }
        }
        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.º 4
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.º 5
0
        public void Limpiar()
        {
            MyerrorProvider.Clear();
            AsistenciaIdnumericUpDown.Value = 0;
            FechadateTimePicker.Value       = DateTime.Now;
            AsignaturaComboBox.ResetText();
            PresenteCheckBox.Checked = false;
            CantidadtextBox.Text     = string.Empty;

            this.Detalle = new List <EstudianteDetalle>();
            CargarGrid();
        }