Esempio n. 1
0
    protected void btnFiltrar_Click(object sender, EventArgs e)
    {
        try
        {
            iCom_BusinessEntity.Usuario oBE = new iCom_BusinessEntity.Usuario();
            iCom_BusinessLogic.Usuario  oBL = new iCom_BusinessLogic.Usuario();

            oBE.idusuariotipo = 4;
            oBE.idcarrera     = DdlCarrera.SelectedIndex;
            oBE.idperiodo     = DdlPeriodo.SelectedIndex;

            dtDatos = oBL.Filtrar(oBE);

            if (dtDatos.Rows.Count > 0)
            {
                GvDatos.DataSource = dtDatos;
                GvDatos.DataBind();
                return;
            }
        }
        catch (Exception ex)
        {
            ResgitraLog(ex.Message);
            return;
        }
    }
 public void llenarDatosGrid()
 {
     if (hdfvalidar.Value == "true")
     {
         if (txtNomina.Text != "" && txtcalificacion.Text == "" && ddlPeriodo.SelectedValue == "-1")//1
         {
             query = "sp_muestra_calificacion_solicitantes '" + txtNomina.Text.Trim() + "',null," + ddlPeriodo.SelectedValue + "";
         }
         if (txtNomina.Text == "" && txtcalificacion.Text != "" && ddlPeriodo.SelectedValue == "-1")//2
         {
             query = "sp_muestra_calificacion_solicitantes null, " + txtcalificacion.Text.Trim() + "," + ddlPeriodo.SelectedValue + " ";
         }
         if (txtNomina.Text == "" && txtcalificacion.Text == "" && ddlPeriodo.SelectedValue != "-1")//3
         {
             query = "sp_muestra_calificacion_solicitantes null , null , " + ddlPeriodo.SelectedValue + "";
         }
         if (txtNomina.Text != "" && txtcalificacion.Text != "" && ddlPeriodo.SelectedValue == "-1")//4
         {
             query = "sp_muestra_calificacion_solicitantes '" + txtNomina.Text.Trim() + "'," + txtcalificacion.Text.Trim() + "," + ddlPeriodo.SelectedValue + " ";
         }
         if (txtNomina.Text != "" && txtcalificacion.Text == "" && ddlPeriodo.SelectedValue != "-1")//5
         {
             query = "sp_muestra_calificacion_solicitantes '" + txtNomina.Text.Trim() + "',null," + ddlPeriodo.SelectedValue + "";
         }
         if (txtNomina.Text == "" && txtcalificacion.Text != "" && ddlPeriodo.SelectedValue != "-1")//6
         {
             query = "sp_muestra_calificacion_solicitantes null," + txtcalificacion.Text.Trim() + "," + ddlPeriodo.SelectedValue + " ";
         }
         if (txtNomina.Text != "" && txtcalificacion.Text != "" && ddlPeriodo.SelectedValue != "-1")//7
         {
             query = "sp_muestra_calificacion_solicitantes '" + txtNomina.Text.Trim() + "'," + txtcalificacion.Text.Trim() + "," + ddlPeriodo.SelectedValue + "";
         }
         if (txtNomina.Text == "" && txtcalificacion.Text == "" && ddlPeriodo.SelectedValue == "-1")//8
         {
             query = "sp_muestra_calificacion_solicitantes null,null,-1";
         }
         dt = db.getQuery(conexionBecarios, query);
         if (dt.Rows.Count > 0)
         {
             GvDatos.DataSource = dt;
             GvDatos.DataBind();
         }
     }
 }
Esempio n. 3
0
 protected void Page_Load(object sender, EventArgs e)
 {
     try
     {
         if (!IsPostBack)
         {
             query = "sp_presenta_alumnos_asignados_al_sb '" + Session["usuario"].ToString() + "'";
             dt    = db.getQuery(conexionBecarios, query);
             if (dt.Rows.Count > 0)
             {
                 GvDatos.DataSource = dt;
                 GvDatos.DataBind();
                 pnlmostrarGrid.Visible = true;
             }
             else
             {
                 verModal("Alerta", "Usted no tiene asignación de becarios");
             }
         }
     }catch (Exception es)
     {
         verModal("Error", es.Message.ToString());
     }
 }
        public void llenarGrid()
        {
            if (hdfActivarRol.Value == "1")
            {
                if (ddlPeriodo.SelectedValue != "-1" && ddlCampus.SelectedValue == "-1" && ddlValoracion.SelectedValue == "-1")//1
                {
                    query = "sp_reporte_Proyectos  '" + ddlPeriodo.SelectedValue + "','-1' ,-1";
                }
                if (ddlPeriodo.SelectedValue == "-1" && ddlCampus.SelectedValue != "-1" && ddlValoracion.SelectedValue == "-1")//2
                {
                    query = "sp_reporte_Proyectos '-1' , '" + ddlCampus.SelectedValue + "',-1";
                }
                if (ddlPeriodo.SelectedValue == "-1" && ddlCampus.SelectedValue == "-1" && ddlValoracion.SelectedValue != "-1")//3
                {
                    query = "sp_reporte_Proyectos  '-1','-1'," + ddlValoracion.SelectedValue + "";
                }
                if (ddlPeriodo.SelectedValue != "-1" && ddlCampus.SelectedValue != "-1" && ddlValoracion.SelectedValue == "-1")//4
                {
                    query = "sp_reporte_Proyectos '" + ddlPeriodo.SelectedValue + "', '" + ddlCampus.SelectedValue + "',-1";
                }
                if (ddlPeriodo.SelectedValue != "-1" && ddlCampus.SelectedValue == "-1" && ddlValoracion.SelectedValue != "-1")//5
                {
                    query = "sp_reporte_Proyectos '" + ddlPeriodo.SelectedValue + "','-1'," + ddlValoracion.SelectedValue + "";
                }
                if (ddlPeriodo.SelectedValue == "-1" && ddlCampus.SelectedValue != "-1" && ddlValoracion.SelectedValue != "-1")//6
                {
                    query = "sp_reporte_Proyectos '-1', '" + ddlCampus.SelectedValue + "'," + ddlValoracion.SelectedValue + "";
                }
                if (ddlPeriodo.SelectedValue != "-1" && ddlCampus.SelectedValue != "-1" && ddlValoracion.SelectedValue != "-1")//7
                {
                    query = "sp_reporte_Proyectos '" + ddlPeriodo.SelectedValue + "','" + ddlCampus.SelectedValue + "'," + ddlValoracion.SelectedValue + "";
                }
                if (ddlPeriodo.SelectedValue == "-1" && ddlCampus.SelectedValue == "-1" && ddlValoracion.SelectedValue == "-1")//8
                {
                    query = "sp_reporte_Proyectos '-1','-1',-1";
                }
            }
            else
            {
                if (ddlPeriodo.SelectedValue != "-1" && hdfMostrarId.Value == "-1" && ddlValoracion.SelectedValue == "-1")//1
                {
                    query = "sp_reporte_Proyectos  '" + ddlPeriodo.SelectedValue + "','-1' ,-1";
                }
                if (ddlPeriodo.SelectedValue == "-1" && hdfMostrarId.Value != "-1" && ddlValoracion.SelectedValue == "-1")//2
                {
                    query = "sp_reporte_Proyectos '-1' , '" + hdfMostrarId.Value + "',-1";
                }
                if (ddlPeriodo.SelectedValue == "-1" && hdfMostrarId.Value == "-1" && ddlValoracion.SelectedValue != "-1")//3
                {
                    query = "sp_reporte_Proyectos  '-1','-1'," + ddlValoracion.SelectedValue + "";
                }
                if (ddlPeriodo.SelectedValue != "-1" && hdfMostrarId.Value != "-1" && ddlValoracion.SelectedValue == "-1")//4
                {
                    query = "sp_reporte_Proyectos '" + ddlPeriodo.SelectedValue + "', '" + hdfMostrarId.Value + "',-1";
                }
                if (ddlPeriodo.SelectedValue != "-1" && hdfMostrarId.Value == "-1" && ddlValoracion.SelectedValue != "-1")//5
                {
                    query = "sp_reporte_Proyectos '" + ddlPeriodo.SelectedValue + "','-1'," + ddlValoracion.SelectedValue + "";
                }
                if (ddlPeriodo.SelectedValue == "-1" && hdfMostrarId.Value != "-1" && ddlValoracion.SelectedValue != "-1")//6
                {
                    query = "sp_reporte_Proyectos '-1', '" + hdfMostrarId.Value + "'," + ddlValoracion.SelectedValue + "";
                }
                if (ddlPeriodo.SelectedValue != "-1" && hdfMostrarId.Value != "-1" && ddlValoracion.SelectedValue != "-1")//7
                {
                    query = "sp_reporte_Proyectos '" + ddlPeriodo.SelectedValue + "','" + hdfMostrarId.Value + "'," + ddlValoracion.SelectedValue + "";
                }
                if (ddlPeriodo.SelectedValue == "-1" && hdfMostrarId.Value == "-1" && ddlValoracion.SelectedValue == "-1")//8
                {
                    query = "sp_reporte_Proyectos '-1','-1',-1";
                }
            }

            dt = db.getQuery(conexionBecarios, query);
            if (dt.Rows.Count > 0)
            {
                GvDatos.DataSource = dt;
                GvDatos.DataBind();
                ViewState["dt"] = dt;
            }
            else
            {
                GvDatos.DataSource = null;
                GvDatos.DataBind();
                ViewState["dt"] = null;
                verModal("Alerta", "No se encontro la informacion filtrada");
            }
        }