Ejemplo n.º 1
0
 protected void GvTipos_PageIndexChanging(object sender, GridViewPageEventArgs e)
 {
     try{
         GvTipos.PageIndex  = e.NewPageIndex;
         GvTipos.DataSource = (DataTable)Session["DOCUMENTOS_TIPO"];
         GvTipos.DataBind();
     }catch (Exception ex) {
         Mensaje(ex.Message, WarningType.Danger);
     }
 }
Ejemplo n.º 2
0
        private void cargarDatos()
        {
            try{
                String    vQuery = "[RSP_Documentacion] 15," + Session["USUARIO"].ToString();
                DataTable vDatos = vConexion.obtenerDataTable(vQuery);
                if (vDatos.Rows.Count > 0)
                {
                    GvTipos.DataSource = vDatos;
                    GvTipos.DataBind();
                    Session["DOCUMENTOS_TIPO"] = vDatos;

                    vQuery = "[RSP_Perfiles] 2," + Session["USUARIO"].ToString() + ", 5";
                    DataTable vDataInfo = vConexion.obtenerDataTable(vQuery);
                    if (vDataInfo.Rows[0][0].ToString() == "0")
                    {
                        foreach (GridViewRow row in GvTipos.Rows)
                        {
                            var vLinkButton = row.FindControl("BtnEditar") as LinkButton;
                            vLinkButton.Visible = false;
                        }
                    }
                }

                vQuery = "[RSP_Documentacion] 2";
                vDatos = vConexion.obtenerDataTable(vQuery);
                if (vDatos.Rows.Count > 0)
                {
                    DDLCategoria.Items.Clear();
                    DDLCategoria.Items.Add(new ListItem {
                        Value = "0", Text = "Seleccione una opción"
                    });
                    foreach (DataRow item in vDatos.Rows)
                    {
                        DDLCategoria.Items.Add(new ListItem {
                            Value = item["idCategoria"].ToString(), Text = item["nombre"].ToString()
                        });
                    }
                }

                vQuery = "[RSP_Documentacion] 6";
                vDatos = vConexion.obtenerDataTable(vQuery);
                if (vDatos.Rows.Count > 0)
                {
                    DDLEmpleados.Items.Clear();
                    DDLEmpleados.Items.Add(new ListItem {
                        Value = "0", Text = "Seleccione una opción"
                    });
                    foreach (DataRow item in vDatos.Rows)
                    {
                        DDLEmpleados.Items.Add(new ListItem {
                            Value = item["idEmpleado"].ToString(), Text = item["nombre"].ToString()
                        });
                    }
                }

                vQuery = "[RSP_Documentacion] 14";
                vDatos = vConexion.obtenerDataTable(vQuery);
                if (vDatos.Rows.Count > 0)
                {
                    DDLNivelConfidencialidad.Items.Clear();
                    DDLNivelConfidencialidad.Items.Add(new ListItem {
                        Value = "0", Text = "Seleccione una opción"
                    });
                    foreach (DataRow item in vDatos.Rows)
                    {
                        DDLNivelConfidencialidad.Items.Add(new ListItem {
                            Value = item["idConfidencialidad"].ToString(), Text = item["nombre"].ToString()
                        });
                    }
                }

                vQuery = "[RSP_Documentacion] 19";
                vDatos = vConexion.obtenerDataTable(vQuery);
                if (vDatos.Rows.Count > 0)
                {
                    LBReferencia.Items.Clear();
                    foreach (DataRow item in vDatos.Rows)
                    {
                        LBReferencia.Items.Add(new ListItem {
                            Value = item["idDocumento"].ToString(), Text = item["codigo"].ToString() + " - " + item["nombre"].ToString()
                        });
                    }
                }

                vQuery = "[RSP_Documentacion] 28";
                vDatos = vConexion.obtenerDataTable(vQuery);
                if (vDatos.Rows.Count > 0)
                {
                    DDLPropietario.Items.Clear();
                    DDLPropietario.Items.Add(new ListItem {
                        Value = "0", Text = "Seleccione una opción"
                    });
                    foreach (DataRow item in vDatos.Rows)
                    {
                        DDLPropietario.Items.Add(new ListItem {
                            Value = item["idEmpleado"].ToString(), Text = item["nombre"].ToString()
                        });
                    }
                }

                vQuery = "[RSP_Documentacion] 20";
                vDatos = vConexion.obtenerDataTable(vQuery);
                if (vDatos.Rows.Count > 0)
                {
                    DDLGrupos.Items.Clear();
                    DDLGrupos.Items.Add(new ListItem {
                        Value = "0", Text = "Seleccione una opción"
                    });
                    foreach (DataRow item in vDatos.Rows)
                    {
                        DDLGrupos.Items.Add(new ListItem {
                            Value = item["idGrupo"].ToString(), Text = item["nombre"].ToString()
                        });
                    }
                }

                vQuery = "[RSP_Documentacion] 16";
                vDatos = vConexion.obtenerDataTable(vQuery);
                if (vDatos.Rows.Count > 0)
                {
                    LBxAreas.Items.Clear();
                    foreach (DataRow item in vDatos.Rows)
                    {
                        LBxAreas.Items.Add(new ListItem {
                            Value = item["idDepartamento"].ToString(), Text = item["nombre"].ToString()
                        });
                    }
                }
            }catch (Exception ex) {
                Mensaje(ex.Message, WarningType.Danger);
            }
        }