public ActionResult SaveGeneralSettings(WebApiConfigModel model)
        {
            if (!ModelState.IsValid)
            {
                return(Configure());
            }

            model.Copy(_webApiSettings, false);
            Services.Settings.SaveSetting(_webApiSettings);

            WebApiCachingControllingData.Remove();

            return(Configure());
        }
Esempio n. 2
0
        public ActionResult SaveGeneralSettings(WebApiConfigModel model)
        {
            if (!HasPermission(false) || !ModelState.IsValid)
            {
                return(Configure());
            }

            model.Copy(_webApiSettings, false);
            _settingService.SaveSetting(_webApiSettings);

            WebApiCaching.Remove(WebApiControllingCacheData.Key);

            return(Configure());
        }
        public ActionResult Configure()
        {
            var model = new WebApiConfigModel();

            model.Copy(_webApiSettings, true);

            var odataUri   = new Uri(Request.Url, Url.Content("~/" + WebApiGlobal.MostRecentOdataPath));
            var swaggerUri = new Uri(Request.Url, Url.Content("~/swagger/ui/index"));

            model.ApiOdataUrl         = odataUri.AbsoluteUri.EnsureEndsWith("/");
            model.ApiOdataMetadataUrl = model.ApiOdataUrl + "$metadata";
            model.SwaggerUrl          = swaggerUri.AbsoluteUri;

            model.GridPageSize = _adminAreaSettings.GridPageSize;

            return(View(model));
        }
Esempio n. 4
0
        public ActionResult SaveGeneralSettings(WebApiConfigModel model)
        {
            if (!ModelState.IsValid)
            {
                return(Configure());
            }

            if (!HasPermission(false))
            {
                return(AccessDeniedPartialView());
            }

            model.Copy(_webApiSettings, false);
            _commonServices.Settings.SaveSetting(_webApiSettings);

            WebApiCachingControllingData.Remove();

            return(Configure());
        }
Esempio n. 5
0
        public ActionResult Configure()
        {
            if (!HasPermission(false))
            {
                return(AccessDeniedPartialView());
            }

            var model = new WebApiConfigModel();

            model.Copy(_webApiSettings, true);

            var odataUri = new Uri(Request.Url,
                                   WebApiGlobal.MostRecentOdataPath.StartsWith("/") ? WebApiGlobal.MostRecentOdataPath : "/" + WebApiGlobal.MostRecentOdataPath
                                   );

            model.ApiOdataUrl         = odataUri.AbsoluteUri.EnsureEndsWith("/");
            model.ApiOdataMetadataUrl = model.ApiOdataUrl + "$metadata";

            model.GridPageSize = _adminAreaSettings.GridPageSize;

            AddButtonText();

            return(View(model));
        }