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); }
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); }
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); }
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); }