示例#1
0
 ///<summary>
 /// Returns a value indicating whether this instance is equal to a specified object.
 ///</summary>
 ///<param name="toObject">An object to compare to this instance.</param>
 ///<returns>true if toObject is a <see cref="EvlVLearningRecordExcelBase"/> and has the same value as this instance; otherwise, false.</returns>
 public virtual bool Equals(EvlVLearningRecordExcelBase toObject)
 {
     if (toObject == null)
     {
         return(false);
     }
     return(Equals(this, toObject));
 }
示例#2
0
        ///<summary>
        /// Determines whether the specified <see cref="EvlVLearningRecordExcelBase"/> instances are considered equal.
        ///</summary>
        ///<param name="Object1">The first <see cref="EvlVLearningRecordExcelBase"/> to compare.</param>
        ///<param name="Object2">The second <see cref="EvlVLearningRecordExcelBase"/> to compare. </param>
        ///<returns>true if Object1 is the same instance as Object2 or if both are null references or if objA.Equals(objB) returns true; otherwise, false.</returns>
        public static bool Equals(EvlVLearningRecordExcelBase Object1, EvlVLearningRecordExcelBase Object2)
        {
            // both are null
            if (Object1 == null && Object2 == null)
            {
                return(true);
            }

            // one or the other is null, but not both
            if (Object1 == null ^ Object2 == null)
            {
                return(false);
            }

            bool equal = true;

            if (Object1.CourseName != null && Object2.CourseName != null)
            {
                if (Object1.CourseName != Object2.CourseName)
                {
                    equal = false;
                }
            }
            else if (Object1.CourseName == null ^ Object1.CourseName == null)
            {
                equal = false;
            }
            if (Object1.Sso != null && Object2.Sso != null)
            {
                if (Object1.Sso != Object2.Sso)
                {
                    equal = false;
                }
            }
            else if (Object1.Sso == null ^ Object1.Sso == null)
            {
                equal = false;
            }
            if (Object1.UserName != null && Object2.UserName != null)
            {
                if (Object1.UserName != Object2.UserName)
                {
                    equal = false;
                }
            }
            else if (Object1.UserName == null ^ Object1.UserName == null)
            {
                equal = false;
            }
            if (Object1.Function != null && Object2.Function != null)
            {
                if (Object1.Function != Object2.Function)
                {
                    equal = false;
                }
            }
            else if (Object1.Function == null ^ Object1.Function == null)
            {
                equal = false;
            }
            if (Object1.StartDate != null && Object2.StartDate != null)
            {
                if (Object1.StartDate != Object2.StartDate)
                {
                    equal = false;
                }
            }
            else if (Object1.StartDate == null ^ Object1.StartDate == null)
            {
                equal = false;
            }
            if (Object1.CompletedDate != null && Object2.CompletedDate != null)
            {
                if (Object1.CompletedDate != Object2.CompletedDate)
                {
                    equal = false;
                }
            }
            else if (Object1.CompletedDate == null ^ Object1.CompletedDate == null)
            {
                equal = false;
            }
            if (Object1.Location != null && Object2.Location != null)
            {
                if (Object1.Location != Object2.Location)
                {
                    equal = false;
                }
            }
            else if (Object1.Location == null ^ Object1.Location == null)
            {
                equal = false;
            }
            if (Object1.Trainer != null && Object2.Trainer != null)
            {
                if (Object1.Trainer != Object2.Trainer)
                {
                    equal = false;
                }
            }
            else if (Object1.Trainer == null ^ Object1.Trainer == null)
            {
                equal = false;
            }
            if (Object1.Courseid != null && Object2.Courseid != null)
            {
                if (Object1.Courseid != Object2.Courseid)
                {
                    equal = false;
                }
            }
            else if (Object1.Courseid == null ^ Object1.Courseid == null)
            {
                equal = false;
            }
            if (Object1.Id != Object2.Id)
            {
                equal = false;
            }
            if (Object1.CreatedDate != null && Object2.CreatedDate != null)
            {
                if (Object1.CreatedDate != Object2.CreatedDate)
                {
                    equal = false;
                }
            }
            else if (Object1.CreatedDate == null ^ Object1.CreatedDate == null)
            {
                equal = false;
            }
            return(equal);
        }