public void AddOrUpdateAllCfgDefinitionVersion(CfgDefinitionVersion model)
 {
     if (model.DefVerId != Guid.Empty)
     {
         _cfgManagerDao.UpdateAllCfgDefinitionVersion(model);
     }
     else
     {
         model.DefVerId = Guid.NewGuid();
         _cfgManagerDao.InsertCfgDefinitionVersion(model);
     }
 }
示例#2
0
        public ActionResult CfgDefinitionVersionAdd(Guid defId)
        {
            var cfgDef = _cfgManagerService.GetCfgDefinition(defId);

            if (cfgDef == null)
            {
                throw new InkeyException(InkeyErrorCodes.CommonFailure, "配置Id无效");
            }
            var data = new CfgDefinitionVersion();

            data.DefId = cfgDef.DefId;
            data.Name  = cfgDef.Name;
            data.Title = cfgDef.Title;
            return(View("CfgDefinitionVersionEdit", data));
        }
示例#3
0
        public ActionResult SaveCfgDefinitionVersion(CfgDefinitionVersion model)
        {
            InkeyResult result = new InkeyResult();
            Version     ver;

            if (Version.TryParse(model.Version, out ver))
            {
                model.Version = VersionHelper.FormatVersion(model.Version).ToString();
                _cfgManagerService.AddOrUpdateAllCfgDefinitionVersion(model);
            }
            else
            {
                result.Code = -101;
                result.Desc = "版本号格式错误";
            }
            return(Json(result));
        }