예제 #1
0
파일: list.cs 프로젝트: orapow/x.yc
        protected override XResp Execute()
        {
            var r = new Resp_List();

            if (hasc == 1)
            {
                var tree = new XTree();
                tree.LoadList += tree_LoadList;
                var dt = DateTime.Now;
                tree.InitTree("", 5);
                Debug.WriteLine("tree.init:" + (DateTime.Now - dt).TotalMilliseconds);
                dt      = DateTime.Now;
                r.items = tree.OutTree();
                Debug.WriteLine("tree.out:" + (DateTime.Now - dt).TotalMilliseconds);
            }
            else
            {
                var q = from m in DB.x_dict
                        where m.code == code && m.upval == "0"
                        select new
                {
                    name = m.name,
                    cid  = m.value,
                    img  = m.img
                };

                r.items = q.Skip((page - 1) * limit).Take(limit);
                r.count = q.Count();
            }
            return(r);
        }
예제 #2
0
        protected override Web.Com.XResp Execute()
        {
            var tree = new XTree();

            tree.LoadList += tree_LoadList;
            tree.InitTree("");
            var r = new Resp_List();

            r.items = tree.OutTree();
            return(r);
        }
예제 #3
0
        protected override void InitDict()
        {
            var tree = new XTree();

            tree.LoadList += tree_LoadList;
            tree.InitTree("");
            var list = tree.OutTree();

            list.Insert(0, new item()
            {
                id = "0", name = "无"
            });
            dict.Add("dict", list);
        }
예제 #4
0
        protected override XResp Execute()
        {
            var r = new Resp_List();

            var tree = new XTree();

            tree.LoadList += tree_LoadList;
            tree.InitTree("", 5);

            var data = tree.OutTree();

            if (!string.IsNullOrEmpty(key))
            {
                r.items = data.Where(o => o.name.Contains(key)).ToList();
            }
            else
            {
                r.items = data;
            }

            return(r);
        }