コード例 #1
0
        public virtual ActionResult View(int id)
        {
            if (!_permissionService.Authorize(StandardPermissionProvider.ManageIdea))
            {
                return(AccessDeniedView());
            }

            var idea = _ideaService.GetIdeaById(id);

            if (idea == null)
            {
                return(RedirectToAction("List"));
            }

            var model = idea.ToModel();

            model.CustomerEmail = idea.Customer != null ? idea.Customer.Email : null;
            model.CreatedOn     = _dateTimeHelper.ConvertToUserTime(idea.CreatedOnUtc, DateTimeKind.Utc);
            model.UpdatedOn     = idea.UpdatedOnUtc.HasValue
                ? (DateTime?)_dateTimeHelper.ConvertToUserTime(idea.CreatedOnUtc, DateTimeKind.Utc)
                : null;

            return(View(model));
        }