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

            var dbQuery = ModTourService.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("Tour", 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;
        }
Ejemplo n.º 2
0
        public void ActionIndex(MTourModel model)
        {
            if (ViewPage.CurrentPage.MenuID > 0)
            {
                MenuID = ViewPage.CurrentPage.MenuID;
            }

            var dbQuery = ModTourService.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("Tour", 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;
        }