提交当前本机最新程序
This commit is contained in:
+2
@@ -109,6 +109,7 @@
|
||||
this.gridLeft.Name = "gridLeft";
|
||||
this.gridLeft.SiftEnumObj = Lskj.Control.GridControlEx.HeaderSiftEnum.Sum;
|
||||
this.gridLeft.Size = new System.Drawing.Size(250, 702);
|
||||
this.gridLeft.SysModel = null;
|
||||
this.gridLeft.TabIndex = 7;
|
||||
//
|
||||
// splitRightContainer
|
||||
@@ -265,6 +266,7 @@
|
||||
this.gcMain.Name = "gcMain";
|
||||
this.gcMain.SiftEnumObj = Lskj.Control.GridControlEx.HeaderSiftEnum.Sum;
|
||||
this.gcMain.Size = new System.Drawing.Size(1192, 215);
|
||||
this.gcMain.SysModel = null;
|
||||
this.gcMain.TabIndex = 0;
|
||||
//
|
||||
// plm_top_cond
|
||||
|
||||
@@ -76,6 +76,18 @@ namespace Lskj.PubProductSysMge
|
||||
/// </summary>
|
||||
private List<SysSetModel> ControlList = new List<SysSetModel>();
|
||||
/// <summary>
|
||||
/// 左侧树节点正在加载,防止连续点击重复进入加载流程。
|
||||
/// </summary>
|
||||
private bool _isTreeNodeLoading = false;
|
||||
/// <summary>
|
||||
/// 左侧树当前正在加载的节点,用于加载期间恢复选中状态。
|
||||
/// </summary>
|
||||
private TreeNode _loadingTreeNode = null;
|
||||
/// <summary>
|
||||
/// 程序内部切换方案下拉框时,屏蔽 SelectedIndexChanged 的嵌套加载。
|
||||
/// </summary>
|
||||
private bool _suppressProjectSelectedIndexChanged = false;
|
||||
/// <summary>
|
||||
/// 规格控件
|
||||
/// </summary>
|
||||
private BaseUserControl _SpecBaseControl;
|
||||
@@ -553,8 +565,9 @@ namespace Lskj.PubProductSysMge
|
||||
this.ControlList.Clear();
|
||||
try
|
||||
{
|
||||
if (projectComBoEdit.SelectedItem == "" || treeNode == null) return;
|
||||
string projectId = (projectComBoEdit.SelectedItem as ComboBoxModel).Value;
|
||||
ComboBoxModel selectedProject = projectComBoEdit.SelectedItem as ComboBoxModel;
|
||||
if (selectedProject == null || treeNode == null) return;
|
||||
string projectId = selectedProject.Value;
|
||||
if (treeNode != null && !string.IsNullOrEmpty(projectId))
|
||||
{
|
||||
DataTable dataTable = new DataTable();
|
||||
@@ -1004,6 +1017,11 @@ namespace Lskj.PubProductSysMge
|
||||
/// <param name="e"></param>
|
||||
private void OnProjectSelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (_suppressProjectSelectedIndexChanged || _isTreeNodeLoading)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
WaitForm.ShowForm();
|
||||
try
|
||||
{
|
||||
@@ -1027,24 +1045,38 @@ namespace Lskj.PubProductSysMge
|
||||
/// <param name="e"></param>
|
||||
private void OnTreeLeftTreeNodeSelected(object sender, TreeNodeMouseClickEventArgs e)
|
||||
{
|
||||
WaitForm.ShowForm();
|
||||
if (e.Node == null)
|
||||
if (_isTreeNodeLoading)
|
||||
{
|
||||
MessageUtil.Show("请选择节点");
|
||||
if (_loadingTreeNode != null && this.treeLeftViewEx.TreeView.SelectedNode != _loadingTreeNode)
|
||||
{
|
||||
this.treeLeftViewEx.TreeView.SelectedNode = _loadingTreeNode;
|
||||
}
|
||||
return;
|
||||
}
|
||||
this.treeLeftViewEx.TreeView.SelectedNode = e.Node;
|
||||
string nodeName = this.treeLeftViewEx.TreeView.SelectedNode != null ? this.treeLeftViewEx.TreeView.SelectedNode.Name : "";
|
||||
this.speciesNoEdit.Text = "";
|
||||
this.speciesNameEdit.Text = "";
|
||||
//this.projectComBoEdit.Text = "";
|
||||
//this.projectComBoEdit.Tag = "";
|
||||
this.btnUpdate.Enabled = false;
|
||||
this.btnSave.Enabled = true;
|
||||
this.MainControlObj.ResetControlValue();
|
||||
this.pl_Top.Controls.Clear();
|
||||
this.ControlList.Clear();
|
||||
|
||||
_isTreeNodeLoading = true;
|
||||
_loadingTreeNode = e.Node;
|
||||
try
|
||||
{
|
||||
WaitForm.ShowForm();
|
||||
if (e.Node == null)
|
||||
{
|
||||
MessageUtil.Show("请选择节点");
|
||||
return;
|
||||
}
|
||||
this.treeLeftViewEx.TreeView.SelectedNode = e.Node;
|
||||
string nodeName = this.treeLeftViewEx.TreeView.SelectedNode != null ? this.treeLeftViewEx.TreeView.SelectedNode.Name : "";
|
||||
this.speciesNoEdit.Text = "";
|
||||
this.speciesNameEdit.Text = "";
|
||||
//this.projectComBoEdit.Text = "";
|
||||
//this.projectComBoEdit.Tag = "";
|
||||
this.btnUpdate.Enabled = false;
|
||||
this.btnSave.Enabled = true;
|
||||
this.MainControlObj.ResetControlValue();
|
||||
//this.pl_Top.Controls.Clear();
|
||||
this.DisposeTopControls();
|
||||
this.ControlList.Clear();
|
||||
|
||||
//string projectId = MainImpl.GetResult(string.Format("select BmFaID from P_ProductSpeciesTab where speciesno = '{0}'", e.Node.Name)) + "";
|
||||
//string projectName = MainImpl.GetResult(string.Format("select ItemName from p_productsyssetGrouptab where id = '{0}'", projectId)) + "";
|
||||
string sql = "select id,ItemName from p_productsyssetGrouptab where speciesno = '{0}'";
|
||||
@@ -1055,23 +1087,40 @@ namespace Lskj.PubProductSysMge
|
||||
this.speciesNameEdit.Text = e.Node.Text;
|
||||
//this.projectComBoEdit.Text = projectName;
|
||||
//this.projectComBoEdit.Tag = projectId;
|
||||
this.projectComBoEdit.Text = "";
|
||||
this.projectComBoEdit.Properties.Items.Clear();
|
||||
if (e.Node.Nodes.Count == 0)
|
||||
bool hasProjectItem = false;
|
||||
_suppressProjectSelectedIndexChanged = true;
|
||||
try
|
||||
{
|
||||
foreach (DataRow item in dataTable.Rows)
|
||||
this.projectComBoEdit.Text = "";
|
||||
this.projectComBoEdit.Properties.Items.Clear();
|
||||
if (e.Node.Nodes.Count == 0)
|
||||
{
|
||||
|
||||
ComboBoxModel comboBoxModel = new ComboBoxModel(item)
|
||||
foreach (DataRow item in dataTable.Rows)
|
||||
{
|
||||
ValueMember = dataTable.Columns[0].ColumnName,
|
||||
DisplayMember = dataTable.Columns[1].ColumnName,
|
||||
};
|
||||
this.projectComBoEdit.Properties.Items.Add(comboBoxModel);
|
||||
|
||||
ComboBoxModel comboBoxModel = new ComboBoxModel(item)
|
||||
{
|
||||
ValueMember = dataTable.Columns[0].ColumnName,
|
||||
DisplayMember = dataTable.Columns[1].ColumnName,
|
||||
};
|
||||
this.projectComBoEdit.Properties.Items.Add(comboBoxModel);
|
||||
}
|
||||
if (this.projectComBoEdit.Properties.Items.Count > 0)
|
||||
{
|
||||
this.projectComBoEdit.SelectedIndex = 0;
|
||||
hasProjectItem = true;
|
||||
}
|
||||
}
|
||||
this.projectComBoEdit.SelectedIndex = 0;
|
||||
}
|
||||
//SetDynamicControl(e.Node);
|
||||
finally
|
||||
{
|
||||
_suppressProjectSelectedIndexChanged = false;
|
||||
}
|
||||
|
||||
if (hasProjectItem)
|
||||
{
|
||||
SetDynamicControl(e.Node);
|
||||
}
|
||||
string where = null;
|
||||
if (string.IsNullOrWhiteSpace(this.ParentUnionField))
|
||||
{
|
||||
@@ -1099,9 +1148,34 @@ namespace Lskj.PubProductSysMge
|
||||
}
|
||||
finally
|
||||
{
|
||||
_loadingTreeNode = null;
|
||||
_isTreeNodeLoading = false;
|
||||
WaitForm.HideForm();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 清空并释放顶部动态控件,避免 Controls.Clear 只移除不释放导致资源累积。
|
||||
/// </summary>
|
||||
private void DisposeTopControls()
|
||||
{
|
||||
if (this.pl_Top == null || this.pl_Top.IsDisposed)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
for (int i = this.pl_Top.Controls.Count - 1; i >= 0; i--)
|
||||
{
|
||||
System.Windows.Forms.Control control = this.pl_Top.Controls[i];
|
||||
this.pl_Top.Controls.RemoveAt(i);
|
||||
control.Dispose();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 控件面板点击时切换焦点,实现隐藏弹出框
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user