HaveValuesChanged() 개인적인 메소드

private HaveValuesChanged ( DataColumn columns ) : bool
columns DataColumn
리턴 bool
예제 #1
0
        internal override void CheckConstraint(DataRow row, DataRowAction action)
        {
            if (Table.EnforceConstraints &&
                (action == DataRowAction.Add ||
                 action == DataRowAction.Change ||
                 (action == DataRowAction.Rollback && row.tempRecord != -1)))
            {
                if (row.HaveValuesChanged(Columns))
                {
                    Index    index  = Key.GetSortIndex();
                    object[] values = row.GetColumnValues(Columns);
                    if (index.IsKeyInIndex(values))
                    {
#if DEBUG
                        if (CompModSwitches.Data_Constraints.TraceVerbose)
                        {
                            Debug.WriteLine("UniqueConstraint violation...");
                            string valuesText = "";
                            for (int i = 0; i < values.Length; i++)
                            {
                                valuesText = Convert.ToString(values[i]) + (i < values.Length - 1 ? ", " : "");
                            }
                            Debug.WriteLine("   constraint: " + this.GetDebugString());
                            Debug.WriteLine("   key values: " + valuesText);
                            Range range  = index.FindRecords(values);
                            int   record = index.GetRecord(range.Min);
                            Debug.WriteLine("   conflicting record: " + record.ToString());
                        }
#endif
                        throw ExceptionBuilder.ConstraintViolation(Columns, values);
                    }
                }
            }
        }
예제 #2
0
 internal override void CheckConstraint(DataRow row, DataRowAction action)
 {
     if (Table.EnforceConstraints &&
         (action == DataRowAction.Add ||
          action == DataRowAction.Change ||
          (action == DataRowAction.Rollback && row._tempRecord != -1)))
     {
         if (row.HaveValuesChanged(ColumnsReference))
         {
             if (ConstraintIndex.IsKeyRecordInIndex(row.GetDefaultRecord()))
             {
                 object[] values = row.GetColumnValues(ColumnsReference);
                 throw ExceptionBuilder.ConstraintViolation(ColumnsReference, values);
             }
         }
     }
 }
 internal override void CheckConstraint(DataRow row, DataRowAction action) {
     if (Table.EnforceConstraints &&
         (action == DataRowAction.Add ||
          action == DataRowAction.Change ||
          (action == DataRowAction.Rollback && row.tempRecord != -1))) {
         if (row.HaveValuesChanged(ColumnsReference)) {
             if (ConstraintIndex.IsKeyRecordInIndex(row.GetDefaultRecord())) {
                 object[] values = row.GetColumnValues(ColumnsReference);
                 throw ExceptionBuilder.ConstraintViolation(ColumnsReference, values);
             }
         }
     }
 }
 internal override void CheckConstraint(DataRow row, DataRowAction action)
 {
     if ((this.Table.EnforceConstraints && (((action == DataRowAction.Add) || (action == DataRowAction.Change)) || ((action == DataRowAction.Rollback) && (row.tempRecord != -1)))) && (row.HaveValuesChanged(this.ColumnsReference) && this.ConstraintIndex.IsKeyRecordInIndex(row.GetDefaultRecord())))
     {
         object[] columnValues = row.GetColumnValues(this.ColumnsReference);
         throw ExceptionBuilder.ConstraintViolation(this.ColumnsReference, columnValues);
     }
 }