Esempio n. 1
0
        public ActionResult Index()
        {
            try
            {
                var    customerCode = _identityProvider.Identity.CustomerCode;
                object model;

                if (!String.IsNullOrEmpty(_restUrl))
                {
                    var client = _factory.CreateClient();
                    var result = client.GetAsync(GetUrl(customerCode)).Result.Content.ReadAsStringAsync().Result;
                    model = JsonConvert.DeserializeObject <ConfigurationInfo>(result);
                }
                else
                {
                    model = _service.GetConfigurationInfo(customerCode);
                }
                ViewBag.HostId = _qpHelper.HostId;
                return(View(model));
            }
            catch (EndpointNotFoundException)
            {
                return(View((object)null));
            }
        }