/****************************** * 说明:单据系统配置对象 * 创建人:龚宇超 * 创建日期:2017-11-23 * 修改人: * 修改日期: * 修改备注: * 版本:1.0.0.0 ******************************/ using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Data; namespace Lskj.Model { /// /// 单据系统配置对象 /// public class BillModel { /// /// Gets a value indicating whether this instance can copy. /// /// true if this instance can copy; otherwise, false. public bool CanCopy { get; private set; } /// /// Gets a value indicating whether this instance can import. /// /// true if this instance can import; otherwise, false. public bool CanImport { get; private set; } /// /// Gets a value indicating whether this instance can export. /// /// true if this instance can export; otherwise, false. public bool CanExport { get; private set; } /// /// 是否默认添加空行 /// /// true if [default add empty row]; otherwise, false. public bool DefaultAddEmptyRow { get; private set; } /// /// 是否显示红字单据 /// /// true if [visible red bill]; otherwise, false. public bool VisibleRedBill { get; private set; } /// /// 是否允许保存空明细 /// /// true if [save null detail]; otherwise, false. public bool SaveNullDetail { get; private set; } /// /// 单据状态,true:修改.false:新增 /// /// true if [save state]; otherwise, false. public bool SaveState { get; set; } /// /// 单据拖拽是否判断新增 /// /// true if [save state]; otherwise, false. public bool isWorkLogin { get; set; } /// /// 操作区域宽度 /// /// The width of the panel. public int PanelWidth { get; set; } /// /// 操作区域高度 /// /// The height of the panel. public int PanelHeight { get; set; } /// /// Gets the height of the parent. /// /// The height of the parent. public int ParentHeight { get; private set; } /// /// Gets the width of the parent. /// /// The width of the parent. public int ParentWidth { get; private set; } /// /// 打印文件类型 /// /// The type of the print file. public int PrintFileType { get; private set; } /// /// 单据明细列回车默认跳转方式(0.默认列跳转,1为行跳转) /// /// The enter order. public int EnterOrder { get; private set; } /// /// 附件ID /// /// The dir identifier. public int DirId { get; private set; } /// /// 模块名称 /// /// The name of the type. public string TypeName { get; set; } /// /// 主表名 /// /// The master table. public string MasterTable { get; private set; } /// /// 明细表 /// /// The detail table. public string DetailTable { get; private set; } /// /// 主表sql /// /// The master SQL. public string MasterSql { get; private set; } /// /// 明细表sql /// /// The detail SQL. public string DetailSql { get; private set; } /// /// 单据前缀 /// /// The prefix. public string Prefix { get; private set; } /// /// 生成单据号标识 /// /// The bill seq. public string BillSeq { get; private set; } /// /// 修改条件 /// /// The modify cond. public string ModifyCond { get; private set; } /// /// Gets the form key. /// /// The form key. public string FormKey { get; private set; } /// /// 打印文件 /// /// The print file. public string PrintFile { get; private set; } /// /// 打印条件 /// /// The print cond. public string PrintCond { get; private set; } /// /// 打印SQL /// /// The print SQL. public string PrintSql { get; private set; } /// /// 打印SQL1 /// /// The print SQL1. public string PrintSql1 { get; private set; } /// /// 打印SQL2. /// /// The print SQL2. public string PrintSql2 { get; private set; } /// /// Gets the BMP spec. /// /// The BMP spec. public string BmpSpec { get; private set; } /// /// 单据回退人员 /// /// The over back oper. public string OverBackOper { get; private set; } /// /// 单据回退条件 /// /// The over back cond. public string OverBackCond { get; private set; } /// /// 红蓝字单据标记 未配置或者-1显示全部,0=蓝字,1=红字,只加载其中一种类型,屏蔽另一种类型,与单据配置的红字标记不冲突 /// /// The bill flag. public int BillFlag { get; set; } /// /// 单据来源id,逗号分隔,为空代表加载全部来源 /// /// The bill source ids. public string BillSourceIds { get; set; } /// /// 明细排序字段 /// /// The detail order field. public string DetailOrderField { get; set; } /// /// 明细双击是否提示(1.提示,其他情况不提示) /// /// The detail double click tip. public string DetailDoubleClickTip { get; set; } /// /// 主表列前缀 /// /// The master pre fix. public string MasterPreFix { get; set; } /// /// 明细表列前缀 /// /// The detail pre fix. public string DetailPreFix { get; set; } /// /// 单据主键字段 /// /// The primary key. public string PrimaryKey { get { return this.MasterPreFix + "Billdocument_Id"; } } /// /// 单据明细主键字段 /// /// The primary detail key. public string PrimaryDetailKey { get { return this.DetailPreFix + "Billdocument_Id"; } } /// /// 单据明细数据合计UUID字段名 /// public string DetailUUIDKey { get { return "bom_rdl_lstr1"; } } /// /// 红字、蓝字字段 /// /// The rtagid key. public string RtagidKey { get { return this.MasterPreFix + "Rtagid"; } } /// /// 保存后新增 /// /// true if [apply refresh]; otherwise, false. public bool ApplyRefresh { get; set; } /// /// 关联弹出分配数量模块编号 /// /// The popup union code. public string PopupUnionCode { get; set; } /// /// The new ver /// public int NewVer; /// /// 单据明细是否能删除 /// public string DeleteDetailCond; /// /// 单据明细是否能修改 /// public string UpdateDetailCond; /// /// 单据明细打印条件配置 /// public string BillPrintTag; /// /// 单据来源明细拖拽后是否隐藏自身(首次刷新) /// public string drgFinishHide; /// /// 基础档案是否是配置的动态多表头 /// public int AutoMultiHeader; /// /// 保存单据是否显示 /// public string unableToSave; /// /// /// 来源明细第一列是否为复选框 /// public int IsBillDetailCheck; /// /// /// 来源第一列是否为复选框 /// public int IsBillSourceCheck; /// /// /// 明细第一列是否为复选框 /// public int IsBillMainDetailCheck; /// /// /// 单据来源明细改变颜色判断字段 /// public string ChangeColColor; /// /// 单据新增手动触发关联 /// public bool ManuallyTriggerCorrelation; /// /// 拖拽来源明细时同时拖拽来源到主表 /// public bool DrgDetailAndSource; /// /// 导出权限人员名称 /// public string exportUser; /// /// 是否可以导出 /// public bool ExportPermission { get { return string.IsNullOrWhiteSpace(exportUser) || exportUser.Replace(", ", ",").Split(',').Contains(ERPInfo.Instance.UserName); } set { ExportPermission = value; } } /// /// 是否自动刷新下拉框数据源 /// public bool RefGridLookUpData; /// /// 显示隐藏主表按钮 /// public bool HiddenMasterTable; /// /// 是否提交后新增 /// public bool IsApplyAferAdd; /// /// 是否快速拖拽添加明细 /// public bool IsFastDragAddDetail; /// /// 单据明细为树表格 /// public bool DetailTreeTable; /// /// 单据明细为树表格展开方式 /// public string DetailTreeTableExpansion; /// /// 单据明细可以推拽改变顺序 /// public bool DraggingOrder; /// /// 是否为Brp模式 /// public bool IsBrp; /// /// 明细表中默认选中最后一行 /// public bool SelectLast; /// /// 主表明细 加载筛选行 /// public bool LoadFilter; /// /// 主表显示纵向滚动条 /// public bool MainVerticalScroll; /// /// 主表显示横向滚动条 /// public bool MainHorizontalScrolling; /// /// 禁显列不加载数据源 /// public bool DisableFieldSources; /// /// 单据保存前执行的右键id /// public string BeforeBillSaveExec; /// /// 取消拖拽时的提示(是否确认拖拽) /// public bool DisableDragPrompt; /// /// 取消提交成功的提示 /// public bool DisableSubmitPrompt; /// /// 下方附加模块修改后是否刷新主表和主表明细 /// public bool AttachmentRefreshMain; /// ///扫码执行的存储过程 /// public string CodeExecuteSql; /// /// 扫码执行的存储过程参数 /// public string CodeExecuteParameter; /// /// 主表居中(只对Lskj.PubBillSpecial生效) /// //public bool CenterMain; /// /// 扫码后打开的串码模块 /// public string ScanCodeModuleCode; /// /// 扫码时,条码前缀(满足前缀就直接执行存储过程) /// public string ScanCodeFixedPrefix; /// /// 右侧表格模块号 /// public string RightModuleCode; /// /// 刷新选中的附加明细(默认单击主表明细行时,刷新下方全部附加明细) /// public bool RefreshSelectedDetail; /// ///初始化后自动切换到指定页签并搜索的页签id /// public string InitialRefreshId; /// ///旧版分配 不判断是否为分配后的数据 /// public bool IgnoreAllocated; /// ///单据来源控件FieldName(设置后界面上不显示来源和来源明细) /// public string BillSourceControlName; /// ///单据明细拖拽条件(为树表格时推拽改变父节点和来源明细中推拽内容上去) /// public string TreeTableDragCondition; /// ///是否固定替换(默认为true,主表中固定后缀的控件会替换为固定的默认值) /// public bool isReplaceFixed; /// ///保存后刷新下方附加明细 /// public bool SaveRefreshAdditional; /// ///取消复制表头后的触发关联(默认触发,设置为1不触发) /// public bool CancelCopyAssociation; /// ///打印按钮交互条件 /// public string PrintingConditions; /// ///新增保存时检查单据号 /// public bool SaveVerifyBillNo; /// ///添加明细行时,不包含在推拽行中的列固定为默认值 /// public bool DragFixedDefault; /// ///凭证模块 替换csign字段的字段名 /// public string CsignFieldName; /// ///附加模块修改条件(不配置默认根据单据条件ModifyCond判断) /// public string AdditionalCond; /// /// 单据终审后可以添加明细 /// public bool BillFinalReviewAdd; /// /// Initializes a new instance of the class. /// /// The row item. /// //p_systembilltype public BillModel(DataRow rowItem) { if (rowItem == null) return; DataColumnCollection columns = rowItem.Table.Columns; this.TypeName = rowItem["typeName"] + ""; this.Prefix = columns.Contains("prefix") ? rowItem["prefix"] + "" : string.Empty; this.MasterTable = rowItem["masterTable"] + ""; this.DetailTable = rowItem["detailTable"] + ""; this.MasterSql = rowItem["MasterSql"] + ""; this.DetailSql = rowItem["DetailSql"] + ""; this.PanelWidth = string.IsNullOrEmpty(rowItem["billWidth"] + "") ? 900 : Convert.ToInt32(rowItem["billWidth"] + ""); this.PanelHeight = string.IsNullOrEmpty(rowItem["billHeight"] + "") ? 450 : Convert.ToInt32(rowItem["billHeight"] + ""); this.ParentHeight = string.IsNullOrEmpty(rowItem["ParentHeight"] + "") ? 0 : Convert.ToInt32(rowItem["ParentHeight"] + ""); this.ParentWidth = string.IsNullOrEmpty(rowItem["ParentWidth"] + "") ? 0 : Convert.ToInt32(rowItem["ParentWidth"] + ""); this.BillSeq = columns.Contains("billseq") ? rowItem["billseq"] + "" : string.Empty; this.ModifyCond = columns.Contains("ModifyCond") ? rowItem["ModifyCond"] + "" : string.Empty; this.FormKey = rowItem["FormKey"] + ""; this.PrintFileType = columns.Contains("billPrintType") && !string.IsNullOrEmpty(rowItem["billPrintType"] + "") ? Convert.ToInt32(rowItem["billPrintType"] + "") : 0; this.PrintFile = rowItem["billModuleFile"] + ""; this.PrintSql = rowItem["billPrintSql"] + ""; this.PrintSql1 = rowItem["billPrintSql1"] + ""; this.PrintSql2 = rowItem["billPrintSql2"] + ""; this.DirId = string.IsNullOrEmpty(rowItem["dirid"] + "") ? 0 : Convert.ToInt32(rowItem["dirid"] + ""); this.BmpSpec = string.IsNullOrEmpty(rowItem["BmpSpec"] + "") ? string.Empty : rowItem["BmpSpec"] + ""; this.VisibleRedBill = columns.Contains("redBill") && !string.IsNullOrEmpty(rowItem["redBill"] + "") ? Convert.ToBoolean(rowItem["redBill"] + "") : true; this.SaveNullDetail = columns.Contains("bHasDetail") && !string.IsNullOrEmpty(rowItem["bHasDetail"] + "") ? Convert.ToBoolean(rowItem["bHasDetail"] + "") : false; this.OverBackOper = columns.Contains("OverBackOper") ? rowItem["OverBackOper"] + "" : string.Empty; this.OverBackCond = columns.Contains("OverBackCond") ? rowItem["OverBackCond"] + "" : string.Empty; this.DefaultAddEmptyRow = columns.Contains("AddEmptyRow") && !string.IsNullOrEmpty(rowItem["AddEmptyRow"] + "") ? "1".Equals(rowItem["AddEmptyRow"] + "") : false; this.CanCopy = columns.Contains("CanCopy") && !string.IsNullOrEmpty(rowItem["CanCopy"] + "") ? "1".Equals(rowItem["CanCopy"] + "") : true; this.CanImport = columns.Contains("CanImport") && !string.IsNullOrEmpty(rowItem["CanImport"] + "") ? "1".Equals(rowItem["CanImport"] + "") : true; this.CanExport = columns.Contains("CanExport") && !string.IsNullOrEmpty(rowItem["CanExport"] + "") ? "1".Equals(rowItem["CanExport"] + "") : true; this.EnterOrder = columns.Contains("EnterOrder") && !string.IsNullOrEmpty(rowItem["EnterOrder"] + "") ? Convert.ToInt32(rowItem["EnterOrder"] + "") : 0; this.DetailDoubleClickTip = columns.Contains("DetailDoubleClickTip") ? rowItem["DetailDoubleClickTip"] + "" : string.Empty; this.ApplyRefresh = columns.Contains("ApplyRefresh") && "1".Equals(rowItem["ApplyRefresh"] + ""); this.NewVer = columns.Contains("NewVer") && !string.IsNullOrEmpty(rowItem["NewVer"] + "") ? Convert.ToInt32(rowItem["NewVer"] + "") : 0; this.PopupUnionCode = columns.Contains("PopupUnionCode") && !string.IsNullOrEmpty(rowItem["PopupUnionCode"] + "") ? rowItem["PopupUnionCode"] + "" : ""; this.DeleteDetailCond = columns.Contains("DeleteDetailCond") && !string.IsNullOrEmpty(rowItem["DeleteDetailCond"] + "") ? rowItem["DeleteDetailCond"] + "" : ""; this.UpdateDetailCond = columns.Contains("UpdateDetailCond") && !string.IsNullOrEmpty(rowItem["UpdateDetailCond"] + "") ? rowItem["UpdateDetailCond"] + "" : ""; this.BillPrintTag = columns.Contains("BillPrintTag") && !string.IsNullOrEmpty(rowItem["BillPrintTag"] + "") ? rowItem["BillPrintTag"] + "" : ""; this.AutoMultiHeader = columns.Contains("AutoMultiHeader") && !string.IsNullOrEmpty(rowItem["AutoMultiHeader"] + "") ? Convert.ToInt32(rowItem["AutoMultiHeader"] + "") : 0; this.IsBillDetailCheck = columns.Contains("billDetailCheck") && !string.IsNullOrEmpty(rowItem["billDetailCheck"] + "") ? Convert.ToInt32(rowItem["billDetailCheck"] + "") : 0; this.IsBillSourceCheck = columns.Contains("billSourceCheck") && !string.IsNullOrEmpty(rowItem["billSourceCheck"] + "") ? Convert.ToInt32(rowItem["billSourceCheck"] + "") : 0; this.IsBillMainDetailCheck = columns.Contains("billMainDetailCheck") && !string.IsNullOrEmpty(rowItem["billMainDetailCheck"] + "") ? Convert.ToInt32(rowItem["billMainDetailCheck"] + "") : 0; this.unableToSave = columns.Contains("UnableToSave") && !string.IsNullOrEmpty(rowItem["UnableToSave"] + "") ? rowItem["UnableToSave"] + "" : ""; this.drgFinishHide = columns.Contains("drgFinishHide") && !string.IsNullOrEmpty(rowItem["drgFinishHide"] + "") ? rowItem["drgFinishHide"] + "" : ""; this.ChangeColColor = columns.Contains("ChangeColColor") && !string.IsNullOrEmpty(rowItem["ChangeColColor"] + "") ? rowItem["ChangeColColor"] + "" : ""; this.PrintCond = columns.Contains("PrintCond") && !string.IsNullOrEmpty(rowItem["PrintCond"] + "") ? rowItem["PrintCond"] + "" : ""; this.ManuallyTriggerCorrelation = columns.Contains("manuallyTriggerCorrelation") && "1".Equals(rowItem["manuallyTriggerCorrelation"] + ""); this.DrgDetailAndSource = columns.Contains("drgDetailAndSource") && "1".Equals(rowItem["drgDetailAndSource"] + ""); this.exportUser = columns.Contains("exportUser") && !string.IsNullOrEmpty(rowItem["exportUser"] + "") ? rowItem["exportUser"] + "" : ""; this.RefGridLookUpData = columns.Contains("RefGridLookUpData") && "1".Equals(rowItem["RefGridLookUpData"] + ""); this.HiddenMasterTable = columns.Contains("HiddenMasterTable") && !string.IsNullOrEmpty(rowItem["HiddenMasterTable"] + "") ? "1".Equals(rowItem["HiddenMasterTable"] + "") : false; this.IsApplyAferAdd = columns.Contains("IsApplyAferAdd") && !string.IsNullOrEmpty(rowItem["IsApplyAferAdd"] + "") ? "1".Equals(rowItem["IsApplyAferAdd"] + "") : false; this.IsFastDragAddDetail = columns.Contains("IsFastDragAddDetail") && !string.IsNullOrEmpty(rowItem["IsFastDragAddDetail"] + "") ? "1".Equals(rowItem["IsFastDragAddDetail"] + "") : false; this.DraggingOrder = columns.Contains("DraggingOrder") && !string.IsNullOrEmpty(rowItem["DraggingOrder"] + "") ? "1".Equals(rowItem["DraggingOrder"] + "") : false; this.IsBrp = columns.Contains("IsBrp") && !string.IsNullOrEmpty(rowItem["IsBrp"] + "") ? "1".Equals(rowItem["IsBrp"] + "") : false; this.isWorkLogin = columns.Contains("isWorkLogin") && !string.IsNullOrEmpty(rowItem["isWorkLogin"] + "") ? "1".Equals(rowItem["isWorkLogin"] + "") : false; this.DetailTreeTable = columns.Contains("DetailTreeTable") && !string.IsNullOrEmpty(rowItem["DetailTreeTable"] + "") ? "1".Equals(rowItem["DetailTreeTable"] + "") : false; this.DetailTreeTableExpansion = columns.Contains("DetailTreeTableExpansion") && !string.IsNullOrEmpty(rowItem["DetailTreeTableExpansion"] + "") ? rowItem["DetailTreeTableExpansion"] + "" : "1"; this.SelectLast = columns.Contains("SelectLast") && !string.IsNullOrEmpty(rowItem["SelectLast"] + "") ? "1".Equals(rowItem["SelectLast"] + "") : false; this.LoadFilter = columns.Contains("LoadFilter") && !string.IsNullOrEmpty(rowItem["LoadFilter"] + "") ? "1".Equals(rowItem["LoadFilter"] + "") : false; this.MainVerticalScroll = columns.Contains("MainVerticalScroll") && !string.IsNullOrEmpty(rowItem["MainVerticalScroll"] + "") ? "1".Equals(rowItem["MainVerticalScroll"] + "") : false; this.MainHorizontalScrolling = columns.Contains("MainHorizontalScrolling") && !string.IsNullOrEmpty(rowItem["MainHorizontalScrolling"] + "") ? "1".Equals(rowItem["MainHorizontalScrolling"] + "") : false; this.DisableFieldSources = rowItem.Table.Columns.Contains("DisableFieldSources") ? "1".Equals(rowItem["DisableFieldSources"] + "") : false; this.BeforeBillSaveExec = rowItem.Table.Columns.Contains("BeforeBillSaveExec") ? rowItem["BeforeBillSaveExec"] + "" : ""; this.DisableDragPrompt = rowItem.Table.Columns.Contains("DisableDragPrompt") ? "1".Equals(rowItem["DisableDragPrompt"] + "") : false; this.DisableSubmitPrompt = rowItem.Table.Columns.Contains("DisableSubmitPrompt") ? "1".Equals(rowItem["DisableSubmitPrompt"] + "") : false; this.AttachmentRefreshMain = rowItem.Table.Columns.Contains("AttachmentRefreshMain") ? "1".Equals(rowItem["AttachmentRefreshMain"] + "") : false; this.CodeExecuteSql = rowItem.Table.Columns.Contains("CodeExecuteSql") ? rowItem["CodeExecuteSql"] + "" : ""; this.CodeExecuteParameter = rowItem.Table.Columns.Contains("CodeExecuteParameter") ? rowItem["CodeExecuteParameter"] + "" : ""; //this.CenterMain = rowItem.Table.Columns.Contains("CenterMain") ? "1".Equals(rowItem["CenterMain"] + "") : false; this.ScanCodeModuleCode = rowItem.Table.Columns.Contains("ScanCodeModuleCode") ? rowItem["ScanCodeModuleCode"] + "" : ""; this.ScanCodeFixedPrefix = rowItem.Table.Columns.Contains("ScanCodeFixedPrefix") ? rowItem["ScanCodeFixedPrefix"] + "" : ""; this.RightModuleCode = rowItem.Table.Columns.Contains("RightModuleCode") ? rowItem["RightModuleCode"] + "" : ""; this.RefreshSelectedDetail = rowItem.Table.Columns.Contains("RefreshSelectedDetail") ? "1".Equals(rowItem["RefreshSelectedDetail"] + "") : false; this.InitialRefreshId = rowItem.Table.Columns.Contains("InitialRefreshId") ? rowItem["InitialRefreshId"] + "" : ""; this.IgnoreAllocated = rowItem.Table.Columns.Contains("IgnoreAllocated") ? "1".Equals(rowItem["IgnoreAllocated"] + "") : false; this.BillSourceControlName = rowItem.Table.Columns.Contains("BillSourceControlName") ? rowItem["BillSourceControlName"] + "" : ""; if (!string.IsNullOrWhiteSpace(this.BillSourceControlName)) { this.PanelWidth = 0; this.PanelHeight = 0; } this.TreeTableDragCondition = rowItem.Table.Columns.Contains("TreeTableDragCondition") ? rowItem["TreeTableDragCondition"] + "" : ""; this.isReplaceFixed = rowItem.Table.Columns.Contains("isReplaceFixed") ? !"1".Equals(rowItem["isReplaceFixed"] + "") : true; this.SaveRefreshAdditional = rowItem.Table.Columns.Contains("SaveRefreshAdditional") ? "1".Equals(rowItem["SaveRefreshAdditional"] + "") : false; this.CancelCopyAssociation