Ejemplo n.º 1
0
        private void SetProperty <T>(Table table, Row row, Column column, DynaRow <T> bean)
        {
            string     name      = column.Name;
            string     textValue = GetValue(row, name);
            DynaColumn property  = bean.DynaType[column.Name];
            object     value     = ToObject(name, property.Type, property.ComponentType, textValue, table, row);

            ((IDictionary)bean.Instance)[name] = value;
        }
Ejemplo n.º 2
0
        private object ToObject(DynaColumn column, string textValue, Table table, Row row)
        {
            object value = ToObject(column.Name, column.Type, column.ComponentType, textValue, table, row);

            if (value == null)
            {
                return(DBNull.Value);
            }
            return(value);
        }
Ejemplo n.º 3
0
        private DataTable CreateDataTable(Table table)
        {
            DataTable dataTable = new DataTable(table.Name);

            foreach (Column column in table.Columns)
            {
                if (column != null)
                {
                    Type       type       = new DynaColumn(column).Type;
                    DataColumn dataColumn = new DataColumn(column.Name, type);
                    dataTable.Columns.Add(dataColumn);
                }
            }
            return(dataTable);
        }