<commit_before>﻿using System;
using System.Web.Mvc;
using Purchasing.Mvc.Controllers;
using Purchasing.Mvc.Services;
using UCDArch.Web.ActionResults;
using UCDArch.Web.Attributes;

namespace Purchasing.Mvc.Controllers
{
    /// <summary>
    /// Controller for UserVoice
    /// </summary>
    /// <remarks>
    /// </remarks>
    [HandleTransactionsManually]
    public class HelpController : ApplicationController
    {
        private readonly IUservoiceService _uservoiceService;

        public HelpController(IUservoiceService uservoiceService)
        {
            _uservoiceService = uservoiceService;
        }

        public ActionResult Index()
        {
            return View();
        }

        /// <summary>
        /// Gets the number of active issues in the purchasing uservoice forum
        /// </summary>
        /// <returns></returns>
        [OutputCache(Duration = 60)] //Cache this call for a while
        public ActionResult GetActiveIssuesCount()
        {
            var issuesCount = _uservoiceService.GetActiveIssuesCount();

            return Json(new {HasIssues = issuesCount > 0, IssuesCount = issuesCount, TimeStamp = DateTime.Now.Ticks},
                        JsonRequestBehavior.AllowGet);
        }

        [OutputCache(Duration = 60)] //Cache this call for a while
        public ActionResult OpenIssues()<commit_msg>not really used<commit_after>﻿using System;
using System.Web.Mvc;
using Purchasing.Core.Helpers;
using Purchasing.Mvc.Controllers;
using Purchasing.Mvc.Services;
using UCDArch.Web.ActionResults;
using UCDArch.Web.Attributes;

namespace Purchasing.Mvc.Controllers
{
    /// <summary>
    /// Controller for UserVoice
    /// </summary>
    /// <remarks>
    /// </remarks>
    [HandleTransactionsManually]
    public class HelpController : ApplicationController
    {
        private readonly IUservoiceService _uservoiceService;

        public HelpController(IUservoiceService uservoiceService)
        {
            _uservoiceService = uservoiceService;
        }

        public ActionResult Index()
        {
            return View();
        }

        /// <summary>
        /// Gets the number of active issues in the purchasing uservoice forum
        /// </summary>
        /// <returns></returns>
        [OutputCache(Duration = 60)] //Cache this call for a while
        public ActionResult GetActiveIssuesCount()
        {
            var issuesCount = _uservoiceService.GetActiveIssuesCount();

            return Json(new {HasIssues = issuesCount > 0, IssuesCount = issuesCount, TimeStamp = DateTime.UtcNow.ToPacificTime().Ticks},
                        JsonRequestBehavior.AllowGet);
        }

        [OutputCache(Duration = 60)] //Cache this call for a while
        public ActionResult OpenIssues()
{'fraction_non_alphanumeric': 0.09410919540229885, 'fraction_numerical': 0.0035919540229885057, 'mean_word_length': 2.355421686746988, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 21, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6878247', 'n_tokens_mistral': 745, 'n_tokens_neox': 749, 'n_words': 181}