Example #1
0
        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 }));
        }
Example #2
0
        private string RefreshQueryData(long queryId)
        {
            AvrServiceAccessability access = AvrServiceAccessability.Check();

            if (!access.IsOk)
            {
                return(access.ErrorMessage);
            }
            ServiceClientHelper.AvrServiceClearQueryCache(queryId);
            ServiceClientHelper.RefreshQuery(queryId);
            return(string.Empty);
        }
Example #3
0
        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);
        }
Example #4
0
        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);
        }