/// <summary> /// Save your website widget configuration /// </summary> /// <param name="webSiteWidgetId"></param> /// <param name="data"></param> /// <returns>Response JSON </returns> public JsonResult SaveConfig(long webSiteWidgetId, string data) { var apiResponse = new ApiResponse(false, "Config save failed."); var webSiteWidget = _nccWebSiteWidgetService.Get(webSiteWidgetId); if (webSiteWidget != null) { webSiteWidget.WidgetConfigJson = data; _nccWebSiteWidgetService.Update(webSiteWidget); apiResponse.IsSuccess = true; apiResponse.Message = "Config save successfully."; } return(Json(apiResponse)); }
/// <summary> /// Save your website widget configuration /// </summary> /// <param name="webSiteWidgetId"></param> /// <param name="data"></param> /// <returns>Response JSON </returns> public JsonResult SaveConfig(long webSiteWidgetId, string data) { var apiResponse = new ApiResponse(false, "Config save failed."); var webSiteWidget = _nccWebSiteWidgetService.Get(webSiteWidgetId); if (webSiteWidget != null) { webSiteWidget.WidgetConfigJson = data; _nccWebSiteWidgetService.Update(webSiteWidget); apiResponse.IsSuccess = true; apiResponse.Message = "Config save successfully."; GlobalContext.WebSiteWidgets = _nccWebSiteWidgetService.LoadAll().OrderBy(x => x.WidgetOrder).ToList(); } return(Json(apiResponse)); }