1cbed9fd73
SVN-Revision: r500
313 lines
14 KiB
C#
313 lines
14 KiB
C#
/******************************
|
||
* 说明:表格明细对象
|
||
* 创建人:龚宇超
|
||
* 创建日期: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
|
||
{
|
||
/// <summary>
|
||
/// 表格明细对象(p_systemDlltabDetail)
|
||
/// </summary>
|
||
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 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;
|
||
/// <summary>
|
||
/// Gets the identifier.
|
||
/// </summary>
|
||
/// <value>The identifier.</value>
|
||
public int Id { get { return _id; } }
|
||
public int DetailType { get { return _detailType; } }
|
||
/// <summary>
|
||
/// 是左侧的明细
|
||
/// </summary>
|
||
/// <value><c>true</c> if this instance is search; otherwise, <c>false</c>.</value>
|
||
public bool IsUnioDetail { get { return this._isUnioDetail; } }
|
||
|
||
/// <summary>
|
||
/// 是否为编辑展现方式
|
||
/// </summary>
|
||
/// <value><c>true</c> if this instance is report; otherwise, <c>false</c>.</value>
|
||
public bool IsReadOnly { get { return !string.IsNullOrEmpty(this._detailSql) || string.IsNullOrEmpty(this._unionModule); } }
|
||
/// <summary>
|
||
/// 是否显示查询条件
|
||
/// </summary>
|
||
/// <value><c>true</c> if this instance is search; otherwise, <c>false</c>.</value>
|
||
public bool IsSearch { get { return this._isSearch; } }
|
||
/// <summary>
|
||
/// 是否为图表
|
||
/// </summary>
|
||
/// <value><c>true</c> if this instance is chart; otherwise, <c>false</c>.</value>
|
||
public bool IsChart { get { return this._detailType == 1; } }
|
||
/// <summary>
|
||
/// 是否为Excel
|
||
/// </summary>
|
||
/// <value><c>true</c> if this instance is excel; otherwise, <c>false</c>.</value>
|
||
public bool IsExcel { get { return this._detailType == 1; } }
|
||
/// <summary>
|
||
/// 网页地址,下载验证
|
||
/// </summary>
|
||
/// <value><c>true</c> if this instance is web view; otherwise, <c>false</c>.</value>
|
||
public bool IsWebView { get { return this._detailType == 2; } }
|
||
/// <summary>
|
||
/// 网页地址,原有下载
|
||
/// </summary>
|
||
/// <value><c>true</c> if this instance is web view; otherwise, <c>false</c>.</value>
|
||
public bool IsWebView2 { get { return this._detailType == 5; } }
|
||
/// <summary>
|
||
/// 网页地址,禁止下载
|
||
/// </summary>
|
||
/// <value><c>true</c> if this instance is web view; otherwise, <c>false</c>.</value>
|
||
public bool IsWebView3 { get { return this._detailType == 6; } }
|
||
/// <summary>
|
||
/// 添加界面
|
||
/// </summary>
|
||
/// <value><c>true</c> if this instance is add panel; otherwise, <c>false</c>.</value>
|
||
public bool IsAddPanel { get { return this._detailType == 3; } }
|
||
/// <summary>
|
||
/// 明细页签
|
||
/// </summary>
|
||
/// <value><c>true</c> if this instance is web view; otherwise, <c>false</c>.</value>
|
||
public bool IsDetailView { get { return this._detailType == 4; } }
|
||
/// <summary>
|
||
/// sql配置明细是否可以保存
|
||
/// </summary>
|
||
public bool DetailIsSave;
|
||
/// <summary>
|
||
/// 拖拽模式下是否可以拖拽明细
|
||
/// </summary>
|
||
public bool IsDrag;
|
||
/// <summary>
|
||
/// 排序号
|
||
/// </summary>
|
||
/// <value>The orderid.</value>
|
||
public int Orderid { get { return _orderid; } }
|
||
/// <summary>
|
||
/// 自动刷新
|
||
/// </summary>
|
||
/// <value><c>true</c> if [automatic refresh]; otherwise, <c>false</c>.</value>
|
||
public bool AutoRefresh { get { return _autoRefresh; } }
|
||
/// <summary>
|
||
/// 右侧显示
|
||
/// </summary>
|
||
/// <value><c>true</c> if this instance is right visible; otherwise, <c>false</c>.</value>
|
||
public bool IsRightVisible { get { return _rightVisible; } }
|
||
/// <summary>
|
||
/// Gets the form key.
|
||
/// </summary>
|
||
/// <value>The form key.</value>
|
||
public string FormKey { get { return _formKey; } }
|
||
/// <summary>
|
||
/// 标签名称
|
||
/// </summary>
|
||
/// <value>The name of the detail.</value>
|
||
public string DetailName { get { return _detailName; } }
|
||
/// <summary>
|
||
/// 标签数据源SQL
|
||
/// </summary>
|
||
/// <value>The detail SQL.</value>
|
||
public string DetailSql { get { return _detailSql; } set { this._detailSql = value; } }
|
||
/// <summary>
|
||
/// 关联模块
|
||
/// </summary>
|
||
/// <value>The union module.</value>
|
||
public string UnionModule { get { return _unionModule; } }
|
||
/// <summary>
|
||
/// 关联模块
|
||
/// </summary>
|
||
/// <value>The union module.</value>
|
||
public string UnionCond { get { return _unionCond; } }
|
||
|
||
/// <summary>
|
||
/// 关联值
|
||
/// </summary>
|
||
/// <value>The union value.</value>
|
||
public string UnionValue { get { return _unionValue.Replace("{", "").Replace("}", "").Replace("{", "").Replace("}", ""); } }
|
||
/// <summary>
|
||
/// 关联父级数据字段
|
||
/// </summary>
|
||
/// <value>The union parent field.</value>
|
||
public string UnionParentField { get { return _unionParentField.Replace("}", "").Replace("{", "").Replace("}", ""); } }
|
||
|
||
/// <summary>
|
||
/// 自定义表格列标识字段
|
||
/// </summary>
|
||
/// <value>The grid custom column key.</value>
|
||
public string GridCustomColumnKey { get { return _columnKey + this._formKey; } }
|
||
/// <summary>
|
||
/// 默认明细为多表头控件
|
||
/// </summary>
|
||
/// <value>The grid custom column key.</value>
|
||
public int AutoMultiHeader;
|
||
/// <summary>
|
||
/// 明细衍生到右侧数据
|
||
/// </summary>
|
||
/// <value>The Detail Right Data.</value>
|
||
public int rightVisible;
|
||
/// <summary>
|
||
/// 明细衍生到下侧平铺数据
|
||
/// </summary>
|
||
/// <value>The Detail Bottom Data.</value>
|
||
public int displayMode;
|
||
|
||
/// <summary>
|
||
/// 表格列数据源
|
||
/// </summary>
|
||
/// <value>The grid columns.</value>
|
||
public DataTable GridColumns { get { return this._columns; } set { this._columns = value; } }
|
||
/// <summary>
|
||
/// 对应的模块对象
|
||
/// </summary>
|
||
public ModuleModel SystemModel;
|
||
/// <summary>
|
||
/// 是否添加复选框
|
||
/// </summary>
|
||
public int IsCheck { get { return this._isCheck; } }
|
||
/// <summary>
|
||
/// 柱状图表是否横向展示
|
||
/// </summary>
|
||
public bool transverseHistogram { get { return this._transverseHistogram; } }
|
||
/// <summary>
|
||
/// 是否Mrp拖拽
|
||
/// </summary>
|
||
public bool IsMrpDrag { get { return this._isMrpDrag; } }
|
||
/// <summary>
|
||
/// Mrp拖拽标记
|
||
/// </summary>
|
||
public string MrpDragTag { get { return this._mrpDragTag; } }
|
||
/// <summary>
|
||
/// 底部配置为2个名字相同的名字时,执行右键是否刷新(默认false)
|
||
/// </summary>
|
||
public bool BottomDetailsRefresh;
|
||
/// <summary>
|
||
/// 图档预览模块中,左下明细是否关联右侧页签(右侧页签为左下第一个页签的第一个明细)
|
||
/// </summary>
|
||
public bool AssociateRight;
|
||
/// <summary>
|
||
///单据审核中下载明细表的明细的条件
|
||
/// </summary>
|
||
public string Enablecond;
|
||
/// <summary>
|
||
///双击执行
|
||
/// </summary>
|
||
public bool DBClickEvent;
|
||
/// <summary>
|
||
///扫码模块(Lskj.SweepCode.dll)中,扫码后不刷新
|
||
/// </summary>
|
||
public bool ProhibitRefresh;
|
||
/// <summary>
|
||
///页签配置左右明细时,推拽执行sql
|
||
/// </summary>
|
||
public string DragExecuteSql;
|
||
/// <summary>
|
||
///页签配置左右明细时,查询后再次查询(替换上方主表行数据)
|
||
/// </summary>
|
||
public bool QueryAgain;
|
||
/// <summary>
|
||
///页签配置左右明细时,右键执行后刷新主表
|
||
/// </summary>
|
||
public bool BottomRefreshMain;
|
||
/// <summary>
|
||
///显示筛选行
|
||
/// </summary>
|
||
public bool LoadFilter;
|
||
/// <summary>
|
||
///动态明细模式
|
||
/// </summary>
|
||
public bool DynamicDetails;
|
||
/// <summary>
|
||
///显示明细条件
|
||
/// </summary>
|
||
public bool DetailSearch;
|
||
/// <summary>
|
||
///记住上下复选行(上下表都有复选框才生效)
|
||
/// </summary>
|
||
public bool RecordDetailsCheckbox;
|
||
|
||
|
||
/// <summary>
|
||
/// 主模块编号
|
||
/// </summary>
|
||
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._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.T |