public DataSet ConsultarEstudiantesSinFecha(Nota nota) { List<DbParameter> lstParam = new List<DbParameter>(); DbParameter pEvento2 = this.CrearParametros(); pEvento2.Value = nota.IdGrupo; pEvento2.ParameterName = "@idGrupo"; pEvento2.DbType = DbType.Int16; lstParam.Add(pEvento2); return (this.EjecutarConsulta("PAR.Personas_GetEstudiantesSinFecha", this.mstrDBKEY, lstParam)); }
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); } } }
public DataSet actualizarEstadoNota(Nota nota) { List<DbParameter> lstParam = new List<DbParameter>(); DbParameter pEvento2 = this.CrearParametros(); pEvento2.Value = nota.IdGrupo; pEvento2.ParameterName = "@idGrupo"; pEvento2.DbType = DbType.Int16; lstParam.Add(pEvento2); DbParameter pEvento = this.CrearParametros(); pEvento.Value = nota.Id_ParametroNota; pEvento.ParameterName = "@idParametroNota"; pEvento.DbType = DbType.Int16; lstParam.Add(pEvento); DbParameter pEvento3 = this.CrearParametros(); pEvento3.Value = nota.Concurrencia_id; pEvento3.ParameterName = "@concurrencia_id"; pEvento3.DbType = DbType.Int16; lstParam.Add(pEvento3); return (this.EjecutarConsulta("[PAR].[ActualizarEstadoNota]", this.mstrDBKEY, lstParam)); }
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); }
public void AddNota(Nota detalle) { AgregarNota.Add(detalle); }
public DataSet tipoEvaluacionGetAll(Nota nota) { List<DbParameter> lstParam = new List<DbParameter>(); DbParameter pEvento = this.CrearParametros(); pEvento.Value = nota.IdGrupo; pEvento.ParameterName = "@idGrupo"; pEvento.DbType = DbType.Int16; lstParam.Add(pEvento); return (this.EjecutarConsulta("[PAR].[ParametroNota_GetAll]", this.mstrDBKEY, lstParam)); }
public DataSet notasGetById(Nota nota) { List<DbParameter> lstParam = new List<DbParameter>(); DbParameter pEvento2 = this.CrearParametros(); pEvento2.Value = nota.IdGrupo; pEvento2.ParameterName = "@idGrupo"; pEvento2.DbType = DbType.Int16; lstParam.Add(pEvento2); DbParameter pEvento = this.CrearParametros(); pEvento.Value = nota.Id_ParametroNota; pEvento.ParameterName = "@idParametroNota"; pEvento.DbType = DbType.Int16; lstParam.Add(pEvento); return (this.EjecutarConsulta("[PAR].[Nota_GetId]", this.mstrDBKEY, lstParam)); }
public CNotas(string strDBkey, Nota notaa) { this.notass = notaa; mstrDBKEY = strDBkey; adaProxy = this.CrearAdaptador("PAR.tblNotas", strDBkey); }
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); }
public int InsertarNota1(Nota nota) { List<DbParameter> lstParam = new List<DbParameter>(); DbParameter dbpiPK = this.CrearParametros(); dbpiPK.ParameterName = "@idNota"; dbpiPK.Direction = ParameterDirection.Output; dbpiPK.DbType = DbType.Int16; dbpiPK.Size = 10; lstParam.Add(dbpiPK); DbParameter par = this.CrearParametros(); par.Value = nota.IdGrupo; par.ParameterName = "@idGrupo"; par.DbType = DbType.Int16; par.Size = 20; lstParam.Add(par); DbParameter par2 = this.CrearParametros(); par2.Value = nota.Id_ParametroNota; par2.ParameterName = "@idParametroNota"; par2.DbType = DbType.Int16; par2.Size = 20; lstParam.Add(par2); DbParameter par3 = this.CrearParametros(); par3.Value = nota.Fecha; par3.ParameterName = "@fecha"; par3.DbType = DbType.Date; par3.Size = 20; lstParam.Add(par3); DbParameter par4 = this.CrearParametros(); par4.Value = nota.Estado; par4.ParameterName = "@estado"; par4.DbType = DbType.Int16; par4.Size = 20; lstParam.Add(par4); DbParameter par5 = this.CrearParametros(); par5.Value = nota.Concurrencia_id; par5.ParameterName = "@concurrencia_id"; par5.DbType = DbType.Int16; par5.Size = 20; lstParam.Add(par5); return (this.EjecutarDML("[PAR].[NotasAlumnos_Insertar]", this.mstrDBKEY, lstParam)); }
public int InsertarDetalleNota(Nota maestro, List<DetalleNota> detalles) { using (TransactionScope scope = new TransactionScope(TransactionScopeOption.RequiresNew)) { this.InsertarNota1(maestro); foreach (DetalleNota detalle in detalles) { this.InsertarDetalle(detalle); } scope.Complete(); } return 1; }
public int Insert() { List<Nota> lista = new List<Nota>(); foreach (Nota detalle in notass.AgregarNota) { Nota temp = new Nota(); temp.IdGrupo = detalle.IdGrupo; temp.Id_ParametroNota = detalle.Id_ParametroNota; temp.Nota1 = detalle.Nota1; temp.Estado = detalle.Estado; temp.Concurrencia_id = detalle.Concurrencia_id; lista.Add(temp); } return this.InsertarAsistencia(lista); }
public int notaAlumons(Nota notas) { if (cNotas.notasGetById(notas).Tables[0].Rows.Count < 1) { return 0; } return 1; }
public int notaAsignadaPorDocente(Nota notas) { if (cNotas.notasAsignadasPorDocente(notas).Tables[0].Rows.Count < 1) { return 0; } int nota = Convert.ToInt16(cNotas.notasAsignadasPorDocente(notas).Tables[0].Rows[0][0]); return nota; }