/// <summary> /// Initializes a new instance of the <see cref="MultiCrossReferenceDefinition"/> class. /// </summary> /// <param name="manyTable1">The many table1.</param> /// <param name="keyTable1">The key table1.</param> /// <param name="manyTable2">The many table2.</param> /// <param name="keyTable2">The key table2.</param> /// <param name="joinTableName">Name of the join table.</param> /// <param name="showFieldList">The show field list.</param> /// <param name="baseTables">The base tables.</param> public MultiCrossReferenceDefinition(TableDefinition manyTable1, string keyTable1, TableDefinition manyTable2, string keyTable2, string joinTableName, IList<string> showFieldList, params TableDefinition[] baseTables) { if (manyTable1 != null) _manyTable1Name = manyTable1.Name; JoinTable = new TableDefinition(joinTableName); JoinTable.AddField(keyTable1, ColumnTypes.Integer); JoinTable.AddField(keyTable2, ColumnTypes.Integer); CrossRef1 = new SingleCrossReferenceDefinition(JoinTable, manyTable1, keyTable1, "alias1"); CrossRef2 = new SingleCrossReferenceDefinition(JoinTable, manyTable2, keyTable2, "alias2"); ShowFieldList = showFieldList; var list = new List<TableDefinition>(); if (baseTables != null) for (var index = 0; index < baseTables.Length; index++) { var tbl = baseTables[index]; if (manyTable2 == null || string.Equals(manyTable2.Name, tbl.Name)) continue; var newTableDef = new TableDefinition(tbl.Name) { Prefix = manyTable2.Name + string.Format(CultureInfo.InvariantCulture, "_b{0}", index) }; foreach (var field in tbl.GetFields()) newTableDef.AddField(field.SystemName, field.ColumnType); list.Add(newTableDef); } BaseTables = list; }
/// <summary> /// Initializes a new instance of the <see cref="SingleCrossReferenceDefinition"/> class. /// </summary> /// <param name="oneTable">The one table.</param> /// <param name="manyTable">The many table.</param> /// <param name="keyField">The key field.</param> /// <param name="alias">The alias.</param> public SingleCrossReferenceDefinition(TableDefinition oneTable, TableDefinition manyTable, string keyField, string alias) { OneTable = oneTable; KeyField = keyField; ManyTable = manyTable; Alias = alias; BaseTables = new TableDefinition[0]; }
/// <summary> /// Initializes a new instance of the <see cref="FieldDefinition"/> class. /// </summary> /// <param name="name"> /// The name. /// </param> /// <param name="type"> /// The type. /// </param> /// <param name="parentTable"> /// The parent table. /// </param> /// <param name="securityGuardValue"> /// The security guard value. /// </param> /// <param name="includeInResult"> /// if set to <c>true</c> [include in result]. /// </param> /// <param name="isFilterable"> /// if set to <c>true</c> [is filterable]. /// </param> /// <param name="nameValuesList"> /// The name values list. /// </param> /// <param name="isRichText"> /// if set to <c>true</c> [is rich text]. /// </param> /// <param name="allowLocalizedData"> /// The allow localized data. /// </param> public FieldDefinition(string name, ColumnTypes type, TableDefinition parentTable, string securityGuardValue, bool includeInResult = true, bool isFilterable = true, Dictionary<string, object> nameValuesList = null, bool isRichText = false, bool allowLocalizedData = false) { this.SystemName = name; this.ColumnType = type; _parentTable = parentTable; SecurityGuardValue = securityGuardValue; IncludeInResult = includeInResult; IsFilterable = isFilterable; NameValuesList = nameValuesList; IsRichText = isRichText; AllowLocalizedData = allowLocalizedData; }
/// <summary> /// Initializes a new instance of the <see cref="SingleCrossReferenceDefinition"/> class. /// </summary> /// <param name="oneTable">The one table.</param> /// <param name="manyTable">The many table.</param> /// <param name="keyField">The key field.</param> /// <param name="showFieldList">The show field list.</param> /// <param name="alias">The alias.</param> /// <param name="baseTables">The base tables.</param> public SingleCrossReferenceDefinition(TableDefinition oneTable, TableDefinition manyTable, string keyField, string[] showFieldList, string alias, params TableDefinition[] baseTables) : this(oneTable, manyTable, keyField, alias) { ShowFieldList = showFieldList; var list = new List<TableDefinition>(); if (baseTables != null) foreach (var tbl in baseTables) { if (oneTable != null && string.Equals(oneTable.Name, tbl.Name)) continue; var newTableDef = new TableDefinition(tbl.Name); foreach (var field in tbl.GetFields()) newTableDef.AddField(field.SystemName, field.ColumnType); list.Add(newTableDef); } BaseTables = list.ToArray(); }
/// <summary> /// Initializes a new instance of the <see cref="SingleCrossReferenceDefinition"/> class. /// </summary> /// <param name="oneTable">The one table.</param> /// <param name="manyTable">The many table.</param> /// <param name="keyField">The key field.</param> /// <param name="showFieldList">The show field list.</param> /// <param name="alias">The alias.</param> /// <param name="dateTimeFields">The date time fields.</param> /// <param name="joinTables">The join tables.</param> /// <param name="baseTables">The base tables.</param> public SingleCrossReferenceDefinition(TableDefinition oneTable, TableDefinition manyTable, string keyField, string[] showFieldList, string alias, Dictionary<string, string> dateTimeFields, IEnumerable<Tuple<string, TableDefinition>> joinTables, params TableDefinition[] baseTables) : this(oneTable, manyTable, keyField, showFieldList, alias, dateTimeFields, baseTables) { DateTimeFields = dateTimeFields; JoinTables = joinTables.ToList(); }
/// <summary> /// Initializes a new instance of the <see cref="SingleCrossReferenceDefinition"/> class. /// </summary> /// <param name="oneTable">The one table.</param> /// <param name="manyTable">The many table.</param> /// <param name="keyField">The key field.</param> /// <param name="showFieldList">The show field list.</param> /// <param name="alias">The alias.</param> /// <param name="dateTimeFields">The date time fields.</param> /// <param name="baseTables">The base tables.</param> public SingleCrossReferenceDefinition(TableDefinition oneTable, TableDefinition manyTable, string keyField, string[] showFieldList, string alias, Dictionary<string, string> dateTimeFields, params TableDefinition[] baseTables) : this(oneTable, manyTable, keyField, showFieldList, alias, baseTables) { DateTimeFields = dateTimeFields; }
/// <summary> /// Adds the field. /// </summary> /// <param name="name"> /// The field name. /// </param> /// <param name="type"> /// The field type. /// </param> /// <param name="parentTable"> /// The parent table. /// </param> /// <param name="securityGuardExpression"> /// The security guard expression. /// </param> /// <returns> /// The <see cref="FieldDefinition"/>. /// </returns> public FieldDefinition AddField(string name, ColumnTypes type, TableDefinition parentTable, string securityGuardExpression = null) { var fieldDefinition = new FieldDefinition(name, type, parentTable, securityGuardExpression); _fieldList.Add(fieldDefinition); return fieldDefinition; }
/// <summary> /// Initializes a new instance of the <see cref="FieldDefinition"/> class. /// </summary> /// <param name="propertyInfo"> /// The property information. /// </param> /// <param name="type"> /// The type. /// </param> /// <param name="parentTable"> /// The parent table. /// </param> /// <param name="securityGuardExpression"> /// The security guard expression. /// </param> /// <param name="includeInResult"> /// if set to <c>true</c> [include in result]. /// </param> /// <param name="isFilterable"> /// if set to <c>true</c> [is filterable]. /// </param> /// </param> /// <param name="nameValuesList"> /// The name values list. /// </param> /// <param name="isRichText"> /// if set to <c>true</c> [is rich text]. /// </param> /// <param name="allowLocalizedData"> /// The allow localized data. /// </param> /// <exception cref="System.ArgumentNullException"> /// propertyInfo /// </exception> public FieldDefinition( IPropertyInfo propertyInfo, ColumnTypes type, TableDefinition parentTable, string securityGuardExpression, bool includeInResult, bool isFilterable, Dictionary<string, object> nameValuesList, bool isRichText, bool allowLocalizedData) : this( propertyInfo == null ? string.Empty : propertyInfo.Name, type, parentTable, securityGuardExpression, includeInResult, isFilterable, nameValuesList, isRichText, allowLocalizedData) { if (propertyInfo == null) throw new ArgumentNullException("propertyInfo"); PropertyInfo = propertyInfo; }