当前位置: 首页>>代码示例>>C#>>正文


C# ISchedule.GetPartialSchedule方法代码示例

本文整理汇总了C#中ISchedule.GetPartialSchedule方法的典型用法代码示例。如果您正苦于以下问题:C# ISchedule.GetPartialSchedule方法的具体用法?C# ISchedule.GetPartialSchedule怎么用?C# ISchedule.GetPartialSchedule使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ISchedule的用法示例。


在下文中一共展示了ISchedule.GetPartialSchedule方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: ClassAtTheSameTimeOnOtherWeek

 public static bool ClassAtTheSameTimeOnOtherWeek(ISchedule schedule, StudentsClass[] sClasses, int dayOfWeek, int classOfDay)
 {
     StudentsClass tempClass = schedule.GetTempClass();
     if (dayOfWeek < Constants.DAYS_IN_WEEK)
     {
         foreach (StudentSubGroup subGroup in tempClass.SubGroups)
         {
             StudentsClass secondClass = schedule.GetPartialSchedule(subGroup).GetClassesOfDay(dayOfWeek + Constants.DAYS_IN_WEEK)[classOfDay];
             if (!IsSameClassesAtTheSameTimeOnOtherWeek(sClasses, tempClass, secondClass))
             {
                 return false;
             }
         }
     }
     else
     {
         foreach (StudentSubGroup subGroup in tempClass.SubGroups)
         {
             StudentsClass secondClass = schedule.GetPartialSchedule(subGroup).GetClassesOfDay(dayOfWeek - Constants.DAYS_IN_WEEK)[classOfDay];
             if (!IsSameClassesAtTheSameTimeOnOtherWeek(sClasses, tempClass, secondClass))
             {
                 return false;
             }
         }
     }
     return true;
 }
开发者ID:Kirk7by,项目名称:mandarin,代码行数:27,代码来源:SameClasses.cs

示例2: GetFineOfAddedClass

 public int GetFineOfAddedClass(ISchedule schedule, EntityStorage eStorage)
 {
     StudentSubGroup[] groups = schedule.GetTempClass().SubGroups;
     int fineResult = 0;
     if (IsSaturday(Constants.GetDayOfClass(schedule.GetTimeOfTempClass())))
     {
         for (int groupIndex = 0; groupIndex < groups.Length; groupIndex++)
         {
             PartialSchedule groupSchedule = schedule.GetPartialSchedule(groups[groupIndex]);
             int day = Constants.GetDayOfClass(schedule.GetTimeOfTempClass());
             if (Array.FindAll<StudentsClass>(groupSchedule.GetClassesOfDay(day), (c) => c != null).Count() > 0)
             {
                 if (isBlock)
                     return Constants.BLOCK_FINE;
                 else
                     fineResult += fine;
             }
         }
     }
     else
     {
         return 0;
     }
     return fineResult;
 }
开发者ID:Kirk7by,项目名称:mandarin,代码行数:25,代码来源:SaturdayClass.cs

示例3: GetFineOfFullSchedule

 public int GetFineOfFullSchedule(ISchedule schedule, EntityStorage eStorage)
 {
     int fineResult = 0;
     foreach (StudentSubGroup subGroup in eStorage.StudentSubGroups)
     {
         for (int dayIndex = 0; dayIndex < Constants.DAYS_IN_WEEK; dayIndex++)
         {
             StudentsClass[] subGroupDay = schedule.GetPartialSchedule(subGroup).GetClassesOfDay(dayIndex);
             for (int classIndex = 0; classIndex < subGroupDay.Length; classIndex++)
             {
                 if (Array.Find<StudentsClass>(sClassesList.ToArray(), (c) => c == subGroupDay[classIndex]) != null)
                 {
                     StudentsClassPosition? firstClassPosition = schedule.GetClassPosition(subGroupDay[classIndex]);
                     StudentsClass secondClass = schedule.GetClassByRoomAndPosition(firstClassPosition.Value.ClassRoom,
                         firstClassPosition.Value.Time + Constants.CLASSES_IN_DAY * Constants.DAYS_IN_WEEK);
                     if (secondClass != null)
                     {
                         int firstClassRow = ClassesInWeek.GetRow(sClasses, subGroupDay[classIndex]);
                         int secondClassRow = ClassesInWeek.GetRow(sClasses, secondClass);
                         if (secondClassRow == -1 || secondClassRow != firstClassRow)
                         {
                             if (isBlock)
                                 return Constants.BLOCK_FINE;
                             else
                                 fineResult += fine;
                         }
                     }
                 }
             }
         }
     }
     return fineResult;
 }
开发者ID:Kirk7by,项目名称:mandarin,代码行数:33,代码来源:PairClassesInSameRoom.cs

示例4: GetFineOfFullSchedule

 public int GetFineOfFullSchedule(ISchedule schedule, EntityStorage eStorage)
 {
     int fineResult = 0;
     for (int groupIndex = 0; groupIndex < eStorage.StudentSubGroups.Length; groupIndex++)
     {
         PartialSchedule groupSchedule = schedule.GetPartialSchedule(eStorage.StudentSubGroups[groupIndex]);
         for (int dayIndex = 0; dayIndex < Constants.DAYS_IN_WEEK; dayIndex++)
         {
             StudentsClass[] sClass = groupSchedule.GetClassesOfDay(dayIndex);
             for (int classIndex = 0; classIndex < sClass.Length; classIndex++)
             {
                 if (sClasses.FindAll((c) => c.sClass == sClass[classIndex]).Count() > 0)
                 {
                     FixedClasses vipClass = sClasses.Find((c) => c.sClass == sClass[classIndex]);
                     if (vipClass.Room != schedule.GetClassRoom(sClass[classIndex]) && vipClass.Time != schedule.GetClassPosition(sClass[classIndex]).Value.Time)
                     {
                         if (isBlock)
                             return Constants.BLOCK_FINE;
                         else
                             fineResult += fine;
                     }
                 }
             }
         }
     }
     return fineResult;
 }
开发者ID:Kirk7by,项目名称:mandarin,代码行数:27,代码来源:VIPClasses.cs

示例5: GetFineOfAddedClass

 public int GetFineOfAddedClass(ISchedule schedule, EntityStorage eStorage)
 {
     StudentSubGroup[] groups = schedule.GetTempClass().SubGroups;
     int classTime = schedule.GetTimeOfTempClass();
     //Считаем день недели последней добавленной пары
     int dayOfWeek = Constants.GetDayOfClass(classTime);
     //Считаем номер пары в этот день
     int classOfDay = Constants.GetTimeOfClass(classTime);
     int otherWeekDay;
     int fineResult = 0;
     if (dayOfWeek < Constants.DAYS_IN_WEEK)
     {
         otherWeekDay = Constants.DAYS_IN_WEEK;
     }
     else
     {
         otherWeekDay = -Constants.DAYS_IN_WEEK;
     }
     if (dayOfWeek == Constants.DAYS_IN_WEEK - 1)
     {
         foreach (StudentSubGroup subGroup in groups)
         {
             StudentsClass[] classes = schedule.GetPartialSchedule(subGroup).GetClassesOfDay(dayOfWeek + otherWeekDay);
             if (classes[classOfDay] == null)
             {
                 if (isBlock)
                     return Constants.BLOCK_FINE;
                 else
                     fineResult += fine;
             }
         }
     }
     return fineResult;
 }
开发者ID:Kirk7by,项目名称:mandarin,代码行数:34,代码来源:SaturdayClassOneAtWeek.cs

示例6: GetFineOfFullSchedule

        public int GetFineOfFullSchedule(ISchedule schedule, EntityStorage eStorage)
        {
            int fineResult = 0;
            if (sClasses == null)
            { return fineResult; }
            for (int groupIndex = 0; groupIndex < eStorage.StudentSubGroups.Length; groupIndex++)
            {
                PartialSchedule groupSchedule = schedule.GetPartialSchedule(eStorage.StudentSubGroups[groupIndex]);
                for (int dayIndex = 0; dayIndex < Constants.WEEKS_IN_SCHEDULE * Constants.DAYS_IN_WEEK; dayIndex++)
                {
                    for (int classIndex = 0; classIndex < Constants.CLASSES_IN_DAY; classIndex++)
                    {
                        if (!SameClasses.ClassAtTheSameTimeOnOtherWeek(schedule, sClasses, dayIndex, classIndex))
                        {
                            if (isBlock)
                                return Constants.BLOCK_FINE;
                            else
                                fineResult += fine;
                        }

                    }
                }
            }
            return fineResult;
        }
开发者ID:Eugenni,项目名称:mandarin,代码行数:25,代码来源:ClassInSameTimeOnOtherWeek.cs

示例7: GetFineOfAddedClass

 public int GetFineOfAddedClass(ISchedule schedule, EntityStorage eStorage)
 {
     int fineCount = 0;
     if (lClasses == null)
     { return fineCount; }
     int classTime = schedule.GetTimeOfTempClass();
     int dayOfWeek = Constants.GetDayOfClass(classTime);
     int lectureCount = 0;
     foreach (StudentSubGroup subGroup in schedule.GetTempClass().SubGroups)
     {
         lectureCount = CountLectureClassesInDay(schedule.GetPartialSchedule(subGroup).GetClassesOfDay(dayOfWeek), lClasses);
         if (lectureCount > 3)
         {
             fineCount++;
         }
     }
     if (fineCount != 0)
     {
         if (isBlock)
             return Constants.BLOCK_FINE;
         else
             return fineCount * fine;
     }
     return fineCount;
 }
开发者ID:Eugenni,项目名称:mandarin,代码行数:25,代码来源:LectureClassesInDay.cs

示例8: GetFineOfFullSchedule

        public int GetFineOfFullSchedule(ISchedule schedule, EntityStorage eStorage)
        {
            int lectureCount = 0;
            int fineCount = 0;
            foreach (StudentSubGroup subGroup in eStorage.StudentSubGroups)
            {
                for (int dayIndex = 0; dayIndex < Constants.DAYS_IN_WEEK * Constants.WEEKS_IN_SCHEDULE; dayIndex++)
                {

                    lectureCount = CountLectureClassesInDay(schedule.GetPartialSchedule(subGroup).GetClassesOfDay(dayIndex), lClasses);
                    if (lectureCount > 3)
                    {
                        fineCount++;
                    }
                }
            }
            if (fineCount != 0)
            {
                if (isBlock)
                    return Constants.BLOCK_FINE;
                else
                    return fineCount * fine;
            }
            return fineCount;
        }
开发者ID:Kirk7by,项目名称:mandarin,代码行数:25,代码来源:LectureClassesInDay.cs

示例9: GetFineOfAddedClass

 public int GetFineOfAddedClass(ISchedule schedule, EntityStorage eStorage)
 {
     StudentSubGroup[] groups = schedule.GetTempClass().SubGroups;
     int day = Constants.GetDayOfClass(schedule.GetTimeOfTempClass());
     List<StudentsClass[]> groupDaySchedule = new List<StudentsClass[]>();
     int fineResult = 0;
     //Проверка является ли добавленная пара пятой
     for (int groupIndex = 0; groupIndex < groups.Length; groupIndex++)
     {
         groupDaySchedule.Add(schedule.GetPartialSchedule(groups[groupIndex]).GetClassesOfDay(day));
         if (schedule.GetTempClass() != groupDaySchedule[groupIndex][Constants.CLASSES_IN_DAY - 2])
         {
             return 0;
         }
     }
     //Проверка отсутствия первой пары
     for (int groupIndex = 0; groupIndex < groups.Length; groupIndex++)
     {
         if (groupDaySchedule[groupIndex][Constants.CLASSES_IN_DAY - 6] == null)
         {
             if (isBlock)
                 return Constants.BLOCK_FINE;
             else
                 fineResult += fine;
         }
     }
     return fineResult;
 }
开发者ID:Kirk7by,项目名称:mandarin,代码行数:28,代码来源:FifthClass.cs

示例10: GetFineOfFullSchedule

        public int GetFineOfFullSchedule(ISchedule schedule, EntityStorage eStorage)
        {
            int fineResult = 0;
            for (int groupIndex = 0; groupIndex < eStorage.StudentSubGroups.Length; groupIndex++)
            {
                StudentsClass[] groupFirstWeekSaturdaySchedule = schedule.GetPartialSchedule(eStorage.StudentSubGroups[groupIndex]).GetClassesOfDay(Constants.DAYS_IN_WEEK - 1);
                StudentsClass[] groupSecondWeekSaturdaySchedule = schedule.GetPartialSchedule(eStorage.StudentSubGroups[groupIndex]).GetClassesOfDay(Constants.WEEKS_IN_SCHEDULE * Constants.DAYS_IN_WEEK - 1);
                for (int classIndex = 0; classIndex < Constants.CLASSES_IN_DAY; classIndex++)
                {
                    if ((groupFirstWeekSaturdaySchedule[classIndex] != null && groupSecondWeekSaturdaySchedule[classIndex] == null) ||
                        (groupSecondWeekSaturdaySchedule[classIndex] != null && groupFirstWeekSaturdaySchedule[classIndex] == null))
                    {
                        if (isBlock)
                            return Constants.BLOCK_FINE;
                        else
                            fineResult += fine;
                    }
                }

            }
            return fineResult;
        }
开发者ID:Kirk7by,项目名称:mandarin,代码行数:22,代码来源:SaturdayClassOneAtWeek.cs

示例11: GetFineOfFullSchedule

 public int GetFineOfFullSchedule(ISchedule schedule, EntityStorage eStorage)
 {
     int fineResult = 0;
     for (int teacherIndex = 0; teacherIndex < eStorage.Teachers.Length; teacherIndex++)
     {
         PartialSchedule teacherSchedule = schedule.GetPartialSchedule(eStorage.Teachers[teacherIndex]);
         if (Math.Abs(GetCountClassesOnFirstWeek(teacherSchedule) - GetCountClassesOnSecondWeek(teacherSchedule)) > DIFFERENCE)
         {
             if (isBlock)
                 return Constants.BLOCK_FINE;
             else
                 fineResult += fine;
         }
     }
     return fineResult;
 }
开发者ID:Kirk7by,项目名称:mandarin,代码行数:16,代码来源:TeacherBalanceClasses.cs

示例12: GetFineOfAddedClass

        public int GetFineOfAddedClass(ISchedule schedule, EntityStorage eStorage)
        {
            Teacher[] teachers = schedule.GetTempClass().Teacher;
            for (int teacherIndex = 0; teacherIndex < teachers.Length; teacherIndex++)
            {
                PartialSchedule teacherSchedule = schedule.GetPartialSchedule(teachers[teacherIndex]);
                if (Math.Abs(GetCountClassesOnFirstWeek(teacherSchedule) - GetCountClassesOnSecondWeek(teacherSchedule)) > DIFFERENCE)
                {
                    if (isBlock)
                        return Constants.BLOCK_FINE;
                    else
                        return fine;
                }
            }

            return 0;
        }
开发者ID:Kirk7by,项目名称:mandarin,代码行数:17,代码来源:TeacherBalanceClasses.cs

示例13: GetFineOfAddedClass

 public int GetFineOfAddedClass(ISchedule schedule, EntityStorage eStorage)
 {
     StudentSubGroup[] groups = schedule.GetTempClass().SubGroups;
     int fineResult = 0;
     for (int groupIndex = 0; groupIndex < groups.Length; groupIndex++)
     {
         PartialSchedule groupSchedule = schedule.GetPartialSchedule(groups[groupIndex]);
         int day = Constants.GetDayOfClass(schedule.GetTimeOfTempClass());
         if (GetCountClassesInRow(groupSchedule.GetClassesOfDay(day)) == 5)
         {
             if (isBlock)
                 return Constants.BLOCK_FINE;
             else
                 fineResult += fine;
         }
     }
     return fineResult;
 }
开发者ID:Kirk7by,项目名称:mandarin,代码行数:18,代码来源:FiveStudentsClassesInRow.cs

示例14: GetFineOfFullSchedule

        public int GetFineOfFullSchedule(ISchedule schedule, EntityStorage eStorage)
        {
            int windowsCount = 0;

            foreach (StudentSubGroup subGroup in eStorage.StudentSubGroups)
            {
                //Получаем количество форточек у одной группы в один день
                windowsCount += Classes.CountUpTwoWindowsOfFullSchedule(schedule.GetPartialSchedule(subGroup));
            }

            if (windowsCount > 0)
            {
                if (isBlock)
                    return Constants.BLOCK_FINE;
                else
                    return windowsCount * fine;
            }
            return 0;
        }
开发者ID:Kirk7by,项目名称:mandarin,代码行数:19,代码来源:StudentTwoWindows.cs

示例15: GetFineOfFullSchedule

        public int GetFineOfFullSchedule(ISchedule schedule, EntityStorage eStorage)
        {
            int windowCount = 0;

            foreach (Teacher teacher in eStorage.Teachers)
            {
                //Получаем количество форточек у одной группы в один день
                windowCount += Classes.CountUpFourWindowsOfFullSchedule(schedule.GetPartialSchedule(teacher));
            }

            if (windowCount > 0)
            {
                if (isBlock)
                    return Constants.BLOCK_FINE;
                else
                    return windowCount * fine;
            }
            return 0;
        }
开发者ID:Kirk7by,项目名称:mandarin,代码行数:19,代码来源:TeachersFourWindows.cs


注:本文中的ISchedule.GetPartialSchedule方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。