diff --git a/插件库/Lskj.Control/Model/CommonMenu.cs b/插件库/Lskj.Control/Model/CommonMenu.cs index fb9664c..d75629c 100644 --- a/插件库/Lskj.Control/Model/CommonMenu.cs +++ b/插件库/Lskj.Control/Model/CommonMenu.cs @@ -384,7 +384,7 @@ namespace Lskj.Control.Model paramList[9] }; string maintabFocusedRowJson = ""; - if (BaseGridView.GetFocusedDataRow() != null) + if (BaseGridView != null && BaseGridView.GetFocusedDataRow() != null) { maintabFocusedRowJson = BaseGridView.GetFocusedDataRow().ToJsonObject(); // 假设 ToJsonObject() 是将对象转换为 JSON 字符串的方法 } diff --git a/插件库/Lskj.Control/Model/ControlModel.cs b/插件库/Lskj.Control/Model/ControlModel.cs index 7b143b3..f3e2c30 100644 --- a/插件库/Lskj.Control/Model/ControlModel.cs +++ b/插件库/Lskj.Control/Model/ControlModel.cs @@ -298,4 +298,4 @@ namespace Lskj.Control.Model /// 条件 /// public string SplicingConditions; - /// 返回保存成功于否 public bool SaveBaseModuleData(string menuCode, string tableName, string primaryKey, ref string primaryValue, bool isAdd = true, string leftField = "", bool isTip = true, int newVer = 0) { - //保存前执行某个右键 - if (!string.IsNullOrEmpty(SystemModel.BeforeSaveExec)) - { - DataRow menuRow = BaseModuleImpl.GetBaseGridRightMenuById(SystemModel.BeforeSaveExec); - if (menuRow != null) - { - CommonMenu menu = new CommonMenu(Model, this, MainGridEx); - //menu.ApplyBefore += new CommonToolApplyEventHandler(OnMenuApplyBefore); - //menu.DynamicLinkAfter += new CommonToolAfterDynamicLinkEventHandler(OnDynamicLinkAfter); - StaticControl.RightMenuGridView = MainGridEx.GridView; - StaticControl.RightMenuMyControl = this; - menu.Apply(menuRow); - if (!menu.issuccess) - { - return false; - } - } - } string execSql = string.Empty; if (string.IsNullOrWhiteSpace(tableName)) { @@ -2958,6 +2940,7 @@ namespace Lskj.Control.Model //保存成功 if (newVer == 1 && saveModel.BaseSaveType == SaveType.Add) saveModel.FieldValue = primaryValue = saveModel.FaultMsg; + this.PrimaryValue = primaryValue; #region 修改保存成功后调用API if (ApiHelper.IsExecEventApi(Interface.Api.OperateEvent.AfterModuleDataChange, saveModel.MenuCode, 0)) { @@ -3014,6 +2997,25 @@ namespace Lskj.Control.Model } } #endregion + #region 保存后执行某个右键 + if (!string.IsNullOrEmpty(SystemModel.AfterSaveExec)) + { + DataRow menuRow = BaseModuleImpl.GetBaseGridRightMenuById(SystemModel.AfterSaveExec); + if (menuRow != null) + { + CommonMenu menu = new CommonMenu(Model, this, MainGridEx); + //menu.ApplyBefore += new CommonToolApplyEventHandler(OnMenuApplyBefore); + //menu.DynamicLinkAfter += new CommonToolAfterDynamicLinkEventHandler(OnDynamicLinkAfter); + //StaticControl.RightMenuGridView = MainGridEx.GridView; + StaticControl.RightMenuMyControl = this; + menu.Apply(menuRow); + if (!menu.issuccess) + { + return false; + } + } + } + #endregion //if (Autogrowcolumn.Equals(primaryKey, StringComparison.CurrentCultureIgnoreCase)) //{ // primaryValue = "LskjIdebtity" + SqlHelper.ExecuteScalar(string.Format("SELECT {0} FROM P_EmployeePostTab WHERE {0} = @@IDENTITY", Autogrowcolumn)) + "";