diff --git a/插件库/Lskj.PubAccraditation/FrmAccraditation.cs b/插件库/Lskj.PubAccraditation/FrmAccraditation.cs index b951e2f..f521b34 100644 --- a/插件库/Lskj.PubAccraditation/FrmAccraditation.cs +++ b/插件库/Lskj.PubAccraditation/FrmAccraditation.cs @@ -1014,8 +1014,6 @@ namespace Lskj.PubAccraditation dtDetailColumns = BillImpl.GetDetailColumns(this.SysModel.ModuleCode); } this.gridBillInfo.SetEditColumns(dtDetailColumns, GridCustomColumnStruct.AuditPopupDetailGridView + this.BillModelObj.FormKey); - //触发右键回调 - this.gridBillInfo.OnAfterLinkCilk += OnAfterLinkCilkCall; if (!dataCaches.GetValue(gridBillInfo, "BaseGridRightMenus", out DataTable dtGridRightMenu)) { dtGridRightMenu = BaseModuleImpl.GetBaseGridRightMenus(this.AuditModelObj.BillGridMenuFlag + this.SysModel.ModuleCode, ModuleType.BillAuditDetail); @@ -1098,20 +1096,6 @@ namespace Lskj.PubAccraditation this.dbpFP.Visible = !string.IsNullOrWhiteSpace(this.BillModelObj.PopupUnionCode); } - - /// - /// 表格触发右键功能 - /// - /// - /// - private void OnAfterLinkCilkCall(object sender, EventArgs e) - { - string unioright = sender + ""; - DataRow rightrowitem = this.gridBillInfo.gridViewRightMenu.MenuTable.Rows.Cast().FirstOrDefault(x => (x["orderid"] + "").Equals(unioright)); - CommonMenu menu = new CommonMenu(this.SysModel, ControlObj, this.gridBillInfo); - menu.Apply(rightrowitem); - } - /// /// 说明:数据绑定完后刷新数据 /// 创建人:龚宇超 @@ -3419,6 +3403,18 @@ namespace Lskj.PubAccraditation // string result = BaseAuditImpl.Audit(out nextSelectStepCode, out nextSelectStepOper, out string msgText, //this.SysModel, this.SysModel.StepCode, this.SysModel.BillDocumentId, "", this.BillAuditComObj.ProcedureName, "R", this._flowTypeStepModel.RemindSelect, this._auditAdvice, remindOpers, confirmOpers, true, ret); + //反退前调用 + if (ApiHelper.IsExecEventApi(Interface.Api.OperateEvent.BeforeModuleAuditStateChange, this.SysModel.ModuleCode, 0)) + { + ApiHelper apiHelper = new ApiHelper(this.SysModel.ModuleCode, this.SysModel.BillDocumentId, this.BillModelObj.PrimaryKey, this.BillModelObj.MasterTable, 0); + apiHelper.OnEvent(Interface.Api.OperateEvent.BeforeModuleAuditStateChange, Interface.Api.ActionType.AuditBack);//审核 + if (!apiHelper.apiHandler.GetApiSuccess(apiHelper.apiHandlerModels)) + { + DialogResult dialogResult = MessageUtil.Show(ResourceKeys.ForcedFail + "\r\n" + apiHelper.apiResutMsg); + return; + } + } + string result = this.AuditMethod(out nextSelectStepCode, out nextSelectStepOper, out string msgText, this.SysModel, this.SysModel.StepCode, this.SysModel.BillDocumentId, "", this.BillAuditComObj.ProcedureName, "R", this._flowTypeStepModel.RemindSelect, this._auditAdvice, remindOpers, confirmOpers, true, ret); @@ -3427,6 +3423,18 @@ namespace Lskj.PubAccraditation MessageUtil.Show(ResourceKeys.ForcedSuccess); PushHelper push = new PushHelper(this.SysModel.BillDocumentId, this.SysModel.StepCode, this.SysModel.ModuleCode, this._beforeUsers, this._beforeMenuName, this._beforeId); push.Push_Bill_Oper_Message(); + + //反退后调用 + if (ApiHelper.IsExecEventApi(Interface.Api.OperateEvent.AfterModuleAuditStateChange, this.SysModel.ModuleCode, 0)) + { + ApiHelper apiHelper = new ApiHelper(this.SysModel.ModuleCode, this.SysModel.BillDocumentId, this.BillModelObj.PrimaryKey, this.BillModelObj.MasterTable, 0); + apiHelper.OnEvent(Interface.Api.OperateEvent.AfterModuleAuditStateChange, Interface.Api.ActionType.AuditBack); + if (!apiHelper.apiHandler.GetApiSuccess(apiHelper.apiHandlerModels)) + { + MessageUtil.Show(apiHelper.apiResutMsg); + } + } + this.DialogResult = DialogResult.OK; if (refreshThePage != null) { @@ -4497,4 +4505,30 @@ namespace Lskj.PubAccraditation /// /// public void SaveAdditionalModules() - { \ No newline at end of file + { + try + { + foreach (XtraTabPage tabPage in this.tab_basicInfo.TabControlObj.TabPages) + { + GridDetailModel model = this.tab_basicInfo.GetGridDetailModel(tabPage); + + Object moduleObject = tabPage.Controls.Cast().FirstOrDefault(); + if (moduleObject is ModuleGridEx) + { + ModuleGridEx moduleGridEx = moduleObject as ModuleGridEx; + if (moduleGridEx.GridControlObj.IsDataNotSaved() && moduleGridEx.BtnSave.Visible && moduleGridEx.BtnSave.Enabled) + { + moduleGridEx.BtnSave.PerformClick(); + } + } + } + } + catch (Exception ex) + { + string Message = ErrorMessage.PromptErrorMessage(ex); + MessageUtil.Show(Message, ex.Message); + } + } + + } +}