using Lskj.Control.Model;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
namespace Lskj.PubBomAlter.Model
{
///
/// PubProductSysMge实体类
///
public class SysSetModel : ControlModel
{
///
/// 数据源
///
public DataRow SourceRow;
public int Id { get; set; }
public int GroupId { get; set; }
///
/// 方案名称
///
public string GroupName { get; set; }
///
/// 序号
///
public int OrderId { get; set; }
///
/// 反写规格序号
///
public int SpecSort { get; set; }
///
/// 反写型号序号
///
public int ModelSort { get; set; }
///
/// 反写综合属性序号
///
public int ProDeSort { get; set; }
///
/// 反写材质序号
///
public int GradeSort { get; set; }
///
/// 节点
///
public string SpeciesId { get; set; }
///
/// 节点名
///
public string SpeciesName { get; set; }
///
/// 参数名
///
public string SysName { get; set; }
public int SysCount { get; set; }
public int SysInt { get; set; }
///
/// 备注
///
public string SysInfo { get; set; }
//禁用标识
public int Ban { get; set; }
///
/// 类型 ,1仅限选择,2仅限输入
///
public string Item { get; set; }
public string XZ1 { get; set; }
///
/// 反写字段
///
public string DbName { get; set; }
public int? DbNameCount { get; set; }
///
/// 是否反写规格
///
public int? SpecDbName { get; set; }
///
/// 是否反写型号
///
public int? ModelDbName { get; set; }
///
/// 是否反写综合属性
///
public int? ZhSxdbName { get; set; }
///
/// 是否反写材质
///
public int? CzdbName { get; set; }
///
/// 反写规格型号类型
///
public string FxType { get; set; }
///
/// 反写字段类型
///
public string FxTypeDB { get; set; }
///
/// 数据源来源类型
///
public string DataSourceType { get; set; }
///
/// 数据源来源sql
///
public string DataSourceSql { get; set; }
///
/// 生成BOM标识
///
public int? BomTig { get; set; }
///
/// 连接符
///
public string ConnectorStr { get; set; }
///
/// 默认编码
///
public string DefaultID { get; set; }
///
/// 默认名称
///
public string DefaultName { get; set; }
///
/// 必填标识
///
public int? MustTig { get; set; }
///
/// 关联字段
///
public string UnionFields { get; set; }
///
/// 关联值
///
/// The union values.
public string UnionValues { get; set; }
///
/// 禁编
///
/// The union values.
public bool ProhibitEdited { get; set; }
///
/// 排序字段
///
/// The union values.
public string OrderField { get; set; }
///
/// 日期格式
///
public string DataFormat { get; set; }
///
/// 必填条件
///
public string RequiredCond { get; set; }
///
/// 连接符(后方)
///
public string EndConnectorStr { get; set; }
///
/// 反写类型(反写规格)
///
public string FxTypeGg { get; set; }
///
/// 反写类型(反写型号)
///
public string FxTypeXh { get; set; }
///
/// 反写类型(反写综合属性)
///
public string FxTypeZhsx { get; set; }
///
/// 反写类型(反写材质)
///
public string FxTypeCz { get; set; }
///
/// 前连接符 (反写规格)
///
public string ConnectorStrGg { get; set; }
//
/// 后连接符 (反写规格)
///
public string EndConnectorStrGg { get; set; }
///
/// 前连接符 (反写型号)
///
public string ConnectorStrXh { get; set; }
//
/// 后连接符 (反写型号)
///
public string EndConnectorStrXh { get; set; }
///
/// 前连接符 (反写综合属性)
///
public string ConnectorStrZhsx { get; set; }
//
/// 后连接符 (反写综合属性)
///
public string EndConnectorStrZhsx { get; set; }
///
/// 前连接符 (反写材质)
///
public string ConnectorStrCz { get; set; }
//
/// 后连接符 (反写材质)
///
public string EndConnectorStrCz { get; set; }
public SysSetModel(DataRow rowItem)
{
this.SourceRow = rowItem;
this.Id = rowItem.Table.Columns.Contains("id") && int.TryParse(rowItem["id"] + "", out int id) ? id : 0;
this.GroupId = rowItem.Table.Columns.Contains("Groupid") && int.TryParse(rowItem["Groupid"] + "", out int groupId) ? groupId : 0;
this.GroupName = rowItem.Table.Columns.Contains("GroupName") ? rowItem["GroupName"] + "" : "";
this.OrderId = rowItem.Table.Columns.Contains("orderid") && int.TryParse(rowItem["orderid"] + "", out int orderid) ? orderid : 0;
this.SpecSort = rowItem.Table.Columns.Contains("SpecSort") && int.TryParse(rowItem["SpecSort"] + "", out int specSort) ? specSort : 0;
this.ModelSort = rowItem.Table.Columns.Contains("ModelSort") && int.TryParse(rowItem["ModelSort"] + "", out int modelSort) ? modelSort : 0;
this.ProDeSort = rowItem.Table.Columns.Contains("ProDeSort") && int.TryParse(rowItem["ProDeSort"] + "", out int proDeSort) ? proDeSort : 0;
this.GradeSort = rowItem.Table.Columns.Contains("GradeSort") && int.TryParse(rowItem["GradeSort"] + "", out int gradeSort) ? gradeSort : 0;
this.SpeciesId = rowItem.Table.Columns.Contains("speciesid") ? rowItem["speciesid"] + "" : "";
this.SpeciesName = rowItem.Table.Columns.Contains("speciesname") ? rowItem["speciesname"] + "" : "";
this.SysName = rowItem.Table.Columns.Contains("sysname") ? rowItem["sysname"] + "" : "";
this.SysCount = rowItem.Table.Columns.Contains("syscount") && int.TryParse(rowItem["syscount"] + "", out int syscount) ? syscount : 0;
this.SysInt = rowItem.Table.Columns.Contains("sysint") && int.TryParse(rowItem["sysint"] + "", out int sysint) ? sysint : 0;
this.SysInfo = rowItem.Table.Columns.Contains("sysinfo") ? rowItem["sysinfo"] + "" : "";
this.Ban = rowItem.Table.Columns.Contains("ban") && int.TryParse(rowItem["ban"] + "", out int ban) ? ban : 0;
this.Item = rowItem.Table.Columns.Contains("Item") ? rowItem["Item"] + "" : "";
this.XZ1 = rowItem.Table.Columns.Contains("XZ1") ? rowItem["XZ1"] + "" : "";
this.DbName = rowItem.Table.Columns.Contains("dbname") ? rowItem["dbname"] + "" : "";
this.DbNameCount = rowItem.Table.Columns.Contains("dbnameCount") ? rowItem["dbnameCount"] == DBNull.Value ? (int?)null : Convert.ToInt32(rowItem["dbnameCount"] + "") : 0;
this.SpecDbName = rowItem.Table.Columns.Contains("specdbname") ? rowItem["specdbname"] == DBNull.Value ? (int?)null : Convert.ToInt32(rowItem["specdbname"] + "") : 0;
this.ModelDbName = rowItem.Table.Columns.Contains("modeldbname") ? rowItem["modeldbname"] == DBNull.Value ? (int?)null : Convert.ToInt32(rowItem["modeldbname"] + "") : 0;
this.ZhSxdbName = rowItem.Table.Columns.Contains("ZhSxdbName") ? rowItem["ZhSxdbName"] == DBNull.Value ? (int?)null : Convert.ToInt32(rowItem["ZhSxdbName"] + "") : 0;
this.CzdbName = rowItem.Table.Columns.Contains("CzdbName") ? rowItem["CzdbName"] == DBNull.Value ? (int?)null : Convert.ToInt32(rowItem["CzdbName"] + "") : 0;
this.FxType = rowItem.Table.Columns.Contains("FxType") ? rowItem["FxType"] + "" : "";
this.FxTypeDB = rowItem.Table.Columns.Contains("FxTypeDB") ? rowItem["FxTypeDB"] + "" : "";
this.DataSourceType = rowItem.Table.Columns.Contains("DataSourceType") ? rowItem["DataSourceType"] + "" : "";
this.DataSourceSql = rowItem.Table.Columns.Contains("DataSourceSql") ? rowItem["DataSourceSql"] + "" : "";
this.BomTig = rowItem.Table.Columns.Contains("BomTig") ? rowItem["BomTig"] == DBNull.Value ? (int?)null : Convert.ToInt32(rowItem["BomTig"] + "") : 0;
this.ConnectorStr = rowItem.Table.Columns.Contains("ConnectorStr") ? rowItem["ConnectorStr"] + "" : "";
this.EndConnectorStr = rowItem.Table.Columns.Contains("EndConnectorStr") ? rowItem["EndConnectorStr"] + "" : "";
this.DefaultID = rowItem.Table.Columns.Contains("defaultID") ? rowItem["defaultID"] + "" : "";
this.DefaultName = rowItem.Table.Columns.Contains("defaultName") ? rowItem["defaultName"] + "" : "";
this.MustTig = rowItem.Table.Columns.Contains("musttig") ? rowItem["musttig"] == DBNull.Value ? (int?)null : Convert.ToInt32(rowItem["musttig"] + "") : 0;
this.UnionFields = rowItem.Table.Columns.Contains("RelevanceField") ? rowItem["RelevanceField"] + "" : "";
this.UnionValues = rowItem.Table.Columns.Contains("RelevanceValue") ? rowItem["RelevanceValue"] + "" : "";
this.ProhibitEdited = rowItem.Table.Columns.Contains("ProhibitEdited") ? "1".Equals(rowItem["ProhibitEdited"] + "") : false;
this.LookUpFieldsWidth = rowItem.Table.Columns.Contains("LookUpFieldsWidth") ? rowItem["LookUpFieldsWidth"] + "" : "";
this.LookUpWidth = 0;
this.OrderField = rowItem.Table.Columns.Contains("lsidx_id") ? rowItem["lsidx_id"] + "" : "";
this.DataFormat = rowItem.Table.Columns.Contains("DataFormat") ? rowItem["DataFormat"] + "" : "";
this.RequiredCond = rowItem.Table.Columns.Contains("RequiredCond") ? rowItem["RequiredCond"] + "" : "";
this.DisableCond = rowItem.Table.Columns.Contains("DisableCond") ? rowItem["DisableCond"] + "" : "";
this.FxTypeGg = rowItem.Table.Columns.Contains("FxTypeGg") && !string.IsNullOrEmpty(rowItem["FxTypeGg"] + "") ? rowItem["FxTypeGg"] + "" : this.FxType;
this.FxTypeXh = rowItem.Table.Columns.Contains("FxTypeXh") && !string.IsNullOrEmpty(rowItem["FxTypeXh"] + "") ? rowItem["FxTypeXh"] + "" : this.FxType;
this.FxTypeZhsx = rowItem.Table.Columns.Contains("FxTypeZhsx") && !string.IsNullOrEmpty(rowItem["FxTypeZhsx"] + "") ? rowItem["FxTypeZhsx"] + "" : this.FxType;
this.FxTypeCz = rowItem.Table.Columns.Contains("FxTypeCz") && !string.IsNullOrEmpty(rowItem["FxTypeCz"] + "") ? rowItem["FxTypeCz"] + "" : this.FxType;
this.ConnectorStrGg = rowItem.Table.Columns.Contains("ConnectorStrGg") && !string.IsNullOrEmpty(rowItem["ConnectorStrGg"] + "") ? rowItem["ConnectorStrGg"] + "" : "";
this.EndConnectorStrGg = rowItem.Table.Columns.Contains("EndConnectorStrGg") && !string.IsNullOrEmpty(rowItem["EndConnectorStrGg"] + "") ? rowItem["EndConnectorStrGg"] + "" : "";
this.ConnectorStrXh = rowItem.Table.Columns.Contains("ConnectorStrXh") && !string.IsNullOrEmpty(rowItem["ConnectorStrXh"] +