} // GetLogicalProposedAmount private void CreateUnlogicalOffer() { this.medalAgent.Notify(); if (Medal.HasError) { CreateErrorResult("Error calculating medal for {0}.", OuterContextDescription); return; } // if bool isHomeOwner = DB.ExecuteScalar <bool>( "GetIsCustomerHomeOwnerAccordingToLandRegistry", CommandSpecies.StoredProcedure, new QueryParameter("CustomerId", this.customerID) ); ProposedAmount = Math.Min( Medal.RoundOfferedAmount(), isHomeOwner ? this.homeOwnerCap : this.notHomeOwnerCap ); bool noGo = (ProposedAmount <= 0) || (Medal.MedalClassification == EZBob.DatabaseLib.Model.Database.Medal.NoClassification); if (noGo) { string errorMsg = string.Join( " ", new List <string> { ProposedAmount <= 0 ? "Proposed amount is not positive." : null, (Medal.MedalClassification == EZBob.DatabaseLib.Model.Database.Medal.NoClassification) ? "No medal calculated." : null, }.Where(s => !string.IsNullOrWhiteSpace(s)) ); CreateErrorResult("'{0}' for {1}, no offer.", errorMsg, OuterContextDescription); return; } // if GradeRangeSubproduct grsp = LoadOfferRanges(false); if (grsp == null) { return; } Calculate(); } // CreateUnlogicalOffer