Ejemplo n.º 1
0
        public ActionResult getMostCommented()
        {
            var news       = artSer.getMostCommented().ToArray();
            var TotalGames = artSer.GetMany().ToArray();
            var comm       = commSer.getDateOfComm().ToArray();


            var totalFund = artSer.GetMany().ToArray();

            // var totalFund = artSer.GetMany().ToArray();
            // var comm = commSer.getDateOfComm().ToArray();


            List <newsViewModels> gVM = new List <newsViewModels>();

            foreach (var item in news)
            {
                newsViewModels gm = new newsViewModels()
                {
                    idArticle   = item.idArticle,
                    DTYPE       = item.DTYPE,
                    name        = item.name,
                    description = item.description,
                    link_img    = item.link_img,
                    date        = item.date,
                    commentts   = item.commentts,
                };

                ViewBag.newsCount    = news.Count();
                ViewBag.TotalCount   = TotalGames.Count();
                ViewBag.notcommented = TotalGames.Count() - news.Count();

                ViewBag.usersComm      = users.getUsersComments().Count();
                ViewBag.totalUsers     = users.GetMany().Count();
                ViewBag.NonActiveUsers = users.GetMany().Count() - users.getUsersComments().Count();


                var comms1  = commSer.GetCommentsNewsByMonth(1).ToArray();
                var comms2  = commSer.GetCommentsNewsByMonth(2).ToArray();
                var comms3  = commSer.GetCommentsNewsByMonth(3).ToArray();
                var comms4  = commSer.GetCommentsNewsByMonth(4).ToArray();
                var comms5  = commSer.GetCommentsNewsByMonth(5).ToArray();
                var comms6  = commSer.GetCommentsNewsByMonth(6).ToArray();
                var comms7  = commSer.GetCommentsNewsByMonth(7).ToArray();
                var comms8  = commSer.GetCommentsNewsByMonth(8).ToArray();
                var comms9  = commSer.GetCommentsNewsByMonth(9).ToArray();
                var comms10 = commSer.GetCommentsNewsByMonth(10).ToArray();
                var comms11 = commSer.GetCommentsNewsByMonth(11).ToArray();
                var comms12 = commSer.GetCommentsNewsByMonth(12).ToArray();
                ViewBag.nbComm1  = comms1.Count();
                ViewBag.nbComm2  = comms2.Count();
                ViewBag.nbComm3  = comms3.Count();
                ViewBag.nbComm4  = comms4.Count();
                ViewBag.nbComm5  = comms5.Count();
                ViewBag.nbComm6  = comms6.Count();
                ViewBag.nbComm7  = comms7.Count();
                ViewBag.nbComm8  = comms8.Count();
                ViewBag.nbComm9  = comms9.Count();
                ViewBag.nbComm10 = comms10.Count();
                ViewBag.nbComm11 = comms11.Count();
                ViewBag.nbComm12 = comms12.Count();



                gVM.Add(gm);
            }


            //CommentViewModels cm = new CommentViewModels();
            //ViewBag.gmCount = games.Count();
            //ViewBag.TotalCount = TotalGames.Count();
            //ViewBag.notcommented = TotalGames.Count() - games.Count();
            //ViewBag.usersComm = users.getUsersComments().Count();
            //ViewBag.totalUsers = users.GetMany().Count();
            //ViewBag.NonActiveUsers = users.GetMany().Count() - users.getUsersComments().Count();

            //var comms1 = commSer.GetCommentsByMonth(1).ToArray();
            //var comms2 = commSer.GetCommentsByMonth(2).ToArray();
            //var comms3 = commSer.GetCommentsByMonth(3).ToArray();
            //var comms4 = commSer.GetCommentsByMonth(4).ToArray();
            //var comms5 = commSer.GetCommentsByMonth(5).ToArray();
            //var comms6 = commSer.GetCommentsByMonth(6).ToArray();
            //var comms7 = commSer.GetCommentsByMonth(7).ToArray();
            //var comms8 = commSer.GetCommentsByMonth(8).ToArray();
            //var comms9 = commSer.GetCommentsByMonth(9).ToArray();
            //var comms10 = commSer.GetCommentsByMonth(10).ToArray();
            //var comms11 = commSer.GetCommentsByMonth(11).ToArray();
            //var comms12 = commSer.GetCommentsByMonth(12).ToArray();
            //ViewBag.nbComm1 = comms1.Count();
            //ViewBag.nbComm2 = comms2.Count();
            //ViewBag.nbComm3 = comms3.Count();
            //ViewBag.nbComm4 = comms4.Count();
            //ViewBag.nbComm5 = comms5.Count();
            //ViewBag.nbComm6 = comms6.Count();
            //ViewBag.nbComm7 = comms7.Count();
            //ViewBag.nbComm8 = comms8.Count();
            //ViewBag.nbComm9 = comms9.Count();
            //ViewBag.nbComm10 = comms10.Count();
            //ViewBag.nbComm11 = comms11.Count();
            //ViewBag.nbComm12 = comms12.Count();



            return(View(gVM));
        }