public ActionResult Create(Guid planItemId) { var model = new PromotionCreate(new PlanItemService(Guid.Parse(UserHelper.GetUserId())).GetPlanItemById(planItemId)); return(View(model)); }
public ActionResult Create(PromotionCreate model) { if (!ModelState.IsValid) { return(View(model)); } var svc = CreatePromotionService(); if (svc.CreatePromotion(model)) { TempData["SaveResult"] = "Your PlanItem was promoted."; return(RedirectToAction("Details", "Project", new { id = new PlanItemService(Guid.Parse(UserHelper.GetUserId())).GetProjectIdFor(model.PlanId) })); } return(View(model)); }
// GET: Promotion public ActionResult Index(Guid planId) { var model = CreatePromotionService().GetPromotionListItems(planId).ToList().Sorted(new PromotionListItem.DateComparer()).ToArray(); return(View(new PromotionListModel(new PlanItemService(Guid.Parse(UserHelper.GetUserId())).GetPlanItemById(planId), model))); }