Esempio n. 1
0
        private void CargarGrid(ref GridView grid, int idGrid)
        {
            lblError.Text   = string.Empty;
            grid.DataSource = null;
            grid.DataBind();
            try
            {
                //SesionUsu.DependenciaB = DDLDependencia.SelectedValue;
                //SesionUsu.BusquedaB = txtBuscar.Text;
                //SesionUsu.StatusB = DDLStatus.SelectedValue;
                //SesionUsu.TipoPersonalB = DDLTipoEmpleado.SelectedValue;


                DataTable dt = new DataTable();
                grid.DataSource = dt;
                grid.DataSource = GetList(idGrid);
                grid.DataBind();
                Celdas = new Int32[] { };
                if (grid.Rows.Count > 0)
                {
                    CNComun.HideColumns(grid, Celdas);
                }
            }
            catch (Exception ex)
            {
                lblError.Text = ex.Message;
            }
        }
        private void CargarGridDetalle(List <Pres_Documento_Detalle> ListDocDet)
        {
            lblError.Text = string.Empty;
            try
            {
                grdDetalles.DataSource = ListDocDet;
                grdDetalles.DataBind();
                Sumatoria(grdDetalles);
                Celdas = new Int32[] { 3, 4, 7, 9 };

                if (grdDetalles.Rows.Count > 0)
                {
                    ddlTipoEnc.Enabled       = false;
                    ddlFuente_F.Enabled      = false;
                    ddlMesInicialDet.Enabled = false;
                    ddlDepen.Enabled         = false;
                    if (ddlTipoEnc.SelectedValue == "MN" && SesionUsu.Editar == 0)
                    {
                        Celdas = new Int32[] { 3, 3, 4, 7 };
                    }
                    //if (Convert.ToString(grdDocumentos.SelectedRow.Cells[8].Text) == "Editar" || Convert.ToString(grdDocumentos.SelectedRow.Cells[8].Text) == "Ver")
                    //    ddlFuente_F.SelectedValue = ListDocDet.ElementAt(0).Desc_Codigo_Prog.Substring(25, 5);
                    lblFF.Text = grdDetalles.Rows[0].Cells[4].Text.Substring(25, 5);
                    ddlMesInicialDet.SelectedValue = grdDetalles.Rows[0].Cells[6].Text.PadLeft(2, '0');
                }
                else
                {
                    ddlTipoEnc.Enabled       = true;
                    ddlFuente_F.Enabled      = true;
                    ddlMesInicialDet.Enabled = true;
                    ddlDepen.Enabled         = true;
                    lblFF.Text = string.Empty;
                }
                CNComun.HideColumns(grdDetalles, Celdas);
            }
            catch (Exception ex)
            {
                lblError.Text = ex.Message;
            }
        }
 private void CargarGrid(ref GridView grid)
 {
     lblError.Text   = string.Empty;
     grid.DataSource = null;
     grid.DataBind();
     try
     {
         DataTable dt = new DataTable();
         grid.DataSource = dt;
         grid.DataSource = GetList();
         grid.DataBind();
         Celdas = new Int32[] { };
         if (grid.Rows.Count > 0)
         {
             CNComun.HideColumns(grid, Celdas);
         }
     }
     catch (Exception ex)
     {
         lblError.Text = ex.Message;
     }
 }
Esempio n. 4
0
 private void CargarGrid()
 {
     try
     {
         DataTable dt = new DataTable();
         grvControl_Cierre.DataSource = dt;
         grvControl_Cierre.DataSource = GetList();
         grvControl_Cierre.DataBind();
         if (grvControl_Cierre.Rows.Count > 0)
         {
             CNComun.HideColumns(grvControl_Cierre, Celdas);
         }
     }
     catch (Exception ex)
     {
         lblError.Text = ex.Message;
     }
 }
Esempio n. 5
0
 private void CargarGrid(ref GridView grid, int idGrid)
 {
     lblError.Text   = string.Empty;
     grid.DataSource = null;
     grid.DataBind();
     try
     {
         DataTable dt = new DataTable();
         grid.DataSource = dt;
         grid.DataSource = GetList(idGrid);
         grid.DataBind();
         Celdas = new Int32[] { };
         if (grid.Rows.Count > 0)
         {
             CNComun.HideColumns(grid, Celdas);
         }
     }
     catch (Exception ex)
     {
         ScriptManager.RegisterStartupScript(this.Page, Page.GetType(), "modal", "mostrar_modal(0, 'Error: " + ex.Message + "');", true);
     }
 }
Esempio n. 6
0
 protected void CargarCapitulos()
 {
     try
     {
         List <Pres_Reportes> List = new List <Pres_Reportes>();
         objReportes.Ejercicio    = SesionUsu.Usu_Ejercicio;
         objReportes.Dependencia  = DDLDependencia.SelectedValue;
         objReportes.DependenciaF = DDLDependencia.SelectedValue;
         objReportes.Fuente       = DDLFuente.SelectedValue;
         CNReportes.ConsultaGrid_Capitulo(ref objReportes, ref List);
         grdCapitulo.DataSource = List;
         grdCapitulo.DataBind();
         Int32[] Celdas = new Int32[] { 1 };
         if (grdCapitulo.Rows.Count > 0)
         {
             CNComun.HideColumns(grdCapitulo, Celdas);
         }
     }
     catch (Exception ex)
     {
         ScriptManager.RegisterStartupScript(this.Page, Page.GetType(), "modal", "mostrar_modal(0, '" + ex.Message + ".')", true);
     }
 }