Esempio n. 1
0
 public RR.HomeEndoResponse GetAllEndorsements(RR.HomeEndoRequest req)
 {
     try
     {
         BLO.HomeEndoRequest details = _mapper.Map <RR.HomeEndoRequest, BLO.HomeEndoRequest>(req);
         var result = _homeEndorsementRepository.GetAllEndorsements(details);
         return(_mapper.Map <BLO.HomeEndoResponse, RR.HomeEndoResponse>(result));
     }
     catch (Exception ex)
     {
         return(new RR.HomeEndoResponse()
         {
             IsTransactionDone = false,
             TransactionErrorMessage = ex.Message
         });
     }
 }
Esempio n. 2
0
        private void ListEndorsements(DataServiceManager service, OAuthTokenResponse userInfo)
        {
            if (userInfo == null)
            {
                Response.Redirect("Login.aspx");
            }

            if (ddlHomePolicies.SelectedIndex > 0)
            {
                var homeEndoRequest = new BKIC.SellingPoint.DTO.RequestResponseWrappers.HomeEndoRequest();
                homeEndoRequest.Agency        = userInfo.Agency;
                homeEndoRequest.AgentCode     = userInfo.AgentCode;
                homeEndoRequest.InsuranceType = Constants.Home;
                homeEndoRequest.DocumentNo    = ddlHomePolicies.SelectedItem.Text.Trim();

                var listEndoResponse = service.PostData <BKIC.SellingPoint.DTO.RequestResponseWrappers.ApiResponseWrapper
                                                         <BKIC.SellingPoint.DTO.RequestResponseWrappers.HomeEndoResponse>,
                                                         BKIC.SellingPoint.DTO.RequestResponseWrappers.HomeEndoRequest>
                                           (BKIC.SellingPoint.DTO.Constants.HomeEndorsementURI.GetAllEndorsements, homeEndoRequest);

                if (listEndoResponse.StatusCode == 200 && listEndoResponse.Result.IsTransactionDone)
                {
                    gvHomeEndorsement.DataSource = listEndoResponse.Result.HomeEndorsements;
                    gvHomeEndorsement.DataBind();

                    if (listEndoResponse.Result.HomeEndorsements.Count > 0)
                    {
                        _HomeEndorsementID = listEndoResponse.Result.HomeEndorsements[listEndoResponse.Result.HomeEndorsements.Count - 1].HomeEndorsementID;
                    }
                    else
                    {
                        _HomeEndorsementID = 0;
                    }
                }
            }
        }