Example #1
0
        /// <summary>
        /// 数据信息工整
        /// </summary>
        public static void FixModules()
        {
            BLL.modules bmodules = new BLL.modules();
            var         list     = bmodules.GetList();

            for (int i = 0; i < list.Count; i++)
            {
                var item        = list[i];
                var itempath    = item.path;
                var itempathArr = itempath.Trim('-').Split('-');
                var pathdeep    = itempathArr.Length;

                var innerList  = bmodules.GetList().FindAll(c => c.path.IndexOf(itempath) > -1);
                var realModule = bmodules.GetList().Find(c => c.path == itempath);//绝对存在

                if (realModule != null)
                {
                    if (innerList.Count > 1)
                    {
                        realModule.stem     = 1;
                        realModule.haschild = 1;
                    }
                    else
                    {
                        realModule.stem     = 0;
                        realModule.haschild = 0;
                    }

                    bmodules.Update(realModule);
                }
            }
        }
Example #2
0
        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/plain";
            if (HttpContext.Current.Session[userKey] != null)
            {
                #region code
                list = bmodules.GetList();
                nodeTable.Append("[");
                MyLoop(0, 0);
                nodeTable.Append("]");
                str = "{\"code\":1,\"data\":" + JsonConvert.SerializeObject(nodeTable.Replace("]},]", "]}]")).Replace("]},]", "]}]") + "}";
                #endregion
            }
            else
            {
                str = "{\"code\":-1,\"msg\":\"权限错误\"}";
            }

            context.Response.Write(str);
        }
Example #3
0
        /// <summary>
        /// 删除外键数据相关
        /// </summary>
        /// <param name="ids"></param>
        public static void FixModulesExt(string ids)
        {
            BLL.modules bmodules = new BLL.modules();
            var         arr      = ids.Split(',');

            for (int i = 0; i < arr.Length; i++)
            {
                var id     = arr[i];
                var module = bmodules.Get(Int32.Parse(id));

                if (module != null)
                {
                    var list = bmodules.GetList().FindAll(c => c.path.IndexOf(module.path) > -1);
                    for (int j = 0; j < list.Count; j++)
                    {
                        var sub = list[j];
                        bmodules.Del(sub.id);
                    }
                }
            }
        }