Exemplo n.º 1
0
        private void loadHistory(string rel)
        {
            // Page size: from private config
            AppSettingsReader asr = new AppSettingsReader();

            histPageSize = (int)asr.GetValue("historyPageSize", typeof(int));

            // Page ID from URL
            rel = rel.Replace("edit/history", "");
            if (rel.StartsWith("/"))
            {
                rel = rel.Substring(1);
            }
            rel = rel.Replace("page-", "");
            if (rel != "")
            {
                int.TryParse(rel, out histPageIX);
            }
            if (histPageIX == -1)
            {
                histPageIX = 0;
            }
            else
            {
                --histPageIX;  // Humans count from 1
            }
            // Retrieve data from DB
            using (SqlDict.History hist = new SqlDict.History())
            {
                histPageCount = hist.GetChangeCount() / histPageSize + 1;
                histChanges   = hist.GetChangePage(histPageIX * histPageSize, histPageSize);
            }
        }
Exemplo n.º 2
0
        private void loadData()
        {
            // Page size: from private config
            AppSettingsReader asr = new AppSettingsReader();

            pageSize = (int)asr.GetValue("historyPageSize", typeof(int));

            // Page ID from request?
            string pageId = Request.Params["page"];

            if (pageId != null)
            {
                int.TryParse(pageId, out pageIX);
            }
            if (pageIX == -1)
            {
                pageIX = 0;
            }
            else
            {
                --pageIX;  // Humans count from 1
            }
            // Retrieve data from DB
            using (SqlDict.History hist = new SqlDict.History())
            {
                pageCount = hist.GetChangeCount() / pageSize + 1;
                changes   = hist.GetChangePage(pageIX * pageSize, pageSize);
            }
        }