public Contract(string number, string phoneNumber, TariffPlan tariffPlan, string personalAccount, string dateOfConclusion) { Number = number; PhoneNumber = new PhoneNumber { Value = phoneNumber }; TariffPlan = tariffPlan; DateOfConclusion = DateTime.Parse(dateOfConclusion); PersonalAccount = new PersonalAccount(personalAccount, DateOfConclusion + new TimeSpan(31, 0, 0)); }
public bool ChangeTariffPlan(TariffPlan tariffPlan) { DateTime nowDateTime = DateTime.Now, resultDareTime = DateOfConclusion + new TimeSpan(31, 0, 0, 0); if (resultDareTime >= nowDateTime) return false; TariffPlan = tariffPlan; DateOfConclusion = nowDateTime; return true; }