Exemple #1
0
 public List<MenuGroup> GetMenuGroupList(IList<QueryParameter> list, Sort sort)
 {
     var queryData = Rep.GetMenuGroupList(db);
     var condition = QueryHelp.ToExpression<App.Entity.MenuGroup>(list);
     queryData = queryData.Where(condition);
     queryData = queryData.OrderBy(sort.sort, sort.order.Equals("desc", StringComparison.CurrentCultureIgnoreCase));
     return ToMenuGroupList(ref queryData);
 }
Exemple #2
0
        public JsonResult GetMenuGroupTree(String SysFunctionid)
        {
            List<IDictionary<String, Object>> list = new List<IDictionary<string, object>>();
            Sort sort = new Sort() {
                sort = "Sort",
                order=""
            };
            IList<QueryParameter> queryParameters = new List<QueryParameter>();
            queryParameters.Add(new QueryParameter
            {
                FileName = "SysFunction_Id",
                FileValue = SysFunctionid,
                CompareSymbol = CompareSymbol.StartsWith,
                ConnectSysmbol = ConnectSysmbol.And
            });
            var menugroups = bal.GetMenuGroupList(queryParameters, sort);

            foreach (var item in menugroups)
            {
                IDictionary<String, Object> node = new Dictionary<String, Object>();
                node.Add("id", item.MenuGroup_Id);
                node.Add("text", item.Name);
                node.Add("iconCls", item.Iconic);
                queryParameters = new List<QueryParameter>();
                queryParameters.Add(new QueryParameter
                {
                    FileName = "MenuGroup_Id",
                    FileValue = item.MenuGroup_Id,
                    CompareSymbol = CompareSymbol.StartsWith,
                    ConnectSysmbol = ConnectSysmbol.And
                });

                List<IDictionary<String, Object>> childrenNodes = new List<IDictionary<String, Object>>();
                var menus = bal.GetMenuList(queryParameters, sort);
                foreach (var menu in menus)
                {
                    IDictionary<String, Object> childrennode = new Dictionary<String, Object>();
                    childrennode.Add("id", menu.Menu_Id);
                    childrennode.Add("text", menu.Name);
                    childrennode.Add("iconCls", menu.Iconic);
                    IDictionary<String, Object> attributes = new Dictionary<String, Object>();
                    attributes.Add("url", menu.Url);
                    attributes.Add("ModelId", menu.ModelId);
                    childrennode.Add("attributes", attributes);
                    childrenNodes.Add(childrennode);
                }
                if (childrenNodes.Count > 0)
                    node.Add("state", "closed");
                node.Add("children", childrenNodes);
                list.Add(node);
            }

            return Json(list, JsonRequestBehavior.AllowGet);
        }
Exemple #3
0
 public ActionResult Index()
 {
     Sort sort = new Sort() {
         sort = "Sort",
         order=""
     };
        var list =  bal.GetSysFounctionList(new List<QueryParameter>(), sort);
     return View(list);
 }
Exemple #4
0
 public List<SysSample> GetList(string queryStr, Sort sort)
 {
     var queryData = Rep.GetList(db);
     queryData = queryData.OrderBy(sort.sort, sort.order.Equals("desc", StringComparison.CurrentCultureIgnoreCase));
     return ToSysSampleList(ref queryData);
 }