/// <summary> /// Adds the type of the contact. /// </summary> /// <param name="contactType">Type of the contact.</param> public virtual void AddContactType(PatientContactType contactType) { if (_contactTypes.FirstOrDefault(p => p.PatientContactType == contactType) != null) { throw new Exception("Contact Type already exists for PatientContact."); } _contactTypes.Add(new PatientContactContactType(this, contactType)); NotifyItemAdded(() => ContactTypes, contactType); }
/// <summary> /// Removes the type of the contact. /// </summary> /// <param name="contactType">Type of the contact.</param> public virtual void RemoveContactType(PatientContactType contactType) { PatientContactContactType patientContactType = _contactTypes.FirstOrDefault(p => p.PatientContactType == contactType); if (patientContactType == null) { throw new Exception("Contact Type does not contain PatientContactType."); } _contactTypes.Remove(patientContactType); NotifyItemRemoved(() => ContactTypes, contactType); }
/// <summary> /// Initializes a new instance of the <see cref="PatientContactContactType"/> class. /// </summary> /// <param name="patientContact">The patient contact.</param> /// <param name="contactType">Type of the contact.</param> protected internal PatientContactContactType( PatientContact patientContact, PatientContactType contactType ) : base(patientContact) { PatientContactType = contactType; }
/// <summary> /// Removes the type of the contact. /// </summary> /// <param name="contactType">Type of the contact.</param> public virtual void RemoveContactType( PatientContactType contactType ) { PatientContactContactType patientContactType = _contactTypes.FirstOrDefault ( p => p.PatientContactType == contactType ); if ( patientContactType == null ) { throw new Exception ( "Contact Type does not contain PatientContactType." ); } _contactTypes.Remove ( patientContactType ); NotifyItemRemoved ( () => ContactTypes, contactType ); }
/// <summary> /// Adds the type of the contact. /// </summary> /// <param name="contactType">Type of the contact.</param> public virtual void AddContactType( PatientContactType contactType ) { if ( _contactTypes.FirstOrDefault ( p => p.PatientContactType == contactType ) != null ) { throw new Exception ( "Contact Type already exists for PatientContact." ); } _contactTypes.Add ( new PatientContactContactType ( this, contactType ) ); NotifyItemAdded ( () => ContactTypes, contactType ); }
/// <summary> /// Initializes a new instance of the <see cref="PatientContactContactType"/> class. /// </summary> /// <param name="patientContact">The patient contact.</param> /// <param name="contactType">Type of the contact.</param> protected internal PatientContactContactType(PatientContact patientContact, PatientContactType contactType) : base(patientContact) { PatientContactType = contactType; }