Пример #1
0
        /// <summary>
        /// Get the schedule for specific insurance type (Motor or Home or Travel or Domestic)
        /// </summary>
        /// <param name="request">Schedule request.</param>
        /// <returns>Schedule file path.</returns>
        public DownloadScheduleResponse GetScheduleFilePath(DownloadScheuleRequest request)
        {
            try
            {
                string FilePath = string.Empty;

                if (request.InsuranceType == Constants.Insurance.Travel)
                {
                    TravelInsurance travel = new TravelInsurance();
                    TravelSavedQuotationResponse travelresult = travel.GetSavedQuotationByPolicy(request.DocNo, "portal", request.AgentCode,
                                                                                                 request.IsEndorsement, request.EndorsementID);
                    FilePath = this.CreateTravelSchudles(travelresult, false);
                }
                else if (request.InsuranceType == Constants.Insurance.Motor)
                {
                    MotorInsurance motor = new MotorInsurance();
                    MotorSavedQuotationResponse motorresult = motor.GetSavedMotorPolicy(request.DocNo, "", request.AgentCode,
                                                                                        request.IsEndorsement, request.EndorsementID, request.RenewalCount);
                    FilePath = this.CreateMotorSchudles(motorresult.MotorPolicyDetails, false);
                }
                else if (request.InsuranceType == Constants.Insurance.DomesticHelp)
                {
                    DomesticHelp domestic = new DomesticHelp();
                    DomesticHelpSavedQuotationResponse domesticresult = domestic.GetSavedDomesticPolicy(request.DocNo, request.AgentCode,
                                                                                                        request.IsEndorsement, request.EndorsementID);
                    FilePath = this.CreateDomesticSchudles(domesticresult, false);
                }
                else
                {
                    HomeInsurance home = new HomeInsurance();
                    HomeSavedQuotationResponse homeresult = home.GetSavedQuotationPolicy(request.DocNo, "", request.AgentCode,
                                                                                         request.IsEndorsement, request.EndorsementID, request.RenewalCount);
                    FilePath = CreateHomeSchudles(homeresult, false);
                }
                return(new DownloadScheduleResponse
                {
                    FilePath = FilePath,
                    IsTransactionDone = true
                });
            }
            catch (Exception ex)
            {
                return(new DownloadScheduleResponse
                {
                    IsTransactionDone = false,
                    TransactionErrorMessage = ex.Message
                });
            }
        }
Пример #2
0
 /// <summary>
 /// Get motor proposal file.
 /// </summary>
 /// <param name="request">Schedule request.</param>
 /// <returns>Schedule file path.</returns>
 public DownloadScheduleResponse GetProposalFilePath(DownloadScheuleRequest request)
 {
     try
     {
         string FilePath = string.Empty;
         if (request.InsuranceType == Constants.Insurance.Motor)
         {
             MotorInsurance motor = new MotorInsurance();
             MotorSavedQuotationResponse motorresult = motor.GetSavedMotorPolicy(request.DocNo, "", request.AgentCode, false, 0, request.RenewalCount);
             FilePath = this.CreateMotorProposal(motorresult.MotorPolicyDetails, false);
         }
         return(new DownloadScheduleResponse {
             FilePath = FilePath, IsTransactionDone = true
         });
     }
     catch (Exception ex)
     {
         return(new DownloadScheduleResponse {
             IsTransactionDone = false, TransactionErrorMessage = ex.Message
         });
     }
 }