134 lines
6.9 KiB
C#
134 lines
6.9 KiB
C#
/******************************
|
|
* 说明:单据来源对象
|
|
* 创建人:龚宇超
|
|
* 创建日期:2017-11-28
|
|
* 修改人:
|
|
* 修改日期:
|
|
* 修改备注:
|
|
* 版本:1.0.0.0
|
|
******************************/
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Data;
|
|
|
|
namespace Lskj.PubBillManagement.Model
|
|
{
|
|
/// <summary>
|
|
/// 单据来源对象
|
|
/// </summary>
|
|
public class BillSourceModel
|
|
{
|
|
public int Id { get; private set; }
|
|
public int SourceType { get; private set; }
|
|
public int LoadBom { get; private set; }
|
|
public bool CadDragDetail { get; private set; }
|
|
public string UserName { get; private set; }
|
|
public string FormKey { get; private set; }
|
|
public string SourceKeyField { get; private set; }
|
|
public string SourceResult { get; private set; }
|
|
public string SourceSql { get; private set; }
|
|
public string DetailSql { get; private set; }
|
|
public string BomSql { get; private set; }
|
|
public string BomCaption { get; private set; }
|
|
public string DetailEnableCond { get; private set; }
|
|
public string CodeInputSql { get; private set; }
|
|
public string CodeInputCaption { get; private set; }
|
|
public string CodeInputHint { get; private set; }
|
|
public string SearchDefaultField { get; private set; }
|
|
public string DetailEnableMsg { get; private set; }
|
|
public bool SaveRefreshFlag { get; private set; }
|
|
public string SourceDetailsDetailsSql { get; private set; }//来源明细的明细
|
|
public string sourceDetailType { get; private set; }//来源明细的类型
|
|
public bool DisableShowSourceCount { get; private set; }//是否显示来源数量
|
|
public string AddDataSql { get; private set; }// 添加数据sql(来源明细添加到主表明细时,执行sql把查询数据源一并添加到来源明细中)
|
|
public string AddDataCondition { get; private set; }// 添加数据条件
|
|
public bool LoadFilter { get; private set; }//来源筛选行是否显示
|
|
public bool DetailedLoadFilter { get; private set; }//来源明细筛选行是否显示
|
|
|
|
public bool DetailsDoubleClick;// 单据来源刷新来源明细模式,默认单击,1为双击
|
|
|
|
public string MainDetailsAddType;// 主表明细新增模式 (默认来源明细和来源明细的明细都可以添加到主表, 1为来源明细添加 2为来源明细的明细添加)
|
|
|
|
public string SourceKeyFieldName;// 节点id(来源主表为树表格时)
|
|
|
|
public string SourceParentFieldName;// 父节点id(来源主表为树表格时 )
|
|
|
|
public bool DragAndSave;// 拖拽后保存
|
|
|
|
public bool TreeInhibitSort;// 树节点 禁用默认排序
|
|
|
|
public string Orderid;// 来源页签序号
|
|
|
|
public string DetailMenuCode;// 来源模块号
|
|
|
|
|
|
|
|
public BillSourceModel(DataRow item)
|
|
{
|
|
if (item == null) return;
|
|
|
|
this.Id = Convert.ToInt32(item["Id"] + "");
|
|
this.SourceType = string.IsNullOrEmpty(item["sourceType"] + "") ? 0 : Convert.ToInt32(item["sourceType"] + "");
|
|
this.LoadBom = string.IsNullOrEmpty(item["loadbom"] + "") ? 0 : Convert.ToInt32(item["loadbom"] + "");
|
|
this.CadDragDetail = item.Table.Columns.Contains("dragDetailEnable") ? "1" != item["dragDetailEnable"] + "" : true;
|
|
this.UserName = item["userName"] + "";
|
|
if (Business.Impl.LanguageTranslation.Translatable)
|
|
{
|
|
this.UserName = Business.Impl.LanguageTranslation.GetTranslatedText(this.UserName);
|
|
}
|
|
|
|
this.FormKey = item["FormKey"] + "";
|
|
this.SourceKeyField = item["sourceKeyField"] + "";
|
|
this.SourceResult = item["sourceResult"] + "";
|
|
this.SourceSql = item["SourceSql"] + "";
|
|
this.DetailSql = item["DetailSql"] + "";
|
|
this.BomSql = item["BomSql"] + "";
|
|
this.BomCaption = item["BomCaption"] + "";
|
|
this.DetailEnableCond = item["DetailEnableCond"] + "";
|
|
this.CodeInputSql = item["CodeInputSql"] + "";
|
|
this.CodeInputCaption = item["CodeInputCaption"] + "";
|
|
this.CodeInputHint = item["CodeInputHint"] + "";
|
|
this.SearchDefaultField = item["SearchDefault"] + "";
|
|
this.DetailEnableMsg = item["DetailEnableMsg"] + "";
|
|
this.SaveRefreshFlag = item.Table.Columns.Contains("SaveRefreshFlag") && "1".Equals(item["SaveRefreshFlag"] + "") ? true : false;
|
|
this.SourceDetailsDetailsSql = item.Table.Columns.Contains("detailSQL1") ? item["detailSQL1"] + "" : "";
|
|
this.sourceDetailType = item.Table.Columns.Contains("sourceDetailType") ? item["sourceDetailType"] + "" : "";
|
|
this.DisableShowSourceCount = item.Table.Columns.Contains("DisableShowSourceCount") && "1".Equals(item["DisableShowSourceCount"] + "") ? true : false;
|
|
|
|
this.AddDataSql = item.Table.Columns.Contains("AddDataSql") ? item["AddDataSql"] + "" : "";
|
|
this.AddDataCondition = item.Table.Columns.Contains("AddDataCondition") ? item["AddDataCondition"] + "" : "";
|
|
|
|
this.LoadFilter = item.Table.Columns.Contains("LoadFilter") && "1".Equals(item["LoadFilter"] + "") ? true : false;
|
|
this.DetailedLoadFilter = item.Table.Columns.Contains("DetailedLoadFilter") && "1".Equals(item["DetailedLoadFilter"] + "") ? true : false;
|
|
this.DetailsDoubleClick = item.Table.Columns.Contains("DetailsDoubleClick") && "1".Equals(item["DetailsDoubleClick"] + "") ? true : false;
|
|
this.MainDetailsAddType = item.Table.Columns.Contains("MainDetailsAddType") ? item["MainDetailsAddType"] + "" : "";
|
|
|
|
this.SourceKeyFieldName = item.Table.Columns.Contains("SourceKeyFieldName") ? item["SourceKeyFieldName"] + "" : "";
|
|
this.SourceParentFieldName = item.Table.Columns.Contains("SourceParentFieldName") ? item["SourceParentFieldName"] + "" : "";
|
|
this.DragAndSave = item.Table.Columns.Contains("DragAndSave") && "1".Equals(item["DragAndSave"] + "") ? true : false;
|
|
this.TreeInhibitSort = item.Table.Columns.Contains("TreeInhibitSort") && "1".Equals(item["TreeInhibitSort"] + "") ? true : false;
|
|
this.Orderid = item.Table.Columns.Contains("Orderid") ? item["Orderid"] + "" : "";
|
|
this.DetailMenuCode = item.Table.Columns.Contains("DetailMenuCode") ? item["DetailMenuCode"] + "" : "";
|
|
}
|
|
/// <summary>
|
|
/// 改变来源类型
|
|
/// </summary>
|
|
/// <param name="sourceType"></param>
|
|
public void ChangeSourceType(int sourceType)
|
|
{
|
|
this.SourceType = sourceType;
|
|
}
|
|
|
|
/// <summary>
|
|
/// 改变来源明细类型
|
|
/// </summary>
|
|
/// <param name="sourceType"></param>
|
|
public void ChangeSourceDetailType(string sourceDetailType)
|
|
{
|
|
this.sourceDetailType = sourceDetailType;
|
|
}
|
|
}
|
|
}
|