Exemplo n.º 1
0
        public HttpResponseMessage GetCreditRiskRating(HttpRequestMessage request, int creditRiskRatingId)
        {
            return(GetHttpResponse(request, () =>
            {
                HttpResponseMessage response = null;

                CreditRiskRating creditRiskRating = _LoanService.GetCreditRiskRating(creditRiskRatingId);

                // notice no need to create a seperate model object since CreditRiskRating entity will do just fine
                response = request.CreateResponse <CreditRiskRating>(HttpStatusCode.OK, creditRiskRating);

                return response;
            }));
        }
 /// <summary>
 /// Gets the hash code
 /// </summary>
 /// <returns>Hash code</returns>
 public override int GetHashCode()
 {
     unchecked // Overflow is fine, just wrap
     {
         var hashCode = 41;
         // Suitable nullity checks etc, of course :)
         if (CreditProfileDate != null)
         {
             hashCode = hashCode * 59 + CreditProfileDate.GetHashCode();
         }
         if (CreditRiskRating != null)
         {
             hashCode = hashCode * 59 + CreditRiskRating.GetHashCode();
         }
         if (CreditScore != null)
         {
             hashCode = hashCode * 59 + CreditScore.GetHashCode();
         }
         if (ValidFor != null)
         {
             hashCode = hashCode * 59 + ValidFor.GetHashCode();
         }
         if (TagCreditScoring != null)
         {
             hashCode = hashCode * 59 + TagCreditScoring.GetHashCode();
         }
         if (TagCreditLimit != null)
         {
             hashCode = hashCode * 59 + TagCreditLimit.GetHashCode();
         }
         if (TagCreditThreshold != null)
         {
             hashCode = hashCode * 59 + TagCreditThreshold.GetHashCode();
         }
         if (TagCreditOnHold != null)
         {
             hashCode = hashCode * 59 + TagCreditOnHold.GetHashCode();
         }
         if (TagContractDailyCreditLimit != null)
         {
             hashCode = hashCode * 59 + TagContractDailyCreditLimit.GetHashCode();
         }
         if (TagContractPeriodicCreditLimit != null)
         {
             hashCode = hashCode * 59 + TagContractPeriodicCreditLimit.GetHashCode();
         }
         return(hashCode);
     }
 }
Exemplo n.º 3
0
        public HttpResponseMessage DeleteCreditRiskRating(HttpRequestMessage request, [FromBody] int creditRiskRatingId)
        {
            return(GetHttpResponse(request, () =>
            {
                HttpResponseMessage response = null;

                // not that calling the WCF service here will authenticate access to the data
                CreditRiskRating creditRiskRating = _LoanService.GetCreditRiskRating(creditRiskRatingId);

                if (creditRiskRating != null)
                {
                    _LoanService.DeleteCreditRiskRating(creditRiskRatingId);

                    response = request.CreateResponse(HttpStatusCode.OK);
                }
                else
                {
                    response = request.CreateErrorResponse(HttpStatusCode.NotFound, "No Opex Business Rule found under that ID.");
                }

                return response;
            }));
        }
 public CreditRiskRating UpdateCreditRiskRating(CreditRiskRating creditRiskRating)
 {
     return(Channel.UpdateCreditRiskRating(creditRiskRating));
 }
        /// <summary>
        /// Returns true if CreditProfile instances are equal
        /// </summary>
        /// <param name="other">Instance of CreditProfile to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(CreditProfile other)
        {
            if (ReferenceEquals(null, other))
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     CreditProfileDate == other.CreditProfileDate ||
                     CreditProfileDate != null &&
                     CreditProfileDate.Equals(other.CreditProfileDate)
                     ) &&
                 (
                     CreditRiskRating == other.CreditRiskRating ||
                     CreditRiskRating != null &&
                     CreditRiskRating.Equals(other.CreditRiskRating)
                 ) &&
                 (
                     CreditScore == other.CreditScore ||
                     CreditScore != null &&
                     CreditScore.Equals(other.CreditScore)
                 ) &&
                 (
                     ValidFor == other.ValidFor ||
                     ValidFor != null &&
                     ValidFor.Equals(other.ValidFor)
                 ) &&
                 (
                     TagCreditScoring == other.TagCreditScoring ||
                     TagCreditScoring != null &&
                     TagCreditScoring.Equals(other.TagCreditScoring)
                 ) &&
                 (
                     TagCreditLimit == other.TagCreditLimit ||
                     TagCreditLimit != null &&
                     TagCreditLimit.Equals(other.TagCreditLimit)
                 ) &&
                 (
                     TagCreditThreshold == other.TagCreditThreshold ||
                     TagCreditThreshold != null &&
                     TagCreditThreshold.Equals(other.TagCreditThreshold)
                 ) &&
                 (
                     TagCreditOnHold == other.TagCreditOnHold ||
                     TagCreditOnHold != null &&
                     TagCreditOnHold.Equals(other.TagCreditOnHold)
                 ) &&
                 (
                     TagContractDailyCreditLimit == other.TagContractDailyCreditLimit ||
                     TagContractDailyCreditLimit != null &&
                     TagContractDailyCreditLimit.Equals(other.TagContractDailyCreditLimit)
                 ) &&
                 (
                     TagContractPeriodicCreditLimit == other.TagContractPeriodicCreditLimit ||
                     TagContractPeriodicCreditLimit != null &&
                     TagContractPeriodicCreditLimit.Equals(other.TagContractPeriodicCreditLimit)
                 ));
        }
Exemplo n.º 6
0
        public HttpResponseMessage UpdateCreditRiskRating(HttpRequestMessage request, [FromBody] CreditRiskRating creditRiskRatingModel)
        {
            return(GetHttpResponse(request, () =>
            {
                var creditRiskRating = _LoanService.UpdateCreditRiskRating(creditRiskRatingModel);

                return request.CreateResponse <CreditRiskRating>(HttpStatusCode.OK, creditRiskRating);
            }));
        }