Example #1
0
        public static BillingAccount NewBillingAccount(string billingCompanyIdString,
                                                       string billingAccountUsername, string billingAccountPassword)
        {
            //billing account id string formulation, calls a service to perform action
            IBillingAccountService billingAccountService = new BillingAccountService();
            string           localBillingAccountIdString = billingAccountService.CreateBillingAccountId();
            BillingAccountId localBillingAccountId       = new BillingAccountId(localBillingAccountIdString);

            BillingCompanyId localBillingCompanyId = new BillingCompanyId(billingCompanyIdString);

            return(new BillingAccount(localBillingAccountId, localBillingCompanyId, billingAccountUsername, billingAccountPassword, new APSUser.APSUser(new APSUser.APSUserId("1"), "testUsername", "testPassword")));
        }
Example #2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="BillingCompany"/> class.
 /// </summary>
 /// <param name="billingCompanyId">The billing company identifier.</param>
 /// <param name="companyName">Name of the company.</param>
 /// <exception cref="System.ArgumentNullException"></exception>
 public BillingCompany(BillingCompanyId billingCompanyId, string companyName)
 {
     if (billingCompanyId == null && string.IsNullOrEmpty(companyName))
     {
         throw new ArgumentNullException();
     }
     else
     {
         this._billingCompanyId = billingCompanyId;
         this.companyName       = companyName;
     }
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="BillingAccount"/> class.
 /// </summary>
 /// <param name="billingAccountId">The billing account identifier.</param>
 /// <param name="billingCompanyId">The billing company identifier.</param>
 /// <param name="billingAccountUsername">The billing account username.</param>
 /// <param name="billingAccountPassword">The billing account password.</param>
 /// <exception cref="System.ArgumentNullException"></exception>
 public BillingAccount(BillingAccountId billingAccountId, BillingCompanyId billingCompanyId,
                       string billingAccountUsername, string billingAccountPassword, APSUser apsUser)
 {
     if (billingAccountId != null && billingCompanyId != null &&
         !string.IsNullOrEmpty(billingAccountUsername) && !string.IsNullOrEmpty(billingAccountPassword))
     {
         _billingAccountId       = billingAccountId;
         _billingCompanyId       = billingCompanyId;
         _billingAccountUsername = billingAccountUsername;
         _billingAccountPassword = billingAccountPassword;
         _apsUser = apsUser;
     }
     else
     {
         throw new ArgumentNullException();
     }
 }