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