Exemple #1
0
        /// <summary>
        /// Sets the primary photo.
        /// </summary>
        /// <param name="patientPhoto">The patient photo.</param>
        public virtual void SetPrimaryPhoto(PatientPhoto patientPhoto)
        {
            Check.IsNotNull(patientPhoto, "patientPhoto is required.");

            DomainRuleEngine.CreateRuleEngine <Patient, PatientPhoto> (this, () => SetPrimaryPhoto)
            .WithContext(patientPhoto)
            .Execute(() => PrimaryPatientPhoto = patientPhoto);
        }
Exemple #2
0
        /// <summary>
        /// Adds the patient photo.
        /// </summary>
        /// <param name="patientPhoto">The patient photo.</param>
        public virtual void AddPatientPhoto(PatientPhoto patientPhoto)
        {
            Check.IsNotNull(patientPhoto, "patientPhoto is required.");

            DomainRuleEngine.CreateRuleEngine <Patient, PatientPhoto> (this, () => AddPatientPhoto)
            .WithContext(patientPhoto)
            .Execute(
                () =>
            {
                patientPhoto.Patient = this;
                _photos.Add(patientPhoto);

                if (_photos.Count == 1)
                {
                    SetPrimaryPhoto(patientPhoto);
                }

                NotifyItemAdded(() => Photos, patientPhoto);
            });
        }
Exemple #3
0
        /// <summary>
        /// Adds the patient photo.
        /// </summary>
        /// <param name="patientPhoto">The patient photo.</param>
        public virtual void AddPatientPhoto(PatientPhoto patientPhoto)
        {
            Check.IsNotNull(patientPhoto, "patientPhoto is required.");

            DomainRuleEngine.CreateRuleEngine<Patient, PatientPhoto> ( this, () => AddPatientPhoto )
                .WithContext ( patientPhoto )
                .Execute (
                    () =>
                        {
                            patientPhoto.Patient = this;
                            _photos.Add ( patientPhoto );

                            if ( _photos.Count == 1 )
                            {
                                SetPrimaryPhoto ( patientPhoto );
                            }

                            NotifyItemAdded ( () => Photos, patientPhoto );
                        } );
        }
Exemple #4
0
        /// <summary>
        /// Sets the primary photo.
        /// </summary>
        /// <param name="patientPhoto">The patient photo.</param>
        public virtual void SetPrimaryPhoto(PatientPhoto patientPhoto)
        {
            Check.IsNotNull(patientPhoto, "patientPhoto is required.");

            DomainRuleEngine.CreateRuleEngine<Patient, PatientPhoto> ( this, () => SetPrimaryPhoto )
                .WithContext ( patientPhoto )
                .Execute ( () => PrimaryPatientPhoto = patientPhoto );
        }