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 RR.MotorDetailsPortalResponse GetMotorDetails(long motorID, string InsuredCode) { try { BLO.MotorDetailsPortalResponse result = new BLO.MotorDetailsPortalResponse(); result = _insurancePortalRepository.GetMotorDetails(motorID, InsuredCode); RR.MotorDetailsPortalResponse portalresponse = new RR.MotorDetailsPortalResponse(); RR.MotorInsurancePolicy response = new RR.MotorInsurancePolicy() { InsuredCode = result.MotorInsurancePolicy.InsuredCode, InsuredName = result.MotorInsurancePolicy.InsuredName, DocumentNo = result.MotorInsurancePolicy.DocumentNo, ExpiryDate = result.MotorInsurancePolicy.ExpiryDate, DOB = result.MotorInsurancePolicy.DOB, YearOfMake = result.MotorInsurancePolicy.YearOfMake, VehicleMake = result.MotorInsurancePolicy.VehicleMake, VehicleModel = result.MotorInsurancePolicy.VehicleModel, VehicleTypeCode = result.MotorInsurancePolicy.vehicleTypeCode, PolicyCode = result.MotorInsurancePolicy.PolicyCode, IsNCB = result.MotorInsurancePolicy.IsNCB, NCBStartDate = result.MotorInsurancePolicy.NCBStartDate, NCBEndDate = result.MotorInsurancePolicy.NCBEndDate, VehicleValue = result.MotorInsurancePolicy.VehicleValue, PremiumAmount = result.MotorInsurancePolicy.PremiumAmount, PolicyCommencementDate = result.MotorInsurancePolicy.PolicyCommencementDate, DeliveryOption = result.MotorInsurancePolicy.DeliveryOption, DeliveryBranch = result.MotorInsurancePolicy.DeliveryBranch, RegistrationNumber = result.MotorInsurancePolicy.RegistrationNumber, ChassisNo = result.MotorInsurancePolicy.ChassisNo, EngineCC = result.MotorInsurancePolicy.EngineCC, FinancierCompanyCode = result.MotorInsurancePolicy.FinancierCompanyCode, ExcessType = result.MotorInsurancePolicy.ExcessType, ExcessAmount = result.MotorInsurancePolicy.ExcessAmount, AgentBranch = result.MotorInsurancePolicy.Branch, MobileNumber = result.MotorInsurancePolicy.MobileNumber, CPR = result.MotorInsurancePolicy.CPR, IsHIR = result.MotorInsurancePolicy.IsHIR }; portalresponse.MotorInsurancePolicy = response; portalresponse.LoadAmount = result.LoadAmount; portalresponse.DiscountAmount = result.DiscountAmount; portalresponse.Remarks = result.Remarks; portalresponse.IsTransactionDone = result.IsTransactionDone; portalresponse.TransactionErrorMessage = result.TransactionErrorMessage; return(portalresponse); } catch (Exception ex) { return(new RR.MotorDetailsPortalResponse { TransactionErrorMessage = ex.Message, IsTransactionDone = false }); } }
private void SetVehicleMake(DataServiceManager service, BKIC.SellingPoint.DTO.RequestResponseWrappers.MotorInsurancePolicy response) { if (ddlMake.SelectedIndex > 0) { string VehicleMake = ddlMake.SelectedItem.Value; var vehicleModel = service.GetData <BKIC.SellingPoint.DTO.RequestResponseWrappers.ApiResponseWrapper <BKIC.SellingPoint.DTO.RequestResponseWrappers.VehicleModelResponse> >( BKIC.SellingPoint.DTO.Constants.DropDownURI.GetVehicleModel.Replace("{vehicleMake}", VehicleMake)); DataTable vehicleModeldt = JsonConvert.DeserializeObject <DataTable>(vehicleModel.Result.VehicleModeldt); if (vehicleModeldt.Rows.Count > 0) { ddlModel.DataValueField = "Model"; ddlModel.DataTextField = "Model"; ddlModel.DataSource = ExtensionMethod.GetDistictModel(response.Subclass, vehicleModeldt); ddlModel.DataBind(); ddlModel.Items.Insert(0, new ListItem("--Please Select--", "")); } ddlModel.SelectedIndex = ddlModel.Items.IndexOf(ddlModel.Items.FindByText(response.VehicleModel)); } }
public void SetEndorsementType(BKIC.SellingPoint.DTO.RequestResponseWrappers.MotorEndorsement mtorEndorsement, BKIC.SellingPoint.DTO.RequestResponseWrappers.MotorInsurancePolicy mtorPolicyDetails) { mtorEndorsement.VehicleValue = mtorPolicyDetails.VehicleValue; mtorEndorsement.Mainclass = mtorPolicyDetails.Mainclass; mtorEndorsement.Subclass = mtorPolicyDetails.Subclass; mtorEndorsement.MotorID = mtorPolicyDetails.MotorID; mtorEndorsement.PolicyCommencementDate = mtorPolicyDetails.PolicyCommencementDate; mtorEndorsement.ExpiryDate = mtorPolicyDetails.ExpiryDate; mtorEndorsement.Remarks = //txtRemarks.Text; mtorEndorsement.AccountNumber = ""; mtorEndorsement.EndorsementType = "InternalEndorsement"; mtorEndorsement.PaymentType = string.Empty; mtorEndorsement.InsuredCode = mtorPolicyDetails.InsuredCode; mtorEndorsement.InsuredName = mtorPolicyDetails.InsuredName; mtorEndorsement.FinancierCompanyCode = mtorPolicyDetails.FinancierCompanyCode; mtorEndorsement.CPR = mtorPolicyDetails.CPR; mtorEndorsement.NewExcess = mtorPolicyDetails.ExcessAmount; mtorEndorsement.PremiumBeforeDiscount = 0; mtorEndorsement.PremiumAfterDiscount = 0; mtorEndorsement.CommisionBeforeDiscount = 0; mtorEndorsement.CommissionAfterDiscount = 0; mtorEndorsement.RenewalCount = mtorPolicyDetails.RenewalCount; //InternalEndorsement mtorEndorsement.ChassisNo = txtChassis.Text.Trim(); mtorEndorsement.RegistrationNo = txtRegistration.Text.Trim(); mtorEndorsement.VehicleMake = ddlMake.SelectedItem.Text.Trim(); mtorEndorsement.VehicleModel = ddlModel.SelectedItem.Text.Trim(); mtorEndorsement.EngineCC = Convert.ToInt32(ddlEnginecc.SelectedItem.Value); mtorEndorsement.VehicleYear = Convert.ToInt32(ddlManufactureYear.SelectedItem.Text.Trim()); mtorEndorsement.VehicleBodyType = ddlBodyType.SelectedItem.Text.Trim(); }
public void SetEndorsementType(BKIC.SellingPoint.DTO.RequestResponseWrappers.MotorEndorsement mtorEndorsement, BKIC.SellingPoint.DTO.RequestResponseWrappers.MotorInsurancePolicy mtorPolicyDetails) { //mtorEndorsement.OldInsuredCode = mtorPolicyDetails.InsuredCode; //mtorEndorsement.OldInsuredName = mtorPolicyDetails.InsuredName; //mtorEndorsement.OldChassisNo = mtorPolicyDetails.ChassisNo; //mtorEndorsement.OldRegistrationNo = mtorPolicyDetails.RegistrationNumber; mtorEndorsement.VehicleValue = mtorPolicyDetails.VehicleValue; mtorEndorsement.Mainclass = mtorPolicyDetails.Mainclass; mtorEndorsement.Subclass = mtorPolicyDetails.Subclass; mtorEndorsement.MotorID = mtorPolicyDetails.MotorID; mtorEndorsement.PolicyCommencementDate = mtorPolicyDetails.PolicyCommencementDate; mtorEndorsement.ExpiryDate = mtorPolicyDetails.ExpiryDate; mtorEndorsement.Remarks = ""; mtorEndorsement.AccountNumber = ""; mtorEndorsement.EndorsementType = "Correction"; mtorEndorsement.PaymentType = ""; mtorEndorsement.InsuredCode = mtorPolicyDetails.InsuredCode; mtorEndorsement.InsuredName = mtorPolicyDetails.InsuredName; mtorEndorsement.RegistrationNo = !string.IsNullOrEmpty(txtNewRegistrationNumber.Text) ? txtNewRegistrationNumber.Text.Trim() : mtorPolicyDetails.RegistrationNumber; mtorEndorsement.ChassisNo = !string.IsNullOrEmpty(txtNewChassesNumber.Text) ? txtNewChassesNumber.Text.Trim() : mtorPolicyDetails.ChassisNo; mtorEndorsement.CPR = mtorPolicyDetails.CPR; mtorEndorsement.FinancierCompanyCode = mtorPolicyDetails.FinancierCompanyCode; mtorEndorsement.NewExcess = mtorPolicyDetails.ExcessAmount; }
public MotorRenewalDetailsResponse() { MototorRenewDetails = new MotorInsurancePolicy(); }
public UpdateMotorRequest() { MotorInsurance = new MotorInsurancePolicy(); }
public MotorSavedQuotationResponse() { MotorPolicyDetails = new MotorInsurancePolicy(); InsuredDetails = new InsuredMaster(); }
public MotorDetailsPortalResponse() { MotorInsurancePolicy = new MotorInsurancePolicy(); }
public void SetEndorsementType(BKIC.SellingPoint.DTO.RequestResponseWrappers.MotorEndorsement mtorEndorsement, BKIC.SellingPoint.DTO.RequestResponseWrappers.MotorInsurancePolicy mtorPolicyDetails) { mtorEndorsement.VehicleValue = mtorPolicyDetails.VehicleValue; mtorEndorsement.Mainclass = mtorPolicyDetails.Mainclass; mtorEndorsement.Subclass = mtorPolicyDetails.Subclass; mtorEndorsement.MotorID = mtorPolicyDetails.MotorID; mtorEndorsement.PolicyCommencementDate = mtorPolicyDetails.PolicyCommencementDate; mtorEndorsement.ExpiryDate = mtorPolicyDetails.ExpiryDate; mtorEndorsement.Remarks = ""; mtorEndorsement.AccountNumber = ""; mtorEndorsement.EndorsementType = "AddRemoveBank"; mtorEndorsement.InsuredCode = mtorPolicyDetails.InsuredCode; mtorEndorsement.InsuredName = mtorPolicyDetails.InsuredName; mtorEndorsement.RegistrationNo = mtorPolicyDetails.RegistrationNumber; mtorEndorsement.ChassisNo = mtorPolicyDetails.ChassisNo; mtorEndorsement.FinancierCompanyCode = ddlBank.SelectedIndex > 0 ? ddlBank.SelectedItem.Text : string.Empty; mtorEndorsement.CPR = mtorPolicyDetails.CPR; mtorEndorsement.NewExcess = mtorPolicyDetails.ExcessAmount; mtorEndorsement.PremiumBeforeDiscount = 0; mtorEndorsement.PremiumAfterDiscount = 0; mtorEndorsement.CommisionBeforeDiscount = 0; mtorEndorsement.CommissionAfterDiscount = 0; mtorEndorsement.RenewalCount = mtorPolicyDetails.RenewalCount; //InternalEndorsement mtorEndorsement.VehicleMake = mtorPolicyDetails.VehicleMake; mtorEndorsement.VehicleModel = mtorPolicyDetails.VehicleModel; mtorEndorsement.EngineCC = mtorPolicyDetails.EngineCC; mtorEndorsement.VehicleYear = mtorPolicyDetails.YearOfMake; mtorEndorsement.VehicleBodyType = mtorPolicyDetails.vehicleBodyType; }
public void SetEndorsementType(BKIC.SellingPoint.DTO.RequestResponseWrappers.MotorEndorsement mtorEndorsement, BKIC.SellingPoint.DTO.RequestResponseWrappers.MotorInsurancePolicy mtorPolicyDetails) { mtorEndorsement.VehicleValue = mtorPolicyDetails.VehicleValue; mtorEndorsement.Mainclass = mtorPolicyDetails.Mainclass; mtorEndorsement.Subclass = mtorPolicyDetails.Subclass; mtorEndorsement.MotorID = mtorPolicyDetails.MotorID; mtorEndorsement.PolicyCommencementDate = mtorPolicyDetails.PolicyCommencementDate; mtorEndorsement.ExpiryDate = mtorPolicyDetails.ExpiryDate; mtorEndorsement.Remarks = txtRemarks.Text; mtorEndorsement.AccountNumber = txtAccountNumber.Text.Trim(); mtorEndorsement.EndorsementType = "ChangePremium"; mtorEndorsement.PaymentType = ddlPaymentMethods.SelectedIndex > 0 ? ddlPaymentMethods.SelectedItem.Text : ""; mtorEndorsement.InsuredCode = mtorPolicyDetails.InsuredCode; mtorEndorsement.InsuredName = mtorPolicyDetails.InsuredName; mtorEndorsement.RegistrationNo = mtorPolicyDetails.RegistrationNumber; mtorEndorsement.ChassisNo = mtorPolicyDetails.ChassisNo; mtorEndorsement.CPR = mtorPolicyDetails.CPR; mtorEndorsement.FinancierCompanyCode = mtorPolicyDetails.FinancierCompanyCode; mtorEndorsement.NewExcess = mtorPolicyDetails.ExcessAmount; mtorEndorsement.PremiumBeforeDiscount = string.IsNullOrEmpty(calculatedPremium.Value) ? decimal.Zero : Convert.ToDecimal(calculatedPremium.Value); mtorEndorsement.PremiumAfterDiscount = string.IsNullOrEmpty(adjustedPremium.Value) ? decimal.Zero : Convert.ToDecimal(adjustedPremium.Value); mtorEndorsement.CommisionBeforeDiscount = string.IsNullOrEmpty(calculatedCommission.Value) ? decimal.Zero : Convert.ToDecimal(calculatedCommission.Value); mtorEndorsement.CommissionAfterDiscount = string.IsNullOrEmpty(adjustedCommission.Value) ? decimal.Zero : Convert.ToDecimal(adjustedCommission.Value); mtorEndorsement.RenewalCount = mtorPolicyDetails.RenewalCount; //InternalEndorsement mtorEndorsement.VehicleMake = mtorPolicyDetails.VehicleMake; mtorEndorsement.VehicleModel = mtorPolicyDetails.VehicleModel; mtorEndorsement.EngineCC = mtorPolicyDetails.EngineCC; mtorEndorsement.VehicleYear = mtorPolicyDetails.YearOfMake; mtorEndorsement.VehicleBodyType = mtorPolicyDetails.vehicleBodyType; }
public void SetEndorsementType(BKIC.SellingPoint.DTO.RequestResponseWrappers.MotorEndorsement mtorEndorsement, BKIC.SellingPoint.DTO.RequestResponseWrappers.MotorInsurancePolicy mtorPolicyDetails) { mtorEndorsement.VehicleValue = mtorPolicyDetails.VehicleValue; mtorEndorsement.Mainclass = mtorPolicyDetails.Mainclass; mtorEndorsement.Subclass = mtorPolicyDetails.Subclass; mtorEndorsement.MotorID = mtorPolicyDetails.MotorID; mtorEndorsement.PolicyCommencementDate = mtorPolicyDetails.PolicyCommencementDate; mtorEndorsement.ExpiryDate = mtorPolicyDetails.ExpiryDate; mtorEndorsement.Remarks = txtRemarks.Text; mtorEndorsement.EndorsementType = "CancelPolicy"; mtorEndorsement.PaymentType = ""; mtorEndorsement.InsuredCode = mtorPolicyDetails.InsuredCode; mtorEndorsement.InsuredName = mtorPolicyDetails.InsuredName; mtorEndorsement.RegistrationNo = mtorPolicyDetails.RegistrationNumber; mtorEndorsement.ChassisNo = mtorPolicyDetails.ChassisNo; mtorEndorsement.CancelDate = txtEffectiveToDate.Text.CovertToCustomDateTime(); //mtorEndorsement.CPR = ddlCPR.SelectedItem.Text; mtorEndorsement.CPR = txtCPRSearch.Text.Trim(); mtorEndorsement.NewExcess = mtorPolicyDetails.ExcessAmount; mtorEndorsement.PremiumBeforeDiscount = string.IsNullOrEmpty(calculatedPremium.Value) ? decimal.Zero : Convert.ToDecimal(calculatedPremium.Value); mtorEndorsement.PremiumAfterDiscount = string.IsNullOrEmpty(adjustedPremium.Value) ? decimal.Zero : Convert.ToDecimal(adjustedPremium.Value); mtorEndorsement.CommisionBeforeDiscount = string.IsNullOrEmpty(calculatedCommission.Value) ? decimal.Zero : Convert.ToDecimal(calculatedCommission.Value); mtorEndorsement.CommissionAfterDiscount = string.IsNullOrEmpty(adjustedCommission.Value) ? decimal.Zero : Convert.ToDecimal(adjustedCommission.Value); mtorEndorsement.RenewalCount = mtorPolicyDetails.RenewalCount; //InternalEndorsement mtorEndorsement.VehicleMake = mtorPolicyDetails.VehicleMake; mtorEndorsement.VehicleModel = mtorPolicyDetails.VehicleModel; mtorEndorsement.EngineCC = mtorPolicyDetails.EngineCC; mtorEndorsement.VehicleYear = mtorPolicyDetails.YearOfMake; mtorEndorsement.VehicleBodyType = mtorPolicyDetails.vehicleBodyType; }
public void SetEndorsementType(BKIC.SellingPoint.DTO.RequestResponseWrappers.MotorEndorsement mtorEndorsement, BKIC.SellingPoint.DTO.RequestResponseWrappers.MotorInsurancePolicy mtorPolicyDetails) { mtorEndorsement.VehicleValue = mtorPolicyDetails.VehicleValue; mtorEndorsement.Mainclass = mtorPolicyDetails.Mainclass; mtorEndorsement.Subclass = mtorPolicyDetails.Subclass; mtorEndorsement.MotorID = mtorPolicyDetails.MotorID; mtorEndorsement.PolicyCommencementDate = mtorPolicyDetails.PolicyCommencementDate; mtorEndorsement.ExpiryDate = mtorPolicyDetails.ExpiryDate; mtorEndorsement.Remarks = ""; mtorEndorsement.AccountNumber = ""; mtorEndorsement.EndorsementType = "ChangeExcess"; mtorEndorsement.PaymentType = ""; mtorEndorsement.InsuredCode = mtorPolicyDetails.InsuredCode; mtorEndorsement.InsuredName = mtorPolicyDetails.InsuredName; mtorEndorsement.RegistrationNo = mtorPolicyDetails.RegistrationNumber; mtorEndorsement.ChassisNo = mtorPolicyDetails.ChassisNo; mtorEndorsement.NewExcess = Convert.ToDecimal(txtNewExcess.Text); mtorEndorsement.CPR = mtorPolicyDetails.CPR; mtorEndorsement.FinancierCompanyCode = mtorPolicyDetails.FinancierCompanyCode; mtorEndorsement.RenewalCount = mtorPolicyDetails.RenewalCount; //InternalEndorsement mtorEndorsement.VehicleMake = mtorPolicyDetails.VehicleMake; mtorEndorsement.VehicleModel = mtorPolicyDetails.VehicleModel; mtorEndorsement.EngineCC = mtorPolicyDetails.EngineCC; mtorEndorsement.VehicleYear = mtorPolicyDetails.YearOfMake; mtorEndorsement.VehicleBodyType = mtorPolicyDetails.vehicleBodyType; }