예제 #1
0
 public MotorSavedQuotationResponse()
 {
     MotorPolicyDetails = new MotorInsurancePolicy();
     InsuredDetails     = new InsuredMaster();
 }
        public RR.TravelSavedQuotationResponse GetTravelSavedQuotation(int travelQuotationId, string userInsuredCode, string type)
        {
            BLO.TravelSavedQuotationResponse result = _travelInsuranceRep.GetSavedQuotationByTravelId(travelQuotationId, userInsuredCode, type);

            RR.TravelSavedQuotationResponse rrResult      = new RR.TravelSavedQuotationResponse();
            RR.TravelInsurancePolicy        policyDetails = new RR.TravelInsurancePolicy();

            policyDetails.TravelID           = result.TravelInsurancePolicyDetails.TravelID;
            policyDetails.InsuredCode        = result.TravelInsurancePolicyDetails.InsuredCode;
            policyDetails.InsuredName        = result.TravelInsurancePolicyDetails.InsuredName;
            policyDetails.SumInsured         = result.TravelInsurancePolicyDetails.SumInsured;
            policyDetails.PremiumAmount      = result.TravelInsurancePolicyDetails.PremiumAmount;
            policyDetails.InsuranceStartDate = result.TravelInsurancePolicyDetails.InsuranceStartDate;
            policyDetails.ExpiryDate         = result.TravelInsurancePolicyDetails.ExpiryDate;
            policyDetails.MainClass          = result.TravelInsurancePolicyDetails.MainClass;
            policyDetails.SubClass           = result.TravelInsurancePolicyDetails.SubClass;
            policyDetails.Passport           = result.TravelInsurancePolicyDetails.Passport;
            policyDetails.Occupation         = result.TravelInsurancePolicyDetails.Occupation;
            policyDetails.PeroidOfCoverCode  = result.TravelInsurancePolicyDetails.PeroidOfCoverCode;
            policyDetails.DiscountAmount     = result.TravelInsurancePolicyDetails.DiscountAmount;
            //policyDetails.Code = result.TravelInsurancePolicyDetails.Code;
            policyDetails.CPR            = result.TravelInsurancePolicyDetails.CPR;
            policyDetails.Mobile         = result.TravelInsurancePolicyDetails.Mobile;
            policyDetails.CreadtedDate   = result.TravelInsurancePolicyDetails.CreadtedDate;
            policyDetails.UpdatedDate    = result.TravelInsurancePolicyDetails.UpdatedDate;
            policyDetails.DocumentNumber = result.TravelInsurancePolicyDetails.DocumentNumber;
            //policyDetailsls.ISHIR = result.TravelInsurancePolicyDetails.IsHIR,
            policyDetails.IsPhysicalDefect         = result.TravelInsurancePolicyDetails.IsPhysicalDefect;
            policyDetails.PhysicalStateDescription = result.TravelInsurancePolicyDetails.PhysicalStateDescription;
            policyDetails.FFPNumber        = result.TravelInsurancePolicyDetails.FFPNumber;
            policyDetails.CoverageType     = result.TravelInsurancePolicyDetails.CoverageType;
            policyDetails.PackageName      = result.TravelInsurancePolicyDetails.PackageName;
            policyDetails.PolicyPeroidName = result.TravelInsurancePolicyDetails.PolicyPeroidName;

            rrResult.TravelInsurancePolicyDetails = policyDetails;
            List <RR.TravelMembers> rrMembers = new List <RR.TravelMembers>();

            if (result.TravelMembers.Count > 0)
            {
                foreach (var member in result.TravelMembers)
                {
                    RR.TravelMembers rrMember = new RR.TravelMembers();
                    rrMember.Age               = member.Age;
                    rrMember.DocumentNo        = member.DocumentNo;
                    rrMember.ItemSerialNo      = member.ItemSerialNo;
                    rrMember.ItemName          = member.ItemName;
                    rrMember.SumInsured        = member.SumInsured;
                    rrMember.ForeignSumInsured = member.ForeignSumInsured;
                    rrMember.Category          = member.Category;
                    rrMember.Title             = member.Title;
                    rrMember.Sex               = member.Sex;
                    rrMember.DateOfBirth       = member.DateOfBirth;
                    rrMember.Age               = member.Age;
                    rrMember.PremiumAmount     = member.PremiumAmount;
                    rrMember.Make              = member.Make;
                    rrMember.OccupationCode    = member.OccupationCode;
                    rrMember.CPR               = member.CPR;
                    rrMember.Passport          = member.Passport;
                    rrMember.FirstName         = member.FirstName;
                    rrMember.LastName          = member.LastName;
                    rrMember.MiddleName        = member.MiddleName;
                    rrMember.CreatedDate       = member.CreatedDate;
                    rrMember.UpdatedDate       = member.UpdatedDate;
                    rrMembers.Add(rrMember);
                }
            }
            rrResult.TravelMembers = rrMembers;

            RR.InsuredMaster details = new RR.InsuredMaster();
            if (result.InsuredDetails != null)
            {
                details.UserInfo.CPR         = result.InsuredDetails.UserInfo.CPR;
                details.UserInfo.DOB         = result.InsuredDetails.UserInfo.DOB;
                details.UserInfo.Nationality = result.InsuredDetails.UserInfo.Nationality;
                details.UserInfo.Sex         = result.InsuredDetails.UserInfo.Sex;
                details.UserInfo.Title       = result.InsuredDetails.UserInfo.Title;
                details.UserInfo.FirstName   = result.InsuredDetails.UserInfo.FirstName;
                details.UserInfo.MiddleName  = result.InsuredDetails.UserInfo.MiddleName;
                details.UserInfo.LastName    = result.InsuredDetails.UserInfo.LastName;
            }
            rrResult.InsuredDetails          = details;
            rrResult.IsTransactionDone       = result.IsTransactionDone;
            rrResult.TransactionErrorMessage = result.TransactionErrorMessage;

            return(rrResult);
        }