Exemple #1
0
 public Contract(Customer customer, TariffType type, DateTime contractDate)
 {
     Customer               = customer;
     ContractNumber         = random.Next(10000, 99999);
     Number                 = new PhoneNumber(random.Next(100, 999));
     tariffPlan             = new TariffPlan(type);
     ContractDate           = contractDate;
     dateOfLastTariffChange = DateTime.Now;
 }
Exemple #2
0
 public bool ChangeTariff(TariffType type)
 {
     if (DateTime.Now.AddMonths(-1) < dateOfLastTariffChange)
     {
         return(false);
     }
     else
     {
         dateOfLastTariffChange = DateTime.Now;
         tariffPlan             = new TariffPlan(type);
         return(true);
     }
 }