public void AddOrUpdateAllCfgDefinitionVersion(CfgDefinitionVersion model) { if (model.DefVerId != Guid.Empty) { _cfgManagerDao.UpdateAllCfgDefinitionVersion(model); } else { model.DefVerId = Guid.NewGuid(); _cfgManagerDao.InsertCfgDefinitionVersion(model); } }
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)); }
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)); }