public RR.CommissionResponse GetCommision(RR.CommissionRequest request) { try { BLO.CommissionRequest requestdetails = _mapper.Map <RR.CommissionRequest, BLO.CommissionRequest>(request); BLO.CommissionResponse result = _insurancePortalRepository.GetCommission(requestdetails); return(_mapper.Map <BLO.CommissionResponse, RR.CommissionResponse>(result)); } catch (Exception ex) { return(new RR.CommissionResponse { IsTransactionDone = false, TransactionErrorMessage = ex.Message }); } }
public decimal GetCommision(BO.MotorInsurancePolicy policy, decimal totalPremium, bool isDeductable) { decimal CommissionAmount = 0; var commisionRequest = new BO.CommissionRequest { AgentCode = policy.AgencyCode, Agency = policy.Agency, SubClass = policy.Subclass, PremiumAmount = totalPremium, IsDeductable = isDeductable }; var commissionResponse = _insurancePortalRepository.GetCommission(commisionRequest); if (commissionResponse.IsTransactionDone) { CommissionAmount = commissionResponse.CommissionAmount; } return(CommissionAmount); }