SVN r340
SVN-Revision: r340
This commit is contained in:
+85
-45
@@ -30,6 +30,9 @@ namespace Lskj.PubControlDetail
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.splitMainControl = new DevExpress.XtraEditors.SplitContainerControl();
|
||||
this.pl_right = new DevExpress.XtraEditors.PanelControl();
|
||||
this.pl_main = new DevExpress.XtraEditors.XtraScrollableControl();
|
||||
this.splitLeftControl = new DevExpress.XtraEditors.SplitContainerControl();
|
||||
this.pl_mainSearch = new DevExpress.XtraEditors.PanelControl();
|
||||
this.pl_search = new DevExpress.XtraEditors.PanelControl();
|
||||
this.pl_top_fix_search = new DevExpress.XtraEditors.PanelControl();
|
||||
@@ -37,14 +40,17 @@ namespace Lskj.PubControlDetail
|
||||
this.btnFixSearch = new DevExpress.XtraEditors.SimpleButton();
|
||||
this.txtFixKey = new System.Windows.Forms.TextBox();
|
||||
this.label1 = new System.Windows.Forms.Label();
|
||||
this.pl_main = new DevExpress.XtraEditors.XtraScrollableControl();
|
||||
this.pl_buttom = new DevExpress.XtraEditors.PanelControl();
|
||||
this.gcMain = new Lskj.Control.GridControlEx();
|
||||
this.btnClear = new DevExpress.XtraEditors.SimpleButton();
|
||||
this.btnAdd = new DevExpress.XtraEditors.SimpleButton();
|
||||
this.pl_right = new DevExpress.XtraEditors.PanelControl();
|
||||
this.gcMain = new Lskj.Control.GridControlEx();
|
||||
this.pl_buttom = new DevExpress.XtraEditors.PanelControl();
|
||||
this.gcBottom = new Lskj.Control.GridControlEx();
|
||||
((System.ComponentModel.ISupportInitialize)(this.splitMainControl)).BeginInit();
|
||||
this.splitMainControl.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.pl_right)).BeginInit();
|
||||
this.pl_right.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.splitLeftControl)).BeginInit();
|
||||
this.splitLeftControl.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.pl_mainSearch)).BeginInit();
|
||||
this.pl_mainSearch.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.pl_search)).BeginInit();
|
||||
@@ -53,8 +59,6 @@ namespace Lskj.PubControlDetail
|
||||
this.pl_top_fix_search.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.pl_buttom)).BeginInit();
|
||||
this.pl_buttom.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.pl_right)).BeginInit();
|
||||
this.pl_right.SuspendLayout();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// splitMainControl
|
||||
@@ -63,8 +67,7 @@ namespace Lskj.PubControlDetail
|
||||
this.splitMainControl.Location = new System.Drawing.Point(0, 0);
|
||||
this.splitMainControl.Margin = new System.Windows.Forms.Padding(2);
|
||||
this.splitMainControl.Name = "splitMainControl";
|
||||
this.splitMainControl.Panel1.Controls.Add(this.gcMain);
|
||||
this.splitMainControl.Panel1.Controls.Add(this.pl_mainSearch);
|
||||
this.splitMainControl.Panel1.Controls.Add(this.splitLeftControl);
|
||||
this.splitMainControl.Panel1.Text = "Panel1";
|
||||
this.splitMainControl.Panel2.Controls.Add(this.pl_right);
|
||||
this.splitMainControl.Panel2.Controls.Add(this.pl_buttom);
|
||||
@@ -73,6 +76,42 @@ namespace Lskj.PubControlDetail
|
||||
this.splitMainControl.SplitterPosition = 500;
|
||||
this.splitMainControl.TabIndex = 2;
|
||||
//
|
||||
// pl_right
|
||||
//
|
||||
this.pl_right.BorderStyle = DevExpress.XtraEditors.Controls.BorderStyles.Simple;
|
||||
this.pl_right.Controls.Add(this.pl_main);
|
||||
this.pl_right.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.pl_right.Location = new System.Drawing.Point(0, 0);
|
||||
this.pl_right.Name = "pl_right";
|
||||
this.pl_right.Size = new System.Drawing.Size(469, 529);
|
||||
this.pl_right.TabIndex = 16;
|
||||
//
|
||||
// pl_main
|
||||
//
|
||||
this.pl_main.Appearance.BackColor = System.Drawing.Color.Transparent;
|
||||
this.pl_main.Appearance.Options.UseBackColor = true;
|
||||
this.pl_main.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.pl_main.Location = new System.Drawing.Point(2, 2);
|
||||
this.pl_main.Name = "pl_main";
|
||||
this.pl_main.Size = new System.Drawing.Size(465, 525);
|
||||
this.pl_main.TabIndex = 13;
|
||||
//
|
||||
// splitLeftControl
|
||||
//
|
||||
this.splitLeftControl.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.splitLeftControl.Horizontal = false;
|
||||
this.splitLeftControl.Location = new System.Drawing.Point(0, 0);
|
||||
this.splitLeftControl.Margin = new System.Windows.Forms.Padding(2);
|
||||
this.splitLeftControl.Name = "splitLeftControl";
|
||||
this.splitLeftControl.Panel1.Controls.Add(this.gcMain);
|
||||
this.splitLeftControl.Panel1.Controls.Add(this.pl_mainSearch);
|
||||
this.splitLeftControl.Panel1.Text = "Panel1";
|
||||
this.splitLeftControl.Panel2.Controls.Add(this.gcBottom);
|
||||
this.splitLeftControl.Panel2.Text = "Panel2";
|
||||
this.splitLeftControl.Size = new System.Drawing.Size(500, 565);
|
||||
this.splitLeftControl.SplitterPosition = 301;
|
||||
this.splitLeftControl.TabIndex = 3;
|
||||
//
|
||||
// pl_mainSearch
|
||||
//
|
||||
this.pl_mainSearch.Appearance.BackColor = System.Drawing.Color.Transparent;
|
||||
@@ -84,7 +123,7 @@ namespace Lskj.PubControlDetail
|
||||
this.pl_mainSearch.LookAndFeel.UseDefaultLookAndFeel = false;
|
||||
this.pl_mainSearch.Name = "pl_mainSearch";
|
||||
this.pl_mainSearch.Size = new System.Drawing.Size(500, 33);
|
||||
this.pl_mainSearch.TabIndex = 13;
|
||||
this.pl_mainSearch.TabIndex = 14;
|
||||
//
|
||||
// pl_search
|
||||
//
|
||||
@@ -148,25 +187,16 @@ namespace Lskj.PubControlDetail
|
||||
this.label1.TabIndex = 0;
|
||||
this.label1.Text = "查询";
|
||||
//
|
||||
// pl_main
|
||||
// gcMain
|
||||
//
|
||||
this.pl_main.Appearance.BackColor = System.Drawing.Color.Transparent;
|
||||
this.pl_main.Appearance.Options.UseBackColor = true;
|
||||
this.pl_main.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.pl_main.Location = new System.Drawing.Point(2, 2);
|
||||
this.pl_main.Name = "pl_main";
|
||||
this.pl_main.Size = new System.Drawing.Size(465, 525);
|
||||
this.pl_main.TabIndex = 13;
|
||||
//
|
||||
// pl_buttom
|
||||
//
|
||||
this.pl_buttom.Controls.Add(this.btnAdd);
|
||||
this.pl_buttom.Controls.Add(this.btnClear);
|
||||
this.pl_buttom.Dock = System.Windows.Forms.DockStyle.Bottom;
|
||||
this.pl_buttom.Location = new System.Drawing.Point(0, 529);
|
||||
this.pl_buttom.Name = "pl_buttom";
|
||||
this.pl_buttom.Size = new System.Drawing.Size(469, 36);
|
||||
this.pl_buttom.TabIndex = 15;
|
||||
this.gcMain.AdapterObj = null;
|
||||
this.gcMain.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.gcMain.Location = new System.Drawing.Point(0, 33);
|
||||
this.gcMain.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
|
||||
this.gcMain.Name = "gcMain";
|
||||
this.gcMain.SiftEnumObj = Lskj.Control.GridControlEx.HeaderSiftEnum.Sum;
|
||||
this.gcMain.Size = new System.Drawing.Size(500, 268);
|
||||
this.gcMain.TabIndex = 15;
|
||||
//
|
||||
// btnClear
|
||||
//
|
||||
@@ -191,26 +221,26 @@ namespace Lskj.PubControlDetail
|
||||
this.btnAdd.TabStop = false;
|
||||
this.btnAdd.Text = "添加保存(&A)";
|
||||
//
|
||||
// pl_right
|
||||
// pl_buttom
|
||||
//
|
||||
this.pl_right.BorderStyle = DevExpress.XtraEditors.Controls.BorderStyles.Simple;
|
||||
this.pl_right.Controls.Add(this.pl_main);
|
||||
this.pl_right.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.pl_right.Location = new System.Drawing.Point(0, 0);
|
||||
this.pl_right.Name = "pl_right";
|
||||
this.pl_right.Size = new System.Drawing.Size(469, 529);
|
||||
this.pl_right.TabIndex = 16;
|
||||
this.pl_buttom.Controls.Add(this.btnAdd);
|
||||
this.pl_buttom.Controls.Add(this.btnClear);
|
||||
this.pl_buttom.Dock = System.Windows.Forms.DockStyle.Bottom;
|
||||
this.pl_buttom.Location = new System.Drawing.Point(0, 529);
|
||||
this.pl_buttom.Name = "pl_buttom";
|
||||
this.pl_buttom.Size = new System.Drawing.Size(469, 36);
|
||||
this.pl_buttom.TabIndex = 15;
|
||||
//
|
||||
// gcMain
|
||||
// gcBottom
|
||||
//
|
||||
this.gcMain.AdapterObj = null;
|
||||
this.gcMain.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.gcMain.Location = new System.Drawing.Point(0, 33);
|
||||
this.gcMain.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
|
||||
this.gcMain.Name = "gcMain";
|
||||
this.gcMain.SiftEnumObj = Lskj.Control.GridControlEx.HeaderSiftEnum.Sum;
|
||||
this.gcMain.Size = new System.Drawing.Size(500, 532);
|
||||
this.gcMain.TabIndex = 14;
|
||||
this.gcBottom.AdapterObj = null;
|
||||
this.gcBottom.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.gcBottom.Location = new System.Drawing.Point(0, 0);
|
||||
this.gcBottom.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
|
||||
this.gcBottom.Name = "gcBottom";
|
||||
this.gcBottom.SiftEnumObj = Lskj.Control.GridControlEx.HeaderSiftEnum.Sum;
|
||||
this.gcBottom.Size = new System.Drawing.Size(500, 259);
|
||||
this.gcBottom.TabIndex = 16;
|
||||
//
|
||||
// FrmMain
|
||||
//
|
||||
@@ -221,6 +251,10 @@ namespace Lskj.PubControlDetail
|
||||
this.Text = "FrmMain";
|
||||
((System.ComponentModel.ISupportInitialize)(this.splitMainControl)).EndInit();
|
||||
this.splitMainControl.ResumeLayout(false);
|
||||
((System.ComponentModel.ISupportInitialize)(this.pl_right)).EndInit();
|
||||
this.pl_right.ResumeLayout(false);
|
||||
((System.ComponentModel.ISupportInitialize)(this.splitLeftControl)).EndInit();
|
||||
this.splitLeftControl.ResumeLayout(false);
|
||||
((System.ComponentModel.ISupportInitialize)(this.pl_mainSearch)).EndInit();
|
||||
this.pl_mainSearch.ResumeLayout(false);
|
||||
((System.ComponentModel.ISupportInitialize)(this.pl_search)).EndInit();
|
||||
@@ -230,4 +264,10 @@ namespace Lskj.PubControlDetail
|
||||
this.pl_top_fix_search.PerformLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.pl_buttom)).EndInit();
|
||||
this.pl_buttom.ResumeLayout(false);
|
||||
((System.ComponentModel.ISupportInitialize)(this.pl_right)).EndInit()
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
@@ -73,6 +73,19 @@ namespace Lskj.PubControlDetail
|
||||
};
|
||||
DataModel.DetailControlObj.SetGridLeft(gcMain);
|
||||
}
|
||||
if (detailsTab != null && detailsTab.Rows.Count > 1)
|
||||
{
|
||||
string moduleCode = detailsTab.Rows[1]["unionModule"] + "";
|
||||
DataModel.BottomDetailModel = new GridDetailModel(detailsTab.Rows[1], null, GridCustomColumnStruct.BaseDetailGridView);
|
||||
DataModel.BottomSysModel = new DynamicModel(new string[] { DataModel.MainSysModel.FormText, DataModel.MainSysModel.UserId, DataModel.MainSysModel.UserName, DataModel.MainSysModel.Privilege, moduleCode });
|
||||
DataRow sysRow = MainImpl.GetSystemdllTab(DataModel.BottomSysModel.ModuleCode);
|
||||
DataModel.BottomModuleModel = new ModuleModel(sysRow);
|
||||
DataModel.BottomDetailModel.SystemModel = DataModel.BottomModuleModel;
|
||||
DataModel.BottomModuleModel.ParmaryKey = BaseImpl.GetBasePrimaryKey(DataModel.BottomSysModel.ModuleCode);
|
||||
DataModel.BottomGridColumns = BaseModuleImpl.GetBaseGridColumns(DataModel.BottomSysModel.ModuleCode);
|
||||
DataModel.BottomRightMenus = BaseModuleImpl.GetBaseGridRightMenus(DataModel.BottomModuleModel.FormKey);
|
||||
DataModel.BottomRowColors = BaseModuleImpl.GetBaseGridRowColors(DataModel.BottomModuleModel.FormKey);
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 初始化位置
|
||||
@@ -86,6 +99,11 @@ namespace Lskj.PubControlDetail
|
||||
{
|
||||
splitMainControl.SplitterPosition = Convert.ToInt32(splitMainWidth);
|
||||
}
|
||||
string splitLeftWidth = IniHelper.Read(string.Format("ControlDetail_SplitLeft_{0}", DataModel.MainSysModel.ModuleCode));
|
||||
if (!string.IsNullOrEmpty(splitLeftWidth))
|
||||
{
|
||||
splitLeftControl.SplitterPosition = Convert.ToInt32(splitLeftWidth);
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
@@ -116,10 +134,15 @@ namespace Lskj.PubControlDetail
|
||||
//左侧表格
|
||||
gcMain.Model = DataModel.MainSysModel;
|
||||
gcMain.SetEditColumns(DataModel.MainGridColumns, GridCustomColumnStruct.BaseMainGridView + DataModel.MainModuleModel.FormKey);
|
||||
gcMain.SetGridRightMenus(BaseModuleImpl.GetBaseGridRightMenus(DataModel.MainModuleModel.FormKey), DataModel.MainSysModel);
|
||||
gcMain.SetGridRowColors(BaseModuleImpl.GetBaseGridRowColors(DataModel.MainModuleModel.FormKey));
|
||||
gcMain.SetGridRightMenus(DataModel.MainRightMenus, DataModel.MainSysModel);
|
||||
gcMain.SetGridRowColors(DataModel.MainRowColors);
|
||||
//右侧控件
|
||||
DataModel.DetailControlObj.InitControl(DataModel.DetailControlTab, pl_main, BaseModuleImpl.GetAddGroupData(DataModel.DetailModuleModel.FormKey), true);
|
||||
//下方表格
|
||||
gcBottom.Model = DataModel.BottomSysModel;
|
||||
gcBottom.SetEditColumns(DataModel.MainGridColumns, GridCustomColumnStruct.BaseMainGridView + DataModel.BottomModuleModel.FormKey);
|
||||
gcBottom.SetGridRightMenus(DataModel.BottomRightMenus, DataModel.BottomSysModel);
|
||||
gcBottom.SetGridRowColors(DataModel.BottomRowColors);
|
||||
}
|
||||
/// <summary>
|
||||
/// 绑定控件事件
|
||||
@@ -127,12 +150,12 @@ namespace Lskj.PubControlDetail
|
||||
public void InitControlEvents()
|
||||
{
|
||||
splitMainControl.SplitterPositionChanged += OnSplitContainerPositionChanged;
|
||||
splitLeftControl.SplitterPositionChanged += OnSplitContainerPositionChanged;
|
||||
gcMain.GridView.RowCellClick += OnGridViewRowCellClick;
|
||||
GridDragControl dragGrid = new GridDragControl(gcMain.GridView, pl_main);
|
||||
dragGrid.OnDragComplete += OnDragGridOnDragComplete;
|
||||
btnClear.Click += OnBtnClearClick;
|
||||
btnAdd.Click += OnBtnAddClick;
|
||||
btnUpdate.Click += OnBtnUpdateClick;
|
||||
}
|
||||
/// <summary>
|
||||
/// 设置数据
|
||||
@@ -152,7 +175,14 @@ namespace Lskj.PubControlDetail
|
||||
{
|
||||
if (DataModel.MainSysModel != null)
|
||||
{
|
||||
IniHelper.Write(string.Format("ControlDetail_SplitMain_{0}", DataModel.MainSysModel.ModuleCode), splitMainControl.SplitterPosition + "");
|
||||
if (sender == splitMainControl)
|
||||
{
|
||||
IniHelper.Write(string.Format("ControlDetail_SplitMain_{0}", DataModel.MainSysModel.ModuleCode), splitMainControl.SplitterPosition + "");
|
||||
}
|
||||
if (sender == splitLeftControl)
|
||||
{
|
||||
IniHelper.Write(string.Format("ControlDetail_SplitLeft_{0}", DataModel.MainSysModel.ModuleCode), splitLeftControl.SplitterPosition + "");
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
@@ -170,9 +200,8 @@ namespace Lskj.PubControlDetail
|
||||
try
|
||||
{
|
||||
DataRow rowItem = gcMain.GridView.GetFocusedDataRow();
|
||||
string searchSql = GetSearchSql(DataModel.DetailDetailModel, rowItem);
|
||||
DataRow dataRow = BaseImpl.GetDataRowResult(searchSql);
|
||||
DataModel.DetailControlObj.SetAllControlValue(dataRow);
|
||||
string searchSql = GetSearchSql(DataModel.BottomDetailModel, rowItem);
|
||||
gcBottom.SetGridViewDataSource(BaseImpl.GetDataTableResult(searchSql));
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
@@ -239,6 +268,7 @@ namespace Lskj.PubControlDetail
|
||||
DataModel.DetailControlObj.CanExecControl = true;
|
||||
DataModel.DetailControlObj.SyncLocalModel();
|
||||
SetUpdateData(primaryKey, PrimaryValue);//重新加载数据
|
||||
OnGridViewRowCellClick(null, null);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -293,6 +323,7 @@ namespace Lskj.PubControlDetail
|
||||
/// <param name="e"></param>
|
||||
private void OnBtnAddClick(object sender, EventArgs e)
|
||||
{
|
||||
btnClear.Enabled = false;
|
||||
try
|
||||
{
|
||||
AddControlRecord();
|
||||
@@ -301,6 +332,7 @@ namespace Lskj.PubControlDetail
|
||||
{
|
||||
MessageUtil.Show(ex.Message);
|
||||
}
|
||||
btnClear.Enabled = true;
|
||||
}
|
||||
/// <summary>
|
||||
/// 修改按钮点击
|
||||
|
||||
Binary file not shown.
Reference in New Issue
Block a user