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"))); }
/// <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(); } }
/// <summary> /// Entities compare by identity, not by attributes. /// </summary> /// <param name="other">The other entity.</param> /// <returns> /// true if the identities are the same, regardles of other attributes. /// </returns> public virtual bool SameIdentityAs(BillingAccount other) { return(BillingAccountId.SameValueAs(other.BillingAccountId)); }