コード例 #1
0
ファイル: HomeController.cs プロジェクト: yeshusuper/Flh
        public ActionResult Index(String no="")
        {
            var allClasses = _ClassManager.EnabledClasses.ToArray();
            var root = new ClassItem(allClasses, new Classes { no = FlhConfig.CLASSNO_CLASS_PREFIX,name=String.Empty});
            //左上全部,不过可以先查一级和二级
            //右上按后台排序一级
            //下面左边是一级,右边是对应的二级,是一个整体的。都是按排序展示,而且全部展示
            //下面的二级如果放不下就按他的两行,一级是全部展示的

            var model = new IndexPageClassModel();
            model.TopLeftItems = root.Children.OrderByDescending(d => d.Sort).ThenByDescending(d => d.UpdateTime).Take(12).ToArray();
            model.TopRightItems = root.Children.OrderByDescending(d=>d.Sort).ThenByDescending(d=>d.UpdateTime).Take(8).ToArray();
            model.BottomLeftItems = root.Children;
            model.BottomRightItems = root.Children.OrderByDescending(d => d.Sort).ThenByDescending(d => d.UpdateTime).ToArray();
            model.CurrentClassNo = no;
            return View(model);
        }
コード例 #2
0
ファイル: HomeController.cs プロジェクト: pathrough/Flh
        public ActionResult Index(String no = "")
        {
            var allClasses = _ClassManager.EnabledClasses.ToArray();
            var root       = new ClassItem(allClasses, new Classes {
                no = FlhConfig.CLASSNO_CLASS_PREFIX, name = String.Empty
            });
            //左上全部,不过可以先查一级和二级
            //右上按后台排序一级
            //下面左边是一级,右边是对应的二级,是一个整体的。都是按排序展示,而且全部展示
            //下面的二级如果放不下就按他的两行,一级是全部展示的

            var model = new IndexPageClassModel();

            model.TopLeftItems     = root.Children.OrderByDescending(d => d.Sort).ThenByDescending(d => d.UpdateTime).Take(12).ToArray();
            model.TopRightItems    = root.Children.OrderByDescending(d => d.Sort).ThenByDescending(d => d.UpdateTime).Take(8).ToArray();
            model.BottomLeftItems  = root.Children;
            model.BottomRightItems = root.Children.OrderByDescending(d => d.Sort).ThenByDescending(d => d.UpdateTime).ToArray();
            model.CurrentClassNo   = no;
            return(View(model));
        }