/******************************
* 说明:TabControlEx多标签(标签内容包含表格和图表) 应用于审核附加信息、基础档案审核附加信息
* 创建人:龚宇超
* 创建日期:2018-01-10
* 修改人:
* 修改日期:
* 修改备注:
* 版本: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.Util;
using Lskj.Business.Impl;
using Lskj.Control.Model;
using Lskj.Model;
using DevExpress.XtraEditors;
using Lskj.Data;
using DevExpress.XtraGrid.Columns;
using Lskj.Business;
using DevExpress.XtraGrid.Views.Grid;
using System.Threading.Tasks;
using System.Collections;
namespace Lskj.Control
{
///
/// 多标签,标签内容包含表格和图表
///
public partial class TabControlEx : UserControl
{
///
/// 是否加载明细刷新
///
/// true if [_ un refresh]; otherwise, false.
private bool _UnRefresh
{
get
{
return Model is DynamicModuleDetailModel || Model is DynamicModuleModel || Model is DynamicProductionModel;
}
}
///
/// 拖拽模式
///
public bool IsDragDetail;
///
/// 拖拽目标主键字段
///
public string DrgaParentPrimaryKey;
///
/// 添加数据sql赋值
///
public string ControlSql;
///
/// tab标签
///
private List _gridDetail;
///
/// tab标签里明细数据
///
private List _gridIntoDetail;
///
/// 是否为Mrp明细页签
///
private bool isMrpDetail = false;
///
/// The system model
///
public DynamicModel Model;
///
/// 父表格
///
public GridControlEx ParentGridEx;
///
/// Mrp父表格
///
public GridControlEx MrpParentGridEx;
///
/// Mrp父明细表格
///
public GridControlEx MrpDetailGridEx;
///
/// 父容器
///
public MyControl ParentControlEx;
///
/// 明细数据里的主表格
///
public ModuleGridEx ModuleGridObj;
///
/// 选项卡
///
public XtraTabControl TabControlObj
{
get { return this.xtc_container; }
}
///
/// 右键菜单执行后调用
///
/// The sender.
public event EventHandler OnRightCallback;
///
/// 在保存网格回调(右键)
///
/// The sender.
public event EventHandler OnDetailRightCallback;
///
/// 在保存网格回调
///
/// The sender.
public event EventHandler OnDetailSaveGridCallBack;
//拖拽模式拖拽完成委托
public delegate void DragCompleteCallbackEventHandler(object sender, GridDragGridArgs e);
//拖拽模式拖拽完成回调
public event DragCompleteCallbackEventHandler OnDragCompleteCallback;
///
/// 拖拽模式DetailView双击点击事件回调
///
public event EventHandler OnDetailViewDoubleClickCallBack;
///
/// mrp拖拽完成后
///
public event EventHandler OnMrpDragCallback;
public event EventHandler OnMrpBtnClickCallback;
///
/// 明细页签与主模块对应关系
///
public Dictionary> DetailTabPagesDic = new Dictionary>();
///
/// 页签控件集合
///
public Dictionary> PageControlsDic = new Dictionary>();
public TabControlEx()
{
InitializeComponent();
this.Disposed += OnTabControlExDisposed;
}
///
/// 说明:绑定选项卡
/// 创建人:龚宇超
/// 创建日期:2018-01-09
/// 修改人:
/// 修改日期:
/// 修改备注:
/// 版本:1.0
///
public void InitTabPages(List gridDetail, bool isGridmerge = true, bool isAddPages = false)
{
this._gridDetail = gridDetail;
if (!isAddPages)
{
this.xtc_container.TabPages.Clear();
}
string DetaiName = string.Empty;
Dictionary