public ActionResult ChalangeDetail(int chalangeId) { var chalange = _chalangeRepository.GetById(chalangeId); var chalangeVM = ChalangeMappers.ChalangeToDetailChalangeVM(chalange); return(View("ChalangeDetail", chalangeVM)); }
public ActionResult Activate(ProposalChalangeAdminViewModel model) { if (ModelState.IsValid) { var proposalChalangeId = model.ProposalChalangeId; var chalange = ChalangeMappers.ProposalChalangeVMToChalange(model); var result = _proposalChalangeService.ActivateProposalChalange(proposalChalangeId, chalange); //TODO: řešit něco s výsledkem } return(RedirectToAction("ProposalChalangeManagement")); }
public ActionResult ProposalChalangeManagement() { var proposalChalanges = new List <ProposalChalangeAdminViewModel>(); foreach (var chalange in _chalangeRepository.GetActivePropousalChalanges()) { proposalChalanges.Add(ChalangeMappers.ProposalChalangeToProposalAdminMap(chalange)); } return(View(proposalChalanges)); }
public ActionResult ChalangeManagement() { var chalanges = _chalangeRepository.GetAllOrderedByDay(); var chalangesVM = new List <DetailChalangeViewModel>(); foreach (var chalange in chalanges) { chalangesVM.Add(ChalangeMappers.ChalangeToDetailChalangeVM(chalange)); } return(View(chalangesVM)); }
public ActionResult Index() { var chalangesVM = new List <ChalangeOverViewViewModel>(); foreach (var chalange in _chalangeRepository.GetAllOrderedByDay()) { chalangesVM.Add(ChalangeMappers.ChalangeToOverViewMap(chalange)); } ViewBag.OrderByOptions = GetOrderBySelections(); return(View("Index", chalangesVM)); }
public ActionResult AddProposalChalange(ProposalChalangeViewModel model) { if (ModelState.IsValid) { var user = _userRepository.GetById(User.Identity.GetUserId()); model.User = user; var proposalChalange = ChalangeMappers.ProposalChalangeVMToPropChalange(model); _chalangeRepository.AddProposalChalange(proposalChalange); ViewBag.Message = "Vaš chalange byla odeslána ke schválení"; } return(View("Index")); }
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)); }