Пример #1
0
        public void InitView(TabListItem tabItem)
        {
            dtoProjectContext cContext = InitializeContext();

            View.CurrentListContext = cContext;
            if (UserContext.isAnonymous)
            {
                View.DisplaySessionTimeout();
            }
            else
            {
                Person p = CurrentManager.GetPerson(UserContext.CurrentUserID);

                if (tabItem == TabListItem.Resource || (tabItem != TabListItem.Resource && Service.GetAvailableTabs((p != null ? p.Id : 0), cContext, PageContainerType.ProjectsList).Contains(tabItem)))
                {
                    View.InitializeTopControls(cContext, cContext.IdCommunity, View.PreloadFromCookies, tabItem, PageContainerType.ProjectsList, View.PreloadGroupBy, View.PreloadFilterBy, View.PreloadFilterStatus);
                    ModuleProjectManagement pPermission = ModuleProjectManagement.CreatePortalmodule((p == null) ? (Int32)UserTypeStandard.Guest : p.TypeID);
                    ModuleProjectManagement mPermission = (cContext.isForPortal) ? ModuleProjectManagement.CreatePortalmodule((p == null) ? (Int32)UserTypeStandard.Guest : p.TypeID) : new ModuleProjectManagement(CurrentManager.GetModulePermission(UserContext.CurrentUserID, cContext.IdCommunity, CurrentIdModule));
                    if (mPermission.Administration || mPermission.CreatePersonalProject || mPermission.CreatePublicProject)
                    {
                        View.AllowAddProject((mPermission.CreatePersonalProject) ? RootObject.AddProject(cContext.IdCommunity, cContext.isForPortal, true, PageListType.ListManager, cContext.IdCommunity) : "", (mPermission.CreatePublicProject || mPermission.Administration) ? RootObject.AddProject(cContext.IdCommunity, cContext.isForPortal, false, PageListType.ListManager, cContext.IdCommunity) : "", (cContext.isForPortal ? "" : RootObject.AddProject(0, true, true, PageListType.ListManager, cContext.IdCommunity)));
                    }
                    View.SendUserAction(cContext.IdCommunity, CurrentIdModule, 0, GetDefaultAction(tabItem));
                }
                else
                {
                    View.RedirectToUrl(RootObject.ProjectListResource(cContext.IdCommunity, cContext.isForPortal, cContext.isPersonal));
                }
            }
        }