public ActionResult AproveItem(ProposalChalangeAdminViewModel model)
        {
            var result = _proposalChalangeService.AproveProposalChalange(model.ProposalChalangeId);

            if (!result)
            {
                ViewBag.Error = "";//TODO: jestli to jde
            }
            return(RedirectToAction("ProposalChalangeManagement"));
        }
 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 static Chalange ProposalChalangeVMToChalange(ProposalChalangeAdminViewModel prChalange)
 {
     return(new Chalange()
     {
         Active = true,
         Description = prChalange.Description,
         Difficulty = prChalange.Difficulty,
         EndDate = prChalange.EndDate,
         Interests = prChalange.Interests.ToList(),
         MaxAge = prChalange.MaxAge,
         MinAge = prChalange.MinAge,
         Name = prChalange.Name,
         PublishDate = DateTime.Now,
         StartDate = prChalange.StartDate,
         ThumbnailUrl = prChalange.ThumbnailUrl
     });
 }
 public ActionResult ActivateItem(ProposalChalangeAdminViewModel model)
 {
     return(View("Edit", model));
 }