예제 #1
0
 protected void btnAceptar_Click(object sender, EventArgs e)
 {
     if (validarTextBoxNota())
     {
         guardarNotas();
         CNotas nota = new CNotas("SQL", this.notas);
         nota.InsertNota();
         ShowAlertMessage("Las notas se han guardado satisfactoriamente");
         this.notasAlmacenadas();
         //Response.Redirect(Request.Url.AbsoluteUri);
         //System.Threading.Thread.Sleep(3000);
     }
 }
예제 #2
0
        public void sumarNota()
        {
            int sumaNotas = 0;
            int aux = 0;
            foreach (GridViewRow item in gridInsertarNota.Rows)
            {
                TextBox txtNota = (TextBox)(item.FindControl("txtNota"));
                if (int.TryParse(txtNota.Text, out aux))
                {
                    if (aux > 0)
                    {
                        detalleNota = new Nota();
                        int nota = Convert.ToInt32(txtNota.Text);
                        sumaNotas += nota;
                        detalleNota.IdGrupo = Convert.ToInt32(boxGrupos.SelectedValue.ToString());
                        detalleNota.Id_ParametroNota = Convert.ToInt32(item.Cells[0].Text.ToString());
                        detalleNota.Nota1 = Convert.ToInt32(txtNota.Text);
                        detalleNota.Estado = 0;
                        detalleNota.Concurrencia_id = 0;
                        this.nota.AddNota(detalleNota);
                    }
                }
                if (!int.TryParse(txtNota.Text, out aux))
                {
                    ShowAlertMessage("Verifique que todos los campos esten correctos");
                    return;
                }

            }
            if (validarNotas(sumaNotas))
            {
                CNotas nota = new CNotas("SQL", this.nota);
                if (nota.Insert() > 0)
                {
                    ShowAlertMessage("El porcentaje de notas que asigno se guardo satisfactoriamente");
                    System.Threading.Thread.Sleep(3000);
                    Response.Redirect(Request.Url.AbsoluteUri);
                }

            }
        }