Beispiel #1
0
        public void AddModule(CreateModuleInfo Module)
        {
            var moduleKey = "";

            if (!string.IsNullOrEmpty(Module.ParentKey))
            {
                moduleKey = string.Format("{0}.Modules.{1}", Module.ParentKey, Module.Name);
            }
            else if (!string.IsNullOrEmpty(Module.BusinessKey))
            {
                moduleKey = string.Format("BusinessSystem.{0}.Modules.{1}", Module.BusinessKey, Module.Name);
            }
            else
            {
                throw new Exception("必须指定业务系统或者父级模块的Key");
            }

            if (_DisableKey.Contains(Module.Name))
            {
                throw new Exception(string.Format("使用了模块保留关键字:{0}", Module.Name));
            }

            if (string.IsNullOrEmpty(Module.Name))
            {
                throw new Exception("模块Key不能为空");
            }

            var module = new ConfigEntity()
            {
                Key       = moduleKey,
                Value     = Module.Text,
                IsDeleted = false,
                Type      = "1"
            };

            _IBaseConfig.Add(module);

            addProperty(moduleKey, "src", Module.Src);
            addProperty(moduleKey, "param", Module.Param);
            addProperty(moduleKey, "tab", Module.Tab.ToString());
        }
Beispiel #2
0
 public void AddModule(CreateModuleInfo Module)
 {
     _IModule.AddModule(Module);
 }