Ejemplo n.º 1
0
        public ActionResult AddRoleToUser(Guid userID)
        {
            var model = new AddRoleToUserModel(userID);

            model.UserName = new AccountService(Guid.Parse(UserHelper.GetUserId()), GStorage.Data["UserManager"]).GetUserById(userID).UserName;
            return(View(model));
        }
Ejemplo n.º 2
0
 public RoleService CreateRoleService() => new RoleService(Guid.Parse(UserHelper.GetUserId()));
Ejemplo n.º 3
0
 public UserRoleService CreateUserRoleService() => new UserRoleService(Guid.Parse(UserHelper.GetUserId()), GStorage.Data["UserManager"]);
Ejemplo n.º 4
0
        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));
        }
Ejemplo n.º 5
0
        public ActionResult Create(Guid planItemId)
        {
            var model = new PromotionCreate(new PlanItemService(Guid.Parse(UserHelper.GetUserId())).GetPlanItemById(planItemId));

            return(View(model));
        }
Ejemplo n.º 6
0
        // 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)));
        }