public InternalDataColumn(CremaDataColumn target, string columnName, Type dataType) : base(columnName, dataType) { this.ValidateConstructor(columnName, dataType); base.Target = target; this.ColumnMapping = MappingType.Element; }
public static string FieldAsString(this CremaDataRow row, CremaDataColumn column) { object value = row[column]; if (value == null || value == DBNull.Value) { return(null); } return(value.ToString()); }
private void ValidateConstructor(string columnName, Type dataType) { if (string.IsNullOrEmpty(columnName) == false) { CremaDataColumn.ValidateColumnName(columnName); } if (CremaDataTypeUtility.IsBaseType(dataType) == false) { throw new ArgumentException(string.Format(Resources.Exception_TypeCannotBeUsed_Format, dataType.Name), nameof(dataType)); } }
internal static void SetFieldForce <T>(this CremaDataRow row, CremaDataColumn column, T value) { if (column.ReadOnly == true) { row.InternalObject.SetReadOnlyField <T>(column.InternalObject, value); } else { row.InternalObject.SetField <T>(column.InternalObject, value); } }
private void ValidateConstructor(string columnName, InternalDataType dataType) { if (string.IsNullOrEmpty(columnName) == false) { CremaDataColumn.ValidateColumnName(columnName); } if (dataType == null) { throw new ArgumentNullException(nameof(dataType)); } if (dataType.DataSet == null) { throw new ArgumentException("타입이 DataSet에 포함되어 있지 않기 때문에 사용할 수 없습니다.", nameof(dataType)); } }
protected virtual void OnValidateSetColumnName(string value) { if (this.Table != null && value == null) { throw new ArgumentNullException(nameof(value)); } if (this.Table != null || string.IsNullOrEmpty(value) == false) { CremaDataColumn.ValidateColumnName(value); } if (this.Table != null && this.ColumnName != value) { if (this.Table.Columns[value] != null && this.Table.Columns[value].ColumnName == value) { throw new ArgumentException(nameof(value)); } } }
internal void CopyTo(CremaDataColumn dest) { dest.InternalAllowDBNull = this.AllowDBNull; dest.InternalAutoIncrement = this.AutoIncrement; dest.InternalColumnName = this.ColumnName; dest.InternalDataType = this.DataType; dest.InternalCremaType = (InternalDataType)this.CremaType; dest.InternalDefaultValue = this.DefaultValue; dest.InternalExpression = this.Expression; dest.InternalValidation = this.Validation; dest.InternalUnique = this.Unique; dest.InternalReadOnly = this.ReadOnly; dest.InternalComment = this.Comment; dest.InternalIsKey = this.IsKey; dest.InternalCreationInfo = this.CreationInfo; dest.InternalModificationInfo = this.ModificationInfo; dest.InternalTags = this.Tags; dest.InternalColumnID = this.ColumnID; }
public CremaDataSet Filter(CremaDataSet srcDataSet, CremaDataSet destDataSet, TagInfo tags) { CremaDataTable parentDestDataTable = null; if (this.Parent != null) { parentDestDataTable = new CremaDataTable(this.ParentName, this.Parent.CategoryPath); destDataSet.Tables.Add(parentDestDataTable); } var destDataTable = new CremaDataTable(this.TableName, this.CategoryPath); destDataSet.Tables.Add(destDataTable); destDataTable.Parent = parentDestDataTable; foreach (var column in this.Columns) { if ((column.DerivedTags & tags) != TagInfo.Unused) { var newColumn = new CremaDataColumn(column.ColumnName, column.DataType); destDataTable.Columns.Add(newColumn); } } var columns = destDataTable.Columns.ToArray(); foreach (var row in this.Rows) { if ((row.DerivedTags & tags) == TagInfo.Unused) { continue; } destDataTable.AddRow(row.Filter(columns, tags)); } return(destDataSet); }
public string GetColumnError(CremaDataColumn cremaColumn) { return(this.row.GetColumnError(cremaColumn.InternalObject)); }
protected void SetNull(CremaDataColumn column) { this.row.SetNull(column.InternalObject); }
public object this[CremaDataColumn column, DataRowVersion version] { get { return(this.row[column.InternalObject, version]); } }
public object this[CremaDataColumn column] { get { return(this.row[column.InternalObject]); } set { this.row[column.InternalObject] = value; } }
public void SetColumnError(CremaDataColumn column, string error) { this.row.SetColumnError(column.InternalObject, error); }
public bool IsNull(CremaDataColumn column, DataRowVersion version) { return(this.row.IsNull(column.InternalObject, version)); }
public bool IsNull(CremaDataColumn column) { return(this.row.IsNull(column.InternalObject)); }
public static T Field <T>(this CremaDataRow row, CremaDataColumn column, DataRowVersion version) { return(row.InternalObject.Field <T>(column.InternalObject, version)); }
public static void SetFieldAsString(this CremaDataRow row, CremaDataColumn column, string textValue) { row[column] = column.ConvertFromString(textValue); }
public static void SetField <T>(this CremaDataRow row, CremaDataColumn column, T value) { row.InternalObject.SetField <T>(column.InternalObject, value); }