Esempio n. 1
0
        public ActionResult <IEnumerable <string> > Stats(int id)
        {
            try
            {
                StatsVM stats = new StatsVM();
                var     poll  = _pollService.GetById(id);
                if (poll == null)
                {
                    return(NotFound());
                }

                stats.Views = poll.Views;
                stats.votes = _optionService.GetOptionStats(id);

                return(Ok(stats));
            }
            catch (Exception e)
            {
                return(BadRequest(e.Message));

                throw;
            }
        }
        //
        // GET: /Home/Stats
        public ActionResult Stats()
        {
            StatsVM svm = new StatsVM(_adminBLL.ViewListByPage(), _adminBLL.ViewListByDate(), _adminBLL.ViewListByType());

            return(View("Stats", svm));
        }
Esempio n. 3
0
 public Stats()
 {
     ViewModel = new StatsVM();
     InitializeComponent();
 }