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;
        }
Ejemplo n.º 2
0
        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.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;
        }
Ejemplo n.º 4
0
        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;
        }
Ejemplo n.º 5
0
        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;
        }
 public RR.MotorEndorsementResult PostAdminMotorPolicy(RR.MotorEndorsement policy)
 {
     try
     {
         BLO.MotorEndorsement       details = _mapper.Map <RR.MotorEndorsement, BLO.MotorEndorsement>(policy);
         BLO.MotorEndorsementResult result  = _motorEndorsementRepository.PostAdminMotorEndorsement(details);
         return(_mapper.Map <BLO.MotorEndorsementResult, RR.MotorEndorsementResult>(result));
     }
     catch (Exception ex)
     {
         return(new RR.MotorEndorsementResult
         {
             IsTransactionDone = false,
             TransactionErrorMessage = ex.Message
         });
     }
 }
Ejemplo n.º 7
0
 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;
 }
Ejemplo n.º 8
0
        public void SaveAuthorize(bool isSave)
        {
            try
            {
                master.IsSessionAvailable();
                var userInfo = CommonMethods.GetUserDetails();
                var service  = CommonMethods.GetLogedInService();

                if (isSave && EndorsementPrecheck())
                {
                    master.ShowErrorPopup("Your motor policy already have saved endorsement !", "Motor Endorsement");
                    return;
                }
                var postMotorEndorsement = new BKIC.SellingPoint.DTO.RequestResponseWrappers.MotorEndorsement
                {
                    Agency         = userInfo.Agency,
                    AgencyCode     = userInfo.AgentCode,
                    AgentBranch    = userInfo.AgentBranch,
                    IsSaved        = isSave,
                    IsActivePolicy = !isSave,
                    PremiumAmount  = string.IsNullOrEmpty(paidPremium.Value) ? decimal.Zero : Convert.ToDecimal(paidPremium.Value),
                    CreatedBy      = Convert.ToInt32(userInfo.ID)
                };

                var policyRenewalCount = ddlMotorPolicies.SelectedItem.Value.Substring(0, ddlMotorPolicies.SelectedValue.IndexOf("-", 0));

                //Get saved policy details by document(policy) number.
                var url = BKIC.SellingPoint.DTO.Constants.MotorURI.GetSavedQuoteDocumentNo
                          .Replace("{documentNo}", ddlMotorPolicies.SelectedItem.Text.Trim())
                          .Replace("{agentCode}", userInfo.AgentCode)
                          .Replace("{isendorsement}", "true")
                          .Replace("{endorsementid}", "0")
                          .Replace("{renewalCount}", policyRenewalCount);

                var motorDetails = service.GetData <BKIC.SellingPoint.DTO.RequestResponseWrappers.ApiResponseWrapper
                                                    <BKIC.SellingPoint.DTO.RequestResponseWrappers.MotorSavedQuotationResponse> >(url);

                //Update policy details on current page for dispaly the details.
                if (motorDetails.StatusCode == 200 && motorDetails.Result.IsTransactionDone)
                {
                    SetEndorsementType(postMotorEndorsement, motorDetails.Result.MotorPolicyDetails);
                }

                var response = service.PostData <BKIC.SellingPoint.DTO.RequestResponseWrappers.ApiResponseWrapper
                                                 <BKIC.SellingPoint.DTO.RequestResponseWrappers.MotorEndorsementResult>,
                                                 BKIC.SellingPoint.DTO.RequestResponseWrappers.MotorEndorsement>
                                   (BKIC.SellingPoint.DTO.Constants.MotorEndorsementURI.PostMotorEndorsement, postMotorEndorsement);

                if (response.Result != null && response.StatusCode == 200 && response.Result.IsTransactionDone)
                {
                    _MotorEndorsementID = response.Result.MotorEndorsementID;
                    ListEndorsements(service, userInfo);
                    btnSubmit.Enabled = false;
                    master.ShowErrorPopup("Your motor endorsement has been saved sucessfully :" + response.Result.EndorsementNo, "Motor Endorsement");
                }
            }
            catch (Exception ex)
            {
                //throw ex;
            }
            finally
            {
                master.ShowLoading = false;
            }
        }
Ejemplo n.º 9
0
        public void SaveAuthorize(bool isSave)
        {
            try
            {
                master.IsSessionAvailable();
                var userInfo = CommonMethods.GetUserDetails();
                var service  = CommonMethods.GetLogedInService();

                if (isSave && EndorsementPrecheck())
                {
                    modalBodyText.InnerText = "Your motor policy already have saved endorsement";
                    btnYes.Visible          = false;
                    btnOK.Text = "OK";
                    ScriptManager.RegisterStartupScript(this, this.GetType(), "Pop", "ShowPopup();", true);
                    return;
                }

                var postMotorEndorsement = new BKIC.SellingPoint.DTO.RequestResponseWrappers.MotorEndorsement
                {
                    Agency         = userInfo.Agency,
                    AgencyCode     = userInfo.AgentCode,
                    AgentBranch    = userInfo.AgentBranch,
                    IsSaved        = isSave,
                    IsActivePolicy = !isSave,
                    PremiumAmount  = string.IsNullOrEmpty(paidPremium.Value) ? decimal.Zero : Convert.ToDecimal(paidPremium.Value),
                    CreatedBy      = Convert.ToInt32(userInfo.ID)
                };

                //Get saved policy details by document(policy) number.
                var url = BKIC.SellingPoint.DTO.Constants.MotorURI.GetSavedQuoteDocumentNo
                          .Replace("{documentNo}", ddlMotorPolicies.SelectedItem.Text.Trim())
                          .Replace("{agentCode}", userInfo.AgentCode)
                          .Replace("{isendorsement}", "true")
                          .Replace("{endorsementid}", "0");

                var motorDetails = service.GetData <BKIC.SellingPoint.DTO.RequestResponseWrappers.ApiResponseWrapper
                                                    <BKIC.SellingPoint.DTO.RequestResponseWrappers.MotorSavedQuotationResponse> >(url);

                //Update policy details on current page for dispaly the details.
                if (motorDetails.StatusCode == 200 && motorDetails.Result.IsTransactionDone)
                {
                    SetEndorsementType(postMotorEndorsement, motorDetails.Result.MotorPolicyDetails);
                }
                //if (Convert.ToDecimal(premiumAmount.Text) < Convert.ToDecimal(calculatedPremium.Value))
                //{
                //    postMotorEndorsement.UserChangedPremium = true;
                //    postMotorEndorsement.PremiumAfterDiscount = Convert.ToDecimal(premiumAmount.Text);
                //    var diff = Convert.ToDecimal(calculatedPremium.Value) - postMotorEndorsement.PremiumAfterDiscount;
                //    postMotorEndorsement.CommissionAfterDiscount = Convert.ToDecimal(calculatedCommision.Value) - diff;
                //}

                var response = service.PostData <BKIC.SellingPoint.DTO.RequestResponseWrappers.ApiResponseWrapper
                                                 <BKIC.SellingPoint.DTO.RequestResponseWrappers.MotorEndorsementResult>,
                                                 BKIC.SellingPoint.DTO.RequestResponseWrappers.MotorEndorsement>
                                   (BKIC.SellingPoint.DTO.Constants.MotorEndorsementURI.PostMotorEndorsement, postMotorEndorsement);

                if (response.Result != null && response.StatusCode == 200 && response.Result.IsTransactionDone)
                {
                    _MotorEndorsementID = response.Result.MotorEndorsementID;
                    ListEndorsements(service, userInfo);
                    modalBodyText.InnerText = GetMessageText(false, response.Result.EndorsementNo);
                    //SetScheduleCertificateHref(userInfo);
                    ScriptManager.RegisterStartupScript(this, this.GetType(), "Pop", "ShowPopup();", true);
                }
            }
            catch (Exception ex)
            {
                //throw ex;
            }
            finally
            {
                master.ShowLoading = false;
            }
        }