Esempio n. 1
0
        public static int Agregar(BoletaDeEducacionFisica pBoletaedu)
        {
            int          retorno = 0;
            MySqlCommand comando = new MySqlCommand(string.Format("Insert into Boletaeducacionfisica (Nombre, Grupo_y_Grado, Esperado, Desarrollo , Requiere_Apoyo, Resultado) values ('{0}','{1}','{2}', '{3}', '{4}','{5}')",
                                                                  pBoletaedu.Nombre, pBoletaedu.GradoyGrupo, pBoletaedu.Esperado, pBoletaedu.Desarrollo, pBoletaedu.RequiereApoyo, pBoletaedu.Resultado), BDConector.ObtenerConexion());

            retorno = comando.ExecuteNonQuery();
            return(retorno);
        }
        private void evaluaralumno_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(pcuerpo.Text))
            {
                MessageBox.Show("Debe completar la informacion");
                return;
            }
            if (string.IsNullOrEmpty(cangrejo.Text))
            {
                MessageBox.Show("Debe completar la informacion");
                return;
            }
            if (string.IsNullOrEmpty(reptar.Text))
            {
                MessageBox.Show("Debe completar la informacion");
                return;
            }
            if (string.IsNullOrEmpty(salticar.Text))
            {
                MessageBox.Show("Debe completar la informacion");
                return;
            }
            if (string.IsNullOrEmpty(sltarunpie.Text))
            {
                MessageBox.Show("Debe completar la informacion");
                return;
            }
            if (string.IsNullOrEmpty(saltar2pies.Text))
            {
                MessageBox.Show("Debe completar la informacion");
                return;
            }
            if (string.IsNullOrEmpty(lanzarcachar.Text))
            {
                MessageBox.Show("Debe completar la informacion");
                return;
            }
            if (string.IsNullOrEmpty(botar.Text))
            {
                MessageBox.Show("Debe completar la informacion");
                return;
            }
            if (string.IsNullOrEmpty(equilibrio.Text))
            {
                MessageBox.Show("Debe completar la informacion");
                return;
            }
            if (string.IsNullOrEmpty(adelante.Text))
            {
                MessageBox.Show("Debe completar la informacion");
                return;
            }
            if (string.IsNullOrEmpty(atras.Text))
            {
                MessageBox.Show("Debe completar la informacion");
                return;
            }
            if (string.IsNullOrEmpty(derecha.Text))
            {
                MessageBox.Show("Debe completar la informacion");
                return;
            }
            if (string.IsNullOrEmpty(izquierda.Text))
            {
                MessageBox.Show("Debe completar la informacion");
                return;
            }
            if (string.IsNullOrEmpty(lejos.Text))
            {
                MessageBox.Show("Debe completar la informacion");
                return;
            }
            if (string.IsNullOrEmpty(cerca.Text))
            {
                MessageBox.Show("Debe completar la informacion");
                return;
            }
            if (string.IsNullOrEmpty(arribade.Text))
            {
                MessageBox.Show("Debe completar la informacion");
                return;
            }
            if (string.IsNullOrEmpty(abajode.Text))
            {
                MessageBox.Show("Debe completar la informacion");
                return;
            }
            if (string.IsNullOrEmpty(ritmo.Text))
            {
                MessageBox.Show("Debe completar la informacion");
                return;
            }
            if (string.IsNullOrEmpty(cordinamtv.Text))
            {
                MessageBox.Show("Debe completar la informacion");
                return;
            }

            Partecuerpo         = Convert.ToInt16(pcuerpo.Text);
            Cangrejo            = Convert.ToInt16(cangrejo.Text);
            Reptar              = Convert.ToInt16(reptar.Text);
            Salticar            = Convert.ToInt16(salticar.Text);
            Saltarunpie         = Convert.ToInt16(sltarunpie.Text);
            Saltardospies       = Convert.ToInt16(saltar2pies.Text);
            Lanzarcachar        = Convert.ToInt16(lanzarcachar.Text);
            Botar               = Convert.ToInt16(botar.Text);
            Equilibrio          = Convert.ToInt16(equilibrio.Text);
            Adelante            = Convert.ToInt16(adelante.Text);
            Atras               = Convert.ToInt16(atras.Text);
            Derecha             = Convert.ToInt16(derecha.Text);
            Izquierda           = Convert.ToInt16(izquierda.Text);
            Lejos               = Convert.ToInt16(lejos.Text);
            Cerca               = Convert.ToInt16(cerca.Text);
            Arribade            = Convert.ToInt16(arribade.Text);
            Abajode             = Convert.ToInt16(abajode.Text);
            Ritmo               = Convert.ToInt16(ritmo.Text);
            Coordinafuervelequi = Convert.ToInt16(cordinamtv.Text);

            MySqlConnection cn;

            try
            {
                cn = new MySqlConnection("server=127.0.0.1; port=3305; database=JardinBonifacioDiaz; Uid=root; pwd=root;");
                evaluadesarrollofisico(Partecuerpo, Cangrejo, Reptar, Salticar, Saltarunpie, Saltardospies, Lanzarcachar, Botar, Equilibrio, Adelante, Atras, Derecha, Izquierda, Lejos, Cerca, Arribade, Abajode, Ritmo, Coordinafuervelequi);
                BoletaDeEducacionFisica pAlumno = new BoletaDeEducacionFisica();

                pAlumno.Nombre        = lblNomAl.Text.Trim();
                pAlumno.GradoyGrupo   = lblGradGrup.Text.Trim();
                pAlumno.Esperado      = lblesperado.Text.Trim();
                pAlumno.Desarrollo    = lbldesarrollo.Text.Trim();
                pAlumno.RequiereApoyo = lblrequiereapoyo.Text.Trim();
                pAlumno.Resultado     = nivel.Text.Trim();


                int resultado = BoletaDeEducacionFisicaABC.Agregar(pAlumno);
                if (resultado > 0)
                {
                    MessageBox.Show("Alumno Guardado Con Exito!!", "Guardado", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    this.limpiar();
                }
                else
                {
                    MessageBox.Show("No se pudo guardar el alumno", "Fallo!!", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("ocurrio un error" + ex.Message);
            }

            MenuEval menu = new MenuEval(nombreAl, gradGrup, id);

            menu.Show();
            this.Hide();
        }