예제 #1
0
 public static bool DataEqual(object obj1, object obj2)
 {
     if (obj1 == null)
     {
         return(false);
     }
     if (!obj1.GetType().Equals(obj2.GetType()))
     {
         return(false);
     }
     string[] keys = BeanHelper.getPropertyNameList(obj1);
     return(DataEqual(obj1, obj2, keys, true));
 }
예제 #2
0
 public static bool DataEqual(object obj1, object obj2, string[] fromKeys, string[] toKeys, params bool[] isExeclude)
 {
     for (int i = 0; i < fromKeys.Length; i++)
     {
         if (isExeclude.Length > 0 && isExeclude[0])
         {
             if (IsExclude(fromKeys[i]))
             {
                 continue;
             }
         }
         object currValue = BeanHelper.getPropertyValueByName(obj1, fromKeys[i]);
         object comValue  = BeanHelper.getPropertyValueByName(obj2, toKeys[i]);
         if (!BeanHelper.Equal(currValue, comValue))
         {
             return(false);
         }
     }
     return(true);
 }