Esempio n. 1
0
        public void ImportRow(CremaDataRow row)
        {
            this.table.BeginLoadData();
            try
            {
                this.table.ImportRow(row.InternalObject);

                foreach (var item in row.Table.childs)
                {
                    var childRows = row.GetChildRows(item);

                    var thisChild = this.childs[item.TableName];
                    if (thisChild == null)
                    {
                        continue;
                    }

                    foreach (var childRow in childRows)
                    {
                        thisChild.ImportRow(childRow);
                    }
                }
            }
            finally
            {
                this.table.EndLoadData();
            }
        }
Esempio n. 2
0
        public static string FieldAsString(this CremaDataRow row, CremaDataColumn column)
        {
            object value = row[column];

            if (value == null || value == DBNull.Value)
            {
                return(null);
            }
            return(value.ToString());
        }
Esempio n. 3
0
        public CremaDataRow AddRow(CremaDataRow parent, params object[] args)
        {
            var dataRow = this.NewRow(parent);

            for (var i = 0; i < args.Length; i++)
            {
                dataRow[i] = args[i];
            }
            this.rows.Add(dataRow);
            return(dataRow);
        }
Esempio n. 4
0
 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);
     }
 }
Esempio n. 5
0
        public CremaDataRow NewRow(CremaDataRow parentRow)
        {
            if (parentRow == null)
            {
                throw new ArgumentNullException(nameof(parentRow));
            }
            if (this.Parent == null)
            {
                throw new CremaDataException(Resources.Exception_UsableOnChildTable);
            }
            var newRow = this.NewRow();

            newRow.ParentID = parentRow.RelationID;
            return(newRow);
        }
Esempio n. 6
0
 public static T Field <T>(this CremaDataRow row, string columnName, DataRowVersion version)
 {
     return(row.InternalObject.Field <T>(columnName, version));
 }
Esempio n. 7
0
 public static string FieldAsString(this CremaDataRow row, string columnName, DataRowVersion version)
 {
     return(row.FieldAsString(row.Table.Columns[columnName], version));
 }
Esempio n. 8
0
 public static string FieldAsString(this CremaDataRow row, int columnIndex, DataRowVersion version)
 {
     return(row.FieldAsString(row.Table.Columns[columnIndex], version));
 }
Esempio n. 9
0
 public static void SetFieldAsString(this CremaDataRow row, string columnName, string textValue)
 {
     row.SetFieldAsString(row.Table.Columns[columnName], textValue);
 }
Esempio n. 10
0
 public static string FieldAsString(this CremaDataRow row, string columnName)
 {
     return(row.FieldAsString(row.Table.Columns[columnName]));
 }
Esempio n. 11
0
 public static string FieldAsString(this CremaDataRow row, int columnIndex)
 {
     return(row.FieldAsString(row.Table.Columns[columnIndex]));
 }
Esempio n. 12
0
 public static void SetField <T>(this CremaDataRow row, string columnName, T value)
 {
     row.InternalObject.SetField <T>(columnName, value);
 }
Esempio n. 13
0
 public static void SetField <T>(this CremaDataRow row, int columnIndex, T value)
 {
     row.InternalObject.SetField <T>(columnIndex, value);
 }
Esempio n. 14
0
 public static void SetFieldAsString(this CremaDataRow row, int columnIndex, string textValue)
 {
     row.SetFieldAsString(row.Table.Columns[columnIndex], textValue);
 }
Esempio n. 15
0
 public static T Field <T>(this CremaDataRow row, int columnIndex, DataRowVersion version)
 {
     return(row.InternalObject.Field <T>(columnIndex, version));
 }
Esempio n. 16
0
 public static T Field <T>(this CremaDataRow row, CremaDataColumn column, DataRowVersion version)
 {
     return(row.InternalObject.Field <T>(column.InternalObject, version));
 }
Esempio n. 17
0
 internal static T Field <T>(this CremaDataRow row, InternalRelation relation)
 {
     return(row.InternalObject.Field <T>(relation));
 }
Esempio n. 18
0
 internal static T Field <T>(this CremaDataRow row, InternalDataColumn column)
 {
     return(row.InternalObject.Field <T>(column));
 }
Esempio n. 19
0
 public static void SetFieldAsString(this CremaDataRow row, CremaDataColumn column, string textValue)
 {
     row[column] = column.ConvertFromString(textValue);
 }
Esempio n. 20
0
 public static void SetField <T>(this CremaDataRow row, CremaDataColumn column, T value)
 {
     row.InternalObject.SetField <T>(column.InternalObject, value);
 }
Esempio n. 21
0
 internal CremaDataTableNewRowEventArgs(DataTableNewRowEventArgs e)
 {
     this.row = (e.Row as InternalDataRow).Target;
 }