Example #1
0
        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);
            }
        }
Example #2
0
        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();
            }
        }
Example #3
0
 protected void GrvPlanesAcreditarPageIndexChanging(object sender, GridViewPageEventArgs e)
 {
     GrvPlanesAcreditar.PageIndex  = e.NewPageIndex;
     GrvPlanesAcreditar.DataSource = HttpContext.Current.Session["dtPlanesAcreditar"];
     GrvPlanesAcreditar.DataBind();
 }