Пример #1
0
 public SelBoxCasePalletSolution(Document document, BoxCasePalletAnalysis analysis, BoxCasePalletSolution sol)
     : base(document)
 {
     _analysis = analysis;
     _solution = sol;
     Name      = sol.Title;
 }
Пример #2
0
        public int CompareTo(object obj)
        {
            BoxCasePalletSolution sol = (BoxCasePalletSolution)obj;

            if (this.BoxPerPalletCount > sol.BoxPerPalletCount)
            {
                return(-1);
            }
            else if (this.BoxPerPalletCount == sol.BoxPerPalletCount)
            {
                if ((sol.Count > 0 && sol[0] is BoxLayer) &&
                    (this.Count > 0 && this[0] is BoxLayer))
                {
                    BoxLayer layerSol     = (BoxLayer)sol[0];
                    int      iPatternSol  = PatternNameToIndex(layerSol.PatternName);
                    BoxLayer layerThis    = (BoxLayer)this[0];
                    int      iPatternThis = PatternNameToIndex(layerThis.PatternName);

                    if (iPatternSol > iPatternThis)
                    {
                        return(-1);
                    }
                    else if (iPatternSol == iPatternThis)
                    {
                        return(0);
                    }
                    else
                    {
                        return(1);
                    }
                }
                return(0);
            }
            else
            {
                return(1);
            }
        }