Example #1
0
        public ActionResult Next(long siteId, long menuId, int style, int pageIndex)
        {
            int totalRecord;
            IEnumerable <ArticleModels> items = CustomArticleDAO.GetItems(menuId, 20, pageIndex, out totalRecord);

            ViewBag.ItemPages = CardsDAO.GetPages(items.Select(item => item.CardNo));
            ViewBag.ItemTypes = ArticleDAO.GetItemTypes(items.Select(item => item.ID));
            return(View("NextStyle" + style, items));
        }
Example #2
0
        public ActionResult List(long siteId, long menuId)
        {
            ViewBag.SiteID = siteId;
            ViewBag.MenuID = menuId;

            IEnumerable <CustomArticleModel> items = CustomArticleDAO.GetItems(menuId);

            IEnumerable <long> articleIds = items.Select(item => item.ArticleID);

            ViewBag.ItemTypes = ArticleDAO.GetItemTypes(articleIds);
            ViewBag.ItemMenus = CustomArticleDAO.GetArticleMenus(articleIds);

            return(View(items));
        }
Example #3
0
        public ActionResult Edit(long siteId, long menuId, int?index, string key)
        {
            ViewBag.SiteID = siteId;
            ViewBag.MenuID = menuId;

            //if (Request.HttpMethod == "GET")
            //{
            //    if (index == null)
            //        Utility.ClearSearchValue();
            //    else
            //    {
            //        string prevKey = Utility.GetSearchValue<string>();
            //        if (prevKey != null)
            //            key = prevKey;
            //    }
            //}
            //else if (Request.HttpMethod == "POST")
            //{
            //    Utility.SetSearchValue(key);
            //}
            ViewBag.Key = key;

            Pagination pagination = new Pagination {
                PageIndex = index ?? 1,
                PageSize  = 5
            };

            int totalRecord;
            IEnumerable <CustomArticleListItemModel> items = CustomArticleDAO.GetItems(menuId, key, pagination.PageSize, pagination.PageIndex, out totalRecord);

            pagination.TotalRecord = totalRecord;

            IEnumerable <long> articleIds = items.Select(item => item.ArticleID);

            ViewBag.ItemTypes = ArticleDAO.GetItemTypes(articleIds);
            ViewBag.ItemMenus = CustomArticleDAO.GetArticleMenus(articleIds);

            ViewBag.Pagination = pagination;
            return(View(items));
        }
Example #4
0
        public ActionResult Index(CardsModels model, int?index)
        {
            ViewBag.SiteID = model.SiteID;
            SitePage page = CardsDAO.GetPage(model.No);

            ViewBag.SitePage = page;
            ViewBag.CardNo   = model.No;

            int        pageIndex  = index ?? 1;
            Pagination pagination = new Pagination {
                PageSize = 20, PageIndex = index ?? 1
            };

            int totalRecord;
            IEnumerable <ArticleModels> items = CustomArticleDAO.GetItems(page.MenuID, pagination.PageSize, pagination.PageIndex, out totalRecord);

            ViewBag.ItemTypes = ArticleDAO.GetItemTypes(items.Select(item => item.ID));
            ViewBag.ItemPages = CardsDAO.GetPages(items.Select(item => item.CardNo));

            int style = model.StylesID == 0 ? 1 : model.StylesID;

            return(View("ListStyle" + style, items));
        }
Example #5
0
 public void AddTopArticles(long siteId, long menuId, long[] articleIds)
 {
     CustomArticleDAO.Add(menuId, articleIds);
 }
Example #6
0
 public void Del(long siteId, long menuId, IEnumerable <long> ids)
 {
     CustomArticleDAO.Remove(menuId, ids);
 }
Example #7
0
 public void Sort(long siteId, long menuId, IEnumerable <SortItem> items)
 {
     CustomArticleDAO.Sort(menuId, items);
 }