Example #1
0
 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
         });
     }
 }
Example #2
0
 public UpdateMotorRequest()
 {
     MotorInsurance = new MotorInsurancePolicy();
 }
Example #3
0
 public MotorSavedQuotationResponse()
 {
     MotorPolicyDetails = new MotorInsurancePolicy();
 }
Example #4
0
 public MotorRenewalDetailsResponse()
 {
     MototorRenewDetails = new MotorInsurancePolicy();
 }
 public MotorDetailsPortalResponse()
 {
     MotorInsurancePolicy = new MotorInsurancePolicy();
 }