SVN r571
SVN-Revision: r571
This commit is contained in:
@@ -567,6 +567,11 @@ namespace Lskj.Control
|
||||
this.ControlObj.SyncLocalModel();
|
||||
}
|
||||
this.ControlObj.CanExecControl = true;
|
||||
|
||||
if (this.scc_container.PanelVisibility == SplitPanelVisibility.Both)
|
||||
{
|
||||
OnSelectedPageChanged(null, null);
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// <para>说明:设置图片事件</para>
|
||||
@@ -768,7 +773,7 @@ namespace Lskj.Control
|
||||
{
|
||||
this.CreateTabDetail();
|
||||
this.tcButtom.TabControlObj.SelectedPageChanged += this.OnSelectedPageChanged;
|
||||
//this.tcButtom.TabControlObj.SelectedPageChanging += this.OnSelectedPageChanging;
|
||||
this.tcButtom.TabControlObj.SelectedPageChanging += this.OnSelectedPageChanging;
|
||||
this.scc_container.PanelVisibility = SplitPanelVisibility.Both;
|
||||
}
|
||||
}
|
||||
@@ -781,7 +786,31 @@ namespace Lskj.Control
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 切换选项卡
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void OnSelectedPageChanging(object sender, TabPageChangingEventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
XtraTabPage page = e.Page;
|
||||
if (page != null)
|
||||
{
|
||||
if (e.PrevPage == this.tcButtom.TabControlObj.TabPages[0] && string.IsNullOrEmpty(this.PrimaryValue))
|
||||
{
|
||||
MessageUtil.Show(ResourceKeys.BeforeSaveData);
|
||||
e.Cancel = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
string Message = ErrorMessage.PromptErrorMessage(ex);
|
||||
MessageUtil.Show(Message, ex.Message);
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// <para>说明:切换标签刷新主键值</para>
|
||||
/// <para>创建人:龚宇超</para>
|
||||
@@ -807,10 +836,10 @@ namespace Lskj.Control
|
||||
tabPage = e.Page;
|
||||
}
|
||||
|
||||
OperatePanelControlObj.Visible = true;
|
||||
if (tabPage.Tag is ModuleGridEx) OperatePanelControlObj.Visible = false;
|
||||
if (!(tabPage.Tag is GridDetailModel)) return;
|
||||
OperatePanelControlObj.Visible = false;
|
||||
//OperatePanelControlObj.Visible = true;
|
||||
//if (tabPage.Tag is ModuleGridEx) OperatePanelControlObj.Visible = false;
|
||||
//if (!(tabPage.Tag is GridDetailModel)) return;
|
||||
//OperatePanelControlObj.Visible = false;
|
||||
if (tabPage.Controls.Count == 0)
|
||||
{
|
||||
|
||||
@@ -899,6 +928,27 @@ namespace Lskj.Control
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (tabPage.Tag != null && tabPage.Tag is GridControlEx gridControlEx)
|
||||
{
|
||||
GridDetailModel detailModel = gridControlEx.Tag as GridDetailModel;
|
||||
if (!string.IsNullOrWhiteSpace(this.ParentKey))
|
||||
{
|
||||
string codeSql = "select";
|
||||
codeSql += string.Format(" '{0}' as {1}", this.PrimaryValue, this.PrimaryKey);
|
||||
gridControlEx.SetGridViewDataSource(SqlHelper.ExecuteDataTable(ReplaceHelper.ReplaceRowParam(BaseImpl.GetDataRowResult(codeSql), ReplaceHelper.ReplaceWhereCond(detailModel.DetailSql))));
|
||||
}
|
||||
else if (this.ControlObj.CurrentData != null)
|
||||
{
|
||||
gridControlEx.SetGridViewDataSource(SqlHelper.ExecuteDataTable(ReplaceHelper.ReplaceRowParam(this.ControlObj.CurrentData, ReplaceHelper.ReplaceWhereCond(detailModel.DetailSql))));
|
||||
}
|
||||
}
|
||||
else if (tabPage.Tag != null && tabPage.Tag is ModuleGridEx moduleGridEx)
|
||||
{
|
||||
moduleGridEx.SearchObj.SearchGrid();
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user