예제 #1
0
        public static TabCollection GetTabCollection(Tab parent, int publishmentSystemId)
        {
            TabCollection tabCollection;

            if (StringUtils.EqualsIgnoreCase(parent.Id, AppManager.Cms.LeftMenu.Function.IdResume))
            {
                tabCollection = new TabCollection(parent.Children);
            }
            else if (StringUtils.EqualsIgnoreCase(parent.Id, AppManager.Wcm.LeftMenu.IdGovInteract))
            {
                Tab[] tabs;
                var   publishmentSystemInfo = PublishmentSystemManager.GetPublishmentSystemInfo(publishmentSystemId);
                var   nodeInfoList          = GovInteractManager.GetNodeInfoList(publishmentSystemInfo);
                if (nodeInfoList.Count > 0 && ProductPermissionsManager.Current.GovInteractPermissionDict.ContainsKey(publishmentSystemId))
                {
                    var govInteractPermissionListOfPublishmentSystemId = ProductPermissionsManager.Current.GovInteractPermissionDict[publishmentSystemId];
                    var govInteractPermissionList = govInteractPermissionListOfPublishmentSystemId;
                    var tabList = new List <Tab>();
                    foreach (var nodeInfo in nodeInfoList)
                    {
                        if (govInteractPermissionListOfPublishmentSystemId == null || govInteractPermissionListOfPublishmentSystemId.Count == 0)
                        {
                            if (ProductPermissionsManager.Current.GovInteractPermissionDict.ContainsKey(nodeInfo.NodeId))
                            {
                                govInteractPermissionList = ProductPermissionsManager.Current.GovInteractPermissionDict[nodeInfo.NodeId];
                            }
                        }

                        if (govInteractPermissionList != null && govInteractPermissionList.Count > 0)
                        {
                            var tab = new Tab
                            {
                                Text = nodeInfo.NodeName,
                                Id   = AppManager.Wcm.LeftMenu.IdGovInteract + "_" + nodeInfo.NodeId
                            };

                            var childList = new List <Tab>();

                            if (govInteractPermissionList.Contains(AppManager.Wcm.Permission.GovInteract.GovInteractAccept))
                            {
                                childList.Add(new Tab
                                {
                                    Text            = "待受理办件",
                                    Href            = PageGovInteractListAccept.GetRedirectUrl(nodeInfo.PublishmentSystemId, nodeInfo.NodeId),
                                    KeepQueryString = false,
                                    Target          = "right"
                                });
                            }
                            if (govInteractPermissionList.Contains(AppManager.Wcm.Permission.GovInteract.GovInteractReply))
                            {
                                childList.Add(new Tab
                                {
                                    Text            = "待办理办件",
                                    Href            = PageGovInteractListReply.GetRedirectUrl(nodeInfo.PublishmentSystemId, nodeInfo.NodeId),
                                    KeepQueryString = false,
                                    Target          = "right"
                                });
                            }
                            if (govInteractPermissionList.Contains(AppManager.Wcm.Permission.GovInteract.GovInteractCheck))
                            {
                                childList.Add(new Tab
                                {
                                    Text            = "待审核办件",
                                    Href            = PageGovInteractListCheck.GetRedirectUrl(nodeInfo.PublishmentSystemId, nodeInfo.NodeId),
                                    KeepQueryString = false,
                                    Target          = "right"
                                });
                            }
                            if (govInteractPermissionList.Contains(AppManager.Wcm.Permission.GovInteract.GovInteractView) || govInteractPermissionList.Contains(AppManager.Wcm.Permission.GovInteract.GovInteractDelete))
                            {
                                childList.Add(new Tab
                                {
                                    Text            = "所有办件",
                                    Href            = PageGovInteractListAll.GetRedirectUrl(nodeInfo.PublishmentSystemId, nodeInfo.NodeId),
                                    KeepQueryString = false,
                                    Target          = "right"
                                });
                            }
                            if (govInteractPermissionList.Contains(AppManager.Wcm.Permission.GovInteract.GovInteractAdd))
                            {
                                var redirectUrl = PageGovInteractListAccept.GetRedirectUrl(nodeInfo.PublishmentSystemId, nodeInfo.NodeId);
                                var child       = new Tab
                                {
                                    Text            = "新增办件",
                                    Href            = WebUtils.GetContentAddAddUrl(publishmentSystemId, nodeInfo, redirectUrl),
                                    KeepQueryString = false,
                                    Target          = "right"
                                };
                                childList.Add(child);
                            }

                            tab.Children = new Tab[childList.Count];
                            for (var i = 0; i < childList.Count; i++)
                            {
                                tab.Children[i] = childList[i];
                            }

                            tabList.Add(tab);
                        }
                    }

                    var k = 0;
                    tabs = new Tab[parent.Children.Length + tabList.Count];
                    for (; k < tabList.Count; k++)
                    {
                        tabs[k] = tabList[k];
                    }

                    for (var j = 0; j < parent.Children.Length; j++)
                    {
                        tabs[j + k] = parent.Children[j];
                    }
                }
                else
                {
                    tabs = parent.Children;
                }

                tabCollection = new TabCollection(tabs);
            }
            else
            {
                tabCollection = new TabCollection(parent.Children);
            }
            return(tabCollection);
        }
예제 #2
0
        public void Page_Load(object sender, EventArgs e)
        {
            if (IsForbidden)
            {
                return;
            }

            _relatedIdentity   = string.IsNullOrEmpty(Body.GetQueryString("RelatedIdentity")) ? PublishmentSystemId : Body.GetQueryInt("RelatedIdentity");
            _tableStyle        = ETableStyleUtils.GetEnumType(Body.GetQueryString("TableStyle"));
            _tableName         = Body.GetQueryString("TableName");
            _itemId            = Body.GetQueryInt("itemID");
            _relatedIdentities = RelatedIdentities.GetRelatedIdentities(_tableStyle, PublishmentSystemId, _relatedIdentity);
            _attributeNames    = TableManager.GetAttributeNameList(_tableStyle, _tableName);

            if (IsPostBack)
            {
                return;
            }

            if (_tableStyle == ETableStyle.InputContent)
            {
                BreadCrumb(AppManager.Cms.LeftMenu.IdFunction, AppManager.Cms.LeftMenu.Function.IdInput, "提交表单管理", AppManager.Cms.Permission.WebSite.Input);
            }
            else if (_tableStyle == ETableStyle.Site)
            {
                BreadCrumb(AppManager.Cms.LeftMenu.IdConfigration, "站点属性设置",
                           AppManager.Cms.Permission.WebSite.Configration);
            }
            else
            {
                BreadCrumb(AppManager.Cms.LeftMenu.IdConfigration, AppManager.Cms.LeftMenu.Configuration.IdConfigurationContentModel, "虚拟字段管理",
                           AppManager.Cms.Permission.WebSite.Configration);
            }

            //删除样式
            if (Body.IsQueryExists("DeleteStyle"))
            {
                DeleteStyle();
            }
            else if (Body.IsQueryExists("SetTaxis"))
            {
                SetTaxis();
            }

            if (_tableStyle == ETableStyle.BackgroundContent)
            {
                var urlModel = PageContentModel.GetRedirectUrl(PublishmentSystemId);
                btnReturn.Attributes.Add("onclick", $"location.href='{urlModel}';return false;");
            }
            else if (_tableStyle == ETableStyle.InputContent)
            {
                btnReturn.Attributes.Add("onclick", $"location.href='{PageInput.GetRedirectUrl(PublishmentSystemId)}';return false;");
            }
            else if (_tableStyle == ETableStyle.GovInteractContent)
            {
                var urlReturn = PageGovInteractListAll.GetRedirectUrl(PublishmentSystemId, 0);
                btnReturn.Attributes.Add("onclick", $"location.href='{urlReturn}';return false;");
            }
            else if (_tableStyle == ETableStyle.Site)
            {
                btnReturn.Attributes.Add("onclick", $"location.href='{PageConfigurationSiteAttributes.GetRedirectUrl(PublishmentSystemId)}';return false;");
            }
            else
            {
                btnReturn.Visible = false;
            }

            var styleInfoList = TableStyleManager.GetTableStyleInfoList(_tableStyle, _tableName, _relatedIdentities);

            dgContents.DataSource     = styleInfoList;
            dgContents.ItemDataBound += dgContents_ItemDataBound;
            dgContents.DataBind();

            var redirectUrl = GetRedirectUrl(PublishmentSystemId, _tableStyle, _tableName, _relatedIdentity, _itemId);

            btnAddStyle.Attributes.Add("onclick", ModalTableStyleAdd.GetOpenWindowString(PublishmentSystemId, 0, _relatedIdentities, _tableName, string.Empty, _tableStyle, redirectUrl));
            btnAddStyles.Attributes.Add("onclick", ModalTableStylesAdd.GetOpenWindowString(PublishmentSystemId, _relatedIdentities, _tableName, _tableStyle, redirectUrl));

            btnImport.Attributes.Add("onclick", ModalTableStyleImport.GetOpenWindowString(_tableName, _tableStyle, PublishmentSystemId, _relatedIdentity));
            btnExport.Attributes.Add("onclick", ModalExportMessage.GetOpenWindowStringToSingleTableStyle(_tableStyle, _tableName, PublishmentSystemId, _relatedIdentity));
        }