Пример #1
0
        public int GetPolicyRenewalCount()
        {
            master.IsSessionAvailable();
            var userInfo = CommonMethods.GetUserDetails();
            var service  = CommonMethods.GetLogedInService();

            int renewalCount = 0;

            var homereq = new BKIC.SellingPoint.DTO.RequestResponseWrappers.AgencyHomeRequest
            {
                AgentCode   = userInfo.AgentCode,
                Agency      = userInfo.Agency,
                AgentBranch = userInfo.AgentBranch,
                IncludeHIR  = false,
                IsRenewal   = false,
                DocumentNo  = txtHomeEndorsementSearch.Text.Trim()
            };

            //Get PolicyNo by Agency
            var homePolicies = service.PostData <BKIC.SellingPoint.DTO.RequestResponseWrappers.ApiResponseWrapper
                                                 <BKIC.SellingPoint.DTO.RequestResponseWrappers.AgencyHomePolicyResponse>,
                                                 BKIC.SellingPoint.DTO.RequestResponseWrappers.AgencyHomeRequest>
                                   (BKIC.SellingPoint.DTO.Constants.HomeURI.GetHomePoliciesEndorsement, homereq);

            if (homePolicies.StatusCode == 200 && homePolicies.Result.IsTransactionDone &&
                homePolicies.Result.AgencyHomePolicies.Count > 0)
            {
                renewalCount = homePolicies.Result.AgencyHomePolicies[0].RenewalCount;
            }
            return(renewalCount);
        }
        private void GetHomePoliciesByCPR()
        {
            master.IsSessionAvailable();
            var userInfo = CommonMethods.GetUserDetails();
            var service  = CommonMethods.GetLogedInService();

            var homereq = new BKIC.SellingPoint.DTO.RequestResponseWrappers.AgencyHomeRequest
            {
                AgentCode   = userInfo.AgentCode,
                Agency      = userInfo.Agency,
                AgentBranch = userInfo.AgentBranch,
                CPR         = txtCPRSearch.Text.Trim(),
                Type        = Constants.Home
            };

            //Get PolicyNo by Agency
            var homePolicies = service.PostData <BKIC.SellingPoint.DTO.RequestResponseWrappers.ApiResponseWrapper
                                                 <BKIC.SellingPoint.DTO.RequestResponseWrappers.AgencyHomePolicyResponse>,
                                                 BKIC.SellingPoint.DTO.RequestResponseWrappers.AgencyHomeRequest>
                                   (BKIC.SellingPoint.DTO.Constants.HomeURI.GetHomePoliciesByCPR, homereq);

            ddlHomePolicies.Items.Clear();
            if (homePolicies.StatusCode == 200 && homePolicies.Result.IsTransactionDone &&
                homePolicies.Result.AgencyHomePolicies.Count > 0)
            {
                policyList = homePolicies.Result.AgencyHomePolicies;

                ddlHomePolicies.DataSource     = homePolicies.Result.AgencyHomePolicies;
                ddlHomePolicies.DataTextField  = "DOCUMENTNO";
                ddlHomePolicies.DataValueField = "DOCUMENTRENEWALNO";
                ddlHomePolicies.DataBind();
                ddlHomePolicies.Items.Insert(0, new ListItem("--Please Select--", "none"));
            }
            ClearControls();
        }
 public RR.AgencyHomePolicyResponse GetHomePoliciesByTypeByCPR(RR.AgencyHomeRequest request)
 {
     try
     {
         BLO.AgencyHomeRequest        home   = _mapper.Map <RR.AgencyHomeRequest, BLO.AgencyHomeRequest>(request);
         BLO.AgencyHomePolicyResponse result = _homeInsuranceRepository.GetHomeAgencyPolicyByCPR(home);
         return(_mapper.Map <BLO.AgencyHomePolicyResponse, RR.AgencyHomePolicyResponse>(result));
     }
     catch (Exception ex)
     {
         return(new RR.AgencyHomePolicyResponse
         {
             IsTransactionDone = false,
             TransactionErrorMessage = ex.Message
         });
     }
 }