Ejemplo n.º 1
0
        public ActionResult ProposalChalangeManagement()
        {
            var proposalChalanges = new List <ProposalChalangeAdminViewModel>();

            foreach (var chalange in _chalangeRepository.GetActivePropousalChalanges())
            {
                proposalChalanges.Add(ChalangeMappers.ProposalChalangeToProposalAdminMap(chalange));
            }

            return(View(proposalChalanges));
        }
Ejemplo n.º 2
0
        public ActionResult Index()
        {
            var user               = _userRepository.GetById(User.Identity.GetUserId());
            var rankedUsers        = _userRepository.GetRankedUser();
            var chalanges          = _chalangeRepository.GetAllOrderedByDay();
            var propousalChalanges = _chalangeRepository.GetActivePropousalChalanges();

            var homePageVM = new HomePageViewModel()
            {
                Chalanges = new List <ChalangeOverViewViewModel>(
                    chalanges.Select(
                        x => ChalangeMappers.ChalangeToOverViewMap(x))),
                UserRanks = new List <UserRankViewModel>(
                    rankedUsers.Select(
                        x => UserMappers.UserToUsersRankMap(x))),
                ProposalChalangesRanks = new List <ProposalChalangeRankViewModel>(
                    propousalChalanges.Select(
                        x => ChalangeMappers.ProposalChalangeToProposalRankMap(x)))
            };

            return(View(homePageVM));
        }