From 30f66dfad4ccc9e2795bfaec0e5bfa17e302a111 Mon Sep 17 00:00:00 2001 From: tdx Date: Fri, 27 Jun 2025 10:26:43 +0000 Subject: [PATCH] SVN r809 SVN-Revision: r809 --- .../Model/MenuStrip/BaseMenuStrip.cs | 38 ++++++++++++++++++- .../Model/MenuStrip/RightMenuModel.cs | 10 ++++- 2 files changed, 46 insertions(+), 2 deletions(-) diff --git a/插件库/Lskj.Control/Model/MenuStrip/BaseMenuStrip.cs b/插件库/Lskj.Control/Model/MenuStrip/BaseMenuStrip.cs index ecb2b71..d535a85 100644 --- a/插件库/Lskj.Control/Model/MenuStrip/BaseMenuStrip.cs +++ b/插件库/Lskj.Control/Model/MenuStrip/BaseMenuStrip.cs @@ -43,6 +43,10 @@ namespace Lskj.Control.Model /// public class BaseRightMenu { + /// + /// 最初账套版本 + /// + public DataRow AccountItem; public DataTable MenuTable; public DynamicModel Model; public MyControl ControlObj; @@ -249,10 +253,18 @@ namespace Lskj.Control.Model /// The instance containing the event data. protected virtual void MenuStripItemClick(object sender, EventArgs e) { + ToolStripMenuItem item = sender as ToolStripMenuItem; DXMenuItem items = sender as DXMenuItem; GridRightMenuModel model = item == null ? items.Tag as GridRightMenuModel : item.Tag as GridRightMenuModel; - + if (!string.IsNullOrEmpty(model.UnionZTid)) + { + string condition = string.Format("where ShowName ='{0}'", ERPInfo.Instance.AccountBook); + DataTable dt = MainImpl.GetLedgerList(condition); + DataRow RT = BaseImpl.GetDataRowResult($"select * from p_sydbGroupTab where ID={model.UnionZTid}"); + AccountItem = dt.Rows[0]; + ToDBatching(RT, AccountItem); + } DataRow[] rowArray = GetSelectedRows(); @@ -309,6 +321,29 @@ namespace Lskj.Control.Model MessageUtil.Show(Message, ex.Message); LogHelper.Instance.WriteError(ex); } + finally + { + if(!string.IsNullOrEmpty(model.UnionZTid))ToDBatching(AccountItem, AccountItem); + } + } + /// + /// 启动账套数据源刷新 + /// + protected void ToDBatching(DataRow RT, DataRow firstrow) + { + string serverIP = RT["IP"] + ""; + string dbName = RT["DBName"] + ""; + string dataBook = RT["ShowName"] + ""; + bool isInternal = RT.Table.Columns.Contains("IsInternalNetwork") && !string.IsNullOrEmpty(RT["IsInternalNetwork"] + "") ? "1".Equals(RT["IsInternalNetwork"] + "") : false; + DBConfig.Instance.DataBook = dataBook; + DBConfig.Instance.ServerName = serverIP; + DBConfig.Instance.DataBase = dbName; + DBConfig.Instance.IsInternalNetwork = isInternal; + if (!DBConfig.Instance.CreateConnection()) + { + ToDBatching(firstrow, firstrow); + } + } /// /// 说明:QQ点击 @@ -383,6 +418,7 @@ namespace Lskj.Control.Model /// true if XXXX, false otherwise. public bool ExecRightMenu(GridRightMenuModel model, DataRow[] rows) { + StaticControl.RightMenuGridView = BaseGridView; List paramListEx = model.ParamList; List paramList = null; diff --git a/插件库/Lskj.Control/Model/MenuStrip/RightMenuModel.cs b/插件库/Lskj.Control/Model/MenuStrip/RightMenuModel.cs index 90ffde4..3bbde56 100644 --- a/插件库/Lskj.Control/Model/MenuStrip/RightMenuModel.cs +++ b/插件库/Lskj.Control/Model/MenuStrip/RightMenuModel.cs @@ -291,6 +291,11 @@ namespace Lskj.Control.Model /// The title label object. public string AutomaticSearchId; /// + /// 关联账套id + /// + /// The title label object. + public string UnionZTid; + /// /// 允许不选中行执行右键 /// public bool AllowNullExec { get { return _allowNullExec; } } @@ -433,4 +438,7 @@ namespace Lskj.Control.Model if (item.Table.Columns.Contains("AllowNullExec")) this._allowNullExec = string.IsNullOrWhiteSpace(item["AllowNullExec"] + "") ? false : "1".Equals(item["AllowNullExec"] + ""); if (item.Table.Columns.Contains("ResultSQL")) - this._resultSQL = ite \ No newline at end of file + this._resultSQL = item["ResultSQL"] + ""; + if (item.Table.Columns.Contains("ExecuteFirstCode")) + this.ExecuteFirstCode = item["ExecuteFirstCode"] + ""; + if \ No newline at end of file