SVN r930
SVN-Revision: r930
This commit is contained in:
@@ -501,9 +501,56 @@ namespace Lskj.PubBillInfo
|
|||||||
foreach (XtraTabPage tabPage in this.baseTab.TabControlObj.TabPages)
|
foreach (XtraTabPage tabPage in this.baseTab.TabControlObj.TabPages)
|
||||||
{
|
{
|
||||||
GridDetailModel model = this.baseTab.GetGridDetailModel(tabPage);
|
GridDetailModel model = this.baseTab.GetGridDetailModel(tabPage);
|
||||||
string sqlValue = ReplaceHelper.ReplaceRowParam(this.gridBillInfo.GridView.GetFocusedDataRow(), model.DetailSql);
|
bool isDetailAttach = (model.IsReadOnly || model.IsChart);
|
||||||
|
DataRow dataRow = this.gridBillInfo.GridView.GetFocusedDataRow();
|
||||||
|
|
||||||
this.baseTab.SetGridDataSource(tabPage, MainImpl.GetDataTableResult(sqlValue));
|
//string sqlValue = ReplaceHelper.ReplaceRowParam(this.gridBillInfo.GridView.GetFocusedDataRow(), model.DetailSql);
|
||||||
|
//this.baseTab.SetGridDataSource(tabPage, MainImpl.GetDataTableResult(sqlValue));
|
||||||
|
if (tabPage.Tag is GridControlEx)
|
||||||
|
{
|
||||||
|
string sqlValue = isDetailAttach ? ReplaceHelper.ReplaceRowParam(dataRow, model.DetailSql) : GetSearchSql(model);
|
||||||
|
GridControlEx grdExMain = (tabPage.Tag as GridControlEx);
|
||||||
|
if (!isDetailAttach) grdExMain.LastSearchSql = sqlValue;
|
||||||
|
//this.tab_basicInfo.SetGridDataSource(tabPage, MainImpl.GetDataTableResult(sqlValue));
|
||||||
|
this.baseTab.SetGridDataSource(tabPage, sqlValue);
|
||||||
|
}
|
||||||
|
else if (tabPage.Tag is TabMultipledetails)
|
||||||
|
{
|
||||||
|
TabMultipledetails tabMultipledetails = tabPage.Tag as TabMultipledetails;
|
||||||
|
tabMultipledetails.SetConditionValues(dataRow);
|
||||||
|
GridControlEx grdExMain = (tabMultipledetails.SplitMain.Panel1.Tag as GridControlEx);
|
||||||
|
GridDetailModel MainModel = grdExMain.Tag as GridDetailModel;
|
||||||
|
string searchMainSql = isDetailAttach ? ReplaceHelper.ReplaceRowParam(dataRow, MainModel.DetailSql) : this.GetSearchSql(MainModel);
|
||||||
|
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 = isDetailAttach ? ReplaceHelper.ReplaceRowParam(dataRow, AdditionalModel.DetailSql) : this.GetSearchSql(AdditionalModel);
|
||||||
|
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);
|
||||||
|
DataTable table = MainImpl.GetDataTableResult(searchAddSql);
|
||||||
|
grdExAdditional.CreateChart(table);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
@@ -882,4 +929,57 @@ namespace Lskj.PubBillInfo
|
|||||||
LogUtil.WriteError("反审出错!", ex);
|
LogUtil.WriteError("反审出错!", ex);
|
||||||
//MessageUtil.Show("反审出错!" + ex);
|
//MessageUtil.Show("反审出错!" + ex);
|
||||||
string Message = ErrorMessage.PromptErrorMessage(ex);
|
string Message = ErrorMessage.PromptErrorMessage(ex);
|
||||||
|
MessageUtil.Show(Message, ex.Message);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// <para>说明:帮助文档</para>
|
||||||
|
/// <para>创建人:龚宇超</para>
|
||||||
|
/// <para>创建日期: </para>
|
||||||
|
/// <para>修改人:</para>
|
||||||
|
/// <para>修改日期:</para>
|
||||||
|
/// <para>修改备注:</para>
|
||||||
|
/// <para>版本:1.0</para>
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="sender">The sender.</param>
|
||||||
|
/// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param>
|
||||||
|
void OnHelpClick(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
WebBrowserUtil.StartWebBrowser(this.SysModel.ModuleCode, this.SysModel.FormTitle);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
string Message = ErrorMessage.PromptErrorMessage(ex);
|
||||||
|
MessageUtil.Show(Message, ex.Message);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region 获取查询条件
|
||||||
|
/// <summary>
|
||||||
|
/// <para>说明:获取查询条件</para>
|
||||||
|
/// <para>创建人:王一帆</para>
|
||||||
|
/// <para>创建日期:2021-01-22 </para>
|
||||||
|
/// <para>修改人:</para>
|
||||||
|
/// <para>修改日期:</para>
|
||||||
|
/// <para>修改备注:</para>
|
||||||
|
/// <para>版本:1.0</para>
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="model">The model.</param>
|
||||||
|
/// <param name="rowItem">The row item.</param>
|
||||||
|
/// <returns>System.String.</returns>
|
||||||
|
protected string GetSearchSql(GridDetailModel model)
|
||||||
|
{
|
||||||
|
string fieldName = !string.IsNullOrEmpty(model.UnionParentField) ? model.UnionParentField : BaseImpl.GetBasePrimaryKey(model.UnionModule);
|
||||||
|
DataRow dr = this.BillModelObj.DetailTreeTable ? (this.gridBillInfo as TreeGridControlEx).GetViewFocusedDataRow() : this.gridBillInfo.GridView.GetFocusedDataRow();
|
||||||
|
|
||||||
|
fieldName = dr.Table.Columns.Contains(fieldName) ? dr[fieldName].ToString() : this.ControlObj.PrimaryValue;
|
||||||
|
string sqlValue = model.IsReadOnly || model.IsChart ? model.DetailSql : model.SystemModel.MenuSql;
|
||||||
|
if (ReplaceHelper.IsSelect(sqlValue) && !string.IsNullOrEmpty(model.UnionValue))
|
||||||
|
{
|
||||||
|
string[] sqlValues = sqlValue.Split(new string[] { "where " }, StringSplitOptions.None);
|
||||||
|
if (sqlValues.Length > 1)
|
||||||
|
{
|
||||||
|
string sql = s
|
||||||
Reference in New Issue
Block a user