702 lines
28 KiB
C#
702 lines
28 KiB
C#
/******************************
|
|
* 说明:顶部为表格、底部为多标签内容模版(适用于基础档案上下模版、报表上下模版、单据审批模版)
|
|
* 创建人:龚宇超
|
|
* 创建日期:2017-11-21
|
|
* 修改人:
|
|
* 修改日期:
|
|
* 修改备注:
|
|
* 版本:1.0.0.0
|
|
******************************/
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.ComponentModel;
|
|
using System.Drawing;
|
|
using System.Data;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Windows.Forms;
|
|
using DevExpress.XtraTab;
|
|
using Lskj.Model;
|
|
using Lskj.Data;
|
|
using Lskj.Control.Model;
|
|
using DevExpress.XtraEditors;
|
|
using Lskj.Business.Impl;
|
|
using Lskj.Util;
|
|
using DevExpress.XtraGrid.Views.Grid;
|
|
using Lskj.Business;
|
|
using Lskj.Core;
|
|
using System.Diagnostics;
|
|
using System.Text.RegularExpressions;
|
|
using System.Collections;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace Lskj.Control
|
|
{
|
|
/// <summary>
|
|
/// 顶部为表格、底部为多标签内容模版
|
|
/// </summary>
|
|
public partial class ReplacementDetailEx : UserControl
|
|
{
|
|
private bool mResourcesReleased;
|
|
private bool mDetailPageCachesPrepared;
|
|
/// <summary>
|
|
/// 系统模块实体对象
|
|
/// </summary>
|
|
/// <value>The system model.</value>
|
|
public ModuleModel SysModel { get; private set; }
|
|
/// <summary>
|
|
/// 调用动态链接库默认传递参数对象
|
|
/// </summary>
|
|
public DynamicModel Model { get; private set; }
|
|
|
|
/// <summary>
|
|
/// Gets or sets a value indicating whether [visible detail panel].
|
|
/// </summary>
|
|
/// <value><c>true</c> if [visible detail panel]; otherwise, <c>false</c>.</value>
|
|
public bool VisibleDetailPanel
|
|
{
|
|
get
|
|
{
|
|
return this.scc_container.PanelVisibility == SplitPanelVisibility.Both;
|
|
}
|
|
set
|
|
{
|
|
this.scc_container.PanelVisibility = value ? SplitPanelVisibility.Both : SplitPanelVisibility.Panel1;
|
|
}
|
|
}
|
|
/// <summary>
|
|
/// 是否为拖拽明细模式
|
|
/// </summary>
|
|
public bool IsDragDetail;
|
|
/// <summary>
|
|
/// 底部多标签表格数据
|
|
/// </summary>
|
|
public List<GridDetailModel> GridDetailList;
|
|
|
|
/// <summary>
|
|
/// 左边查询条件
|
|
/// </summary>
|
|
public MyControl _leftGridSearchObj;
|
|
/// <summary>
|
|
/// 查询条件
|
|
/// </summary>
|
|
/// <value>The search object.</value>
|
|
public MyControl SearchObj { get { return this.mg_control.SearchObj; } }
|
|
/// <summary>
|
|
/// 顶部表格控件
|
|
/// </summary>
|
|
public ModuleGridEx ModuleGridObj { get { return this.mg_control; } }
|
|
/// <summary>
|
|
/// 底部多标签控件
|
|
/// </summary>
|
|
public XtraTabControl TabObj { get { return this.tcButtom.TabControlObj; } }
|
|
/// <summary>
|
|
/// 底部容器
|
|
/// </summary>
|
|
/// <value>The container object.</value>
|
|
public PanelControl BottomPanel { get { return this.pl_bottom; } }
|
|
/// <summary>
|
|
/// 是否只刷新当前选中明细
|
|
/// </summary>
|
|
/// <value>The container object.</value>
|
|
public bool RefreshDetail = false;
|
|
public ReplacementDetailEx()
|
|
{
|
|
InitializeComponent();
|
|
}
|
|
|
|
internal void ReleaseResourcesForDispose()
|
|
{
|
|
if (mResourcesReleased)
|
|
{
|
|
return;
|
|
}
|
|
|
|
mResourcesReleased = true;
|
|
if (ModuleGridObj != null)
|
|
{
|
|
ModuleGridObj.ReleaseResourcesForDispose();
|
|
}
|
|
try
|
|
{
|
|
if (Model != null && Model.DataCaches != null)
|
|
{
|
|
Model.DataCaches.RemoveCache(this);
|
|
}
|
|
}
|
|
catch
|
|
{
|
|
// Cache cleanup must not interrupt control disposal.
|
|
}
|
|
|
|
if (GridDetailList != null)
|
|
{
|
|
GridDetailList.Clear();
|
|
}
|
|
_leftGridSearchObj = null;
|
|
Model = null;
|
|
SysModel = null;
|
|
}
|
|
/// <summary>
|
|
/// <para>说明:初始化控件</para>
|
|
/// <para>创建人:龚宇超</para>
|
|
/// <para>创建日期:2017-11-21 </para>
|
|
/// <para>修改人:</para>
|
|
/// <para>修改日期:</para>
|
|
/// <para>修改备注:</para>
|
|
/// <para>版本:1.0</para>
|
|
/// </summary>
|
|
/// <param name="menuRow">The menu row.</param>
|
|
public void InitializeControl(ModuleModel sysModel, DynamicModel dyncModel)
|
|
{
|
|
try {
|
|
if (sysModel != null && dyncModel != null)
|
|
{
|
|
this.SysModel = sysModel;//系统模块实体对象
|
|
this.Model = dyncModel;//调用动态链接库默认传递参数对象
|
|
Console.WriteLine(DateTime.Now);
|
|
if (SysModel.isLeftRightMode) this.scc_container.Horizontal = true;
|
|
// 初始化顶部GridView
|
|
this.ModuleGridObj._leftGridSearchObj = _leftGridSearchObj;// 顶部表格控件
|
|
|
|
this.ModuleGridObj.TabObj = TabObj;// 底部多标签控件
|
|
this.ModuleGridObj.InitializeControl(sysModel, dyncModel);
|
|
RefreshDetail = this.SysModel.RefreshDetail == "0";
|
|
Console.WriteLine(DateTime.Now);
|
|
PrepareDetailPageCaches(dyncModel.DataCaches);
|
|
// 初始化底部多标签
|
|
this.InitializePages();
|
|
Console.WriteLine(DateTime.Now);
|
|
TabControlEx newtcButtom = tcButtom;
|
|
ModuleGridEx newModuleGridEx = mg_control;
|
|
this.scc_container.Panel1.Controls.Clear(); this.scc_container.Panel2.Controls.Clear();
|
|
this.scc_container.Panel1.Controls.Add(newtcButtom);
|
|
this.scc_container.Panel2.Controls.Add(newModuleGridEx);
|
|
}
|
|
else
|
|
{
|
|
MessageUtil.Show(ResourceKeys.MenuCodeIsNotNull);
|
|
}
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
|
|
string Message = ErrorMessage.PromptErrorMessage(ex);
|
|
MessageUtil.Show(Message,ex.Message);
|
|
}
|
|
|
|
}
|
|
|
|
/// <summary>
|
|
/// 获取数据源缓存
|
|
/// </summary>
|
|
/// <param name="cachesDic"></param>
|
|
/// <param name="sysModel"></param>
|
|
/// <param name="dynamicModel"></param>
|
|
public void GetDataCaches(Dictionary<object, Hashtable> cachesDic)
|
|
{
|
|
//获取通用数据
|
|
Task<ModuleModel> sysModelTask = cachesDic.GetTask<ModuleModel>(this, "SysModel");
|
|
Task<DynamicModel> dynamicModelTask = cachesDic.GetTask<DynamicModel>(this, "DynamicModel");
|
|
cachesDic.AddTask(ModuleGridObj, "DynamicModel", dynamicModelTask);
|
|
cachesDic.AddTask(ModuleGridObj, "SysModel", sysModelTask);
|
|
//初始化顶部表格
|
|
ModuleGridObj.GetDataCaches(cachesDic);
|
|
}
|
|
|
|
private void PrepareDetailPageCaches(
|
|
Dictionary<object, Hashtable> cachesDic)
|
|
{
|
|
if (mDetailPageCachesPrepared || cachesDic == null)
|
|
{
|
|
return;
|
|
}
|
|
|
|
mDetailPageCachesPrepared = true;
|
|
Task<DynamicModel> dynamicModelTask =
|
|
cachesDic.GetTask<DynamicModel>(this, "DynamicModel");
|
|
Task<List<GridDetailModel>> detailsTask =
|
|
cachesDic.GetTask<List<GridDetailModel>>(this, "Details");
|
|
cachesDic.AddTask(tcButtom, "DynamicModel", dynamicModelTask);
|
|
cachesDic.AddTask(tcButtom, "Details", detailsTask);
|
|
tcButtom.GetDataCaches(cachesDic);
|
|
}
|
|
|
|
/// <summary>
|
|
/// <para>说明:初始化底部多标签数据</para>
|
|
/// <para>创建人:龚宇超</para>
|
|
/// <para>创建日期:2017-11-21 </para>
|
|
/// <para>修改人:</para>
|
|
/// <para>修改日期:</para>
|
|
/// <para>修改备注:</para>
|
|
/// <para>版本:1.0</para>
|
|
/// </summary>
|
|
protected void InitializePages()
|
|
{
|
|
if (this.GridDetailList == null || this.GridDetailList.Count == 0)
|
|
{
|
|
this.scc_container.PanelVisibility = SplitPanelVisibility.Panel1;
|
|
}
|
|
else
|
|
{
|
|
this.InitlizeSpiltLocation();
|
|
this.InitilizeGridViewEvent();
|
|
|
|
this.tcButtom.Model = this.Model;
|
|
this.tcButtom.DrgaParentPrimaryKey = this.SysModel.ParmaryKey;
|
|
this.tcButtom.IsDragDetail = false;
|
|
this.tcButtom.ParentGridEx = this.ModuleGridObj.GridControlObj;
|
|
this.tcButtom.InitTabPages(this.GridDetailList);
|
|
this.tcButtom.OnRightCallback += new EventHandler(OnGridViewRightCallBack);
|
|
}
|
|
}
|
|
/// <summary>
|
|
/// <para>说明:设置分割条位置</para>
|
|
/// <para>创建人:龚宇超</para>
|
|
/// <para>创建日期:2018-02-01 </para>
|
|
/// <para>修改人:</para>
|
|
/// <para>修改日期:</para>
|
|
/// <para>修改备注:</para>
|
|
/// <para>版本:1.0</para>
|
|
/// </summary>
|
|
protected void InitlizeSpiltLocation()
|
|
{
|
|
try
|
|
{
|
|
string htight = IniHelper.Read(string.Format("base_height_{0}", this.Model.ModuleCode));
|
|
if (!string.IsNullOrEmpty(htight))
|
|
{
|
|
this.scc_container.SplitterPosition = Convert.ToInt32(htight);
|
|
}
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
LogHelper.Instance.WriteError(ex);
|
|
string Message = ErrorMessage.PromptErrorMessage(ex);
|
|
MessageUtil.Show(Message,ex.Message);
|
|
}
|
|
}
|
|
/// <summary>
|
|
/// <para>说明:绑定事件</para>
|
|
/// <para>创建人:龚宇超</para>
|
|
/// <para>创建日期:2017-11-22 </para>
|
|
/// <para>修改人:</para>
|
|
/// <para>修改日期:</para>
|
|
/// <para>修改备注:</para>
|
|
/// <para>版本:1.0</para>
|
|
/// </summary>
|
|
protected void InitilizeGridViewEvent()
|
|
{
|
|
if (this.IsDragDetail)
|
|
{
|
|
// 拖拽模式
|
|
|
|
}
|
|
else
|
|
{
|
|
// 非拖拽模式
|
|
if (Model.IsBaseModule)
|
|
{
|
|
if (this.ModuleGridObj.GridControlObj is TreeGridControlEx)
|
|
{
|
|
(this.ModuleGridObj.GridControlObj as TreeGridControlEx).TreeListObj.FocusedNodeChanged += OnFocusedNodeChanged;
|
|
}
|
|
this.ModuleGridObj.GridControlObj.GridView.FocusedRowObjectChanged += new DevExpress.XtraGrid.Views.Base.FocusedRowObjectChangedEventHandler(OnGridViewFocusedRowObjectChanged);
|
|
this.ModuleGridObj.GridControlObj.GridView.RowCellClick += new RowCellClickEventHandler(GridView_RowCellClick);
|
|
//this.ModuleGridObj.GridControlObj.GridView.FocusedRowChanged += new DevExpress.XtraGrid.Views.Base.FocusedRowChangedEventHandler(OnGridViewFocusedRowChanged);
|
|
}
|
|
else
|
|
{
|
|
if (this.ModuleGridObj.GridControlObj is TreeGridControlEx)
|
|
{
|
|
(this.ModuleGridObj.GridControlObj as TreeGridControlEx).TreeListObj.FocusedNodeChanged += OnFocusedNodeChanged;
|
|
}
|
|
this.ModuleGridObj.GridControlObj.GridView.DoubleClick += new EventHandler(OnGridViewDoubleClick);
|
|
}
|
|
}
|
|
}
|
|
/// <summary>
|
|
/// <para>说明:获取底部多标签数据</para>
|
|
/// <para>创建人:龚宇超</para>
|
|
/// <para>创建日期:2017-12-19 </para>
|
|
/// <para>修改人:</para>
|
|
/// <para>修改日期:</para>
|
|
/// <para>修改备注:</para>
|
|
/// <para>版本:1.0</para>
|
|
/// </summary>
|
|
public void SetDetailGridDataSource(XtraTabPage tabPage = null)
|
|
{
|
|
if (tabPage != null)
|
|
{
|
|
this.SetTabPageDataSource(tabPage);
|
|
}
|
|
else
|
|
{
|
|
DataRow rowItem = this.ModuleGridObj.GridControlObj.GetViewFocusedDataRow();
|
|
if (RefreshDetail)
|
|
{
|
|
XtraTabPage RefreshPage = this.TabObj.SelectedTabPage;
|
|
if (rowItem != null && RefreshPage != null)
|
|
{
|
|
this.SetTabPageDataSource(RefreshPage);
|
|
}
|
|
else
|
|
{
|
|
SetTabPageDataSource(RefreshPage, true);
|
|
}
|
|
}
|
|
else
|
|
{
|
|
foreach (XtraTabPage page in this.TabObj.TabPages)
|
|
{
|
|
|
|
if (rowItem != null && page != null)
|
|
{
|
|
this.SetTabPageDataSource(page);
|
|
}
|
|
else
|
|
{
|
|
SetTabPageDataSource(page, true);
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
}
|
|
/// <summary>
|
|
/// <para>说明:拖拽模式获取底部多标签数据</para>
|
|
/// <para>创建人:龚宇超</para>
|
|
/// <para>创建日期:2017-12-19 </para>
|
|
/// <para>修改人:</para>
|
|
/// <para>修改日期:</para>
|
|
/// <para>修改备注:</para>
|
|
/// <para>版本:1.0</para>
|
|
/// </summary>
|
|
public void SetDetailGridDataSource(string where, bool isTree, TreeViewEx treeViewEx, GridControlEx gridControlEx)
|
|
{
|
|
foreach (XtraTabPage tabPage in this.TabObj.TabPages)
|
|
{
|
|
GridDetailModel model = this.tcButtom.GetGridDetailModel(tabPage);
|
|
string sqlValue = model.IsReadOnly || model.IsChart ? model.DetailSql : model.SystemModel.MenuSql;
|
|
|
|
if (isTree)
|
|
{
|
|
// 左侧为树,查询数据则追加条件
|
|
if (tabPage.Tag is GridControlEx)
|
|
{
|
|
sqlValue = ReplaceHelper.IsProcedure(sqlValue) ?
|
|
ReplaceHelper.ReplaceTreeViewParentKeyCond(sqlValue, treeViewEx.GetSelectNodeValue()) :
|
|
sqlValue + where;
|
|
(tabPage.Tag as GridControlEx).LastSearchSql = sqlValue;
|
|
}
|
|
this.tcButtom.SetGridDataSource(tabPage, MainImpl.GetDataTableResult(sqlValue));
|
|
}
|
|
else
|
|
{
|
|
// 左侧为表格,查询数据则替换选中行数据
|
|
DataRow rowItem = gridControlEx.GridView.GetFocusedDataRow();
|
|
string searchSql = this.GetSearchSql(model, rowItem);
|
|
if (tabPage.Tag is GridControlEx)
|
|
{
|
|
(tabPage.Tag as GridControlEx).LastSearchSql = searchSql;
|
|
}
|
|
this.tcButtom.SetGridDataSource(tabPage, MainImpl.GetDataTableResult(searchSql));
|
|
}
|
|
}
|
|
}
|
|
/// <summary>
|
|
/// <para>说明:设置表格数据</para>
|
|
/// <para>创建人:龚宇超</para>
|
|
/// <para>创建日期:2018-01-29 </para>
|
|
/// <para>修改人:</para>
|
|
/// <para>修改日期:</para>
|
|
/// <para>修改备注:</para>
|
|
/// <para>版本:1.0</para>
|
|
/// </summary>
|
|
/// <param name="tabPage">The tab page.</param>
|
|
/// <param name="gridControl">The grid control.</param>
|
|
protected void SetTabPageDataSource(XtraTabPage tabPage, bool isNull = false)
|
|
{
|
|
if (isNull)
|
|
{
|
|
this.tcButtom.SetGridDataSource(tabPage, new DataTable());
|
|
return;
|
|
}
|
|
GridDetailModel model = this.tcButtom.GetGridDetailModel(tabPage);
|
|
|
|
DataRow rowItem = this.ModuleGridObj.GridControlObj.GetViewFocusedDataRow();
|
|
if (rowItem != null && model != null)
|
|
{
|
|
if (tabPage.Tag is ModuleWebView)
|
|
{
|
|
// 加载网页
|
|
string url = model.DetailSql.StartsWith("http") ? model.DetailSql : SystemInfo.Instance.OAUrl + model.DetailSql;
|
|
|
|
ModuleWebView webView = tabPage.Tag as ModuleWebView;
|
|
webView.Dock = DockStyle.Fill;
|
|
webView.Tag = model;
|
|
webView.Navigate(ReplaceHelper.ReplaceRowParam(rowItem, ReplaceHelper.ReplaceUserInfo(url)));
|
|
}
|
|
else
|
|
{
|
|
string searchSql = this.GetSearchSql(model, rowItem);
|
|
if (tabPage.Tag is GridControlEx)
|
|
{
|
|
(tabPage.Tag as GridControlEx).LastSearchSql = searchSql;
|
|
}
|
|
this.tcButtom.SetGridDataSource(tabPage, MainImpl.GetDataTableResult(searchSql));
|
|
//配置明细直接根据条件加载
|
|
if (model.SystemModel != null && 1 == model.SystemModel.isFirstLoad)
|
|
{
|
|
(tabPage.Tag as GridControlEx).ParentControl.SearchGrid();
|
|
tabPage.Text = model.DetailName + "(" + (tabPage.Tag as GridControlEx).ParentControl.GridRowCount + "条)";
|
|
}
|
|
else
|
|
{
|
|
if (tabPage.Tag is GridControlEx && (tabPage.Tag as GridControlEx).ParentControl != null)
|
|
(tabPage.Tag as GridControlEx).ParentControl.SetAllControlValue(rowItem);
|
|
}
|
|
}
|
|
}
|
|
else if (rowItem != null && tabPage.Tag is TabMultipledetails)
|
|
{
|
|
TabMultipledetails tabMultipledetails = tabPage.Tag as TabMultipledetails;
|
|
GridControlEx grdExMain = (tabMultipledetails.SplitMain.Panel1.Tag as GridControlEx);
|
|
GridControlEx grdExAdditional = (tabMultipledetails.SplitMain.Panel2.Tag as GridControlEx);
|
|
GridDetailModel MainModel = grdExMain.Tag as GridDetailModel;
|
|
GridDetailModel AdditionalModel = grdExAdditional.Tag as GridDetailModel;
|
|
string searchMainSql = this.GetSearchSql(MainModel, rowItem);
|
|
string searchAddSql = this.GetSearchSql(AdditionalModel, rowItem);
|
|
DataTable firstTable = MainImpl.GetDataTableResult(searchMainSql);
|
|
grdExMain.LastSearchSql = searchMainSql;
|
|
grdExAdditional.LastSearchSql = searchAddSql;
|
|
grdExMain.SetGridViewDataSource(firstTable);
|
|
tabPage.Text = MainModel.DetailName + "(" + firstTable.Rows.Count + "条)";
|
|
grdExAdditional.SetGridViewDataSource(MainImpl.GetDataTableResult(searchAddSql));
|
|
}
|
|
}
|
|
/// <summary>
|
|
/// <para>说明:获取查询条件</para>
|
|
/// <para>创建人:龚宇超</para>
|
|
/// <para>创建日期:2017-11-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, DataRow rowItem)
|
|
{
|
|
string fieldName = !string.IsNullOrEmpty(model.UnionParentField) && rowItem.Table.Columns.Contains(model.UnionParentField) ? model.UnionParentField : ModuleGridObj.ParmaryKey;
|
|
string sqlValue = model.IsReadOnly || model.IsChart ? model.DetailSql : model.SystemModel.MenuSql;
|
|
|
|
sqlValue = ReplaceHelper.ReplaceRowParam(rowItem, sqlValue);
|
|
|
|
if (ReplaceHelper.IsSelect(sqlValue) && !string.IsNullOrEmpty(model.UnionValue))
|
|
{
|
|
sqlValue = ReplaceHelper.ReplaceWhereCond(sqlValue) + string.Format(" and {0}='{1}'", model.UnionValue, rowItem[fieldName] + "");
|
|
}
|
|
return sqlValue;
|
|
}
|
|
/// <summary>
|
|
/// <para>说明:右键菜单执行后刷新数据,刷新规则按照上一次查询条件刷新</para>
|
|
/// <para>创建人:龚宇超</para>
|
|
/// <para>创建日期:2017-11-02 </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>
|
|
protected void OnGridViewRightCallBack(object sender, EventArgs e)
|
|
{
|
|
try
|
|
{
|
|
this.SetDetailGridDataSource(this.TabObj.SelectedTabPage);
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
string Message = ErrorMessage.PromptErrorMessage(ex);
|
|
MessageUtil.Show(Message,ex.Message);
|
|
}
|
|
|
|
}
|
|
/// <summary>
|
|
/// <para>说明:双击加载明细</para>
|
|
/// <para>创建人:龚宇超</para>
|
|
/// <para>创建日期:2017-11-22 </para>
|
|
/// <para>修改人:</para>
|
|
/// <para>修改日期:</para>
|
|
/// <para>修改备注:</para>
|
|
/// <para>版本:1.0</para>
|
|
/// </summary>
|
|
/// <param name="sender">The source of the event.</param>
|
|
/// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param>
|
|
protected void OnGridViewDoubleClick(object sender, EventArgs e)
|
|
{
|
|
try
|
|
{
|
|
WaitForm.ShowForm();
|
|
this.SetDetailGridDataSource();
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
string Message = ErrorMessage.PromptErrorMessage(ex);
|
|
MessageUtil.Show(Message,ex.Message);
|
|
LogHelper.Instance.WriteError(ex);
|
|
}
|
|
finally
|
|
{
|
|
WaitForm.HideForm();
|
|
}
|
|
}
|
|
/// <summary>
|
|
/// <para>说明:双击加载树表格明细</para>
|
|
/// <para>创建人:王一帆</para>
|
|
/// <para>创建日期:2020-02-12 </para>
|
|
/// <para>修改人:</para>
|
|
/// <para>修改日期:</para>
|
|
/// <para>修改备注:</para>
|
|
/// <para>版本:1.0</para>
|
|
/// </summary>
|
|
/// <param name="sender">The source of the event.</param>
|
|
/// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param>
|
|
private void OnFocusedNodeChanged(object sender, DevExpress.XtraTreeList.FocusedNodeChangedEventArgs e)
|
|
{
|
|
try
|
|
{
|
|
WaitForm.ShowForm();
|
|
this.SetDetailGridDataSource();
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
string Message = ErrorMessage.PromptErrorMessage(ex);
|
|
MessageUtil.Show(Message,ex.Message);
|
|
LogHelper.Instance.WriteError(ex);
|
|
}
|
|
finally
|
|
{
|
|
WaitForm.HideForm();
|
|
}
|
|
}
|
|
/// <summary>
|
|
/// <para>说明:加载明细数据</para>
|
|
/// <para>创建人:龚宇超</para>
|
|
/// <para>创建日期:2018-09-28 </para>
|
|
/// <para>修改人:</para>
|
|
/// <para>修改日期:</para>
|
|
/// <para>修改备注:</para>
|
|
/// <para>版本:1.0</para>
|
|
/// </summary>
|
|
/// <param name="sender">The source of the event.</param>
|
|
/// <param name="e">The <see cref="RowCellClickEventArgs"/> instance containing the event data.</param>
|
|
protected void GridView_RowCellClick(object sender, RowCellClickEventArgs e)
|
|
{
|
|
try
|
|
{
|
|
WaitForm.ShowForm();
|
|
this.SetDetailGridDataSource();
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
LogHelper.Instance.WriteError(ex);
|
|
string Message = ErrorMessage.PromptErrorMessage(ex);
|
|
MessageUtil.Show(Message,ex.Message);
|
|
}
|
|
finally
|
|
{
|
|
WaitForm.HideForm();
|
|
}
|
|
}
|
|
/// <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="DevExpress.XtraGrid.Views.Base.FocusedRowObjectChangedEventArgs"/> instance containing the event data.</param>
|
|
protected void OnGridViewFocusedRowObjectChanged(object sender, DevExpress.XtraGrid.Views.Base.FocusedRowObjectChangedEventArgs e)
|
|
{
|
|
try
|
|
{
|
|
WaitForm.ShowForm();
|
|
this.SetDetailGridDataSource();
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
LogHelper.Instance.WriteError(ex);
|
|
string Message = ErrorMessage.PromptErrorMessage(ex);
|
|
MessageUtil.Show(Message,ex.Message);
|
|
}
|
|
finally
|
|
{
|
|
WaitForm.HideForm();
|
|
}
|
|
}
|
|
/// <summary>
|
|
/// <para>说明:加载明细数据</para>
|
|
/// <para>创建人:龚宇超</para>
|
|
/// <para>创建日期:2017-11-22 </para>
|
|
/// <para>修改人:</para>
|
|
/// <para>修改日期:</para>
|
|
/// <para>修改备注:</para>
|
|
/// <para>版本:1.0</para>
|
|
/// </summary>
|
|
/// <param name="sender">The source of the event.</param>
|
|
/// <param name="e">The <see cref="DevExpress.Data.SelectionChangedEventArgs"/> instance containing the event data.</param>
|
|
protected void OnGridViewFocusedRowChanged(object sender, DevExpress.XtraGrid.Views.Base.FocusedRowChangedEventArgs e)
|
|
{
|
|
try
|
|
{
|
|
WaitForm.ShowForm();
|
|
this.SetDetailGridDataSource();
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
LogHelper.Instance.WriteError(ex);
|
|
string Message = ErrorMessage.PromptErrorMessage(ex);
|
|
MessageUtil.Show(Message,ex.Message);
|
|
}
|
|
finally
|
|
{
|
|
WaitForm.HideForm();
|
|
}
|
|
}
|
|
/// <summary>
|
|
/// <para>说明:设置分割条位置</para>
|
|
/// <para>创建人:龚宇超</para>
|
|
/// <para>创建日期:2018-02-01 </para>
|
|
/// <para>修改人:</para>
|
|
/// <para>修改日期:</para>
|
|
/// <para>修改备注:</para>
|
|
/// <para>版本:1.0</para>
|
|
/// </summary>
|
|
/// <param name="sender">The source of the event.</param>
|
|
/// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param>
|
|
protected void OnSplitterMoved(object sender, EventArgs e)
|
|
{
|
|
try
|
|
{
|
|
if (this.Model != null)
|
|
{
|
|
IniHelper.Write(string.Format("base_height_{0}", this.Model.ModuleCode), this.scc_container.SplitterPosition + "");
|
|
}
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
string Message = ErrorMessage.PromptErrorMessage(ex);
|
|
MessageUtil.Show(Message,ex.Message);
|
|
}
|
|
|
|
}
|
|
}
|
|
}
|