Exemple #1
0
        public static bool Equal(AlgorithmRowScoreObjectModel m1, AlgorithmRowScoreObjectModel m2)
        {
            if (m1 == null || m2 == null)
            {
                throw new Exception();
            }

            if (m1.WeeklyProgram.Columns.Count != m2.WeeklyProgram.Columns.Count)
            {
                return(false);
            }

            int i = 0;

            while (i < m1.WeeklyProgram.Columns.Count)
            {
                // def1 : m1.WeeklyProgram.Columns[i].GoalVersionOfferedCourseRow != m2.WeeklyProgram.Columns[i].GoalVersionOfferedCourseRow
                // def2 : m1.WeeklyProgram.Columns[i].OfferedCourse != m2.WeeklyProgram.Columns[i].OfferedCourse : selected
                if (m1.WeeklyProgram.Columns[i].GoalVersionOfferedCourseRow != m2.WeeklyProgram.Columns[i].GoalVersionOfferedCourseRow)
                {
                    return(false);
                }
                i++;
            }
            return(true);
        }
Exemple #2
0
        public static int Compare(AlgorithmRowScoreObjectModel m1, AlgorithmRowScoreObjectModel m2)
        {
            if (m1 == null || m2 == null)
            {
                throw new Exception();
            }

            return(m1.WeeklyProgramScore > m2.WeeklyProgramScore ? 1 : m1.WeeklyProgramScore == m2.WeeklyProgramScore ? 0 : -1);
        }