// Конструктор public AbonementByDays(Pay payStatus, TimeForTr time, TypeWorkout typeTr, SpaService spa, DaysInAbon numDays) : base(payStatus, time, typeTr, spa) { DaysLeft = (int)numDays; _typeAbonement = numDays; NumAerobicTr = 0; NumPersonalTr = 0; _validityPeriod = (typeTr == TypeWorkout.Персональная || typeTr == TypeWorkout.МиниГруппа) ? Options.ValidPeriod12Month: Options.ValidPeriodInMonth; // 12 месяцев - длительность абонемента с персональными тренировками EndDate = CalculateEndDate(DateTime.Now, _validityPeriod); }
private void SetInitialValues() { if (_person.AbonementCurent == null) { _selectedAbonementName = "Абонемент";// Вид Абонемента по Умолчанию radioButton_Abonement.Checked = true; _typeWorkout = TypeWorkout.Тренажерный_Зал; _timeTren = TimeForTr.Весь_День; _spa = SpaService.Спа; _pay = Pay.Оплачено; _daysInAbon = DaysInAbon.На_12_посещений; _periodClubCard = PeriodClubCard.На_1_Месяц; } else // Абонемент Существует { _selectedAbonementName = _person.AbonementCurent.AbonementName; _typeWorkout = _person.AbonementCurent.TypeWorkout; _timeTren = _person.AbonementCurent.TimeTraining; _spa = _person.AbonementCurent.Spa; _pay = _person.AbonementCurent.PayStatus; switch (_person.AbonementCurent) { case AbonementByDays days: _daysInAbon = days.GetTypeAbonementByDays(); radioButton_Abonement.Checked = true; break; case ClubCardA abonement: _periodClubCard = abonement.GetTypeClubCard(); radioButton_ClubCard.Checked = true; break; case SingleVisit _: radioButton_Single.Checked = true; break; } } }
private void ComboBox_Abonem_SelectedIndexChanged(object sender, EventArgs e) { var combo = (ComboBox)sender; _daysInAbon = MyComboBox.GetComboBoxValue <DaysInAbon>(combo); }