SVN r393
SVN-Revision: r393
This commit is contained in:
+12
-14
@@ -39,8 +39,8 @@ namespace Lskj.ProductiSched
|
|||||||
this.pl_search = new DevExpress.XtraEditors.PanelControl();
|
this.pl_search = new DevExpress.XtraEditors.PanelControl();
|
||||||
this.flowLayoutPanel = new System.Windows.Forms.FlowLayoutPanel();
|
this.flowLayoutPanel = new System.Windows.Forms.FlowLayoutPanel();
|
||||||
this.btnSave = new DevExpress.XtraEditors.SimpleButton();
|
this.btnSave = new DevExpress.XtraEditors.SimpleButton();
|
||||||
this.bandGcBottom = new Lskj.Control.BandedGridControlEx();
|
|
||||||
this.gcRight = new Lskj.Control.GridControlEx();
|
this.gcRight = new Lskj.Control.GridControlEx();
|
||||||
|
this.tabBottom = new Lskj.Control.TabControlEx();
|
||||||
((System.ComponentModel.ISupportInitialize)(this.pl_main)).BeginInit();
|
((System.ComponentModel.ISupportInitialize)(this.pl_main)).BeginInit();
|
||||||
this.pl_main.SuspendLayout();
|
this.pl_main.SuspendLayout();
|
||||||
((System.ComponentModel.ISupportInitialize)(this.splitMainControl)).BeginInit();
|
((System.ComponentModel.ISupportInitialize)(this.splitMainControl)).BeginInit();
|
||||||
@@ -93,7 +93,7 @@ namespace Lskj.ProductiSched
|
|||||||
this.splitLeftControl.Panel1.Controls.Add(this.pltopmain);
|
this.splitLeftControl.Panel1.Controls.Add(this.pltopmain);
|
||||||
this.splitLeftControl.Panel1.Controls.Add(this.pl_mainSearch);
|
this.splitLeftControl.Panel1.Controls.Add(this.pl_mainSearch);
|
||||||
this.splitLeftControl.Panel1.Text = "Panel1";
|
this.splitLeftControl.Panel1.Text = "Panel1";
|
||||||
this.splitLeftControl.Panel2.Controls.Add(this.bandGcBottom);
|
this.splitLeftControl.Panel2.Controls.Add(this.tabBottom);
|
||||||
this.splitLeftControl.Panel2.Text = "Panel2";
|
this.splitLeftControl.Panel2.Text = "Panel2";
|
||||||
this.splitLeftControl.Size = new System.Drawing.Size(997, 679);
|
this.splitLeftControl.Size = new System.Drawing.Size(997, 679);
|
||||||
this.splitLeftControl.SplitterPosition = 353;
|
this.splitLeftControl.SplitterPosition = 353;
|
||||||
@@ -180,17 +180,7 @@ namespace Lskj.ProductiSched
|
|||||||
this.btnSave.Size = new System.Drawing.Size(72, 26);
|
this.btnSave.Size = new System.Drawing.Size(72, 26);
|
||||||
this.btnSave.TabIndex = 40;
|
this.btnSave.TabIndex = 40;
|
||||||
this.btnSave.Text = "保存(&S)";
|
this.btnSave.Text = "保存(&S)";
|
||||||
//
|
|
||||||
// bandGcBottom
|
|
||||||
//
|
|
||||||
this.bandGcBottom.AdapterObj = null;
|
|
||||||
this.bandGcBottom.Dock = System.Windows.Forms.DockStyle.Fill;
|
|
||||||
this.bandGcBottom.Location = new System.Drawing.Point(0, 0);
|
|
||||||
this.bandGcBottom.Margin = new System.Windows.Forms.Padding(4);
|
|
||||||
this.bandGcBottom.Name = "bandGcBottom";
|
|
||||||
this.bandGcBottom.SiftEnumObj = Lskj.Control.GridControlEx.HeaderSiftEnum.Sum;
|
|
||||||
this.bandGcBottom.Size = new System.Drawing.Size(997, 321);
|
|
||||||
this.bandGcBottom.TabIndex = 12;
|
|
||||||
//
|
//
|
||||||
// gcRight
|
// gcRight
|
||||||
//
|
//
|
||||||
@@ -203,6 +193,14 @@ namespace Lskj.ProductiSched
|
|||||||
this.gcRight.Size = new System.Drawing.Size(315, 679);
|
this.gcRight.Size = new System.Drawing.Size(315, 679);
|
||||||
this.gcRight.TabIndex = 11;
|
this.gcRight.TabIndex = 11;
|
||||||
//
|
//
|
||||||
|
// tabBottom
|
||||||
|
//
|
||||||
|
this.tabBottom.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||||
|
this.tabBottom.Location = new System.Drawing.Point(0, 0);
|
||||||
|
this.tabBottom.Name = "tabBottom";
|
||||||
|
this.tabBottom.Size = new System.Drawing.Size(997, 321);
|
||||||
|
this.tabBottom.TabIndex = 14;
|
||||||
|
//
|
||||||
// FrmProductSched
|
// FrmProductSched
|
||||||
//
|
//
|
||||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
|
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
|
||||||
@@ -219,4 +217,4 @@ namespace Lskj.ProductiSched
|
|||||||
((System.ComponentModel.ISupportInitialize)(this.pltopmain)).EndInit();
|
((System.ComponentModel.ISupportInitialize)(this.pltopmain)).EndInit();
|
||||||
this.pltopmain.ResumeLayout(false);
|
this.pltopmain.ResumeLayout(false);
|
||||||
((System.ComponentModel.ISupportInitialize)(this.pl_mainSearch)).EndInit();
|
((System.ComponentModel.ISupportInitialize)(this.pl_mainSearch)).EndInit();
|
||||||
this.pl_mainSearch.
|
this.pl_m
|
||||||
@@ -6,9 +6,11 @@ using DevExpress.XtraGrid.Columns;
|
|||||||
using DevExpress.XtraGrid.Views.BandedGrid;
|
using DevExpress.XtraGrid.Views.BandedGrid;
|
||||||
using DevExpress.XtraGrid.Views.Base;
|
using DevExpress.XtraGrid.Views.Base;
|
||||||
using DevExpress.XtraGrid.Views.Grid;
|
using DevExpress.XtraGrid.Views.Grid;
|
||||||
|
using DevExpress.XtraTab;
|
||||||
using DevExpress.XtraTreeList;
|
using DevExpress.XtraTreeList;
|
||||||
using DevExpress.XtraTreeList.Columns;
|
using DevExpress.XtraTreeList.Columns;
|
||||||
using DevExpress.XtraTreeList.Nodes;
|
using DevExpress.XtraTreeList.Nodes;
|
||||||
|
using Lskj.Business;
|
||||||
using Lskj.Business.Impl;
|
using Lskj.Business.Impl;
|
||||||
using Lskj.Control;
|
using Lskj.Control;
|
||||||
using Lskj.Control.Model;
|
using Lskj.Control.Model;
|
||||||
@@ -36,6 +38,8 @@ namespace Lskj.ProductiSched
|
|||||||
{
|
{
|
||||||
|
|
||||||
public bool TreeMultiHeader;
|
public bool TreeMultiHeader;
|
||||||
|
public bool isAddBottom;
|
||||||
|
public Control.BandedGridControlEx bandGcBottom;
|
||||||
public ProductDataModel DataModel;
|
public ProductDataModel DataModel;
|
||||||
public FrmProductSched()
|
public FrmProductSched()
|
||||||
{
|
{
|
||||||
@@ -76,25 +80,17 @@ namespace Lskj.ProductiSched
|
|||||||
DataModel.TopSearchObj = new MyControl(DataModel.TopModuleModel.MenuSql, bandGcTop);
|
DataModel.TopSearchObj = new MyControl(DataModel.TopModuleModel.MenuSql, bandGcTop);
|
||||||
}
|
}
|
||||||
DataModel.TopSearchObj.Model = DataModel.TopSysModel;
|
DataModel.TopSearchObj.Model = DataModel.TopSysModel;
|
||||||
DataTable detailsTab = BaseModuleImpl.GetBaseDetailPages(DataModel.TopSysModel.ModuleCode);
|
DataTable detailsTab = BaseModuleImpl.GetBaseDetailPages(DataModel.TopSysModel.ModuleCode);//明细数据
|
||||||
|
List<GridDetailModel> detailsTablist = new List<GridDetailModel>();
|
||||||
if (detailsTab != null)
|
if (detailsTab != null)
|
||||||
{
|
{
|
||||||
if (detailsTab.Rows.Count > 1)
|
foreach (DataRow item in detailsTab.Rows)
|
||||||
{
|
{
|
||||||
string moduleCode = detailsTab.Rows[0]["unionModule"] + "";
|
GridDetailModel detailModel = new GridDetailModel(item,null, GridCustomColumnStruct.BaseDetailGridView);
|
||||||
DataModel.BottomDetailModel = new GridDetailModel(detailsTab.Rows[0], null, GridCustomColumnStruct.BaseDetailGridView);
|
if (detailModel.Orderid == -1)//序号为-1固定配置右键
|
||||||
DataModel.BottomSysModel = new DynamicModel(new string[] { DataModel.TopSysModel.FormText, DataModel.TopSysModel.UserId, DataModel.TopSysModel.UserName, DataModel.TopSysModel.Privilege, moduleCode });
|
|
||||||
DataRow sysRow = MainImpl.GetSystemdllTab(DataModel.BottomSysModel.ModuleCode);
|
|
||||||
DataModel.BottomModuleModel = new ModuleModel(sysRow);
|
|
||||||
DataModel.BottomModuleModel.ParmaryKey = BaseImpl.GetBasePrimaryKey(DataModel.BottomSysModel.ModuleCode);
|
|
||||||
DataModel.BottomGridColumns = BaseModuleImpl.GetBaseGridColumns(DataModel.BottomSysModel.ModuleCode);
|
|
||||||
DataModel.BottomRightMenus = BaseModuleImpl.GetBaseGridRightMenus(DataModel.TopModuleModel.FormKey);
|
|
||||||
DataModel.BottomRowColors = BaseModuleImpl.GetBaseGridRowColors(DataModel.TopModuleModel.FormKey);
|
|
||||||
}
|
|
||||||
if (detailsTab.Rows.Count > 1)
|
|
||||||
{
|
{
|
||||||
string moduleCode = detailsTab.Rows[1]["unionModule"] + "";
|
string moduleCode = detailModel.UnionModule;
|
||||||
DataModel.RightDetailModel = new GridDetailModel(detailsTab.Rows[1], null, GridCustomColumnStruct.BaseDetailGridView);
|
DataModel.RightDetailModel = detailModel;
|
||||||
DataModel.RightSysModel = new DynamicModel(new string[] { DataModel.TopSysModel.FormText, DataModel.TopSysModel.UserId, DataModel.TopSysModel.UserName, DataModel.TopSysModel.Privilege, moduleCode });
|
DataModel.RightSysModel = new DynamicModel(new string[] { DataModel.TopSysModel.FormText, DataModel.TopSysModel.UserId, DataModel.TopSysModel.UserName, DataModel.TopSysModel.Privilege, moduleCode });
|
||||||
DataRow sysRow = MainImpl.GetSystemdllTab(DataModel.RightSysModel.ModuleCode);
|
DataRow sysRow = MainImpl.GetSystemdllTab(DataModel.RightSysModel.ModuleCode);
|
||||||
DataModel.RightModuleModel = new ModuleModel(sysRow);
|
DataModel.RightModuleModel = new ModuleModel(sysRow);
|
||||||
@@ -105,17 +101,50 @@ namespace Lskj.ProductiSched
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
string moduleCode = detailsTab.Rows[0]["unionModule"] + "";
|
detailsTablist.Add(detailModel);
|
||||||
DataModel.RightDetailModel = new GridDetailModel(detailsTab.Rows[0], null, GridCustomColumnStruct.BaseDetailGridView);
|
|
||||||
DataModel.RightSysModel = new DynamicModel(new string[] { DataModel.TopSysModel.FormText, DataModel.TopSysModel.UserId, DataModel.TopSysModel.UserName, DataModel.TopSysModel.Privilege, moduleCode });
|
|
||||||
DataRow sysRow = MainImpl.GetSystemdllTab(DataModel.RightSysModel.ModuleCode);
|
|
||||||
DataModel.RightModuleModel = new ModuleModel(sysRow);
|
|
||||||
DataModel.RightModuleModel.ParmaryKey = BaseImpl.GetBasePrimaryKey(DataModel.RightSysModel.ModuleCode);
|
|
||||||
DataModel.RightGridColumns = BaseModuleImpl.GetBaseGridColumns(DataModel.RightSysModel.ModuleCode);
|
|
||||||
DataModel.RightRightMenus = BaseModuleImpl.GetBaseGridRightMenus(DataModel.TopModuleModel.FormKey);
|
|
||||||
DataModel.RightRowColors = BaseModuleImpl.GetBaseGridRowColors(DataModel.TopModuleModel.FormKey);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
tabBottom.Model = DataModel.TopSysModel;
|
||||||
|
tabBottom.InitTabPages(detailsTablist);
|
||||||
|
this.isAddBottom = detailsTablist.Where(o => o.displayMode != 1 && o.rightVisible != 1 && o.Orderid == -2).ToList().Count>0;
|
||||||
|
|
||||||
|
//if (detailsTab.Rows.Count > 1)
|
||||||
|
//{
|
||||||
|
// string moduleCode = detailsTab.Rows[0]["unionModule"] + "";
|
||||||
|
// DataModel.BottomDetailModel = new GridDetailModel(detailsTab.Rows[0], null, GridCustomColumnStruct.BaseDetailGridView);
|
||||||
|
// DataModel.BottomSysModel = new DynamicModel(new string[] { DataModel.TopSysModel.FormText, DataModel.TopSysModel.UserId, DataModel.TopSysModel.UserName, DataModel.TopSysModel.Privilege, moduleCode });
|
||||||
|
// DataRow sysRow = MainImpl.GetSystemdllTab(DataModel.BottomSysModel.ModuleCode);
|
||||||
|
// DataModel.BottomModuleModel = new ModuleModel(sysRow);
|
||||||
|
// DataModel.BottomModuleModel.ParmaryKey = BaseImpl.GetBasePrimaryKey(DataModel.BottomSysModel.ModuleCode);
|
||||||
|
// DataModel.BottomGridColumns = BaseModuleImpl.GetBaseGridColumns(DataModel.BottomSysModel.ModuleCode);
|
||||||
|
// DataModel.BottomRightMenus = BaseModuleImpl.GetBaseGridRightMenus(DataModel.TopModuleModel.FormKey);
|
||||||
|
// DataModel.BottomRowColors = BaseModuleImpl.GetBaseGridRowColors(DataModel.TopModuleModel.FormKey);
|
||||||
|
//}
|
||||||
|
//if (detailsTab.Rows.Count > 1)
|
||||||
|
//{
|
||||||
|
// string moduleCode = detailsTab.Rows[1]["unionModule"] + "";
|
||||||
|
// DataModel.RightDetailModel = new GridDetailModel(detailsTab.Rows[1], null, GridCustomColumnStruct.BaseDetailGridView);
|
||||||
|
// DataModel.RightSysModel = new DynamicModel(new string[] { DataModel.TopSysModel.FormText, DataModel.TopSysModel.UserId, DataModel.TopSysModel.UserName, DataModel.TopSysModel.Privilege, moduleCode });
|
||||||
|
// DataRow sysRow = MainImpl.GetSystemdllTab(DataModel.RightSysModel.ModuleCode);
|
||||||
|
// DataModel.RightModuleModel = new ModuleModel(sysRow);
|
||||||
|
// DataModel.RightModuleModel.ParmaryKey = BaseImpl.GetBasePrimaryKey(DataModel.RightSysModel.ModuleCode);
|
||||||
|
// DataModel.RightGridColumns = BaseModuleImpl.GetBaseGridColumns(DataModel.RightSysModel.ModuleCode);
|
||||||
|
// DataModel.RightRightMenus = BaseModuleImpl.GetBaseGridRightMenus(DataModel.TopModuleModel.FormKey);
|
||||||
|
// DataModel.RightRowColors = BaseModuleImpl.GetBaseGridRowColors(DataModel.TopModuleModel.FormKey);
|
||||||
|
//}
|
||||||
|
//else
|
||||||
|
//{
|
||||||
|
// string moduleCode = detailsTab.Rows[0]["unionModule"] + "";
|
||||||
|
// DataModel.RightDetailModel = new GridDetailModel(detailsTab.Rows[0], null, GridCustomColumnStruct.BaseDetailGridView);
|
||||||
|
// DataModel.RightSysModel = new DynamicModel(new string[] { DataModel.TopSysModel.FormText, DataModel.TopSysModel.UserId, DataModel.TopSysModel.UserName, DataModel.TopSysModel.Privilege, moduleCode });
|
||||||
|
// DataRow sysRow = MainImpl.GetSystemdllTab(DataModel.RightSysModel.ModuleCode);
|
||||||
|
// DataModel.RightModuleModel = new ModuleModel(sysRow);
|
||||||
|
// DataModel.RightModuleModel.ParmaryKey = BaseImpl.GetBasePrimaryKey(DataModel.RightSysModel.ModuleCode);
|
||||||
|
// DataModel.RightGridColumns = BaseModuleImpl.GetBaseGridColumns(DataModel.RightSysModel.ModuleCode);
|
||||||
|
// DataModel.RightRightMenus = BaseModuleImpl.GetBaseGridRightMenus(DataModel.TopModuleModel.FormKey);
|
||||||
|
// DataModel.RightRowColors = BaseModuleImpl.GetBaseGridRowColors(DataModel.TopModuleModel.FormKey);
|
||||||
|
//}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 设置数据
|
/// 设置数据
|
||||||
@@ -169,13 +198,11 @@ namespace Lskj.ProductiSched
|
|||||||
{
|
{
|
||||||
flowLayoutPanel.Visible = false;
|
flowLayoutPanel.Visible = false;
|
||||||
}
|
}
|
||||||
//下方表格
|
|
||||||
if (DataModel.BottomSysModel != null && !string.IsNullOrEmpty(DataModel.BottomSysModel.ModuleCode))
|
if (isAddBottom)
|
||||||
{
|
{
|
||||||
bandGcBottom.Model = DataModel.BottomSysModel;
|
GridControlEx gridControl = tabBottom.TabControlObj.TabPages[0].Tag as GridControlEx;
|
||||||
bandGcBottom.SetEditColumns(DataModel.BottomGridColumns, GridCustomColumnStruct.BaseMainGridView + DataModel.BottomModuleModel.FormKey);
|
bandGcBottom = gridControl as BandedGridControlEx;
|
||||||
bandGcBottom.SetGridRightMenus(BaseModuleImpl.GetBaseGridRightMenus(DataModel.BottomModuleModel.ModeCode), DataModel.BottomSysModel);
|
|
||||||
bandGcBottom.SetGridRowColors(BaseModuleImpl.GetBaseGridRowColors(DataModel.BottomModuleModel.ModeCode));
|
|
||||||
AddDataColumns(bandGcBottom);
|
AddDataColumns(bandGcBottom);
|
||||||
foreach (GridBand gridBand in bandGcBottom.BandedView.Bands)
|
foreach (GridBand gridBand in bandGcBottom.BandedView.Bands)
|
||||||
{
|
{
|
||||||
@@ -185,7 +212,6 @@ namespace Lskj.ProductiSched
|
|||||||
bandedGridColumn.OptionsColumn.AllowSize = false;
|
bandedGridColumn.OptionsColumn.AllowSize = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
bandGcBottom.BandedView.OptionsBehavior.Editable = false;
|
|
||||||
if (TreeMultiHeader)
|
if (TreeMultiHeader)
|
||||||
{
|
{
|
||||||
OnBandedViewColumnWidthChanged(treebandGcTop.TreeListObj, null);
|
OnBandedViewColumnWidthChanged(treebandGcTop.TreeListObj, null);
|
||||||
@@ -200,6 +226,34 @@ namespace Lskj.ProductiSched
|
|||||||
{
|
{
|
||||||
splitLeftControl.PanelVisibility = DevExpress.XtraEditors.SplitPanelVisibility.Panel1;
|
splitLeftControl.PanelVisibility = DevExpress.XtraEditors.SplitPanelVisibility.Panel1;
|
||||||
}
|
}
|
||||||
|
//下方表格
|
||||||
|
//if (DataModel.BottomSysModel != null && !string.IsNullOrEmpty(DataModel.BottomSysModel.ModuleCode))
|
||||||
|
//{
|
||||||
|
// bandGcBottom.Model = DataModel.BottomSysModel;
|
||||||
|
// bandGcBottom.SetEditColumns(DataModel.BottomGridColumns, GridCustomColumnStruct.BaseMainGridView + DataModel.BottomModuleModel.FormKey);
|
||||||
|
// bandGcBottom.SetGridRightMenus(BaseModuleImpl.GetBaseGridRightMenus(DataModel.BottomModuleModel.ModeCode), DataModel.BottomSysModel);
|
||||||
|
// bandGcBottom.SetGridRowColors(BaseModuleImpl.GetBaseGridRowColors(DataModel.BottomModuleModel.ModeCode));
|
||||||
|
// AddDataColumns(bandGcBottom);
|
||||||
|
// foreach (GridBand gridBand in bandGcBottom.BandedView.Bands)
|
||||||
|
// {
|
||||||
|
// gridBand.OptionsBand.AllowSize = false;
|
||||||
|
// foreach (BandedGridColumn bandedGridColumn in gridBand.Columns)
|
||||||
|
// {
|
||||||
|
// bandedGridColumn.OptionsColumn.AllowSize = false;
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// bandGcBottom.BandedView.OptionsBehavior.Editable = false;
|
||||||
|
// if (TreeMultiHeader)
|
||||||
|
// {
|
||||||
|
// OnBandedViewColumnWidthChanged(treebandGcTop.TreeListObj, null);
|
||||||
|
|
||||||
|
// }
|
||||||
|
// else
|
||||||
|
// {
|
||||||
|
// OnBandedViewColumnWidthChanged(bandGcTop.BandedView, null);
|
||||||
|
// }
|
||||||
|
//}
|
||||||
|
|
||||||
//右侧表格
|
//右侧表格
|
||||||
if (!string.IsNullOrEmpty(DataModel.RightSysModel.ModuleCode))
|
if (!string.IsNullOrEmpty(DataModel.RightSysModel.ModuleCode))
|
||||||
{
|
{
|
||||||
@@ -218,9 +272,11 @@ namespace Lskj.ProductiSched
|
|||||||
splitMainControl.SplitterPositionChanged += OnSplitContainerPositionChanged;
|
splitMainControl.SplitterPositionChanged += OnSplitContainerPositionChanged;
|
||||||
DataModel.TopSearchObj.OnDataSourceBindCallBack += OnDataSourceBindCallBack;
|
DataModel.TopSearchObj.OnDataSourceBindCallBack += OnDataSourceBindCallBack;
|
||||||
DataModel.TopSearchObj.OnSearchAfterCallBack += OnSearchAfterCallBack;
|
DataModel.TopSearchObj.OnSearchAfterCallBack += OnSearchAfterCallBack;
|
||||||
|
if (bandGcBottom != null)
|
||||||
|
{
|
||||||
bandGcBottom.BandedView.LeftCoordChanged += OnBandedViewLeftCoordChanged;
|
bandGcBottom.BandedView.LeftCoordChanged += OnBandedViewLeftCoordChanged;
|
||||||
bandGcBottom.BandedView.CustomDrawColumnHeader += OnCustomDrawColumnHeader;
|
bandGcBottom.BandedView.CustomDrawColumnHeader += OnCustomDrawColumnHeader;
|
||||||
|
}
|
||||||
if (TreeMultiHeader)
|
if (TreeMultiHeader)
|
||||||
{
|
{
|
||||||
// 改为TreeList的事件绑定
|
// 改为TreeList的事件绑定
|
||||||
@@ -282,6 +338,10 @@ namespace Lskj.ProductiSched
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
private void OnTreeListShowingEditor(object sender, CancelEventArgs e)
|
private void OnTreeListShowingEditor(object sender, CancelEventArgs e)
|
||||||
{
|
{
|
||||||
|
if (DataModel.TopModuleModel.HasReport)//报表所有的都不能编辑
|
||||||
|
{
|
||||||
|
e.Cancel = true; // 取消编辑,单元格变灰
|
||||||
|
}
|
||||||
TreeList treeList = sender as TreeList;
|
TreeList treeList = sender as TreeList;
|
||||||
string bj_tig = treeList.FocusedNode.GetValue("bj_tig")?.ToString() ?? "";
|
string bj_tig = treeList.FocusedNode.GetValue("bj_tig")?.ToString() ?? "";
|
||||||
if (treeList == null || treeList.FocusedNode == null) return;
|
if (treeList == null || treeList.FocusedNode == null) return;
|
||||||
@@ -655,6 +715,7 @@ namespace Lskj.ProductiSched
|
|||||||
if (DataModel.TopModuleModel.HasReport) UpdateRowWithDayPlan(focusedRow, dataDayPlan, dateTime);
|
if (DataModel.TopModuleModel.HasReport) UpdateRowWithDayPlan(focusedRow, dataDayPlan, dateTime);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
this.SetDetailGridDataSource(rowItem);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
@@ -704,6 +765,7 @@ namespace Lskj.ProductiSched
|
|||||||
DateTime dateTime = labelDateEdit.TextEdit.DateTime;
|
DateTime dateTime = labelDateEdit.TextEdit.DateTime;
|
||||||
DataTable dataDayPlan = gcRight.GridControl.DataSourceTable().Copy();
|
DataTable dataDayPlan = gcRight.GridControl.DataSourceTable().Copy();
|
||||||
if (DataModel.TopModuleModel.HasReport) UpdateRowWithDayPlan(rowItem, dataDayPlan, dateTime);
|
if (DataModel.TopModuleModel.HasReport) UpdateRowWithDayPlan(rowItem, dataDayPlan, dateTime);
|
||||||
|
this.SetDetailGridDataSource(rowItem);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -712,7 +774,145 @@ namespace Lskj.ProductiSched
|
|||||||
Console.WriteLine(ex.Message);
|
Console.WriteLine(ex.Message);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// <para>说明:下面多数据源刷新</para>
|
||||||
|
/// <para>创建人:王一帆</para>
|
||||||
|
/// <para>创建日期:2017-12-19 </para>
|
||||||
|
/// <para>修改人:</para>
|
||||||
|
/// <para>修改日期:</para>
|
||||||
|
/// <para>修改备注:</para>
|
||||||
|
/// <para>版本:1.0</para>
|
||||||
|
/// </summary>
|
||||||
|
public void SetDetailGridDataSource(DataRow rowItem,XtraTabPage tabPage = null)
|
||||||
|
{
|
||||||
|
if (tabPage != null)
|
||||||
|
{
|
||||||
|
this.SetTabPageDataSource(tabPage, rowItem);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
foreach (XtraTabPage page in this.tabBottom.TabControlObj.TabPages)
|
||||||
|
{
|
||||||
|
if (rowItem != null && page != null)
|
||||||
|
{
|
||||||
|
this.SetTabPageDataSource(page, rowItem);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void SetTabPageDataSource(XtraTabPage tabPage,DataRow rowItem)
|
||||||
|
{
|
||||||
|
GridDetailModel model = this.tabBottom.GetGridDetailModel(tabPage);
|
||||||
|
if (model.Orderid == -2) return;
|
||||||
|
Object moduleObject = tabPage.Controls.Cast<Object>().FirstOrDefault();
|
||||||
|
ModuleGridEx moduleGridEx = null;
|
||||||
|
if (moduleObject is ModuleGridEx)
|
||||||
|
{
|
||||||
|
moduleGridEx = moduleObject as ModuleGridEx;
|
||||||
|
}
|
||||||
|
if (rowItem != null && model != null)
|
||||||
|
{
|
||||||
|
if (!string.IsNullOrEmpty(model.UnionModule) && (string.IsNullOrEmpty(model.UnionValue) && string.IsNullOrEmpty(model.UnionCond))) return;
|
||||||
|
if (tabPage.Tag is FrmWebBrowser)
|
||||||
|
{
|
||||||
|
// 加载网页
|
||||||
|
FrmWebBrowser webView = tabPage.Tag as FrmWebBrowser;
|
||||||
|
string url = ReplaceHelper.ReplaceRowParam(rowItem, ReplaceHelper.ReplaceUserInfo(model.DetailSql));
|
||||||
|
url = url.StartsWith("http") ? url : SystemInfo.Instance.OAUrl + url;
|
||||||
|
//webView.FrmLoad(url);
|
||||||
|
webView.LoadUrl(url);
|
||||||
|
webView.Dock = DockStyle.Fill;
|
||||||
|
webView.Tag = model;
|
||||||
|
}
|
||||||
|
else if (tabPage.Tag is FrmWebBrowser2)
|
||||||
|
{
|
||||||
|
// 加载网页
|
||||||
|
FrmWebBrowser2 webView = tabPage.Tag as FrmWebBrowser2;
|
||||||
|
string url = ReplaceHelper.ReplaceRowParam(rowItem, ReplaceHelper.ReplaceUserInfo(model.DetailSql));
|
||||||
|
url = url.StartsWith("http") ? url : SystemInfo.Instance.OAUrl + url;
|
||||||
|
webView.LoadUrl(url);
|
||||||
|
webView.Dock = DockStyle.Fill;
|
||||||
|
webView.Tag = model;
|
||||||
|
}
|
||||||
|
else if (tabPage.Tag is FrmMiniBlink)
|
||||||
|
{
|
||||||
|
// 加载网页
|
||||||
|
FrmMiniBlink webView = tabPage.Tag as FrmMiniBlink;
|
||||||
|
string url = ReplaceHelper.ReplaceRowParam(rowItem, ReplaceHelper.ReplaceUserInfo(model.DetailSql));
|
||||||
|
url = url.StartsWith("http") ? url : SystemInfo.Instance.OAUrl + url;
|
||||||
|
webView.LoadUrl(url);
|
||||||
|
webView.Dock = DockStyle.Fill;
|
||||||
|
webView.Tag = model;
|
||||||
|
}
|
||||||
|
else if (tabPage.Tag is TabMultipledetails)
|
||||||
|
{
|
||||||
|
TabMultipledetails tabMultipledetails = tabPage.Tag as TabMultipledetails;
|
||||||
|
tabMultipledetails.SetConditionValues(rowItem);
|
||||||
|
GridControlEx grdExMain = (tabMultipledetails.SplitMain.Panel1.Tag as GridControlEx);
|
||||||
|
GridDetailModel MainModel = grdExMain.Tag as GridDetailModel;
|
||||||
|
string searchMainSql = this.GetSearchSql(MainModel, rowItem);
|
||||||
|
DataTable firstTable = MainImpl.GetDataTableResult(searchMainSql);
|
||||||
|
grdExMain.LastSearchSql = searchMainSql;
|
||||||
|
grdExMain.SetGridViewDataSource(firstTable);
|
||||||
|
if (tabMultipledetails.SplitMain.Panel2.Tag is GridControlEx)
|
||||||
|
{
|
||||||
|
GridControlEx grdExAdditional = (tabMultipledetails.SplitMain.Panel2.Tag as GridControlEx);
|
||||||
|
GridDetailModel AdditionalModel = grdExAdditional.Tag as GridDetailModel;
|
||||||
|
string searchAddSql = this.GetSearchSql(AdditionalModel, rowItem);
|
||||||
|
if (!MainModel.IsUnioDetail)
|
||||||
|
{
|
||||||
|
grdExAdditional.LastSearchSql = searchAddSql;
|
||||||
|
grdExAdditional.SetGridViewDataSource(MainImpl.GetDataTableResult(searchAddSql));
|
||||||
|
}
|
||||||
|
//右侧是左侧的明细,左侧没有数据时。右侧赋空值(因为无法触发左侧行改变事件)
|
||||||
|
if (MainModel.IsUnioDetail && firstTable.Rows.Count == 0)
|
||||||
|
{
|
||||||
|
grdExAdditional.LastSearchSql = "";
|
||||||
|
grdExAdditional.SetGridViewDataSource(new DataTable());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (tabMultipledetails.SplitMain.Panel2.Tag is ChartControlEx)
|
||||||
|
{
|
||||||
|
ChartControlEx grdExAdditional = (tabMultipledetails.SplitMain.Panel2.Tag as ChartControlEx);
|
||||||
|
GridDetailModel AdditionalModel = grdExAdditional.Tag as GridDetailModel;
|
||||||
|
string searchAddSql = this.GetSearchSql(AdditionalModel, rowItem);
|
||||||
|
DataTable table = MainImpl.GetDataTableResult(searchAddSql);
|
||||||
|
grdExAdditional.CreateChart(table);
|
||||||
|
}
|
||||||
|
|
||||||
|
tabPage.Text = MainModel.DetailName + "(" + firstTable.Rows.Count + "条)";
|
||||||
|
tabPage.Appearance.Header.ForeColor = firstTable.Rows.Count > 0 ? Color.Red : Color.FromArgb(0, 0, 0);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (model.IsDrag)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
string searchSql = this.GetSearchSql(model, rowItem);
|
||||||
|
if (tabPage.Tag is GridControlEx)
|
||||||
|
{
|
||||||
|
(tabPage.Tag as GridControlEx).LastSearchSql = searchSql;
|
||||||
|
}
|
||||||
|
//DataTable dataTable = MainImpl.GetDataTableResult(searchSql);//明细数据源
|
||||||
|
if (model.DynamicDetails && rowItem.Table.Columns.Contains("DisplayColumns")) //
|
||||||
|
{
|
||||||
|
this.tabBottom.SetGridDisplayColumns(tabPage, rowItem["DisplayColumns"] + "");
|
||||||
|
}
|
||||||
|
this.tabBottom.SetGridDataSource(tabPage, MainImpl.GetDataTableResult(searchSql));
|
||||||
|
if (tabPage.Tag is GridControlEx && (tabPage.Tag as GridControlEx).ParentControl != null)
|
||||||
|
(tabPage.Tag as GridControlEx).ParentControl.SetAllControlValue(rowItem);
|
||||||
|
//配置明细直接根据条件加载
|
||||||
|
if (model.SystemModel != null && 1 == model.SystemModel.isFirstLoad)
|
||||||
|
{
|
||||||
|
(tabPage.Tag as GridControlEx).ParentControl.SearchGrid();
|
||||||
|
tabPage.Text = model.DetailName + "(" + (tabPage.Tag as GridControlEx).ParentControl.GridRowCount + "条)";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (moduleGridEx != null) moduleGridEx.ParentButtonState(rowItem);
|
||||||
|
}
|
||||||
|
}
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 获取查询sql
|
/// 获取查询sql
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -828,7 +1028,7 @@ namespace Lskj.ProductiSched
|
|||||||
/// <param name="e"></param>
|
/// <param name="e"></param>
|
||||||
private void OnBandedViewLeftCoordChanged(object sender, EventArgs e)
|
private void OnBandedViewLeftCoordChanged(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
if (!bandGcBottom.Visible) return;
|
if (!isAddBottom) return;
|
||||||
if (sender == bandGcTop.BandedView)
|
if (sender == bandGcTop.BandedView)
|
||||||
{
|
{
|
||||||
bandGcBottom.BandedView.LeftCoord = bandGcTop.BandedView.LeftCoord;
|
bandGcBottom.BandedView.LeftCoord = bandGcTop.BandedView.LeftCoord;
|
||||||
@@ -895,7 +1095,7 @@ namespace Lskj.ProductiSched
|
|||||||
{
|
{
|
||||||
LabelDateEdit labelDateEdit = baseUserControl as LabelDateEdit;
|
LabelDateEdit labelDateEdit = baseUserControl as LabelDateEdit;
|
||||||
DateTime dateTime = labelDateEdit.TextEdit.DateTime;
|
DateTime dateTime = labelDateEdit.TextEdit.DateTime;
|
||||||
UpdateDynamicColumns(bandGcBottom, dateTime, typeDate);
|
if(isAddBottom)UpdateDynamicColumns(bandGcBottom, dateTime, typeDate);
|
||||||
if (TreeMultiHeader)
|
if (TreeMultiHeader)
|
||||||
{
|
{
|
||||||
UpdateDynamicColumns(treebandGcTop, dateTime, typeDate);
|
UpdateDynamicColumns(treebandGcTop, dateTime, typeDate);
|
||||||
@@ -940,7 +1140,7 @@ namespace Lskj.ProductiSched
|
|||||||
{
|
{
|
||||||
UpdateDynamicColumns(bandGcTop, dateTime, typeDate);
|
UpdateDynamicColumns(bandGcTop, dateTime, typeDate);
|
||||||
}
|
}
|
||||||
UpdateDynamicColumns(bandGcBottom, dateTime, typeDate);
|
if (isAddBottom) UpdateDynamicColumns(bandGcBottom, dateTime, typeDate);
|
||||||
DataTable dataMain = null;
|
DataTable dataMain = null;
|
||||||
DataTable dataDetail = null;
|
DataTable dataDetail = null;
|
||||||
if (TreeMultiHeader)
|
if (TreeMultiHeader)
|
||||||
@@ -960,7 +1160,7 @@ namespace Lskj.ProductiSched
|
|||||||
string isweekcond = DataModel.TopModuleModel.HasReport ? "" : $"and isWeek='{typeDate}'";
|
string isweekcond = DataModel.TopModuleModel.HasReport ? "" : $"and isWeek='{typeDate}'";
|
||||||
sqlValue = $"{ReplaceHelper.ReplaceWhereCond(sqlValue)} and day >= '{dateTime.ToString("yyyy-MM-dd")}' {isweekcond}";
|
sqlValue = $"{ReplaceHelper.ReplaceWhereCond(sqlValue)} and day >= '{dateTime.ToString("yyyy-MM-dd")}' {isweekcond}";
|
||||||
DataTable dataDayPlan = BaseImpl.GetDataTableResult(sqlValue);
|
DataTable dataDayPlan = BaseImpl.GetDataTableResult(sqlValue);
|
||||||
if (bandGcBottom.Visible)
|
if (isAddBottom)
|
||||||
{
|
{
|
||||||
DataTable bottomTab = BuildCTable(dataDetail, dataDayPlan, dateTime, 93);
|
DataTable bottomTab = BuildCTable(dataDetail, dataDayPlan, dateTime, 93);
|
||||||
bandGcBottom.BandedView.GridControl.DataSource = bottomTab;
|
bandGcBottom.BandedView.GridControl.DataSource = bottomTab;
|
||||||
@@ -2163,4 +2363,34 @@ namespace Lskj.ProductiSched
|
|||||||
|
|
||||||
// 对每个动态日期列,从 dtPlan 中查找 billdocument_id 在 keyValues 内,
|
// 对每个动态日期列,从 dtPlan 中查找 billdocument_id 在 keyValues 内,
|
||||||
// 且 ShowDay 等于当前列名的记录,将 amount 累加后再乘以系数
|
// 且 ShowDay 等于当前列名的记录,将 amount 累加后再乘以系数
|
||||||
foreach (stri
|
foreach (string dateCol in dateColumns)
|
||||||
|
{
|
||||||
|
decimal sumAmount = planRows
|
||||||
|
.Where(pr => keyValues.Contains(pr.BillId) && pr.ShowDay == dateCol)
|
||||||
|
.Sum(pr => pr.Amount);
|
||||||
|
// 乘以系数得到实际值
|
||||||
|
newRow[dateCol] = sumAmount * coefficient;
|
||||||
|
}
|
||||||
|
dtC.Rows.Add(newRow);
|
||||||
|
}
|
||||||
|
return dtC;
|
||||||
|
}
|
||||||
|
catch (Exception)
|
||||||
|
{
|
||||||
|
return default;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// 纠正输入异常
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="sender"></param>
|
||||||
|
/// <param name="e"></param>
|
||||||
|
private void OnInvalidValueException(object sender, InvalidValueExceptionEventArgs e)
|
||||||
|
{
|
||||||
|
if (e.Value.Equals(""))
|
||||||
|
{
|
||||||
|
e.ExceptionMode = ExceptionMode.Ignore;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user