Example #1
0
        /// <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);
        }
Example #2
0
        /// <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;
 }
Example #4
0
        /// <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 );
        }
Example #5
0
        /// <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 );
        }
Example #6
0
 /// <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;
 }