public void CargarPropuestas() { string sql = ""; try { OracleConnection conn = con.crearConexion(); OracleCommand cmd = null; if (conn != null) { sql = "select distinct p.prop_codigo, p.prop_titulo, TO_CHAR( p.PROP_FECHA, 'dd/mm/yyyy') as FECHA , INITCAP(p.PROP_ESTADO) as ESTADO from propuesta p, usuario u, director s where s.USU_USERNAME='******' and p.PROP_CODIGO = s.prop_codigo and s.dir_estado='APROBADO'"; cmd = new OracleCommand(sql, conn); cmd.CommandType = CommandType.Text; using (OracleDataReader reader = cmd.ExecuteReader()){ DataTable dataTable = new DataTable(); dataTable.Load(reader); GVpropuesta.DataSource = dataTable; int cantfilas = Convert.ToInt32(dataTable.Rows.Count.ToString()); Linfo.Text = "Cantidad de filas encontradas: " + cantfilas; } GVpropuesta.DataBind(); } conn.Close(); }catch (Exception ex) { Linfo.Text = "Error al cargar la lista: " + ex.Message; } }
public void CargarPropuesta(int crit) { string sql = ""; try{ OracleConnection conn = con.crearConexion(); OracleCommand cmd = null; if (conn != null) { if (crit.Equals(2)) { sql = "select Distinct p.PROP_CODIGO,p.PROP_TITULO, l.LINV_NOMBRE, t.TEM_NOMBRE,TO_CHAR( p.PROP_FECHA, 'dd/mm/yyyy') as FECHA ,CONCAT(CONCAT(u.usu_nombre, ' '), u.usu_apellido) as director, InitCap(s.dir_estado) as Estado from propuesta p, estudiante e, lin_investigacion l, tema t, director s, usuario u, profesor d" + " where t.LINV_CODIGO = l.LINV_CODIGO and t.TEM_CODIGO = p.TEM_CODIGO and p.PROP_CODIGO = e.PROP_CODIGO and p.PROP_ESTADO = '" + DDLestado.Items[DDLestado.SelectedIndex].Text.ToUpper() + "'and u.USU_USERNAME = s.USU_USERNAME and s.PROP_CODIGO = p.PROP_CODIGO and d.com_codigo = e.prog_codigo"; } else if (crit.Equals(1)) { sql = "Select Distinct P.Prop_Codigo,P.Prop_Titulo, L.Linv_Nombre, T.Tem_Nombre,To_Char( P.Prop_Fecha, 'dd/mm/yyyy') As Fecha ,Concat(Concat(U.Usu_Nombre, ' '), U.Usu_Apellido) As Director, InitCap(S.dir_Estado) As Estado From Propuesta P, Estudiante E, Lin_investigacion L, Tema T, director S, Usuario U Where T.Linv_Codigo = L.Linv_Codigo " + "And T.Tem_Codigo = P.Tem_Codigo And P.Prop_Codigo = E.Prop_Codigo And L.Linv_Codigo = '" + DDLconsultaLinea.Items[DDLconsultaLinea.SelectedIndex].Value + "' And P.Prop_Estado = '" + DDLestado.Items[DDLestado.SelectedIndex].Text.ToUpper() + "' And U.Usu_Username = S.Usu_Username And S.Prop_Codigo = P.Prop_Codigo"; } cmd = new OracleCommand(sql, conn); cmd.CommandType = CommandType.Text; using (OracleDataReader reader = cmd.ExecuteReader()){ DataTable dataTable = new DataTable(); dataTable.Load(reader); GVpropuesta.DataSource = dataTable; int cantfilas = Convert.ToInt32(dataTable.Rows.Count.ToString()); Linfo.Text = "Cantidad de filas encontradas: " + cantfilas; } GVpropuesta.DataBind(); } conn.Close(); } catch (Exception ex) { Linfo.Text = "Error al cargar la lista: " + ex.Message; } ResultadoPropuesta.Visible = true; }