Example #1
0
        public ActionResult Index(string pcode)
        {
            var parliamentService = new ParliamentService();
            var parliamentId      = parliamentService.GetParliamentId(pcode);

            var service    = new LawService();
            var repService = new RepresentativeService();
            var model      = new LawHomeModel();

            model.LatestLaws       = service.GetLatestLaws(AppConfig.GetIntValue("JavnaRasprava.Index.LatestLaws", 5), parliamentId);
            model.LatestLaws.Title = GlobalLocalization.LatestLawsTitle;

            model.MostActive       = service.GetMostActive(AppConfig.GetIntValue("JavnaRasprava.Index.MostActive", 5), parliamentId);
            model.MostActive.Title = GlobalLocalization.MostActiveLawsTitle;

            model.NextLawsInVote       = service.GetNextLawsInVote(AppConfig.GetIntValue("JavnaRasprava.Index.NextLawsInVote", 5), parliamentId);
            model.NextLawsInVote.Title = GlobalLocalization.NextLawsInVoteTitle;

            model.TopRepresentatives = repService.GetTopRepresentatives(Infrastructure.AppConfig.GetIntValue("JavnaRasprava.Index.TopRepresentatives", 5), parliamentId);

            model.Search = service.InitializeSearchModel();

            return(View(model));
        }