Exemple #1
0
        private RowObjectAdapter Bind(Selector columnNames)
        {
            foreach (PropertyInfo propertyInfo in Reflex.GetColumnProperties(obj))
            {
                ColumnAttribute attribute = Reflex.GetColumnAttribute(propertyInfo);

                if (attribute != null && this.Row.Table.Columns.Contains(attribute.ColumnNameSaved))
                {
                    DataField field = this.fields.Add(attribute.ColumnNameSaved, attribute.Type);
                    ColumnAdapter column = new ColumnAdapter(field);
                    this.Bind(column);

                    column.Field.Identity = attribute.Identity;
                    column.Field.Primary = attribute.Primary;

                    if (attribute.Identity || attribute.Computed || ! columnNames.Exists(attribute.ColumnNameSaved))
                        column.Field.Saved = false;
                    else
                        column.Field.Saved = attribute.Saved;
                }
            }

            //in case of ColumnAttribute not setup Identity and Primary Keys
            fields.UpdatePrimaryIdentity(obj.Primary, obj.Identity);

            return this;
        }
Exemple #2
0
        private RowObjectAdapter Bind(Selector columnNames)
        {
            foreach (PropertyInfo propertyInfo in Reflex.GetColumnProperties(obj))
            {
                ColumnAttribute attribute = Reflex.GetColumnAttribute(propertyInfo);

                if (attribute != null && this.Row.Table.Columns.Contains(attribute.ColumnNameSaved))
                {
                    DataField     field  = this.fields.Add(attribute.ColumnNameSaved, attribute.Type);
                    ColumnAdapter column = new ColumnAdapter(field);
                    this.Bind(column);

                    column.Field.Identity = attribute.Identity;
                    column.Field.Primary  = attribute.Primary;

                    if (attribute.Identity || attribute.Computed || !columnNames.Exists(attribute.ColumnNameSaved))
                    {
                        column.Field.Saved = false;
                    }
                    else
                    {
                        column.Field.Saved = attribute.Saved;
                    }
                }
            }

            //in case of ColumnAttribute not setup Identity and Primary Keys
            fields.UpdatePrimaryIdentity(obj.Primary, obj.Identity);

            return(this);
        }
Exemple #3
0
        protected ColumnAdapter Bind(ColumnAdapter column)
        {
            columns.Bind(column);

            column.UpdateValue(this.dataRow);
            return(column);
        }
Exemple #4
0
        protected ColumnAdapter Bind(ColumnAdapter column)
        {
            columns.Bind(column);

            column.UpdateValue(this.dataRow);
            return column;
        }