Пример #1
0
        private int GetTime(Contestent contestent)
        {
            int startHour = contestent.StartHour * 3600;
            int endHour   = contestent.EndHour * 3600;

            contestent.EndMinute   *= 60;
            contestent.StartMinute *= 60;

            int test      = contestent.StartNumber;
            int startTime = startHour + contestent.StartMinute + contestent.StartSecond;
            int endTime   = endHour + contestent.EndMinute + contestent.EndSecond;

            int time;

            if (startTime < endTime)
            {
                time = endTime - startTime;
            }
            else
            {
                int hourTime = (24 - contestent.StartHour) + contestent.EndHour;
                hourTime *= 3600;

                startTime = contestent.StartMinute + contestent.StartSecond;
                endTime   = contestent.EndMinute + contestent.EndSecond;

                time = (endTime - startTime) + hourTime;
            }

            return(time);
        }
Пример #2
0
 public void SaveContestent(Contestent contestent)
 {
     contestants.Add(contestent);
 }