Exemplo n.º 1
0
        public IHttpActionResult Get(string customerNo)
        {
            //string token = Constants.SessionToken;
            string token = string.Empty;

            try
            {
                IEnumerable <string> headerValues = this.Request.Headers.GetValues("token");
                token = headerValues.FirstOrDefault();
            }
            catch
            {
                throw new HttpRequestException("Token not provided");
            }

            List <Product>           productList = new List <Product>();
            CustomerPortfolioRequest request     = new CustomerPortfolioRequest();

            request.Token           = token;
            request.CustomerNumber  = customerNo;
            request.ProductListType = "All";
            request.InquiryMode     = "Simple";
            request.CustLinkMode    = "Direct";
            request.ProductStatus   = "Active";
            XenonAdapter adapter  = new XenonAdapter();
            BaseResponse response = adapter.GetCustomerProfile(request);

            if (response.ErrCode == "0")
            {
                //Deserialize json
                productList = JsonConvert.DeserializeObject <List <Product> >(response.Json);
            }

            return(Json(productList));
        }
Exemplo n.º 2
0
        public BaseResponse GetCustomerProfile(CustomerPortfolioRequest request)
        {
            Hashtable parameters = new Hashtable();

            parameters.Add("token", request.Token);
            parameters.Add("customerNumber", request.CustomerNumber);
            parameters.Add("productListType", request.ProductListType);
            parameters.Add("inquiryMode", request.InquiryMode);
            parameters.Add("custLinkMode", request.CustLinkMode);
            parameters.Add("productStatus", request.ProductStatus);
            BaseResponse response = this.ExecuteCall(request.Transaction, "BFX", parameters);

            return(response);
        }