/// <summary> /// Sets the Certification Specialty /// </summary> /// <param name="certificationSpecialty">The certification specialty.</param> public virtual void SetCertificationSpecialty(CertificationSpecialty certificationSpecialty) { if (certificationSpecialty == null) { throw new ArgumentNullException("certificationSpecialty"); } CertificationSpecialty = certificationSpecialty; }
/// <summary> /// Adds the Certification Specialty. /// </summary> /// <param name="name">The name.</param> /// <returns></returns> public CertificationSpecialty AddCertificationSpecialty(string name) { if (CertificationSpecialties.SingleOrDefault(b => b.Name == name) != null) { throw new BusinessException(string.Format(CultureInfo.CurrentCulture, "Certification Board already contains a Certification Specialty named {0}", name)); } var certificationSpecialty = new CertificationSpecialty(name, this); CertificationSpecialties.Add(certificationSpecialty); return certificationSpecialty; }
public ProviderCertificationSpecialty(Provider provider, CertificationSpecialty certificationSpecialty, string yearOfIssuance) : this() { if (provider == null) { throw new ArgumentNullException("provider"); } Provider = provider; SetCertificationSpecialty(certificationSpecialty); SetYearOfIssuance(yearOfIssuance); }
/// <summary> /// Removes the provider certification specialty /// </summary> /// <param name="certificationSpecialty">The certification specialty.</param> public ProviderCertificationSpecialty RemoveCertificationSpecialty(CertificationSpecialty certificationSpecialty) { if (certificationSpecialty == null) { throw new ArgumentNullException("certificationSpecialty"); } var providerCertificationSpecialty = ProviderCertificationSpecialties.Single(pl => pl.CertificationSpecialty.Id == certificationSpecialty.Id); ProviderCertificationSpecialties.Remove(providerCertificationSpecialty); return providerCertificationSpecialty; }
/// <summary> /// Adds the provider certification specialty. /// </summary> /// <param name="certificationSpecialty">The certification specialty.</param> /// <param name="yearOfIssuance">The year the cerficiation was issued.</param> public ProviderCertificationSpecialty AddCertificationSpecialty(CertificationSpecialty certificationSpecialty, string yearOfIssuance) { if (certificationSpecialty == null) { throw new ArgumentNullException("certificationSpecialty"); } if (String.IsNullOrEmpty(yearOfIssuance)) { throw new ArgumentNullException("yearOfIssuance"); } if (ProviderCertificationSpecialties.Count(pl => pl.CertificationSpecialtyId.Equals(certificationSpecialty.Id)) > 0) { throw new BusinessException("The specialty is already associated with this provider"); } var providerCertificationSpecialty = new ProviderCertificationSpecialty(this, certificationSpecialty, yearOfIssuance); ProviderCertificationSpecialties.Add(providerCertificationSpecialty); return providerCertificationSpecialty; }
private CertificationSpecialty CreateCertificationSpecialty() { _certificationAgency = new CertificationAgency("Big Agency"); _certificationBoard = _certificationAgency.AddCertificationBoard("Medium Board"); _certificationSpecialty = _certificationBoard.AddCertificationSpecialty("Precise Specialty"); return _certificationSpecialty; }
private CertificationSpecialty CreateCertificationSpecialty(string specialtyName) { _certificationAgency = new CertificationAgency("Big Agency"); _certificationBoard = _certificationAgency.AddCertificationBoard("Medium Board"); _certificationSpecialty = _certificationBoard.AddCertificationSpecialty(specialtyName); return _certificationSpecialty; }