Example #1
0
        private bool ValidarValores()
        {
            bool paso = true;

            MyerrorProvider.Clear();

            //Validando que el valor del campo Logrado no sea mayor que el del campo Valor
            if (Convert.ToDecimal(LogradotextBox.Text) > Convert.ToDecimal(ValortextBox.Text))
            {
                MyerrorProvider.SetError(LogradotextBox, "El valor del campo Logrado no puede ser mayor que el del campo Valor");
                ValortextBox.Focus();
                paso = false;
            }
            //Validando que el valor del campo Valor no sea mayor que 100 ni menor que 0
            if (Convert.ToDecimal(ValortextBox.Text) < 0 || Convert.ToDecimal(ValortextBox.Text) > 100)
            {
                MyerrorProvider.SetError(ValortextBox, "El campo Valor no puede tener un valor menor que 0 ni mayor que 100");
                ValortextBox.Focus();
                paso = false;
            }
            //Validando que el valor del campo Logrado no sea mayor que 100 ni menor que 0
            if (Convert.ToDecimal(LogradotextBox.Text) < 0 || Convert.ToDecimal(LogradotextBox.Text) > 100)
            {
                MyerrorProvider.SetError(LogradotextBox, "El campo Logrado no puede tener un valor menor que 0 ni mayor que 100");
                LogradotextBox.Focus();
                paso = false;
            }

            return(paso);
        }
Example #2
0
        private bool Validar()
        {
            bool realizado = true;

            if (string.IsNullOrWhiteSpace(EstudiantetextBox.Text))
            {
                errorProvider.SetError(EstudiantetextBox, "El campo Estudiante no debe estar vacio");
                EstudiantetextBox.Focus();
                realizado = false;
            }
            if (string.IsNullOrWhiteSpace(ValortextBox.Text) || Convert.ToDecimal(ValortextBox.Text) < 0)
            {
                errorProvider.SetError(ValortextBox, "El campo Valor no debe estar vacio \n El campo Logrado no debe ser menor que 0");
                ValortextBox.Focus();
                realizado = false;
            }
            if (string.IsNullOrWhiteSpace(LogradotextBox.Text) || Convert.ToDecimal(LogradotextBox.Text) < 0)
            {
                errorProvider.SetError(LogradotextBox, "El campo Logrado no debe estar vacio \n El campo Logrado no debe ser menor que 0");
                LogradotextBox.Focus();
                realizado = false;
            }

            return(realizado);
        }
Example #3
0
        private bool validar()
        {
            bool paso = true;

            if (EstudiantetextBox.Text == string.Empty)
            {
                MyerrorProvider1.SetError(EstudiantetextBox, "Llenar espacio en blanco ");
                EstudiantetextBox.Focus();
                paso = false;
            }
            if (ValortextBox.Text == string.Empty)
            {
                MyerrorProvider1.SetError(ValortextBox, "Llenar espacio en blanco ");
                ValortextBox.Focus();
                paso = false;
            }
            if (LogradotextBox.Text == string.Empty)
            {
                MyerrorProvider1.SetError(LogradotextBox, "Llenar espacio en blanco ");
                LogradotextBox.Focus();
                paso = false;
            }
            if (ValortextBox.Text == string.Empty)
            {
                MyerrorProvider1.SetError(ValortextBox, "Llenar espacio en blanco ");
                ValortextBox.Focus();
                paso = false;
            }
            return(paso);
        }
Example #4
0
        private bool Validar()
        {
            bool paso = true;

            if (string.IsNullOrWhiteSpace(Convert.ToString(FechadateTimePicker.Value)))
            {
                MyerrorProvider.SetError(FechadateTimePicker, "El campo Fecha no puede estar vacio");
                FechadateTimePicker.Focus();
                paso = false;
            }

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

            if (string.IsNullOrWhiteSpace(ValortextBox.Text))
            {
                MyerrorProvider.SetError(ValortextBox, "El campo Valor no puede estar vacio");
                ValortextBox.Focus();
                paso = false;
            }

            if (string.IsNullOrWhiteSpace(LogradotextBox.Text))
            {
                MyerrorProvider.SetError(LogradotextBox, "El campo Logrado no puede estar vacio");
                LogradotextBox.Focus();
                paso = false;
            }

            if (string.IsNullOrWhiteSpace(Convert.ToString(PronosticocomboBox.SelectedIndex)))
            {
                MyerrorProvider.SetError(PronosticocomboBox, "El campo Pronostico no puede estar vacio");
                PronosticocomboBox.Focus();
                paso = false;
            }


            if (Convert.ToDecimal(ValortextBox.Text) < 0 || Convert.ToDecimal(ValortextBox.Text) > 100)
            {
                MyerrorProvider.SetError(ValortextBox, "El campo Valor no puede tener un valor menor que 0 ni mayor que 100");
                ValortextBox.Focus();
                paso = false;
            }

            if (Convert.ToDecimal(LogradotextBox.Text) < 0 || Convert.ToDecimal(LogradotextBox.Text) > 100)
            {
                MyerrorProvider.SetError(LogradotextBox, "El campo Logrado no puede tener un valor menor que 0 ni mayor que 100");
                LogradotextBox.Focus();
                paso = false;
            }

            return(paso);
        }
        private bool Validar()
        {
            bool paso = true;

            if (Convert.ToDecimal(ValortextBox.Text) < Convert.ToDecimal(LogradotextBox.Text))
            {
                MyerrorProvider.SetError(LogradotextBox, "El campo Logrado no puede ser mayor que el valor");
                LogradotextBox.Focus();
                paso = false;
            }

            if (Convert.ToDecimal(LogradotextBox.Text) < 0)
            {
                MyerrorProvider.SetError(LogradotextBox, "Cantidad invalida");
                LogradotextBox.Focus();
                paso = false;
            }

            if (Convert.ToDecimal(ValortextBox.Text) < 0)
            {
                MyerrorProvider.SetError(ValortextBox, "Cantidad invalida");
                ValortextBox.Focus();
                paso = false;
            }

            if (string.IsNullOrWhiteSpace(NombretextBox.Text))
            {
                MyerrorProvider.SetError(NombretextBox, "El campo Nombre no puede estar vacio");
                NombretextBox.Focus();
                paso = false;
            }

            if (string.IsNullOrWhiteSpace(ValortextBox.Text))
            {
                MyerrorProvider.SetError(ValortextBox, "El campo Valor no puede estar vacio");
                ValortextBox.Focus();
                paso = false;
            }

            if (string.IsNullOrWhiteSpace(LogradotextBox.Text))
            {
                MyerrorProvider.SetError(LogradotextBox, "El campo Logrado no puede estar vacio");
                LogradotextBox.Focus();
                paso = false;
            }
            return(paso);
        }
Example #6
0
        private bool Validar()
        {
            bool paso = true;

            MyerrorProvider.Clear();

            if (string.IsNullOrWhiteSpace(Convert.ToString(FechadateTimePicker.Value)))
            {
                MyerrorProvider.SetError(FechadateTimePicker, "El campo Fecha no puede estar vacio");
                FechadateTimePicker.Focus();
                paso = false;
            }

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

            if (string.IsNullOrWhiteSpace(ValortextBox.Text))
            {
                MyerrorProvider.SetError(ValortextBox, "El campo Valor no puede estar vacio");
                ValortextBox.Focus();
                paso = false;
            }

            if (string.IsNullOrWhiteSpace(LogradotextBox.Text))
            {
                MyerrorProvider.SetError(LogradotextBox, "El campo Logrado no puede estar vacio");
                LogradotextBox.Focus();
                paso = false;
            }

            if (string.IsNullOrWhiteSpace(Convert.ToString(PronosticocomboBox.Text)))
            {
                MyerrorProvider.SetError(PronosticocomboBox, "El campo Pronostico no puede estar vacio");
                PronosticocomboBox.Focus();
                paso = false;
            }

            return(paso);
        }
Example #7
0
        private bool Validar()
        {
            MyerrorProvider.Clear();
            bool paso = true;

            if (EstudiantetextBox.Text == String.Empty)
            {
                MyerrorProvider.SetError(EstudiantetextBox, "No debe quedarse vacio");
                EstudiantetextBox.Focus();
                paso = false;
            }


            if (Convert.ToDecimal(ValortextBox.Text) < 0)
            {
                MyerrorProvider.SetError(ValortextBox, "Campo llenado incorrectamente");
                ValortextBox.Focus();
                paso = false;
            }

            if (Convert.ToDecimal(LogradotextBox.Text) < 0)
            {
                MyerrorProvider.SetError(LogradotextBox, "Campo llenado incorrectamente");
                LogradotextBox.Focus();
                paso = false;
            }

            if (Convert.ToDecimal(LogradotextBox.Text) > Convert.ToDecimal(ValortextBox.Text))
            {
                MyerrorProvider.SetError(LogradotextBox, "Campo llenado incorrectamente");
                MyerrorProvider.SetError(ValortextBox, "Campo llenado incorrectamente");
                LogradotextBox.Focus();
                ValortextBox.Focus();

                paso = false;
            }



            return(paso);
        }