Beispiel #1
0
        public static int CompareByCode(PosInfoTotal o1, PosInfoTotal o2)
        {
            if (o1 == null && o2 == null)
            {
                return(0);
            }
            if (o1 == null)
            {
                return(-1);
            }
            if (o2 == null)
            {
                return(1);
            }

            if (o1._Code.Length > 6 && o2._Code.Length <= 6)
            {
                return(1);
            }
            else if (o1._Code.Length <= 6 && o2._Code.Length > 6)
            {
                return(-1);
            }
            else
            {
                if (o1._Code.CompareTo(o2._Code) == 1)
                {
                    return(1);
                }
                else if (o1._Code.CompareTo(o2._Code) == -1)
                {
                    return(-1);
                }
                else if (o1._Code.CompareTo(o2._Code) == 0)
                {
                    if (o1._TotalPosition.CompareTo(o2._TotalPosition) > 0)
                    {
                        return(1);
                    }
                    if (o1._TotalPosition.CompareTo(o2._TotalPosition) < 0)
                    {
                        return(-1);
                    }
                    if (o1._TotalPosition.CompareTo(o2._TotalPosition) == 0)
                    {
                        return(0);
                    }
                }
            }
            return(1);
        }
Beispiel #2
0
        public PosInfoTotal Copy()
        {
            PosInfoTotal ret = (PosInfoTotal)this.MemberwiseClone();

            return(ret);
        }