Esempio n. 1
0
 public int CompareTo(object obj)
 {
     if (obj == null || obj.GetType() != GetType())
     {
         throw new ArgumentException("Different types comparison");
     }
     return(UserId.CompareTo((obj as User).UserId));
 }
Esempio n. 2
0
 public int CompareTo(Dentist other)
 {
     if (UserId.CompareTo(other.UserId) > 0)
     {
         return(1);
     }
     return(0);
 }
Esempio n. 3
0
        public int CompareTo(UserTaskAccess other)
        {
            int result = 0;

            result = UserId.CompareTo(other.UserId);
            if (result == 0)
            {
                result = ProjectId.CompareTo(other.ProjectId);
            }
            if (result == 0)
            {
                result = TaskId.CompareTo(other.TaskId);
            }
            return(result);
        }
Esempio n. 4
0
        public int CompareTo(object obj)
        {
            if (obj is null)
            {
                throw new Exception(Properties.Resources.CompareObjIsNull);
            }

            var credentials = obj as UserCredentials;

            if (credentials is null)
            {
                throw new Exception(Properties.Resources.ObjIsNotRDPTerminal);
            }

#pragma warning disable CA1307 // Specify StringComparison
            return(UserId.CompareTo(credentials.UserId));

#pragma warning restore CA1307 // Specify StringComparison
        }
Esempio n. 5
0
        // override object.Equals
        public override bool Equals(object obj)
        {
            if (obj == null || GetType() != obj.GetType())
            {
                return(false);
            }

            var compareObj = (UserCustomerInfo)obj;

            if (UserId.CompareTo(compareObj.UserId) != 0)
            {
                return(false);
            }
            if (CustomerId.CompareTo(compareObj.CustomerId) != 0)
            {
                return(false);
            }

            return(true);
        }
Esempio n. 6
0
 public int CompareTo(User other)
 {
     if (UserId.CompareTo(other.UserId) != 0)
     {
         return(UserId.CompareTo(other.UserId));
     }
     if (UserName.CompareTo(other.UserName) != 0)
     {
         return(UserName.CompareTo(other.UserName));
     }
     if (NumViews.CompareTo(other.NumViews) != 0)
     {
         return(NumViews.CompareTo(other.NumViews));
     }
     if (Profile.CompareTo(other.Profile) != 0)
     {
         return(Profile.CompareTo(other.Profile));
     }
     return(RoleMember.CompareTo(other.RoleMember) != 0 ? RoleMember.CompareTo(other.RoleMember) : 0);
 }
Esempio n. 7
0
 public int CompareTo(User other)
 {
     return(UserId.CompareTo(other.UserId));
 }
 public int CompareTo(UserRight other)
 {
     return(UserId.CompareTo(other.UserId) & RightName.CompareTo(other.RightName) & ResourceId.CompareTo(other.ResourceId));
 }
Esempio n. 9
0
        public int CompareTo(AddAction other)
        {
            var timestampComparison = base.CompareTo(other);

            return(timestampComparison != 0 ? timestampComparison : UserId.CompareTo(other.UserId) * -1);
        }