コード例 #1
0
 public ActionResult Preview(Project project, ProjectItem[] items, ProjectItemType type)
 {
     return View(new Model.View
     {
         Project = project,
         Item = items.FirstOrDefault(),
         Type = type,
         Role = this.ProjectProvider.GetRole(project.ID, MvcApplication.CurrentUser.ID)
     });
 }
コード例 #2
0
        /// <summary>
        /// Ve el concepto en vista previa
        /// </summary>
        /// <param name="project">Proyecto</param>
        /// <param name="items">Elemento</param>
        /// <param name="type">Tipo de elemento</param>
        /// <returns></returns>
        public ActionResult Preview(Project project, ProjectItem[] items, ProjectItemType type)
        {
            if (this.GetRole(project.ID) != RoleType.Developer && !items.FirstOrDefault().IsPublic)
                return null;


            return View(new Model.View
            {
                Project = project,
                Item = items.FirstOrDefault(),
                Type = type,
                Role = this.ProjectProvider.GetRole(project.ID, MvcApplication.CurrentUser.ID)
            });
        }
コード例 #3
0
        public ActionResult PreviewResume(Project project, ProjectItem[] items, ProjectItemType type)
        {
            var role = this.ProjectProvider.GetRole(project.ID, MvcApplication.CurrentUser.ID);
            if (role != RoleType.Developer)
            {
                items = (from i in items
                         where i.IsPublic
                         select i).ToArray();
            }

            return View(new Model.Preview
            {
                Project = project,
                Items = items,
                Type = type,
                
            });
        }