Exemplo n.º 1
0
 public void guardarNotas()
 {
     notas = new Nota();
     notas.IdGrupo = Convert.ToInt16(boxGrupos.SelectedValue.ToString());
     notas.Id_ParametroNota = Convert.ToInt16(boxEvaluacion.SelectedValue.ToString());
     notas.Fecha = Convert.ToDateTime(DateTime.Today.ToString("yyy-MM-dd"));
     notas.IdNota = Convert.ToInt16(cNotas.ConsultarEstudiantesSinFecha(notas).Tables[2].Rows[0][0]);
     notas.Estado = 0;
     notas.Concurrencia_id = 0;
     foreach (GridViewRow gvr in gridNotas.Rows)
     {
         detalleNota = new DetalleNota();
         int nitEstudiante = Convert.ToInt32(gvr.Cells[0].Text.ToString());
         detalleNota.IdEstudiante = Convert.ToInt32(cNotas.ConsultarNitEstudiante(nitEstudiante).Tables[0].Rows[0][0].ToString());
         detalleNota.IdNota = notas.IdNota;
         TextBox txtNotas = (TextBox)(gvr.FindControl("txtNota"));
         detalleNota.Nota = (Convert.ToInt16(txtNotas.Text) * notaAsignadaPorDocente(notas)) / 100;
         detalleNota.Cocurrencia_id = notas.Concurrencia_id;
         notas.AddDetalleNota(detalleNota);
     }
     notas.Estado = 1;
     cNotas.actualizarEstadoNota(notas);
 }
Exemplo n.º 2
0
 public void AddDetalleNota(DetalleNota detalle)
 {
     AgregarDetalleNota.Add(detalle);
 }
Exemplo n.º 3
0
        public int InsertNota()
        {
            Nota maestro = new Nota();
            maestro.IdGrupo = notass.IdGrupo;
            maestro.Id_ParametroNota = notass.Id_ParametroNota;
            maestro.Fecha = notass.Fecha;
            maestro.Estado = notass.Estado;
            maestro.Concurrencia_id = notass.Concurrencia_id;

            List<DetalleNota> lista = new List<DetalleNota>();
            foreach (DetalleNota detalle in notass.AgregarDetalleNota)
            {
                DetalleNota temp = new DetalleNota();
                temp.IdNota = detalle.IdNota + 1;
                temp.IdEstudiante = detalle.IdEstudiante;
                temp.Nota = detalle.Nota;
                temp.Cocurrencia_id = detalle.Cocurrencia_id;
                lista.Add(temp);
            }

            return this.InsertarDetalleNota(maestro, lista);
        }
Exemplo n.º 4
0
        public int InsertarDetalle(DetalleNota detalleNota)
        {
            List<DbParameter> lstParam = new List<DbParameter>();

            DbParameter dbpiPK = this.CrearParametros();
            dbpiPK.ParameterName = "@idDetalleNota";
            dbpiPK.Direction = ParameterDirection.Output;
            dbpiPK.DbType = DbType.Int16;
            dbpiPK.Size = 10;
            lstParam.Add(dbpiPK);

            DbParameter par = this.CrearParametros();
            par.Value = detalleNota.IdNota;
            par.ParameterName = "@idNota";
            par.DbType = DbType.Int16;
            par.Size = 20;
            lstParam.Add(par);

            DbParameter par2 = this.CrearParametros();
            par2.Value = detalleNota.IdEstudiante;
            par2.ParameterName = "@idEstudiante";
            par2.DbType = DbType.Int16;
            par2.Size = 20;
            lstParam.Add(par2);

            DbParameter par3 = this.CrearParametros();
            par3.Value = detalleNota.Nota;
            par3.ParameterName = "@nota";
            par3.DbType = DbType.Int16;
            lstParam.Add(par3);

            DbParameter par4 = this.CrearParametros();
            par4.Value = detalleNota.Cocurrencia_id;
            par4.ParameterName = "@concurrencia_id";
            par4.DbType = DbType.Int16;
            lstParam.Add(par4);

            return (this.EjecutarDML("[PAR].[DetalleNota_Insertar]", this.mstrDBKEY, lstParam));
        }