/// <summary>
        /// 获取文档关联下载文件
        /// </summary>
        /// <param name="DataItem"></param>
        /// <returns></returns>
        public List <Playngo_ClientZone_DownloadFile> GetDownloadFiles(Playngo_ClientZone_GameSheet DataItem)
        {
            var DownLoadFiles = new List <Playngo_ClientZone_DownloadFile>();

            if (DataItem != null && DataItem.ID > 0)
            {
                var Relations = Playngo_ClientZone_DownloadRelation.FindListByItem(DataItem.ID, (Int32)EnumDisplayModuleType.GameSheets);


                if (Relations != null && Relations.Count > 0)
                {
                    foreach (var Relation in Relations)
                    {
                        Playngo_ClientZone_DownloadFile DownloadFile = Playngo_ClientZone_DownloadFile.FindByKeyForEdit(Relation.DownloadID);
                        if (DownloadFile != null && DownloadFile.ID > 0)
                        {
                            //判断当前角色和区域是否可以看到这些文件
                            if (IsPreRoleView(DownloadFile.Per_AllUsers, DownloadFile.Per_Roles) && IsPreJurisdictionView(DownloadFile.Per_AllJurisdictions, DownloadFile.Per_Jurisdictions))
                            {
                                DownLoadFiles.Add(DownloadFile);
                            }
                        }
                    }
                }
            }

            return(DownLoadFiles);
        }
        /// <summary>
        /// 复制文件关系
        /// </summary>
        /// <param name="NewID">新的编号</param>
        /// <param name="OldID">老的编号</param>
        public void CopyDownFileRelations(Int32 NewID, Int32 OldID)
        {
            var DownloadRelations = Playngo_ClientZone_DownloadRelation.FindListByItem(OldID, (Int32)EnumDisplayModuleType.GameSheets);

            if (DownloadRelations != null && DownloadRelations.Count > 0)
            {
                foreach (var DownloadRelation in DownloadRelations)
                {
                    var DownloadRelationNew = DownloadRelation.Clone() as Playngo_ClientZone_DownloadRelation;
                    DownloadRelationNew.ItemID     = NewID;
                    DownloadRelationNew.ID         = 0;
                    DownloadRelationNew.CreateUser = UserId;
                    DownloadRelationNew.CreateTime = xUserTime.UtcTime();
                    DownloadRelationNew.Insert();
                }
            }
        }
        /// <summary>
        /// 绑定动态模块到页面
        /// </summary>
        private void BindDownFilesToPage()
        {
            if (CampaignID > 0)
            {
                //绑定动态模块的模态窗口 Resource_Attachments|Manager_Modal_SelectDownloadFiles
                hlSelectFiles.Attributes.Add("data-href", String.Format("{0}Resource_Masters.aspx?PortalId={1}&TabId={2}&ModuleId={3}&language={4}&Master=Manager_Modal_Downloads", ModulePath, PortalId, TabId, ModuleId, language));
            }
            else
            {
                hlSelectFiles.Enabled = false;
                hlSelectFiles.Attributes.Add("disabled", "disabled");
            }


            List <Object> Items = new List <Object>();

            if (CampaignItem != null && CampaignItem.ID > 0)
            {
                var Relations = Playngo_ClientZone_DownloadRelation.FindListByItem(CampaignItem.ID, (Int32)EnumDisplayModuleType.Campaigns);


                if (Relations != null && Relations.Count > 0)
                {
                    foreach (var Relation in Relations)
                    {
                        var Item = Playngo_ClientZone_DownloadFile.FindByKeyForEdit(Relation.DownloadID);
                        Items.Add(new { ID = Relation.ID, ItemID = Item.ID, DownloadID = Relation.DownloadID, Title = Item.Title, PageType = (Int32)EnumDisplayModuleType.Campaigns, PageTypeText = "Campaigns" });
                    }
                }
            }



            //绑定参数项
            RepeaterFiles.DataSource = Items;
            RepeaterFiles.DataBind();
        }