Ejemplo n.º 1
0
        /// <summary>
        /// Searches for an tgColumnMetadata by the propery name.
        /// </summary>
        /// <param name="propertyName">The high level PropertyName, for example, Employees.PropertyNames.LastName</param>
        /// <returns>The tgColumnMetadata or null if not found.</returns>
        public tgColumnMetadata FindByPropertyName(string propertyName)
        {
            tgColumnMetadata col = null;

            if (this.hashByPropertyName.ContainsKey(propertyName))
            {
                col = this.hashByPropertyName[propertyName];
            }

            return(col);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Searches for an tgColumnMetadata by the propery name. This method is the same as
        /// using the indexer.
        /// </summary>
        /// <param name="columnName">The high level PropertyName, for example, Employees.ColumnNames.LastName</param>
        /// <returns>The tgColumnMetadata or null if not found.</returns>
        public tgColumnMetadata FindByColumnName(string columnName)
        {
            tgColumnMetadata col = null;

            if (this.hashByColumnName.ContainsKey(columnName))
            {
                col = this.hashByColumnName[columnName];
            }

            return(col);
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Provides direct access into the collection by column name.
        /// </summary>
        /// <param name="columnName">The name of the desired column. This parameter is expected
        /// to be the physical name of the column as in the table or view, for example,
        /// Employees.ColumnNames.LastName</param>
        /// <returns></returns>
        public tgColumnMetadata this[System.String columnName]
        {
            get
            {
                tgColumnMetadata col = null;

                if (this.hashByColumnName.ContainsKey(columnName))
                {
                    col = this.hashByColumnName[columnName];
                }

                return(col);
            }
        }
Ejemplo n.º 4
0
        /// <summary>
        /// Used internally by Tiraggo. This should never be called by user code
        /// </summary>
        /// <param name="column">The new tgColumnMetadata to add to the array</param>
        public void Add(tgColumnMetadata column)
        {
            list.Add(column);
            hashByColumnName[column.Name]           = column;
            hashByPropertyName[column.PropertyName] = column;

            if (column.HasDefault)
            {
                this.thereAreDefaults = true;
            }

            if (column.IsInPrimaryKey)
            {
                this.primaryKeys.Add(column);
            }
        }
Ejemplo n.º 5
0
        public bool IsSpecialColumn(tgColumnMetadata col)
        {
            if (DateAdded != null && DateAdded.IsEnabled && DateAdded.ColumnName == col.Name)
            {
                return(true);
            }
            if (DateModified != null && DateModified.IsEnabled && DateModified.ColumnName == col.Name)
            {
                return(true);
            }
            if (AddedBy != null && AddedBy.IsEnabled && AddedBy.ColumnName == col.Name)
            {
                return(true);
            }
            if (ModifiedBy != null && ModifiedBy.IsEnabled && ModifiedBy.ColumnName == col.Name)
            {
                return(true);
            }

            return(false);
        }
Ejemplo n.º 6
0
        public bool IsSpecialColumn(tgColumnMetadata col)
        {
            if (DateAdded != null && DateAdded.IsEnabled && DateAdded.ColumnName == col.Name) return true;
            if (DateModified != null && DateModified.IsEnabled && DateModified.ColumnName == col.Name) return true;
            if (AddedBy != null && AddedBy.IsEnabled && AddedBy.ColumnName == col.Name) return true;
            if (ModifiedBy != null && ModifiedBy.IsEnabled && ModifiedBy.ColumnName == col.Name) return true;

            return false;
        }
Ejemplo n.º 7
0
        /// <summary>
        /// Used internally by Tiraggo. This should never be called by user code
        /// </summary>
        /// <param name="column">The new tgColumnMetadata to add to the array</param>
        public void Add(tgColumnMetadata column)
        {
            list.Add(column);
            hashByColumnName[column.Name] = column;
            hashByPropertyName[column.PropertyName] = column;

            if (column.HasDefault)
            {
                this.thereAreDefaults = true;
            }

            if (column.IsInPrimaryKey)
            {
                this.primaryKeys.Add(column);
            }
        }