示例#1
0
        protected Championship CreateChampionshipEx(Profile profile, string name, ChampionshipType type = ChampionshipType.Trojboj, ScheduleEntryState state = ScheduleEntryState.Done, DateTime?startDate = null, params ChampionshipCategory[] categories)
        {
            Championship championship = new Championship();

            championship.Name    = name;
            championship.MyPlace = GetDefaultMyPlace(profile);
            championship.Profile = profile;
            championship.State   = state;
            if (!startDate.HasValue)
            {
                startDate = DateTime.Now;
            }
            championship.StartTime = startDate.Value;
            foreach (var championshipCategory in categories)
            {
                championship.Categories.Add(championshipCategory);
            }

            championship.ChampionshipType = type;
            insertToDatabase(championship);

            return(championship);
        }