示例#1
0
        public JsonResult InsertAppData(NodeRequestParam param)
        {
            JsonData        json          = new JsonData();
            IAppDataService appSetService = IocMvcFactoryHelper.GetInterface <IAppDataService>();

            json = appSetService.Add(new AppModel()
            {
                AppName = param.Name,
                AppCode = param.Code
            });
            return(Json(json));
        }
示例#2
0
        public JsonResult SaveAppSetting(NodeRequestParam param)
        {
            IAppSettingService appSetService = IocMvcFactoryHelper.GetInterface <IAppSettingService>();
            JsonData           json          = appSetService.Add(new CategoryItems()
            {
                ItemDesc   = param.Desc,
                Code       = param.Code,
                ParentCode = param.ParentCode,
                Name       = param.Name,
                ParentId   = param.ParentId,
                ItemValue  = param.Value
            });

            return(Json(json));
        }
        public JsonResult SaveSpecialSpellName(NodeRequestParam param)
        {
            JsonData json = new JsonData();

            if (string.IsNullOrEmpty(param.Name))
            {
            }
            ISpecialSpellNameService appSetService = IocMvcFactoryHelper.GetInterface <ISpecialSpellNameService>();

            json = appSetService.Add(new SpecialSpellName()
            {
                Name = param.Name[0].ToString(),//只读取第一个字符
                Code = param.Code
            });
            return(Json(json));
        }
示例#4
0
        public JsonResult EditAppSetting(NodeRequestParam node)
        {
            Common.Data.JsonData json = new JsonData()
            {
                Result = true
            };
            node.Code = string.Empty;//这个接口不运行修改编码【为实现子节点直接相互联动,需要另一接口进行控制】
            IAppSettingService appService = IocMvcFactoryHelper.GetInterface <IAppSettingService>();

            try
            {
                if (node.ParentId == -1)
                {
                    node.ParentCode = InitAppSetting.DefaultAppsettingRootCode;
                }
                json.Success = appService.Update(new CategoryItems()
                {
                    Id         = int.Parse(node.Id),
                    ParentId   = node.ParentId,
                    ParentCode = node.ParentCode,
                    Name       = node.Name,
                    ItemDesc   = node.Desc,
                    ItemValue  = node.Value
                });
                if (json.Success)
                {//更新系统配置
                    InitAppSetting.AppSettingItemsInDB = RefreshAppSetting.QueryAllAppSetting(appService);
                    RefreshAppSetting.RefreshFileVersion();
                }
            }
            catch (Exception ex)
            {
                json.Message = ex.Message;
            }
            return(Json(json));
        }