public SubscriberInfo(int number, IBillingTariff tariff, IContract contract) { _subscriberNumber = number; Tariff = tariff; Contract = contract; BillingPeriod = contract.SignDate; _statistics = new List <IStatistic>(); }
public void ChangeTariff(int number, TariffOption tariffType) { if (_billing.Repository.ContainsKey(number)) { IBillingTariff currentTariff = _billing.Repository[number].Tariff; if (currentTariff.TariffType != tariffType) { if (_billing.Repository[number].Contract.ChangeTariff(tariffType)) { _billing.Repository[number].Tariff = CreateTariff(tariffType); } } else { Console.WriteLine("You alredy used this tariff."); } } else { Console.WriteLine("Abonunt with number {0} does not exist.", number); } }
private ISubscriberInfo CreateSubscriberInfo(TariffOption tariffType, int number, IContract contract) { IBillingTariff tariff = CreateTariff(tariffType); return(new SubscriberInfo(number, tariff, contract)); }