/// <summary>
        /// Processes the single aggregate.
        /// </summary>
        /// <param name="dto">The dto.</param>
        /// <param name="billingOffice">The billing office.</param>
        /// <returns>A <see cref="System.Boolean"/></returns>
        protected override bool ProcessSingleAggregate(BillingOfficeProfileDto dto, BillingOffice billingOffice)
        {
            var billingOfficeProfile = new BillingOfficeProfile(
                dto.Name, new DateRange(dto.EffectiveDate, dto.EndDate), dto.EmailAddress == null ? null : new EmailAddress(dto.EmailAddress));

            billingOffice.ReviseProfile(billingOfficeProfile);

            return(true);
        }
Пример #2
0
        /// <summary>
        /// Creates the billing office.
        /// </summary>
        /// <param name="agency">The agency.</param>
        /// <param name="administratorStaff">The administrator staff.</param>
        /// <param name="electronicTransmitterIdentificationNumber">The electronic transmitter identification number.</param>
        /// <param name="profile">The profile.</param>
        /// <returns>The Billing Office.</returns>
        public BillingOffice CreateBillingOffice(
            Agency agency, Staff administratorStaff, string electronicTransmitterIdentificationNumber, BillingOfficeProfile profile )
        {
            Check.IsNotNull ( agency, "Agency is required." );
            Check.IsNotNull ( administratorStaff, "Administrator Staff is required." );
            Check.IsNotNull ( electronicTransmitterIdentificationNumber, "Electronic Transmitter Identification Number is required." );

            var billingOffice = new BillingOffice ( agency, administratorStaff, electronicTransmitterIdentificationNumber, profile );

            _billingOfficeRepository.MakePersistent ( billingOffice );

            return billingOffice;
        }
Пример #3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="BillingOffice"/> class.
 /// </summary>
 /// <param name="agency">The agency.</param>
 /// <param name="administratorStaff">The administrator staff.</param>
 /// <param name="electronicTransmitterIdentificationNumber">The electronic transmitter identification number.</param>
 /// <param name="profile">The profile.</param>
 protected internal BillingOffice(
     Agency agency, Staff administratorStaff, string electronicTransmitterIdentificationNumber, BillingOfficeProfile profile )
     : this()
 {
     Check.IsNotNull ( agency, () => Agency );
     Check.IsNotNull ( administratorStaff, () => AdministratorStaff );
     Check.IsNotNull ( electronicTransmitterIdentificationNumber, () => ElectronicTransmitterIdentificationNumber );
     Check.IsNotNull ( profile, () => Profile );
     Agency = agency;
     AdministratorStaff = administratorStaff;
     ElectronicTransmitterIdentificationNumber = electronicTransmitterIdentificationNumber;
     Profile = profile;
 }
Пример #4
0
 /// <summary>
 /// Revises the profile.
 /// </summary>
 /// <param name="profile">The profile.</param>
 public virtual void ReviseProfile( BillingOfficeProfile profile )
 {
     Check.IsNotNull ( profile, () => Profile );
     Profile = profile;
 }