/****************************** * 说明:表格明细对象 * 创建人:龚宇超 * 创建日期:2017-11-21 * 修改人: * 修改日期: * 修改备注: * 版本:1.0.0.0 ******************************/ using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Data; using Lskj.Model; namespace Lskj.Control.Model { /// /// 表格明细对象(p_systemDlltabDetail) /// public class GridDetailModel { private int _id; private int _detailType; private int _orderid; private int _autoMultiHeader; private bool _autoRefresh; private bool _rightVisible; private bool _isSearch; private bool _isDownloadRelated; private string _detailName; private string _detailSql; private string _formKey; private string _unionModule; private string _unionCond; private string _unionValue; private string _unionParentField; private string _columnKey; private DataTable _columns; private int _isCheck; private bool _transverseHistogram; private bool _isUnioDetail; private bool _isMrpDrag; private string _mrpDragTag; private string _parentModuleCode; /// /// Gets the identifier. /// /// The identifier. public int Id { get { return _id; } } public int DetailType { get { return _detailType; } } /// /// 是左侧的明细 /// /// true if this instance is search; otherwise, false. public bool IsUnioDetail { get { return this._isUnioDetail; } } /// /// 是否为编辑展现方式 /// /// true if this instance is report; otherwise, false. public bool IsReadOnly { get { return !string.IsNullOrEmpty(this._detailSql) || string.IsNullOrEmpty(this._unionModule); } } /// /// 是否显示查询条件 /// /// true if this instance is search; otherwise, false. public bool IsSearch { get { return this._isSearch; } } /// /// 是否为图表 /// /// true if this instance is chart; otherwise, false. public bool IsChart { get { return this._detailType == 1; } } /// /// 是否为Excel /// /// true if this instance is excel; otherwise, false. public bool IsExcel { get { return this._detailType == 1; } } /// /// 网页地址,下载验证 /// /// true if this instance is web view; otherwise, false. public bool IsWebView { get { return this._detailType == 2; } } /// /// 网页地址,原有下载 /// /// true if this instance is web view; otherwise, false. public bool IsWebView2 { get { return this._detailType == 5; } } /// /// 网页地址,禁止下载 /// /// true if this instance is web view; otherwise, false. public bool IsWebView3 { get { return this._detailType == 6; } } /// /// 添加界面 /// /// true if this instance is add panel; otherwise, false. public bool IsAddPanel { get { return this._detailType == 3; } } /// /// 明细页签 /// /// true if this instance is web view; otherwise, false. public bool IsDetailView { get { return this._detailType == 4; } } /// /// sql配置明细是否可以保存 /// public bool DetailIsSave; /// /// 拖拽模式下是否可以拖拽明细 /// public bool IsDrag; /// /// 排序号 /// /// The orderid. public int Orderid { get { return _orderid; } } /// /// 自动刷新 /// /// true if [automatic refresh]; otherwise, false. public bool AutoRefresh { get { return _autoRefresh; } } /// /// 右侧显示 /// /// true if this instance is right visible; otherwise, false. public bool IsRightVisible { get { return _rightVisible; } } /// /// Gets the form key. /// /// The form key. public string FormKey { get { return _formKey; } } /// /// 标签名称 /// /// The name of the detail. public string DetailName { get { return _detailName; } } /// /// 标签数据源SQL /// /// The detail SQL. public string DetailSql { get { return _detailSql; } set { this._detailSql = value; } } /// /// 关联模块 /// /// The union module. public string UnionModule { get { return _unionModule; } } /// /// 关联模块 /// /// The union module. public string UnionCond { get { return _unionCond; } } /// /// 关联值 /// /// The union value. public string UnionValue { get { return _unionValue.Replace("{", "").Replace("}", "").Replace("{", "").Replace("}", ""); } } /// /// 关联父级数据字段 /// /// The union parent field. public string UnionParentField { get { return _unionParentField.Replace("}", "").Replace("{", "").Replace("}", ""); } } /// /// 自定义表格列标识字段 /// /// The grid custom column key. public string GridCustomColumnKey { get { return _columnKey + this._formKey; } } /// /// 默认明细为多表头控件 /// /// The grid custom column key. public int AutoMultiHeader; /// /// 明细衍生到右侧数据 /// /// The Detail Right Data. public int rightVisible; /// /// 明细衍生到下侧平铺数据 /// /// The Detail Bottom Data. public int displayMode; /// /// 表格列数据源 /// /// The grid columns. public DataTable GridColumns { get { return this._columns; } set { this._columns = value; } } /// /// 对应的模块对象 /// public ModuleModel SystemModel; /// /// 是否添加复选框 /// public int IsCheck { get { return this._isCheck; } } /// /// 柱状图表是否横向展示 /// public bool transverseHistogram { get { return this._transverseHistogram; } } /// /// 是否Mrp拖拽 /// public bool IsMrpDrag { get { return this._isMrpDrag; } } /// /// 批量关联明细 /// public bool IsDownloadRelated { get { return this._isDownloadRelated; } } /// /// Mrp拖拽标记 /// public string MrpDragTag { get { return this._mrpDragTag; } } /// /// 底部配置为2个名字相同的名字时,执行右键是否刷新(默认false) /// public bool BottomDetailsRefresh; /// /// 图档预览模块中,左下明细是否关联右侧页签(右侧页签为左下第一个页签的第一个明细) /// public bool AssociateRight; /// ///单据审核中下载明细表的明细的条件 /// public string Enablecond; /// ///双击执行 /// public bool DBClickEvent; /// ///扫码模块(Lskj.SweepCode.dll)中,扫码后不刷新 /// public bool ProhibitRefresh; /// ///页签配置左右明细时,推拽执行sql /// public string DragExecuteSql; /// ///页签配置左右明细时,查询后再次查询(替换上方主表行数据) /// public bool QueryAgain; /// ///页签配置左右明细时,右键执行后刷新主表 /// public bool BottomRefreshMain; /// ///显示筛选行 /// public bool LoadFilter; /// ///动态明细模式 /// public bool DynamicDetails; /// ///显示明细条件 /// public bool DetailSearch; /// ///记住上下复选行(上下表都有复选框才生效) /// public bool RecordDetailsCheckbox; /// ///mrp条件页签(根据页签选中行去设置别的页签中对应的条件) /// public bool MrpConditionTab; /// /// 主模块编号 /// public string ParentModuleCode { get { return this._parentModuleCode; } set { this._parentModuleCode = value; } } public GridDetailModel(DataRow item) : this(item, null, GridCustomColumnStruct.BaseDetailGridView) { } public GridDetailModel(DataRow item, DataTable gridColumns, string columnKey, bool isSearch = false) { if (item == null || string.IsNullOrEmpty(columnKey)) return; this._id = Convert.ToInt32(item["id"] + ""); this._detailType = string.IsNullOrEmpty(item["detailType"] + "") ? 0 : Convert.ToInt32(item["detailType"] + ""); this._orderid = string.IsNullOrEmpty(item["orderid"] + "") ? 0 : Convert.ToInt32(item["orderid"] + ""); this._autoRefresh = string.IsNullOrEmpty(item["autoRefresh"] + "") ? false : "1".Equals(item["autoRefresh"] + ""); this._rightVisible = item.Table.Columns.Contains("rightVisible") ? "1".Equals(item["rightVisible"] + "") : false; this.DetailIsSave = item.Table.Columns.Contains("DetailIsSave") ? "1".Equals(item["DetailIsSave"] + "") : false; this.IsDrag = item.Table.Columns.Contains("IsDrag") ? "1".Equals(item["IsDrag"] + "") : false; this._detailName = item["detailName"] + ""; if (Business.Impl.LanguageTranslation.Translatable) { this._detailName = Business.Impl.LanguageTranslation.GetTranslatedText(this._detailName); } this._detailSql = item["detailSql"] + ""; this._formKey = item["formKey"] + ""; this._columnKey = columnKey; this._unionCond = item.Table.Columns.Contains("unionCond") ? (item["unionCond"] + "") : string.Empty; this._unionModule = item.Table.Columns.Contains("unionModule") ? (item["unionModule"] + "").Replace("{", "").Replace("}", "") : string.Empty; this._unionValue = item.Table.Columns.Contains("unionValue") ? (item["unionValue"] + "").Replace("{", "").Replace("}", "") : string.Empty; this._unionParentField = item.Table.Columns.Contains("unionParentField") ? (item["unionParentField"] + "").Replace("{", "").Replace("}", "") : string.Empty; this._columns = gridColumns; this._isDownloadRelated = item.Table.Columns.Contains("IsDownloadRelated") ? "True".Equals(item["IsDownloadRelated"] + "") : false; this._isSearch = isSearch; this._isUnioDetail = item.Table.Columns.Contains("IsUnioDetail") ? "1".Equals(item["IsUnioDetail"] + "") : false; this.AutoMultiHeader = item.Table.Columns.Contains("AutoMultiHeader") && !string.IsNullOrEmpty(item["AutoMultiHeader"] + "") ? Convert.ToInt32(item["AutoMultiHeader"] + "") : 0; this.displayMode = item.Table.Columns.Contains("displayMode") && !string.IsNullOrEmpty(item["displayMode"] + "") ? Convert.ToInt32(item["displayMode"] + "") : 0; this.rightVisible = item.Table.Columns.Contains("rightVisible") && !string.IsNullOrEmpty(item["rightVisible"] + "") ? Convert.ToInt32(item["rightVisible"] + "") : 0; this._isCheck = item.Table.Columns.Contains("gridDetailCheck") && !string.IsNullOrEmpty(item["gridDetailCheck"] + "") ? Convert.ToInt32(item["gridDetailCheck"] + "") : 0; this._transverseHistogram = item.Table.Columns.Contains("transverseHistogram") ? "1".Equals(item["transverseHistogram"] + "") : false; this._isMrpDrag = item.Table.Columns.Contains("isMrpDrag") ? "1".Equals(item["isMrpDrag"] + "") : false; this._mrpDragTag = item.Table.Columns.Contains("mrpDragTag") ? item["mrpDragTag"] + "" : ""; this._parentModuleCode = item.Table.Columns.Contains("tab") ? item["tab"] + "" : ""; this.BottomDetailsRefresh = item.Table.Columns.Contains("BottomDetailsRefresh") ? "1".Equals(item["BottomDetailsRefresh"] + "") : false; this.AssociateRight = item.Table.Columns.Contains("AssociateRight") ? "1".Equals(item["AssociateRight"] + "") : false; this.Enablecond = item.Table.Columns.Contains("Enablecond") ? (item["Enablecond"] + ""): string.Empty; this.DBClickEvent = item.Table.Columns.Contains("DBClickEvent") ? "1".Equals(item["DBClickEvent"] + "") : false; this.ProhibitRefresh = item.Table.Columns.Contains("ProhibitRefresh") ? "1".Equals(item["ProhibitRefresh"] + "") : false; this.DragExecuteSql = item.Ta