コード例 #1
0
 public void SetEndorsementType(BKIC.SellingPoint.DTO.RequestResponseWrappers.HomeEndorsement homeEndorsement, HomeInsurancePolicy homePolicyDetails)
 {
     homeEndorsement.RenewalCount           = homePolicyDetails.RenewalCount;
     homeEndorsement.InsuredCode            = homePolicyDetails.InsuredCode;
     homeEndorsement.InsuredName            = homePolicyDetails.InsuredName;
     homeEndorsement.Mainclass              = homePolicyDetails.MainClass;
     homeEndorsement.Subclass               = homePolicyDetails.SubClass;
     homeEndorsement.HomeID                 = homePolicyDetails.HomeID;
     homeEndorsement.PolicyCommencementDate = homePolicyDetails.PolicyStartDate;
     homeEndorsement.ExpiryDate             = homePolicyDetails.PolicyExpiryDate;
     homeEndorsement.Remarks                = "";
     homeEndorsement.AccountNumber          = "";
     homeEndorsement.EndorsementType        = "ChangeAddress";
     homeEndorsement.FinancierCompanyCode   = homePolicyDetails.FinancierCode;
     homeEndorsement.BlockNo                = txtBlockNo.Text;
     homeEndorsement.BuildingAge            = ddlBuildingAge.SelectedIndex > 0 ? Convert.ToInt32(ddlBuildingAge.SelectedItem.Value) : 0;
     homeEndorsement.BuildingNo             = txtBuildingNo.Text;
     homeEndorsement.Area               = ddlArea.SelectedIndex > 0 ? ddlArea.SelectedItem.Text : "";
     homeEndorsement.NoOfFloors         = string.IsNullOrEmpty(txtNoOfFloor.Text) ? 0 : Convert.ToInt32(txtNoOfFloor.Text);
     homeEndorsement.HouseNo            = txtHouseNo.Text.Trim();
     homeEndorsement.FlatNo             = txtFlatNo.Text.Trim();
     homeEndorsement.RoadNo             = txtRoadNo.Text.Trim();
     homeEndorsement.BuildingType       = ddlBuildingType.SelectedItem.Text.ToLower() == "flat" ? 2 : ddlBuildingType.SelectedItem.Text.ToLower() == "contents" ? 3 : 1;
     homeEndorsement.BuildingSumInsured = homePolicyDetails.BuildingValue;
     homeEndorsement.ContentSumInsured  = homePolicyDetails.ContentValue;
 }
コード例 #2
0
 public void SetEndorsementType(BKIC.SellingPoint.DTO.RequestResponseWrappers.HomeEndorsement homeEndorsement, HomeInsurancePolicy homePolicyDetails)
 {
     homeEndorsement.RenewalCount           = homePolicyDetails.RenewalCount;
     homeEndorsement.InsuredCode            = homePolicyDetails.InsuredCode;
     homeEndorsement.InsuredName            = homePolicyDetails.InsuredName;
     homeEndorsement.Mainclass              = homePolicyDetails.MainClass;
     homeEndorsement.Subclass               = homePolicyDetails.SubClass;
     homeEndorsement.HomeID                 = homePolicyDetails.HomeID;
     homeEndorsement.PolicyCommencementDate = homePolicyDetails.PolicyStartDate;
     homeEndorsement.ExpiryDate             = homePolicyDetails.PolicyExpiryDate;
     homeEndorsement.CancelDate             = txtEffectiveToDate.Text.CovertToCustomDateTime();
     homeEndorsement.Remarks                = txtRemarks.Text;
     homeEndorsement.AccountNumber          = string.Empty;
     homeEndorsement.PaymentType            = string.Empty;
     homeEndorsement.EndorsementType        = "CancelPolicy";
     homeEndorsement.FinancierCompanyCode   = homePolicyDetails.FinancierCode;
     homeEndorsement.BlockNo                = homePolicyDetails.BlockNo;
     homeEndorsement.BuildingAge            = homePolicyDetails.BuildingAge;
     homeEndorsement.BuildingNo             = homePolicyDetails.BuildingNo;
     homeEndorsement.Area                    = homePolicyDetails.Area;
     homeEndorsement.NoOfFloors              = homePolicyDetails.NoOfFloors;
     homeEndorsement.HouseNo                 = homePolicyDetails.HouseNo;
     homeEndorsement.FlatNo                  = homePolicyDetails.FlatNo;
     homeEndorsement.RoadNo                  = homePolicyDetails.RoadNo;
     homeEndorsement.BuildingType            = homePolicyDetails.BuildingType;
     homeEndorsement.BuildingSumInsured      = homePolicyDetails.BuildingValue;
     homeEndorsement.ContentSumInsured       = homePolicyDetails.ContentValue;
     homeEndorsement.PremiumBeforeDiscount   = string.IsNullOrEmpty(calculatedPremium.Value) ? decimal.Zero : Convert.ToDecimal(calculatedPremium.Value);
     homeEndorsement.PremiumAfterDiscount    = string.IsNullOrEmpty(adjustedPremium.Value) ? decimal.Zero : Convert.ToDecimal(adjustedPremium.Value);
     homeEndorsement.CommisionBeforeDiscount = string.IsNullOrEmpty(calculatedCommission.Value) ? decimal.Zero : Convert.ToDecimal(calculatedCommission.Value);
     homeEndorsement.CommissionAfterDiscount = string.IsNullOrEmpty(adjustedCommission.Value) ? decimal.Zero : Convert.ToDecimal(adjustedCommission.Value);
 }
コード例 #3
0
 public void SetEndorsementType(BKIC.SellingPoint.DTO.RequestResponseWrappers.HomeEndorsement homeEndorsement, HomeInsurancePolicy homePolicyDetails)
 {
     homeEndorsement.RenewalCount           = homePolicyDetails.RenewalCount;
     homeEndorsement.InsuredCode            = homePolicyDetails.InsuredCode;
     homeEndorsement.InsuredName            = homePolicyDetails.InsuredName;
     homeEndorsement.Mainclass              = homePolicyDetails.MainClass;
     homeEndorsement.Subclass               = homePolicyDetails.SubClass;
     homeEndorsement.HomeID                 = homePolicyDetails.HomeID;
     homeEndorsement.PolicyCommencementDate = homePolicyDetails.PolicyStartDate;
     homeEndorsement.ExpiryDate             = homePolicyDetails.PolicyExpiryDate;
     homeEndorsement.Remarks                = "";
     homeEndorsement.AccountNumber          = "";
     homeEndorsement.EndorsementType        = "AddRemoveBank";
     homeEndorsement.FinancierCompanyCode   = ddlBank.SelectedIndex > 0 ? ddlBank.SelectedItem.Text : string.Empty;
     homeEndorsement.BlockNo                = homePolicyDetails.BlockNo;
     homeEndorsement.BuildingAge            = homePolicyDetails.BuildingAge;
     homeEndorsement.BuildingNo             = homePolicyDetails.BuildingNo;
     homeEndorsement.Area               = homePolicyDetails.Area;
     homeEndorsement.NoOfFloors         = homePolicyDetails.NoOfFloors;
     homeEndorsement.HouseNo            = homePolicyDetails.HouseNo;
     homeEndorsement.FlatNo             = homePolicyDetails.FlatNo;
     homeEndorsement.RoadNo             = homePolicyDetails.RoadNo;
     homeEndorsement.BuildingType       = homePolicyDetails.BuildingType;
     homeEndorsement.BuildingSumInsured = homePolicyDetails.BuildingValue;
     homeEndorsement.ContentSumInsured  = homePolicyDetails.ContentValue;
 }
コード例 #4
0
 public RR.HomeEndorsementResponse PostHomePolicy(RR.HomeEndorsement homeEndorsement)
 {
     try
     {
         BLO.HomeEndorsement         details = _mapper.Map <RR.HomeEndorsement, BLO.HomeEndorsement>(homeEndorsement);
         BLO.HomeEndorsementResponse result  = _homeEndorsementRepository.PostHomeEndorsement(details);
         return(_mapper.Map <BLO.HomeEndorsementResponse, RR.HomeEndorsementResponse>(result));
     }
     catch (Exception ex)
     {
         return(new RR.HomeEndorsementResponse
         {
             IsTransactionDone = false,
             TransactionErrorMessage = ex.Message
         });
     }
 }
コード例 #5
0
        public void SaveAuthorize(bool isSave)
        {
            try
            {
                master.IsSessionAvailable();
                var userInfo = CommonMethods.GetUserDetails();
                var service  = CommonMethods.GetLogedInService();

                if (isSave && EndorsementPrecheck())
                {
                    master.ShowErrorPopup("Your home policy already have saved endorsement !", "Home Endorsement");
                    return;
                }

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

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

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


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

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

                var response = service.PostData <BKIC.SellingPoint.DTO.RequestResponseWrappers.ApiResponseWrapper
                                                 <BKIC.SellingPoint.DTO.RequestResponseWrappers.HomeEndorsementResponse>,
                                                 BKIC.SellingPoint.DTO.RequestResponseWrappers.HomeEndorsement>
                                   (BKIC.SellingPoint.DTO.Constants.HomeEndorsementURI.PostHomeEndorsement, postHomeEndorsement);

                if (response.Result != null && response.StatusCode == 200 && response.Result.IsTransactionDone)
                {
                    _HomeEndorsementID = response.Result.HomeEndorsementID;
                    ListEndorsements(service, userInfo);
                    btnSubmit.Enabled = false;
                    master.ShowErrorPopup("Your home endorsement has been saved sucessfully :" + response.Result.EndorsementNo, "Home Endorsement");
                }
            }
            catch (Exception ex)
            {
                ////throw ex;
            }
            finally
            {
                master.ShowLoading = false;
            }
        }