/// <summary>
 /// Initializes a new instance of the <see cref="UPSESourceAdditionalColumn"/> class.
 /// </summary>
 /// <param name="addInfo">The add information.</param>
 /// <param name="fieldConfig">The field configuration.</param>
 /// <param name="index">The index.</param>
 /// <param name="positionInControl">The position in control.</param>
 /// <param name="keyColumn">The key column.</param>
 public UPSESourceAdditionalColumn(UPSESingleAdditionalItemInformation addInfo, UPConfigFieldControlField fieldConfig,
                                   int index, int positionInControl, UPSESourceColumn keyColumn)
     : base(fieldConfig, index, positionInControl)
 {
     this.KeyColumn = keyColumn;
     this.AddInfo   = addInfo;
 }
Exemple #2
0
        /// <summary>
        /// Additionals the source fields with key column.
        /// </summary>
        /// <param name="keyColumn">The key column.</param>
        /// <param name="startIndex">The start index.</param>
        /// <returns></returns>
        public List <UPSESourceAdditionalColumn> AdditionalSourceFieldsWithKeyColumn(UPSESourceColumn keyColumn, int startIndex)
        {
            List <UPSESourceAdditionalColumn> fieldArray = null;
            int positionInControl = 0;

            foreach (UPConfigFieldControlField field in this.FieldControl.FieldsOnFirstTab)
            {
                if (field.Function == this.KeyColumnName)
                {
                    positionInControl++;
                    continue;
                }

                UPSESourceAdditionalColumn addColumn = new UPSESourceAdditionalColumn(this, field, startIndex++, positionInControl++, keyColumn);
                if (fieldArray == null)
                {
                    fieldArray = new List <UPSESourceAdditionalColumn> {
                        addColumn
                    };
                }
                else
                {
                    fieldArray.Add(addColumn);
                }
            }

            return(fieldArray);
        }
Exemple #3
0
        /// <summary>
        /// Additionals the source fields with key column.
        /// </summary>
        /// <param name="keyColumn">The key column.</param>
        /// <param name="startIndex">The start index.</param>
        /// <returns></returns>
        public List <UPSEColumn> AdditionalSourceFieldsWithKeyColumn(UPSESourceColumn keyColumn, int startIndex)
        {
            List <UPSEColumn> fieldArray = null;

            foreach (UPSESingleAdditionalItemInformation addInfo in this.AdditionalItemArray)
            {
                List <UPSESourceAdditionalColumn> fields = addInfo.AdditionalSourceFieldsWithKeyColumn(keyColumn, startIndex);
                if (fields.Count > 0)
                {
                    if (fieldArray == null)
                    {
                        fieldArray = new List <UPSEColumn>(fields);
                    }
                    else
                    {
                        fieldArray.AddRange(fields);
                    }

                    startIndex += fields.Count;
                }
            }

            return(fieldArray);
        }