void CargarPlanesAcreditar() { try { consultas.Parameters = null; consultas.Parameters = new[] { new SqlParameter { ParameterName = "@idusuario", Value = usuario.IdContacto } }; var dtPlanesAcreditar = consultas.ObtenerDataTable("MD_PlanesAcreditarUsuario"); if (dtPlanesAcreditar.Rows.Count != 0) { HttpContext.Current.Session["dtPlanesAcreditar"] = dtPlanesAcreditar; GrvPlanesAcreditar.DataSource = dtPlanesAcreditar; GrvPlanesAcreditar.DataBind(); } else { GrvPlanesAcreditar.DataSource = dtPlanesAcreditar; GrvPlanesAcreditar.DataBind(); } } catch (Exception ex) { throw new Exception(ex.Message); } }
protected void GrvPlanesAcreditarSorting(object sender, GridViewSortEventArgs e) { var dt = HttpContext.Current.Session["dtPlanesAcreditar"] as DataTable; if (dt != null) { dt.DefaultView.Sort = e.SortExpression + " " + GetSortDirection(e.SortExpression); GrvPlanesAcreditar.DataSource = HttpContext.Current.Session["dtPlanesAcreditar"]; GrvPlanesAcreditar.DataBind(); } }
protected void GrvPlanesAcreditarPageIndexChanging(object sender, GridViewPageEventArgs e) { GrvPlanesAcreditar.PageIndex = e.NewPageIndex; GrvPlanesAcreditar.DataSource = HttpContext.Current.Session["dtPlanesAcreditar"]; GrvPlanesAcreditar.DataBind(); }