Пример #1
0
 /// <summary>
 /// 大会の新しいインスタンスを生成します。
 /// </summary>
 /// <param name="tournamentName">大会名。</param>
 /// <param name="tournamentType">大会種別。</param>
 /// <param name="registrationYear">登録年度。</param>
 /// <param name="typeOfYear">年度種別。</param>
 /// <param name="aggregationMonth">集計月度。</param>
 /// <param name="tennisEvents">種目一覧。</param>
 /// <param name="holdingPeriod">開催期間。</param>
 /// <param name="holdingDates">開催日一覧。</param>
 /// <param name="venue">会場。</param>
 /// <param name="entryFee">参加費。</param>
 /// <param name="methodOfPayment">支払い方法。</param>
 /// <param name="applicationPeriod">申込期間。</param>
 /// <param name="outline">大会要領。</param>
 /// <param name="tournamentEntryReceptionMailSubject">大会申込受付メールの件名。</param>
 /// <param name="tournamentEntryReceptionMailBody">大会申込受付メールの本文。</param>
 /// <param name="id">大会 ID。</param>
 public Tournament(
     TournamentName tournamentName,
     TournamentType tournamentType,
     RegistrationYear registrationYear,
     TypeOfYear typeOfYear,
     AggregationMonth aggregationMonth,
     List <TennisEvent> tennisEvents,
     HoldingPeriod holdingPeriod,
     List <HoldingDate> holdingDates,
     Venue venue, EntryFee entryFee,
     MethodOfPayment methodOfPayment,
     ApplicationPeriod applicationPeriod,
     Outline outline,
     string tournamentEntryReceptionMailSubject,
     string tournamentEntryReceptionMailBody,
     int id = 0)
 {
     this.Initialize(
         tournamentName,
         tournamentType,
         registrationYear,
         typeOfYear,
         aggregationMonth,
         tennisEvents,
         holdingPeriod,
         holdingDates,
         venue,
         entryFee,
         methodOfPayment,
         applicationPeriod,
         outline,
         tournamentEntryReceptionMailSubject,
         tournamentEntryReceptionMailBody,
         id);
 }
Пример #2
0
        /// <summary>
        /// コンストラクタのプロパティ値設定処理を共通化。
        /// </summary>
        /// <param name="tournamentName">大会名。</param>
        /// <param name="tournamentType">大会種別。</param>
        /// <param name="registrationYear">登録年度。</param>
        /// <param name="typeOfYear">年度種別。</param>
        /// <param name="aggregationMonth">集計月度。</param>
        /// <param name="tennisEvents">種目一覧。</param>
        /// <param name="holdingPeriod">開催期間。</param>
        /// <param name="holdingDates">開催日一覧。</param>
        /// <param name="venue">会場。</param>
        /// <param name="entryFee">参加費。</param>
        /// <param name="methodOfPayment">支払い方法。</param>
        /// <param name="applicationPeriod">申込期間。</param>
        /// <param name="outline">大会要領。</param>
        /// <param name="tournamentEntryReceptionMailSubject">大会申込受付メールの件名。</param>
        /// <param name="tournamentEntryReceptionMailBody">大会申込受付メールの本文。</param>
        private void Initialize(
            TournamentName tournamentName,
            TournamentType tournamentType,
            RegistrationYear registrationYear,
            TypeOfYear typeOfYear,
            AggregationMonth aggregationMonth,
            List <TennisEvent> tennisEvents,
            HoldingPeriod holdingPeriod,
            List <HoldingDate> holdingDates,
            Venue venue,
            EntryFee entryFee,
            MethodOfPayment methodOfPayment,
            ApplicationPeriod applicationPeriod,
            Outline outline,
            string tournamentEntryReceptionMailSubject,
            string tournamentEntryReceptionMailBody,
            int id)
        {
            registrationYear.EnsureValidAggregationMonth(aggregationMonth.Value);
            registrationYear.EnsureValidHoldingStartDate(holdingPeriod?.StartDate);
            holdingPeriod?.EnsureValidHoldingDates(holdingDates);
            holdingPeriod?.EnsureValidApplicationEndDate(applicationPeriod?.EndDate);

            this.TournamentName    = tournamentName;
            this.TournamentType    = tournamentType;
            this.RegistrationYear  = registrationYear;
            this.TypeOfYear        = typeOfYear;
            this.AggregationMonth  = aggregationMonth;
            this.tennisEvents      = tennisEvents;
            this.HoldingPeriod     = holdingPeriod;
            this.holdingDates      = holdingDates;
            this.Venue             = venue;
            this.EntryFee          = entryFee;
            this.MethodOfPayment   = methodOfPayment;
            this.ApplicationPeriod = applicationPeriod;
            this.Outline           = outline;
            this.TournamentEntryReceptionMailSubject = tournamentEntryReceptionMailSubject;
            this.TournamentEntryReceptionMailBody    = tournamentEntryReceptionMailBody;
            this.Id = id;
        }