/*Metodos que se utilizan para la consulta del anteproyecto*/ public void CargarAnteproyecto() { LBanteproyecto.Visible = true; try { OracleConnection conn = con.crearConexion(); OracleCommand cmd = null; if (conn != null) { string sql = "Select P.APRO_CODIGO, P.ANP_NOMBRE, P.ANP_FECHA, INITCAP(P.ANP_APROBACION) as aprobacion ,INITCAP(P.ANP_ESTADO) as estado,CONCAT(CONCAT(o.usu_nombre, ' '), o.usu_apellido) as revisor from anteproyecto p, usuario o, estudiante e, profesor d, evaluador r " + "where d.usu_username = '******' and d.com_codigo = e.prog_codigo and e.usu_username = '******' and e.prop_codigo = p.apro_codigo and r.Usu_Username = o.Usu_Username and r.Apro_Codigo = e.Prop_Codigo"; cmd = new OracleCommand(sql, conn); cmd.CommandType = CommandType.Text; using (OracleDataReader reader = cmd.ExecuteReader()) { DataTable dataTable = new DataTable(); dataTable.Load(reader); GVanteproyecto.DataSource = dataTable; int cantfilas = Convert.ToInt32(dataTable.Rows.Count.ToString()); } GVanteproyecto.DataBind(); } conn.Close(); } catch (Exception ex) { Linfo.Text = "Error al cargar la lista: " + ex.Message; } Comprobado(); }
/*Metodos que consultan anteproyecto especifico*/ private void CargarContenido() { try{ OracleConnection conn = con.crearConexion(); OracleCommand cmd = null; if (conn != null) { string sql = "select apro_codigo, anp_nombre from anteproyecto WHERE apro_codigo = '" + Codigo.Value + "'"; cmd = new OracleCommand(sql, conn); cmd.CommandType = CommandType.Text; using (OracleDataReader reader = cmd.ExecuteReader()){ DataTable dataTable = new DataTable(); dataTable.Load(reader); GVanteproyecto.DataSource = dataTable; } GVanteproyecto.DataBind(); } conn.Close(); } catch (Exception ex) { Linfo.Text = "Error al cargar la lista: " + ex.Message; } MostrarCalifica.Visible = true; Linfo.Text = ""; InfoAnteproy.Visible = true; Terminar.Visible = true; }
public void CargarAnteproyecto(int crit) { string sql = ""; try { OracleConnection conn = con.crearConexion(); OracleCommand cmd = null; if (conn != null) { if (crit.Equals(2)) { sql = "select Distinct A.Apro_Codigo, A.Anp_Nombre,TO_CHAR( A.Anp_Fecha, 'dd/mm/yyyy') as FECHA ,CONCAT(CONCAT(u.usu_nombre, ' '), u.usu_apellido) as director, InitCap(A.Anp_Aprobacion) as aprobacion, CONCAT(CONCAT(o.usu_nombre, ' '), o.usu_apellido) as revisor, TO_CHAR( r.eva_fecha, 'dd/mm/yyyy') as FASIGNADO, TO_CHAR( r.eva_frta, 'dd/mm/yyyy') as FRPTA, TO_CHAR( r.eva_fenvio, 'dd/mm/yyyy') as FENVIO from anteproyecto a, estudiante e, director s, usuario u, evaluador r, usuario o, profesor d " + " where A.Apro_Codigo = e.PROP_CODIGO and A.Anp_Estado = '" + DDLestado.Items[DDLestado.SelectedIndex].Text.ToUpper() + "' and u.USU_USERNAME = s.USU_USERNAME and s.Prop_Codigo = a.Apro_Codigo and r.Usu_Username = o.Usu_Username and r.Apro_Codigo = e.Prop_Codigo and d.com_codigo = e.prog_codigo"; } else if (crit.Equals(1)) { sql = "Select Distinct A.Apro_Codigo, A.Anp_Nombre,TO_CHAR( A.Anp_Fecha, 'dd/mm/yyyy') as FECHA ,CONCAT(CONCAT(u.usu_nombre, ' '), u.usu_apellido) as director, InitCap(A.Anp_Aprobacion) as aprobacion, CONCAT(CONCAT(o.usu_nombre, ' '), o.usu_apellido) as revisor, TO_CHAR( r.eva_fecha, 'dd/mm/yyyy') as FASIGNADO, TO_CHAR( r.eva_frta, 'dd/mm/yyyy') as FRPTA, TO_CHAR( r.eva_fenvio, 'dd/mm/yyyy') as FENVIO From Propuesta P, Estudiante E, lin_investigacion L, director S, Usuario U,evaluador r, usuario o , Tema t, anteproyecto a " + "Where T.Linv_Codigo = L.Linv_Codigo And T.Tem_Codigo = P.Tem_Codigo And L.Linv_Codigo = '" + DDLconsultaLinea.Items[DDLconsultaLinea.SelectedIndex].Value + "' and A.Apro_Codigo= e.PROP_CODIGO and A.Anp_Estado = '" + DDLestado.Items[DDLestado.SelectedIndex].Text.ToUpper() + "' and u.USU_USERNAME = s.USU_USERNAME and s.Prop_Codigo= a.Apro_Codigo and r.Usu_Username = o.Usu_Username and r.Apro_Codigo = e.Prop_Codigo"; } cmd = new OracleCommand(sql, conn); cmd.CommandType = CommandType.Text; using (OracleDataReader reader = cmd.ExecuteReader()){ DataTable dataTable = new DataTable(); dataTable.Load(reader); GVanteproyecto.DataSource = dataTable; int cantfilas = Convert.ToInt32(dataTable.Rows.Count.ToString()); Linfo.Text = "Cantidad de filas encontradas: " + cantfilas; } GVanteproyecto.DataBind(); } conn.Close(); }catch (Exception ex) { Linfo.Text = "Error al cargar la lista: " + ex.Message; } ResultadoAnteproyecto.Visible = true; }