示例#1
0
        /// <summary>
        /// 复制对象
        /// </summary>
        /// <returns></returns>
        public OneToOneType Clone()
        {
            OneToOneType obj = new OneToOneType();

            obj.Property = Property;
            obj.Column   = Column;
            return(obj);
        }
        private static void SetPropertyValueOfNormal(object obj, PropertyInfo[] properties, DataRow sourceRow, OneToOneType one, Dictionary <string, ColumnToColumn> colMaps)
        {
            if (String.IsNullOrEmpty(one.Column))
            {
                return;
            }

            object value = GetTargetColumnValue(sourceRow, one.Column, colMaps);

            if (value != null)
            {
                SetPropertyValue(obj, properties, value, one.Property);
            }
        }
        private static void SetColumnValueFromNormal(DataRow targetRow, object obj, PropertyInfo[] properties, OneToOneType one, Dictionary <string, string> colMaps)
        {
            object objValue = GetPropertyValue(obj, properties, one.Property);

            string column = GetTrueColumn(one.Column, colMaps);

            SetDataColumnValue(targetRow, column, objValue);
        }