SVN r941
SVN-Revision: r941
This commit is contained in:
@@ -431,7 +431,7 @@ namespace Lskj.Control
|
||||
page.SizeChanged += OnPageSizeChanged;
|
||||
|
||||
// 2️⃣ 先生成“左侧”父明细控件
|
||||
System.Windows.Forms.Control leftCtrl = CreateDetailControl(model, dataCaches);
|
||||
System.Windows.Forms.Control leftCtrl = CreateDetailControl(page, model, dataCaches);
|
||||
int position = int.TryParse(IniHelper.Read($"base_TabPageMain_{model.Id}"), out int value) ? value : 0; // 0 是转换失败时的默认值
|
||||
if (hasRight && isGridmerge)
|
||||
{
|
||||
@@ -454,9 +454,8 @@ namespace Lskj.Control
|
||||
foreach (var child in rightChildren.OrderBy(c => c.Orderid))
|
||||
{
|
||||
XtraTabPage childPage = new XtraTabPage { Text = child.DetailName };
|
||||
System.Windows.Forms.Control childCtrl = CreateDetailControl(child, dataCaches);
|
||||
System.Windows.Forms.Control childCtrl = CreateDetailControl(childPage, child, dataCaches);
|
||||
childPage.Controls.Add(childCtrl);
|
||||
childPage.Tag = childCtrl;
|
||||
rightTab.TabPages.Add(childPage);
|
||||
}
|
||||
split.Panel2.Controls.Add(rightTab);
|
||||
@@ -466,12 +465,10 @@ namespace Lskj.Control
|
||||
if (leftCtrl is GridControlEx g1)
|
||||
{
|
||||
g1.GridView.FocusedRowChanged += (s, e) => RefreshRightTab(rightTab, g1);
|
||||
RefreshRightTab(rightTab, g1); // 首次加载
|
||||
page.Tag = leftCtrl;
|
||||
RefreshRightTab(rightTab, g1);// 首次加载
|
||||
}
|
||||
else if (leftCtrl is ModuleGridEx mg)
|
||||
{
|
||||
page.Tag = mg.GridControlObj;
|
||||
var g2 = mg.GridControlObj;
|
||||
g2.GridView.FocusedRowChanged += (s, e) => RefreshRightTab(rightTab, g2);
|
||||
RefreshRightTab(rightTab, g2); // 首次加载
|
||||
@@ -482,16 +479,7 @@ namespace Lskj.Control
|
||||
{
|
||||
/* ── 普通明细 ─────────────────────────────────────── */
|
||||
page.Controls.Add(leftCtrl);
|
||||
if (leftCtrl is ModuleGridEx mg)
|
||||
{
|
||||
page.Tag = mg.GridControlObj;
|
||||
}
|
||||
else
|
||||
{
|
||||
page.Tag = leftCtrl;
|
||||
}
|
||||
}
|
||||
|
||||
/* 3️⃣ 加入到容器 & 索引字典 */
|
||||
this.xtc_container.TabPages.Add(page);
|
||||
var dtp = new DetailTabPageModel
|
||||
@@ -999,9 +987,7 @@ namespace Lskj.Control
|
||||
/// <param name="dataCaches"></param>
|
||||
/// <param name="isGridmerge"></param>
|
||||
/// <returns></returns>
|
||||
private System.Windows.Forms.Control CreateDetailControl(GridDetailModel model,
|
||||
Dictionary<object, Hashtable> dataCaches,
|
||||
bool isGridmerge = true)
|
||||
private System.Windows.Forms.Control CreateDetailControl(System.Windows.Forms.Control parentControl, GridDetailModel model, Dictionary<object, Hashtable> dataCaches, bool isGridmerge = true)
|
||||
{
|
||||
|
||||
GridDetailModel[] isMeage = _gridDetail.Cast<GridDetailModel>().Where(x => x.DetailName.Equals(model.DetailName)).ToArray();
|
||||
@@ -1029,6 +1015,7 @@ namespace Lskj.Control
|
||||
chartEx.SetCharts(dtChartParams);
|
||||
chartEx.SetChartRightMenus(dtBaseGridRightMenus, this.Model, OnGridViewRightCallBack);
|
||||
chartEx.Tag = model;
|
||||
parentControl.Tag = chartEx;
|
||||
return chartEx;
|
||||
}
|
||||
|
||||
@@ -1040,6 +1027,7 @@ namespace Lskj.Control
|
||||
: new ExcelControlEx();
|
||||
excelEx.Dock = DockStyle.Fill;
|
||||
excelEx.Tag = model;
|
||||
parentControl.Tag = excelEx;
|
||||
return excelEx;
|
||||
}
|
||||
|
||||
@@ -1076,6 +1064,7 @@ namespace Lskj.Control
|
||||
webView.Dock = DockStyle.Fill;
|
||||
webView.AllowDownload = !forbidDownload;
|
||||
webView.Tag = model;
|
||||
parentControl.Tag = webView;
|
||||
webView.FrmLoad(url);
|
||||
return webView;
|
||||
}
|
||||
@@ -1086,6 +1075,7 @@ namespace Lskj.Control
|
||||
: new FrmWebBrowser();
|
||||
webView.Dock = DockStyle.Fill;
|
||||
webView.Tag = model;
|
||||
parentControl.Tag = webView;
|
||||
webView.FrmLoad(url);
|
||||
return webView;
|
||||
}
|
||||
@@ -1113,6 +1103,7 @@ namespace Lskj.Control
|
||||
FrmProductSched frmProductSched = new FrmProductSched();
|
||||
frmProductSched.Dock = DockStyle.Fill;
|
||||
frmProductSched.Tag = model;
|
||||
parentControl.Tag = frmProductSched;
|
||||
frmProductSched.InitializeControl(mainModel);
|
||||
frmProductSched.DataModel.TopSearchObj.ButtonObj.Visible = false;
|
||||
return frmProductSched;
|
||||
@@ -1138,6 +1129,7 @@ namespace Lskj.Control
|
||||
modulePanel.OperatePanelControlObj.Visible = false;
|
||||
modulePanel.SpeciesPanelControlObj.Visible = false;
|
||||
modulePanel.Tag = model;
|
||||
parentControl.Tag = modulePanel;
|
||||
return modulePanel;
|
||||
}
|
||||
|
||||
@@ -1196,8 +1188,8 @@ namespace Lskj.Control
|
||||
if (model.MrpConditionTab) ReplaceControlEx = detailEx.ModuleGridObj.GridControlObj;
|
||||
detailEx.ModuleGridObj.VisibleSearchPanel = Model.IsDetailSearch || model.DetailSearch;
|
||||
detailEx.ModuleGridObj.GridControlObj.Tag = model;
|
||||
//return detailEx;
|
||||
return detailEx.ModuleGridObj.GridControlObj;
|
||||
parentControl.Tag = detailEx.ModuleGridObj.GridControlObj;
|
||||
return detailEx;
|
||||
}
|
||||
|
||||
/* ───── 6. 只读网格(单明细) ───────────────────────────── */
|
||||
@@ -1220,8 +1212,8 @@ namespace Lskj.Control
|
||||
: new GridControlEx();
|
||||
|
||||
gridEx.Dock = DockStyle.Fill;
|
||||
gridEx.Tag = model;
|
||||
gridEx.Model = this.Model;
|
||||
gridEx.Tag = model;
|
||||
|
||||
if (!dataCaches.GetValue(model, "GridColumns", out DataTable dtGridColumns))
|
||||
dtGridColumns = model.GridColumns;
|
||||
@@ -1272,7 +1264,8 @@ namespace Lskj.Control
|
||||
plMain.Controls.Add(gridEx);
|
||||
parent.Controls.Add(plMain);
|
||||
parent.Controls.Add(plBottom);
|
||||
return gridEx;
|
||||
parentControl.Tag = gridEx;
|
||||
return parent;
|
||||
}
|
||||
else if (isMeage.Count() > 1 && isGridmerge)
|
||||
{
|
||||
@@ -1287,6 +1280,7 @@ namespace Lskj.Control
|
||||
tabMultipledetails.InitTabPages(isMeage);
|
||||
tabMultipledetails.Dock = DockStyle.Fill;
|
||||
tabMultipledetails.Tag = model;
|
||||
parentControl.Tag = tabMultipledetails;
|
||||
return tabMultipledetails;
|
||||
}
|
||||
/* ───── 7. 普通 ModuleGridEx 明细 ──────────────────────── */
|
||||
@@ -1388,472 +1382,10 @@ namespace Lskj.Control
|
||||
if (model.AutoRefresh && !_UnRefresh && isGridmerge)
|
||||
gridEx.SearchObj.SearchGrid();
|
||||
|
||||
//return gridEx;
|
||||
return gridEx.GridControlObj;
|
||||
parentControl.Tag = gridEx.GridControlObj;
|
||||
return gridEx;
|
||||
}
|
||||
}
|
||||
|
||||
///// <summary>
|
||||
///// <para>说明:绑定选项卡</para>
|
||||
///// <para>创建人:龚宇超</para>
|
||||
///// <para>创建日期:2018-01-09</para>
|
||||
///// <para>修改人:</para>
|
||||
///// <para>修改日期:</para>
|
||||
///// <para>修改备注:</para>
|
||||
///// <para>版本:1.0</para>
|
||||
///// </summary>
|
||||
//public void InitTabPages(List<GridDetailModel> gridDetail, bool isGridmerge = true, bool isAddPages = false)
|
||||
//{
|
||||
// this._gridDetail = gridDetail;
|
||||
// if (!isAddPages)
|
||||
// {
|
||||
// this.xtc_container.TabPages.Clear();
|
||||
// }
|
||||
// string DetaiName = string.Empty;
|
||||
|
||||
// Dictionary<object, Hashtable> dataCaches = Model != null ? Model.DataCaches : null;
|
||||
|
||||
// foreach (GridDetailModel model in this._gridDetail)
|
||||
// {
|
||||
// object control = PageControlsDic.ContainsKey(model) ? PageControlsDic[model] : null;
|
||||
// bool hasControl = control != null;
|
||||
// if (DetaiName.Equals(model.DetailName) && isGridmerge) continue;
|
||||
// GridDetailModel[] isMeage = gridDetail.Cast<GridDetailModel>().Where(x => x.DetailName.Equals(model.DetailName)).ToArray();
|
||||
// XtraTabPage page = new XtraTabPage();
|
||||
// page.SizeChanged += OnPageSizeChanged;
|
||||
// page.Text = model.DetailName;
|
||||
|
||||
// if (SystemInfo.Instance.GridRowFontSize > 0)
|
||||
// {
|
||||
// //页签大小
|
||||
// FontFamily fontFamily = page.Appearance.Header.Font.FontFamily;
|
||||
// page.Appearance.Header.Font = new System.Drawing.Font(fontFamily, SystemInfo.Instance.GridRowFontSize);
|
||||
// }
|
||||
|
||||
// if (model.IsChart)
|
||||
// {
|
||||
// ChartControlEx chartEx = hasControl && control is ChartControlEx ? (ChartControlEx)control : new ChartControlEx();
|
||||
// chartEx.Dock = DockStyle.Fill;
|
||||
// chartEx.transverseHistogram = model.transverseHistogram;
|
||||
// //chartEx.SetCharts(BaseModuleImpl.GetChartParams(model.FormKey));
|
||||
// //chartEx.SetChartRightMenus(BaseModuleImpl.GetBaseGridRightMenus(model.FormKey), this.Model, OnGridViewRightCallBack);
|
||||
// if (!dataCaches.GetValue(chartEx, "ChartParams", out DataTable dtChartParams))
|
||||
// {
|
||||
// dtChartParams = BaseModuleImpl.GetChartParams(model.FormKey);
|
||||
// }
|
||||
// if (!dataCaches.GetValue(chartEx, "ChartRightMenus", out DataTable dtBaseGridRightMenus))
|
||||
// {
|
||||
// dtBaseGridRightMenus = BaseModuleImpl.GetBaseGridRightMenus(model.FormKey);
|
||||
// }
|
||||
// chartEx.SetCharts(dtChartParams);
|
||||
// chartEx.SetChartRightMenus(dtBaseGridRightMenus, this.Model, OnGridViewRightCallBack);
|
||||
// chartEx.Tag = model;
|
||||
// page.Tag = chartEx;
|
||||
// page.Controls.Add(chartEx);
|
||||
// }
|
||||
// else if (model.IsExcel)
|
||||
// {
|
||||
// ExcelControlEx excelEx = hasControl && control is ExcelControlEx ? (ExcelControlEx)control : new ExcelControlEx();
|
||||
// excelEx.Dock = DockStyle.Fill;
|
||||
// excelEx.Tag = model;
|
||||
// page.Tag = excelEx;
|
||||
// page.Controls.Add(excelEx);
|
||||
// }
|
||||
// else if (model.IsWebView)
|
||||
// {
|
||||
// // 加载网页
|
||||
// string url = model.DetailSql.StartsWith("http") ? model.DetailSql : SystemInfo.Instance.OAUrl + model.DetailSql;
|
||||
// //url= System.Web.HttpUtility.UrlEncode(url);
|
||||
// if (SystemInfo.Instance.PrimitiveBrowser)
|
||||
// {
|
||||
// FrmMiniBlink webView = hasControl && control is FrmMiniBlink ? (FrmMiniBlink)control : new FrmMiniBlink();
|
||||
// webView.IsDownVerify = true;
|
||||
// webView.Dock = DockStyle.Fill;
|
||||
// webView.Tag = model;
|
||||
// page.Tag = webView;
|
||||
// page.Controls.Add(webView);
|
||||
// webView.LoadUrl(ReplaceHelper.ReplaceUserInfo(url));
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// FrmWebBrowser webView = hasControl && control is FrmWebBrowser ? (FrmWebBrowser)control : new FrmWebBrowser();
|
||||
// webView.Dock = DockStyle.Fill;
|
||||
// webView.Tag = model;
|
||||
// page.Tag = webView;
|
||||
// page.Controls.Add(webView);
|
||||
// webView.FrmLoad(ReplaceHelper.ReplaceUserInfo(url));
|
||||
// }
|
||||
// }
|
||||
// else if (model.IsWebView2)
|
||||
// {
|
||||
// // 加载网页
|
||||
// string url = model.DetailSql.StartsWith("http") ? model.DetailSql : SystemInfo.Instance.OAUrl + model.DetailSql;
|
||||
// //url= System.Web.HttpUtility.UrlEncode(url);
|
||||
// if (SystemInfo.Instance.PrimitiveBrowser)
|
||||
// {
|
||||
// FrmMiniBlink webView = hasControl && control is FrmMiniBlink ? (FrmMiniBlink)control : new FrmMiniBlink();
|
||||
// webView.Dock = DockStyle.Fill;
|
||||
// webView.Tag = model;
|
||||
// page.Tag = webView;
|
||||
// page.Controls.Add(webView);
|
||||
// webView.LoadUrl(ReplaceHelper.ReplaceUserInfo(url));
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// FrmWebBrowser2 webView = hasControl && control is FrmWebBrowser2 ? (FrmWebBrowser2)control : new FrmWebBrowser2();
|
||||
// webView.Dock = DockStyle.Fill;
|
||||
// webView.Tag = model;
|
||||
// page.Tag = webView;
|
||||
// page.Controls.Add(webView);
|
||||
// webView.FrmLoad(ReplaceHelper.ReplaceUserInfo(url));
|
||||
// }
|
||||
// }
|
||||
// else if (model.IsWebView3)
|
||||
// {
|
||||
// // 加载网页
|
||||
// string url = model.DetailSql.StartsWith("http") ? model.DetailSql : SystemInfo.Instance.OAUrl + model.DetailSql;
|
||||
// //url= System.Web.HttpUtility.UrlEncode(url);
|
||||
// if (SystemInfo.Instance.PrimitiveBrowser)
|
||||
// {
|
||||
// FrmMiniBlink webView = hasControl && control is FrmMiniBlink ? (FrmMiniBlink)control : new FrmMiniBlink();
|
||||
// webView.AllowDownload = false;
|
||||
// webView.Dock = DockStyle.Fill;
|
||||
// webView.Tag = model;
|
||||
// page.Tag = webView;
|
||||
// page.Controls.Add(webView);
|
||||
// webView.LoadUrl(ReplaceHelper.ReplaceUserInfo(url));
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// FrmWebBrowser2 webView = hasControl && control is FrmWebBrowser2 ? (FrmWebBrowser2)control : new FrmWebBrowser2();
|
||||
// webView.Dock = DockStyle.Fill;
|
||||
// webView.Tag = model;
|
||||
// webView.AllowDownload = false;
|
||||
// page.Tag = webView;
|
||||
// page.Controls.Add(webView);
|
||||
// webView.FrmLoad(ReplaceHelper.ReplaceUserInfo(url));
|
||||
// }
|
||||
// }
|
||||
// else if (model.IsAddPanel && isGridmerge)
|
||||
// {
|
||||
// // 加载添加界面
|
||||
// ModulePanelEx modulePanel = hasControl && control is ModulePanelEx ? (ModulePanelEx)control : new ModulePanelEx();
|
||||
// modulePanel.Dock = DockStyle.Fill;
|
||||
|
||||
// if (!dataCaches.GetValue(modulePanel, "BasePrimaryKey", out string primaryKey))
|
||||
// {
|
||||
// primaryKey = BaseImpl.GetBasePrimaryKey(this.Model.ModuleCode);
|
||||
// }
|
||||
// modulePanel.PrimaryKey = primaryKey;
|
||||
// if (!dataCaches.GetValue(modulePanel, "SystemDllRow", out DataRow systemRow))
|
||||
// {
|
||||
// systemRow = MainImpl.GetSystemdllTab(this.Model.ModuleCode);
|
||||
// }
|
||||
// modulePanel.InitializeControl(new ModuleModel(systemRow), this.Model);
|
||||
// //modulePanel.OnAddRecordCallBack += new EventHandler(OnAddRecordCallBack);
|
||||
// //modulePanel.OnCloseCallback += new EventHandler(OnAddRecordCallBack);
|
||||
// modulePanel.OperatePanelControlObj.Visible = false;
|
||||
// modulePanel.SpeciesPanelControlObj.Visible = false;
|
||||
// modulePanel.Tag = model;
|
||||
// page.Tag = modulePanel;
|
||||
// page.Controls.Add(modulePanel);
|
||||
// }
|
||||
// else if (model.IsDetailView)
|
||||
// {
|
||||
// ModuleGridDetailEx DetailEx = hasControl && control is ModuleGridDetailEx ? (ModuleGridDetailEx)control : new ModuleGridDetailEx();
|
||||
// DetailEx.Dock = DockStyle.Fill;
|
||||
// if (!dataCaches.GetValue(DetailEx, "DynamicModel", out DynamicModel dyncModel))
|
||||
// {
|
||||
// dyncModel = new DynamicModuleModel(new string[] { model.DetailName, ERPInfo.Instance.UserId, ERPInfo.Instance.UserName, this.Model.Privilege, model.UnionModule, "0" });
|
||||
// }
|
||||
// if (!dataCaches.GetValue(DetailEx, "SystemDllRow", out DataRow moduleInformation))
|
||||
// {
|
||||
// moduleInformation = MainImpl.GetSystemdllTab(model.UnionModule);
|
||||
// }
|
||||
// if (moduleInformation == null)
|
||||
// {
|
||||
// MessageUtil.Show("没有找到编号为" + model.UnionModule + "的模块信息");
|
||||
// return;
|
||||
// }
|
||||
// if (!dataCaches.GetValue(DetailEx, "SysModel", out model.SystemModel))
|
||||
// {
|
||||
// model.SystemModel = new ModuleModel(moduleInformation);
|
||||
// }
|
||||
// if (!dataCaches.GetValue(DetailEx, "Details", out List<GridDetailModel> details))
|
||||
// {
|
||||
// details = GetDetails(model.SystemModel.ModeCode);//底部多标签表格数据
|
||||
// }
|
||||
|
||||
// DetailEx.GridDetailList = details;
|
||||
// DetailEx.IsDragDetail = IsDragDetail;
|
||||
// DetailEx.TcButtom.OnDetailViewDoubleClickCallBack += OnDetailGridViewDoubleClick;
|
||||
// DetailEx.TcButtom.OnDragCompleteCallback += OnDragGridCompleted;
|
||||
// DetailEx.InitializeControl(model.SystemModel, dyncModel);//初始化控件
|
||||
// if (!Model.DataCaches.GetValue(DetailEx, "BaseGridRightMenus", out DataTable rightDt))
|
||||
// {
|
||||
// rightDt = rightDt = BaseModuleImpl.GetBaseGridRightMenus(model.UnionModule, ModuleType.MrpClickBtn);
|
||||
// }
|
||||
// if ((rightDt != null && rightDt.Rows.Count > 0) || this.isMrpDetail)
|
||||
// {
|
||||
// this.isMrpDetail = true;
|
||||
// //gridEx.VisibleMrpSearchPanel = true;
|
||||
// }
|
||||
// if (IsDragDetail && this.ParentGridEx != null && model.IsDrag)
|
||||
// {
|
||||
// // 拖拽模式,绑定拖拽对象
|
||||
// //GridDragGrid dragGrid = new GridDragGrid(DetailEx.ModuleGridObj.GridControlObj.GridView, this.ParentGridEx.GridView);
|
||||
// //dragGrid.OnDragComplete += new GridFragGridCompleteEventHandler(OnDragGridCompleted);
|
||||
// }
|
||||
// if (this.MrpParentGridEx != null && model.IsMrpDrag)//mrp拖拽
|
||||
// {
|
||||
// GridDragGrid dragGrid = new GridDragGrid(this.MrpParentGridEx.GridView, DetailEx.ModuleGridObj.GridControlObj.GridView);
|
||||
// dragGrid.OnDragComplete += new GridFragGridCompleteEventHandler(OnMrpDragGridCompleted);
|
||||
// }
|
||||
// if (this.MrpDetailGridEx != null && model.IsMrpDrag)//mrp拖拽
|
||||
// {
|
||||
// GridDragGrid dragGrid = new GridDragGrid(this.MrpDetailGridEx.GridView, DetailEx.ModuleGridObj.GridControlObj.GridView);
|
||||
// dragGrid.OnDragComplete += new GridFragGridCompleteEventHandler(OnMrpDragGridCompleted);
|
||||
// }
|
||||
// if (this.isMrpDetail && this.OnMrpBtnClickCallback != null)//当前为mrp模块
|
||||
// {
|
||||
// DetailEx.ModuleGridObj.RightGridCallBack += this.OnMrpBtnClickCallback;
|
||||
// }
|
||||
// if (model.MrpConditionTab )
|
||||
// {
|
||||
// this.ReplaceControlEx = DetailEx.ModuleGridObj.GridControlObj;
|
||||
// }
|
||||
// DetailEx.ModuleGridObj.VisibleSearchPanel = Model.IsDetailSearch || model.DetailSearch;
|
||||
// DetailEx.ModuleGridObj.GridControlObj.Tag = model;
|
||||
// page.Tag = DetailEx.ModuleGridObj.GridControlObj;
|
||||
// page.Controls.Add(DetailEx);
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// if (model.IsReadOnly && isMeage.Count() == 1)
|
||||
// {
|
||||
// PanelControl plBottom = new PanelControl();
|
||||
// plBottom.Dock = DockStyle.Bottom;
|
||||
// plBottom.Visible = false;
|
||||
// PanelControl plMain = new PanelControl();
|
||||
// plMain.Dock = DockStyle.Fill;
|
||||
// GridControlEx gridEx = null;
|
||||
// if (model.AutoMultiHeader == 1)
|
||||
// {
|
||||
// gridEx = hasControl && control is BandedGridControlEx ? (BandedGridControlEx)control : new BandedGridControlEx();
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// gridEx = hasControl && control is GridControlEx ? (GridControlEx)control : new GridControlEx();
|
||||
// }
|
||||
// gridEx.Dock = DockStyle.Fill;
|
||||
// gridEx.Tag = model;
|
||||
// gridEx.Parent = plMain;
|
||||
// gridEx.Model = this.Model;
|
||||
// if (!dataCaches.GetValue(model, "GridColumns", out DataTable dtGridColumns))
|
||||
// {
|
||||
// dtGridColumns = model.GridColumns;
|
||||
// }
|
||||
// gridEx.SetReadOnlyColumns(dtGridColumns, model.GridCustomColumnKey);
|
||||
// //gridEx.SetGridRightMenus(BaseModuleImpl.GetBaseGridRightMenus(model.FormKey), this.Model, OnGridViewRightCallBack);
|
||||
// //gridEx.SetGridRowColors(BaseModuleImpl.GetBaseGridRowColors(model.FormKey));
|
||||
// if (!dataCaches.GetValue(gridEx, "BaseGridRightMenus", out DataTable dtBaseGridRightMenus))
|
||||
// {
|
||||
// dtBaseGridRightMenus = BaseModuleImpl.GetBaseGridRightMenus(model.FormKey);
|
||||
// }
|
||||
// if (!dataCaches.GetValue(gridEx, "BaseGridRowColors", out DataTable dtBaseGridRowColors))
|
||||
// {
|
||||
// dtBaseGridRowColors = BaseModuleImpl.GetBaseGridRowColors(model.FormKey);
|
||||
// }
|
||||
// gridEx.SetGridRightMenus(dtBaseGridRightMenus, this.Model, OnGridViewRightCallBack);
|
||||
// gridEx.SetGridRowColors(dtBaseGridRowColors);
|
||||
|
||||
// if (model.IsCheck == 1)//加载复选框
|
||||
// {
|
||||
// GridDragGrid.GridAddCheckBox(gridEx.GridView);
|
||||
// }
|
||||
// if (model.LoadFilter)//加载筛选行
|
||||
// {
|
||||
// gridEx.GridView.OptionsView.ShowAutoFilterRow = true;
|
||||
// }
|
||||
// if (IsDragDetail && this.ParentGridEx != null && model.IsDrag)
|
||||
// {
|
||||
// // 拖拽模式,绑定拖拽对象
|
||||
// GridDragGrid dragGrid = new GridDragGrid(gridEx.GridView, this.ParentGridEx.GridView);
|
||||
// dragGrid.OnDragComplete += new GridFragGridCompleteEventHandler(OnDragGridCompleted);
|
||||
// }
|
||||
// if (this.MrpParentGridEx != null && model.IsMrpDrag)//mrp拖拽
|
||||
// {
|
||||
// GridDragGrid dragGrid = new GridDragGrid(this.MrpParentGridEx.GridView, gridEx.GridView);
|
||||
// dragGrid.OnDragComplete += new GridFragGridCompleteEventHandler(OnMrpDragGridCompleted);
|
||||
// }
|
||||
// if (this.MrpDetailGridEx != null && model.IsMrpDrag)//mrp拖拽
|
||||
// {
|
||||
// GridDragGrid dragGrid = new GridDragGrid(this.MrpDetailGridEx.GridView, gridEx.GridView);
|
||||
// dragGrid.OnDragComplete += new GridFragGridCompleteEventHandler(OnMrpDragGridCompleted);
|
||||
// }
|
||||
// if (model.MrpConditionTab)
|
||||
// {
|
||||
// this.ReplaceControlEx = gridEx;
|
||||
// }
|
||||
// // 加载配置查询条件
|
||||
// if (Model != null && Model.IsDetailSearch)
|
||||
// {
|
||||
// plBottom.Visible = true;
|
||||
// MyControl searchObj = new MyControl(model.DetailSql, gridEx);
|
||||
// if (!dataCaches.GetValue(gridEx, "CustomQueryFields", out DataTable dtCustomQueryFields))
|
||||
// {
|
||||
// dtCustomQueryFields = BaseModuleImpl.GetCustomQueryFields(model.FormKey);
|
||||
// }
|
||||
// plBottom.Height = searchObj.InitSearchControl(dtCustomQueryFields, plBottom);
|
||||
// }
|
||||
// page.Tag = gridEx;
|
||||
// page.Controls.AddRange(new PanelControl[] { plBottom, plMain });
|
||||
// }
|
||||
// else if (isMeage.Count() > 1 && isGridmerge)
|
||||
// {
|
||||
// DetaiName = model.DetailName;
|
||||
// TabMultipledetails tabMultipledetails = hasControl && control is TabMultipledetails ? (TabMultipledetails)control : new TabMultipledetails();
|
||||
// tabMultipledetails.Model = this.Model;
|
||||
// tabMultipledetails.ParentGridEx = this.ParentGridEx;
|
||||
// tabMultipledetails.ParentControlEx = this.ParentControlEx;
|
||||
// tabMultipledetails.IsDragDetail = this.IsDragDetail;
|
||||
// tabMultipledetails.Model = this.Model;
|
||||
// tabMultipledetails.DrgaParentPrimaryKey = this.DrgaParentPrimaryKey;
|
||||
// tabMultipledetails.InitTabPages(isMeage);
|
||||
// tabMultipledetails.Dock = DockStyle.Fill;
|
||||
// tabMultipledetails.Tag = model;
|
||||
// page.Tag = tabMultipledetails;
|
||||
// page.Controls.Add(tabMultipledetails);
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// ModuleGridEx gridEx = hasControl && control is ModuleGridEx ? (ModuleGridEx)control : new ModuleGridEx();
|
||||
// if (!dataCaches.GetValue(gridEx, "DynamicModel", out DynamicModel dyncModel))
|
||||
// {
|
||||
// dyncModel = new DynamicModuleModel(new string[] { model.DetailName, ERPInfo.Instance.UserId, ERPInfo.Instance.UserName, this.Model.Privilege, model.UnionModule, "0" });
|
||||
// }
|
||||
// if (!dataCaches.GetValue(gridEx, "SystemDllRow", out DataRow moduleInformation))
|
||||
// {
|
||||
// moduleInformation = MainImpl.GetSystemdllTab(model.UnionModule);
|
||||
// }
|
||||
// if (moduleInformation == null)
|
||||
// {
|
||||
// MessageUtil.Show("没有找到编号为" + model.UnionModule + "的模块信息");
|
||||
// return;
|
||||
// }
|
||||
// if (!dataCaches.GetValue(gridEx, "SysModel", out model.SystemModel))
|
||||
// {
|
||||
// model.SystemModel = new ModuleModel(moduleInformation);
|
||||
// }
|
||||
|
||||
|
||||
// if (Model != null)
|
||||
// {
|
||||
// if (!dataCaches.GetValue(gridEx, "ParentPrimaryKey", out string primaryKey))
|
||||
// {
|
||||
// primaryKey = BaseImpl.GetBasePrimaryKey(Model.ModuleCode);
|
||||
// }
|
||||
// model.SystemModel.ParmaryKey = primaryKey;
|
||||
// }
|
||||
// gridEx.OnSaveGridCallBack += OnDetailSaveGridCallBack;
|
||||
// gridEx.DetailRightGridCallBack += OnDetailRightCallback;
|
||||
|
||||
// gridEx.Name = "gridEx";
|
||||
// gridEx.IsDetail = true;
|
||||
// gridEx.Dock = DockStyle.Fill;
|
||||
// gridEx.OperShortMode = Model.IsDetailSearch; // 不显示简短模式
|
||||
// gridEx.VisibleSearchPanel = Model.IsDetailSearch || model.DetailSearch;
|
||||
|
||||
// if (!dataCaches.GetValue(gridEx, "UnionBaseGridRightMenus", out DataTable rightDt))
|
||||
// {
|
||||
// rightDt = BaseModuleImpl.GetBaseGridRightMenus(model.UnionModule, ModuleType.MrpClickBtn);
|
||||
// }
|
||||
// if ((rightDt != null && rightDt.Rows.Count > 0) || this.isMrpDetail)
|
||||
// {
|
||||
// this.isMrpDetail = true;
|
||||
// gridEx.VisibleMrpSearchPanel = true;
|
||||
// }
|
||||
// gridEx.VisibleOperPanel = !model.IsReadOnly;
|
||||
// gridEx.InitializeControl(model.SystemModel, dyncModel);
|
||||
// gridEx.GridControlObj.Tag = model;
|
||||
// gridEx.ParentControlEx = this.ParentControlEx;
|
||||
// gridEx.ParentGridEx = this.ParentGridEx;
|
||||
// gridEx.ParentKeyField = string.IsNullOrEmpty(model.UnionParentField) ? model.SystemModel.ParmaryKey : model.UnionParentField;
|
||||
// gridEx.DetailKeyField = model.UnionValue;
|
||||
// gridEx.GridControlObj.ParentControl = gridEx.SearchObj;
|
||||
// if (model.IsCheck == 1)//加载复选框
|
||||
// {
|
||||
// GridDragGrid.GridAddCheckBox(gridEx.GridControlObj.GridView);
|
||||
|
||||
// //判断父表格是否是复选框
|
||||
// if (model.RecordDetailsCheckbox&& ParentGridEx!=null && ParentGridEx.GridView.OptionsSelection.MultiSelect == true)
|
||||
// {
|
||||
// gridEx.TagName = model.DetailName;
|
||||
// gridEx.GridControlObj.GridView.SelectionChanged += GridView_SelectionChanged;
|
||||
// }
|
||||
// }
|
||||
// if (model.LoadFilter)//加载筛选行
|
||||
// {
|
||||
// gridEx.GridControlObj.GridView.OptionsView.ShowAutoFilterRow = true;
|
||||
// }
|
||||
// if (this.ParentGridEx != null && model.IsDrag)//IsDragDetail &&
|
||||
// {
|
||||
// gridEx.GridControlObj.GridView.DoubleClick += OnDetailGridViewDoubleClick;
|
||||
// // 拖拽模式,绑定拖拽对象
|
||||
// if (model.IsDrag)
|
||||
// {
|
||||
// GridDragGrid dragGrid = new GridDragGrid(gridEx.GridControlObj.GridView, this.ParentGridEx.GridView);
|
||||
// dragGrid.OnDragComplete += new GridFragGridCompleteEventHandler(OnDragGridCompleted);
|
||||
// }
|
||||
// }
|
||||
// if (this.MrpParentGridEx != null && model.IsMrpDrag)//mrp拖拽
|
||||
// {
|
||||
// GridDragGrid dragGrid = new GridDragGrid(this.MrpParentGridEx.GridView, gridEx.GridControlObj.GridView);
|
||||
// dragGrid.OnDragComplete += new GridFragGridCompleteEventHandler(OnMrpDragGridCompleted);
|
||||
// }
|
||||
// if (this.MrpDetailGridEx != null && model.IsMrpDrag)//mrp拖拽
|
||||
// {
|
||||
// GridDragGrid dragGrid = new GridDragGrid(this.MrpDetailGridEx.GridView, gridEx.GridControlObj.GridView);
|
||||
// dragGrid.OnDragComplete += new GridFragGridCompleteEventHandler(OnMrpDragGridCompleted);
|
||||
// }
|
||||
// if (this.isMrpDetail && this.OnMrpBtnClickCallback != null)//当前为mrp模块
|
||||
// {
|
||||
// gridEx.RightGridCallBack += this.OnMrpBtnClickCallback;
|
||||
// }
|
||||
// if (model.MrpConditionTab)
|
||||
// {
|
||||
// this.ReplaceControlEx = gridEx.GridControlObj;
|
||||
// }
|
||||
// if (model.AutoRefresh && !_UnRefresh && isGridmerge)
|
||||
// gridEx.SearchObj.SearchGrid();
|
||||
// page.Tag = gridEx.GridControlObj;
|
||||
// page.Controls.Add(gridEx);
|
||||
// }
|
||||
// }
|
||||
// this.xtc_container.TabPages.Add(page);
|
||||
// DetailTabPageModel detailTabPageModel = new DetailTabPageModel();
|
||||
// detailTabPageModel.TabPageIndex = this._gridDetail.IndexOf(model);
|
||||
// detailTabPageModel.DetailTabPage = page;
|
||||
// detailTabPageModel.DetailModel = model;
|
||||
// if (!string.IsNullOrEmpty(model.ParentModuleCode))
|
||||
// {
|
||||
// string ParentModuleCode = model.ParentModuleCode.ToLower();
|
||||
// if (this.DetailTabPagesDic.ContainsKey(ParentModuleCode))
|
||||
// {
|
||||
// List<DetailTabPageModel> detailTabPageModels = this.DetailTabPagesDic[ParentModuleCode];
|
||||
// detailTabPageModels.Add(detailTabPageModel);
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// List<DetailTabPageModel> detailTabPageModels = new List<DetailTabPageModel>();
|
||||
// detailTabPageModels.Add(detailTabPageModel);
|
||||
// this.DetailTabPagesDic.Add(ParentModuleCode, detailTabPageModels);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 主表和当前页签中表格配置了复选框时,记录当前页签表格的选中记录
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user