Пример #1
0
 public override void Bind(AjaxGridContext context)
 {
     var store = FileBucketMetaStores.Current;
     Metas = store.LoadAll()
                  .OrderBy(x => x.CreatedAt)
                  .ToList();
 }
Пример #2
0
        public override void Bind(AjaxGridContext context)
        {
            SliderId = Convert.ToInt32(context.QueryString["sliderId"]);

            var slider = NhSession.Get<Slider>(SliderId);

            List.DataSource = slider.Items.OrderBy(x => x.DisplayOrder).ThenBy(x => x.Id);
            List.DataBind();
        }
Пример #3
0
        public override void Bind(AjaxGridContext context)
        {
            var roles = NhSession.Query<Role>().OrderBy(x => x.Name).ThenBy(x => x.Id).Paging(Pager.PageSize);

            List.DataSource = roles.Page(context.PageIndex);
            List.DataBind();

            Pager.RecordCount = roles.Count;
            Pager.PageIndex = context.PageIndex;
        }
Пример #4
0
 public override void Bind(AjaxGridContext context)
 {
     var directory = new DirectoryInfo(Server.MapPath("~/App_Data/Backups"));
     if (directory.Exists)
     {
         var files = directory.GetFiles().Where(f => !f.IsHidden()).ToList();
         List.DataSource = files;
         List.DataBind();
     }
 }
Пример #5
0
        public override void Bind(AjaxGridContext context)
        {
            var logs = NhSession.Query<LogEntry>()
                                .OrderByDescending(x => x.UtcTimestamp)
                                .Paging(Pager.PageSize);

            Items = logs.Page(context.PageIndex).ToList();

            Pager.RecordCount = logs.Count;
            Pager.PageIndex = context.PageIndex;
        }
Пример #6
0
        public override void Bind(AjaxGridContext context)
        {
            var langs = NhSession.Query<FrontendLanguage>()
                                 .OrderBy(x => x.Name)
                                 .Paging(Pager.PageSize);

            List.DataSource = langs.Page(context.PageIndex);
            List.DataBind();

            Pager.RecordCount = langs.Count;
            Pager.PageIndex = context.PageIndex;
        }
Пример #7
0
        public override void Bind(AjaxGridContext context)
        {
            var sliders = NhSession.Query<Slider>()
                                   .OrderBy(x => x.UtcCreatedAt)
                                   .Paging(Pager.PageSize);

            List.DataSource = sliders.Page(context.PageIndex);
            List.DataBind();

            Pager.RecordCount = sliders.Count;
            Pager.PageIndex = context.PageIndex;
        }
Пример #8
0
        public override void Bind(AjaxGridContext context)
        {
            var redirects = NhSession.Query<CustomRedirect>()
                                     .OrderByDescending(x => x.Priority)
                                     .ThenBy(x => x.Id)
                                     .Paging(Pager.PageSize);

            List.DataSource = redirects.Page(context.PageIndex);
            List.DataBind();

            Pager.RecordCount = redirects.Count;
            Pager.PageIndex = context.PageIndex;
        }
Пример #9
0
        public override void Bind(AjaxGridContext context)
        {
            var users = NhSession.Query<User>()
                                 .Where(u => !u.IsSuperAdmin)
                                 .OrderBy(u => u.UserName)
                                 .ThenByDescending(u => u.Id)
                                 .Paging(Pager.PageSize);

            List.DataSource = users.Page(context.PageIndex);
            List.DataBind();

            Pager.RecordCount = users.Count;
            Pager.PageIndex = context.PageIndex;
        }
Пример #10
0
        public static string LoadGridHtml(AjaxGridContext context)
        {
            // This try catch is useful when debugging
            try
            {
                var controlPath = context.GetGridControlVirtualPath(HttpContext.Current.Request.FilePath);
                var control = (AjaxGridUserControlBase)ControlHelper.LoadControl(controlPath);
                control.Bind(context);

                return ControlHelper.RenderControl(control);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Пример #11
0
 public override void Bind(AjaxGridContext context)
 {
     CurrentPath = context.QueryString.TryGetValue("path", FileExplorer.AllowedUploadPaths.First());
     List.DataSource = FileExplorer.List(CurrentPath);
     List.DataBind();
 }
Пример #12
0
 public abstract void Bind(AjaxGridContext context);