/// <summary> /// Adds a new credit object to the collection with the specified source type and score values. /// </summary> /// <param name="sourceType">The credit repository source type.</param> /// <param name="creditScore">The credit score.</param> /// <returns>The position of the addition in the collection</returns> public int Add(MISMO.Enums.CreditRepositorySourceType sourceType, short creditScore) { AUS.CreditScore credscore = new AUS.CreditScore(_borrower); credscore.CreditRepositorySourceType = (short)sourceType; credscore.CreditScoreValue = creditScore; return(this.Add(credscore)); }
/// <summary> /// Gets the first credit score from the collection by the specified repository source type. /// </summary> /// <param name="sourceType">The repository source type.</param> /// <returns>An AUS credit score object or null if the repository entry does not exist.</returns> public AUS.CreditScore GetByRepository(MISMO.Enums.CreditRepositorySourceType sourceType) { for (int i = 0, j = this.Count; i < j; i++) { AUS.CreditScore curscore = this[i] as AUS.CreditScore; if (curscore.CreditRepositorySourceType == (short)sourceType) { return(curscore); } } return(null); }
/// <summary> /// Gets or sets the credit score for the specified repository type. /// </summary> /// <remarks> /// If they do not exist, a -1 value is returned. Otherwise, the score itself is returned. /// </remarks> public short this[MISMO.Enums.CreditRepositorySourceType sourceType] { get { AUS.CreditScore score = this.GetByRepository(sourceType); return(score == null ? (short)-1 : score.CreditScoreValue); } set { AUS.CreditScore score = this.GetByRepository(sourceType); if (score == null) { this.Add(sourceType, value); } } }