Exemplo n.º 1
0
        public void ActionIndex(MAlbumModel model)
        {
            if (ViewPage.CurrentPage.MenuID > 0)
               MenuID = ViewPage.CurrentPage.MenuID;

            var dbQuery = ModAlbumService.Instance.CreateQuery()
                            .Where(o => o.Activity == true)
                            .Where(State > 0, o => (o.State & State) == State)
                            .WhereIn(MenuID > 0, o => o.MenuID, WebMenuService.Instance.GetChildIDForWeb_Cache("Album", MenuID, ViewPage.CurrentLang.ID))
                            .OrderByDesc(o => o.Order)
                            .Take(PageSize)
                            .Skip(PageSize * model.Page);

            ViewBag.Data = dbQuery.ToList();
            model.TotalRecord = dbQuery.TotalRecord;
            model.PageSize = PageSize;
            ViewBag.Model = model;
        }
Exemplo n.º 2
0
        public void ActionIndex(MAlbumModel model)
        {
            if (ViewPage.CurrentPage.MenuID > 0)
            {
                MenuID = ViewPage.CurrentPage.MenuID;
            }

            var dbQuery = ModAlbumService.Instance.CreateQuery()
                          .Where(o => o.Activity == true)
                          .Where(State > 0, o => (o.State & State) == State)
                          .WhereIn(MenuID > 0, o => o.MenuID, WebMenuService.Instance.GetChildIDForWeb_Cache("Album", MenuID, ViewPage.CurrentLang.ID))
                          .OrderByDesc(o => o.Order)
                          .Take(PageSize)
                          .Skip(PageSize * model.Page);

            ViewBag.Data      = dbQuery.ToList();
            model.TotalRecord = dbQuery.TotalRecord;
            model.PageSize    = PageSize;
            ViewBag.Model     = model;
        }