public ActionResult OnRefreshDataPost(long layoutId, bool save) { string error; var viewModel = GetModelFromSession(layoutId, out error); if (viewModel == null) { return(View("AvrServiceError", (object)error)); } if (save) { SaveModelInDb(viewModel.ViewHeader); } ServiceClientHelper.AvrServiceClearQueryCache(GetQueryIdFromSession(layoutId)); ObjectStorage.Remove(Session.SessionID, layoutId, LayoutController.StoragePrefix); object ret = GetModelFromService(layoutId); if (ret is string) { return(View("AvrServiceError", (object)ret)); } var pivotResult = ret as AvrServicePivotResult; AdjustToNew(layoutId, viewModel.ViewHeader, pivotResult.Model); viewModel.ViewHeader.GridViewSettings = null; ViewBag.LayoutId = layoutId; return(RedirectToAction("ViewLayout", new { layoutId = layoutId })); }
private string RefreshQueryData(long queryId) { AvrServiceAccessability access = AvrServiceAccessability.Check(); if (!access.IsOk) { return(access.ErrorMessage); } ServiceClientHelper.AvrServiceClearQueryCache(queryId); ServiceClientHelper.RefreshQuery(queryId); return(string.Empty); }
private string RefreshPivotData() { AvrServiceAccessability access = AvrServiceAccessability.Check(); if (!access.IsOk) { return(access.ErrorMessage); } AvrPivotGridModel model = GetModelFromSession(); if (model != null) { ServiceClientHelper.AvrServiceClearQueryCache(model.PivotSettings.QueryId); RemovePivotViewObjects(model.PivotSettings.LayoutId); } return(string.Empty); }
public void DoesCachedQueryExistsTest() { ServiceClientHelper.CallAvrServiceToForceLOHMemoryAllocations(); bool exists = ServiceClientHelper.DoesCachedQueryExists(-1, "en", false); Assert.IsFalse(exists); var queryId = 49539640000000; ServiceClientHelper.AvrServiceClearQueryCache(queryId); exists = ServiceClientHelper.DoesCachedQueryExists(queryId, ModelUserContext.CurrentLanguage, false); Assert.IsFalse(exists); CachedQueryResult result = ServiceClientHelper.GetAvrServiceQueryResult(queryId, false, string.Empty); Assert.IsNotNull(result); exists = ServiceClientHelper.DoesCachedQueryExists(queryId, ModelUserContext.CurrentLanguage, false); Assert.IsTrue(exists); exists = ServiceClientHelper.DoesCachedQueryExists(queryId, ModelUserContext.CurrentLanguage, true); Assert.IsFalse(exists); }