public RR.MotorInsurancePolicyResponse PostMotorPolicy(RR.MotorInsurancePolicy policy) { try { if (ModelState.IsValid) { BLO.MotorInsurancePolicy details = _mapper.Map <RR.MotorInsurancePolicy, BLO.MotorInsurancePolicy>(policy); details.AuthorizedBy = policy.IsActivePolicy ? policy.Createdby : 0; BLO.MotorInsurancePolicyResponse result = _motorInsuranceRepository.PostMotorInsurance(details); return(_mapper.Map <BLO.MotorInsurancePolicyResponse, RR.MotorInsurancePolicyResponse>(result)); } else { var message = string.Join(" | ", ModelState.Values.SelectMany(v => v.Errors).Select(e => e.ErrorMessage)); return(new RR.MotorInsurancePolicyResponse() { IsTransactionDone = false, TransactionErrorMessage = message }); } } catch (Exception ex) { return(new RR.MotorInsurancePolicyResponse { IsTransactionDone = false, TransactionErrorMessage = ex.Message }); } }
public UpdateMotorRequest() { MotorInsurance = new MotorInsurancePolicy(); }
public MotorSavedQuotationResponse() { MotorPolicyDetails = new MotorInsurancePolicy(); }
public MotorRenewalDetailsResponse() { MototorRenewDetails = new MotorInsurancePolicy(); }
public MotorDetailsPortalResponse() { MotorInsurancePolicy = new MotorInsurancePolicy(); }