Example #1
0
 public void setOverride(DatabaseItemComparison overrideCompare, bool overrideValue, List <DB.DatabaseItem> updatedNewItems = null)
 {
     if (overrideValue)
     {
         //set the comparisonstatus just in case
         overrideCompare.comparisonStatus = DatabaseComparisonStatusEnum.dboverride;
         if (overrideCompare.existingDatabaseItem != null)
         {
             overrideCompare.existingDatabaseItem.isOverridden = true;
         }
         else
         {
             overrideCompare.newDatabaseItem.isOverridden = true;
         }
     }
     else
     {
         //un-override item
         // existing item
         if (overrideCompare.existingDatabaseItem != null &&
             overrideCompare.existingDatabaseItem.isOverridden)
         {
             overrideCompare.existingDatabaseItem.isOverridden = false;
         }
         // new item
         if (overrideCompare.newDatabaseItem != null &&
             overrideCompare.newDatabaseItem.isOverridden)
         {
             overrideCompare.newDatabaseItem.isOverridden = false;
         }
     }
 }
Example #2
0
 private void addToComparison(DatabaseItemComparison comparedItem)
 {
     //only add the commparison if not both of them are null
     if (comparedItem.existingDatabaseItem != null ||
         comparedItem.newDatabaseItem != null)
     {
         comparedItems.Add(comparedItem);
     }
 }
Example #3
0
 private void addToComparison(DatabaseItemComparison comparedItem)
 {
     //if new item alrady compared then make it null
     if (comparedItems.Any(x => x.newDatabaseItem == comparedItem.newDatabaseItem))
     {
         comparedItem.newDatabaseItem = null;
     }
     //if existing item already compared then make it null
     if (comparedItems.Any(x => x.existingDatabaseItem == comparedItem.existingDatabaseItem))
     {
         comparedItem.existingDatabaseItem = null;
     }
     //only add the commparison if not both of them are null
     if (comparedItem.existingDatabaseItem != null ||
         comparedItem.newDatabaseItem != null)
     {
         comparedItems.Add(comparedItem);
     }
 }
 private void addToComparison(DatabaseItemComparison comparedItem)
 {
     //only add the commparison if not both of them are null
     if (comparedItem.existingDatabaseItem != null
         || comparedItem.newDatabaseItem != null)
     {
         comparedItems.Add(comparedItem);
     }
 }
 public void setOverride(DatabaseItemComparison overrideCompare, bool overrideValue,List<DB.DatabaseItem>updatedNewItems = null)
 {
     if (overrideValue)
     {
         //set the comparisonstatus just in case
         overrideCompare.comparisonStatus = DatabaseComparisonStatusEnum.dboverride;
         if (overrideCompare.existingDatabaseItem != null)
         {
             overrideCompare.existingDatabaseItem.isOverridden = true;
         }
         else
         {
             overrideCompare.newDatabaseItem.isOverridden = true;
         }
     }
     else
     {
         //un-override item
         // existing item
         if (overrideCompare.existingDatabaseItem != null
             && overrideCompare.existingDatabaseItem.isOverridden)
                 overrideCompare.existingDatabaseItem.isOverridden = false;
         // new item
         if (overrideCompare.newDatabaseItem != null
             && overrideCompare.newDatabaseItem.isOverridden)
                 overrideCompare.newDatabaseItem.isOverridden = false;
     }
 }