本文整理汇总了C#中ISchedule.GetTimeOfTempClass方法的典型用法代码示例。如果您正苦于以下问题:C# ISchedule.GetTimeOfTempClass方法的具体用法?C# ISchedule.GetTimeOfTempClass怎么用?C# ISchedule.GetTimeOfTempClass使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ISchedule
的用法示例。
在下文中一共展示了ISchedule.GetTimeOfTempClass方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: 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;
}
示例2: 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;
}
示例3: 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;
}
示例4: 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;
}
示例5: GetFineOfAddedClass
public int GetFineOfAddedClass(ISchedule schedule, EntityStorage eStorage)
{
int fineResult = 0;
StudentsClass tempClass = schedule.GetTempClass();
int classTime = schedule.GetTimeOfTempClass();
int roomIndex = schedule.GetClassPosition(schedule.GetTempClass()).Value.ClassRoom;
int weekOfClass = Constants.GetWeekOfClass(classTime);
if (Array.Find(sClassesList.ToArray(), (c) => c == schedule.GetTempClass()) != null)
{
StudentsClass secondClass;
if (weekOfClass == 0)
secondClass = schedule.GetClassByRoomAndPosition(roomIndex, classTime + Constants.CLASSES_IN_DAY * Constants.DAYS_IN_WEEK);
else
secondClass = schedule.GetClassByRoomAndPosition(roomIndex, classTime - Constants.CLASSES_IN_DAY * Constants.DAYS_IN_WEEK);
if (secondClass != null)
{
int firstClassRow = ClassesInWeek.GetRow(sClasses, tempClass);
int secondClassRow = ClassesInWeek.GetRow(sClasses, secondClass);
if (secondClassRow == -1 || secondClassRow != firstClassRow)
{
if (isBlock)
return Constants.BLOCK_FINE;
else
fineResult += fine;
}
}
}
return fineResult;
}
示例6: GetFineOfAddedClass
public int GetFineOfAddedClass(ISchedule schedule, EntityStorage eStorage)
{
int classTime = schedule.GetTimeOfTempClass();
//Считаем день недели последней добавленной пары
int dayOfWeek = Constants.GetDayOfClass(classTime);
//Считаем номер пары в этот день
int classOfDay = Constants.GetTimeOfClass(classTime);
int fineResult = 0;
if (!SameClasses.ClassAtTheSameTimeOnOtherWeek(schedule, sClasses, dayOfWeek, classOfDay))
{
if (isBlock)
return Constants.BLOCK_FINE;
else
fineResult += fine;
}
return fineResult;
}
示例7: 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;
}
示例8: GetFineOfAddedClass
public int GetFineOfAddedClass(ISchedule schedule, EntityStorage eStorage)
{
int fineResult = 0;
int classTime = schedule.GetTimeOfTempClass();
//Считаем день недели последней добавленной пары
int dayOfWeek = Constants.GetDayOfClass(classTime);
//Считаем номер пары в этот день
int classOfDay = Constants.GetTimeOfClass(classTime);
foreach (StudentSubGroup subGroup in schedule.GetTempClass().SubGroups)
{
int windowsCount = Classes.CountUpTwoWindowsOfAddedClass(schedule.GetPartialSchedule(subGroup).GetClassesOfDay(dayOfWeek), classOfDay);
if (windowsCount > 0)
{
if (isBlock)
return Constants.BLOCK_FINE;
else
fineResult += windowsCount * fine;
}
}
return fineResult;
}