diff --git a/Console/BExIS.Web.Shell/Areas/DDM/Controllers/DataController.cs b/Console/BExIS.Web.Shell/Areas/DDM/Controllers/DataController.cs index da5a36a41b..d9f4ff3ed8 100644 --- a/Console/BExIS.Web.Shell/Areas/DDM/Controllers/DataController.cs +++ b/Console/BExIS.Web.Shell/Areas/DDM/Controllers/DataController.cs @@ -243,6 +243,7 @@ public ActionResult ShowData(long id, int version = 0, string versionName = "") if (dsv.Dataset.DataStructure.Self.GetType().Equals(typeof(StructuredDataStructure))) { dataStructureType = DataStructureType.Structured.ToString(); + ViewData["gridTotal"] = dm.RowCount(dsv.Dataset.Id, null); } else { @@ -373,6 +374,7 @@ public ActionResult Reload(long id, int version = 0) if (dsv.Dataset.DataStructure.Self.GetType().Equals(typeof(StructuredDataStructure))) { dataStructureType = DataStructureType.Structured.ToString(); + ViewData["gridTotal"] = dm.RowCount(dsv.Dataset.Id, null); } else { @@ -617,12 +619,12 @@ public ActionResult ShowPrimaryData(long datasetID, int versionId) ModelState.AddModelError(string.Empty, "The data is not available, please ask the administrator for a synchronization."); } - Session["gridTotal"] = dm.RowCount(dsv.Dataset.Id, null); + ViewData["gridTotal"] = dm.RowCount(dsv.Dataset.Id, null); } else { table = dm.GetDatasetVersionTuples(versionId, 0, 10); - Session["gridTotal"] = dm.GetDatasetVersionEffectiveTuples(dsv).Count; + ViewData["gridTotal"] = dm.GetDatasetVersionEffectiveTuples(dsv).Count; } sds.Variables = sds.Variables.OrderBy(v => v.OrderNo).ToList(); @@ -713,7 +715,7 @@ public ActionResult _CustomPrimaryDataBinding(GridCommand command, string column } model = new GridModel(table); - model.Total = Convert.ToInt32(Session["gridTotal"]); // (int)Session["gridTotal"]; + model.Total = Convert.ToInt32(Session[versionId + "gridTotal"]); // (int)Session["gridTotal"]; } else { diff --git a/Console/BExIS.Web.Shell/Areas/DDM/Views/Data/ShowData.cshtml b/Console/BExIS.Web.Shell/Areas/DDM/Views/Data/ShowData.cshtml index 2978c4b6ed..dd8aa79b85 100644 --- a/Console/BExIS.Web.Shell/Areas/DDM/Views/Data/ShowData.cshtml +++ b/Console/BExIS.Web.Shell/Areas/DDM/Views/Data/ShowData.cshtml @@ -29,9 +29,9 @@ } int total = 0; - if (Session["gridTotal"] != null) + if (ViewData["gridTotal"] != null) { - total = Convert.ToInt32(Session["gridTotal"]); // (int)Session["gridTotal"]; + total = Convert.ToInt32(ViewData["gridTotal"]); // (int)Session["gridTotal"]; } @@ -61,7 +61,6 @@ @if (Model != null && ((Model.IsPublic == true || User.Identity.Name != "") || check_public_metadata == "false")) { -