/// <summary>
        /// 拼接数据项的设置参数
        /// </summary>
        /// <returns></returns>
        public String SetItemSettings(ref List <KeyValueEntity> list)
        {
            //获取效果参数
            List <SettingEntity> ItemSettingDB = Event_ItemSettingDB;

            if (ItemSettingDB != null && ItemSettingDB.Count > 0)
            {
                ControlHelper ControlItem = new ControlHelper(ModuleId);

                foreach (SettingEntity ri in ItemSettingDB)
                {
                    KeyValueEntity item = new KeyValueEntity();
                    item.Key   = ri.Name;
                    item.Value = ControlHelper.GetWebFormValue(ri, this);
                    list.Add(item);
                }
            }
            return(ConvertTo.Serialize <List <KeyValueEntity> >(list));
        }
        public String EventHtml(Page p)
        {
            if (HttpContext.Current.Session[SessionName()] != null)
            {
                String s = Convert.ToString(HttpContext.Current.Session[SessionName()]);
                if (!String.IsNullOrEmpty(s))
                {
                    MessageTips mt = ConvertTo.Deserialize <MessageTips>(s);
                    if (mt != null && (mt.IsPostBack || !p.IsPostBack))
                    {
                        HttpContext.Current.Session.Remove(SessionName());
                        this._Content = mt.Content;
                        this._MsgType = mt.MsgType;
                        this._GoUrl   = mt.GoUrl;
                    }
                }
            }


            return(ViewContentToHtml(_Content));
        }
        /// <summary>
        /// 保存需要提示的内容
        /// </summary>
        public void Put()
        {
            if (!String.IsNullOrEmpty(_Content))
            {
                //将当前的内容序列化到个人缓存

                String s = ConvertTo.Serialize <MessageTips>((MessageTips)this);
                //如果有Session的话需要先清除
                if (HttpContext.Current.Session[SessionName()] != null)
                {
                    HttpContext.Current.Session.Remove(SessionName());
                }
                //增加当前序列化的内容到Session
                HttpContext.Current.Session.Add(SessionName(), s);
            }
            //跳转
            if (!String.IsNullOrEmpty(_GoUrl))
            {
                HttpContext.Current.Response.Redirect(_GoUrl, true);
            }
        }
        public void Execute(BasePage Context)
        {
            var FileList = new List <Playngo_ClientZone_DownloadFile>();


            //将文件列表取出
            String FileIds = WebHelper.GetStringParam(Context.Request, "FileIds", "");

            if (!String.IsNullOrEmpty(FileIds))
            {
                FileIds = FileIds.Trim(',');
                if (!String.IsNullOrEmpty(FileIds))
                {
                    FileList = Playngo_ClientZone_DownloadFile.FindAllByIds(FileIds);
                }
            }

            //待打包的文件路径
            var FilePathList = new List <String>();

            if (FileList != null && FileList.Count > 0)
            {
                //将文件的路径收集着
                foreach (var FileItem in FileList)
                {
                    if (FileItem != null && FileItem.ID > 0 && !String.IsNullOrEmpty(FileItem.Options))
                    {
                        if (Context.IsPreRoleView(FileItem.Per_AllUsers, FileItem.Per_Roles) && Context.IsPreJurisdictionView(FileItem.Per_AllJurisdictions, FileItem.Per_Jurisdictions))
                        {
                            var FileItemOptions = ConvertTo.Deserialize <List <KeyValueEntity> >(FileItem.Options);
                            if (FileItemOptions != null)
                            {
                                TemplateFormat xf         = new TemplateFormat(Context);
                                String         UploadFile = xf.GetFilePath(xf.ViewItemSettingT <String>(FileItem.Options, "UploadFile", ""), Context);
                                if (!String.IsNullOrEmpty(UploadFile))
                                {
                                    UploadFile = Context.Server.MapPath(UploadFile);
                                    if (File.Exists(UploadFile) && !FilePathList.Exists(r => r.ToLower() == UploadFile.ToLower()))
                                    {
                                        FilePathList.Add(UploadFile);
                                    }
                                }
                            }
                        }
                        else
                        {
                            //没有权限下载
                        }
                    }
                }


                if (FilePathList != null && FilePathList.Count > 0)
                {
                    //整理压缩包文件路径等信息
                    String   ZipPath = Context.Server.MapPath(String.Format("{0}ClientZone/temporary/download-{1}files-{2}.zip", Context.PortalSettings.HomeDirectory, FilePathList.Count, DateTime.Now.ToString("yyyyMMdd-Hms")));
                    FileInfo ZipFile = new FileInfo(ZipPath);
                    if (!ZipFile.Directory.Exists)
                    {
                        ZipFile.Directory.Create();
                    }
                    else
                    {
                        //清楚很多天前的文件
                        FileSystemUtils.ClearFiles(ZipFile.Directory, 1);
                    }

                    //创建压缩包
                    FileSystemUtils.CreateZipFiles(FilePathList, ZipPath);


                    //将压缩好的文件列表下载
                    FileSystemUtils.DownloadFile(ZipPath, Path.GetFileName(ZipPath));
                }
                else
                {
                    IsResponseWrite = true;
                    ResponseString  = "No files found.";
                }
            }
        }
        /// <summary>
        /// 保存文章
        /// </summary>
        /// <param name="CampaignStatus">文章状态(为-1的时候取选项的值)</param>
        private Boolean SaveDataItem(Int32 CampaignStatus, out Playngo_ClientZone_Campaign Campaign)
        {
            Boolean SaveResult = false;

            Campaign = CampaignItem;

            Campaign.Title         = Common.ReplaceEscape(txtTitle.Text);
            Campaign.GameID        = txtGameID.Text;
            Campaign.GameID_Mobile = txtGameIDMobile.Text;
            Campaign.Version       = txtVersion.Text;



            Campaign.NotifyInclude = cbIncludeNotification.Checked ? 1 : 0;
            Campaign.NotifyStatus  = WebHelper.GetIntParam(Request, ddlNotificationStatus.UniqueID, 0);
            //Campaign.NotifySubscribers = cbNotifySubscribers.Checked ? 1 : 0;
            //文件集合
            //CampaignItem.Files = hfDownLoadFiles.Value;

            //权限
            Campaign.Per_AllUsers = cbPermissionsAllUsers.Checked ? 0 : 1;
            String textStr, idStr = String.Empty;

            WebHelper.GetSelected(cblPermissionsRoles, out textStr, out idStr);
            Campaign.Per_Roles = idStr;


            //区域
            Campaign.Per_AllJurisdictions = cbAllJurisdictions.Checked ? 0 : 1;
            String JurisdictionTexts, JurisdictionIDs = String.Empty;

            WebHelper.GetSelected(cblJurisdictions, out JurisdictionTexts, out JurisdictionIDs);
            Campaign.Per_Jurisdictions = JurisdictionIDs;


            //Game Category
            String GameCategoryTexts, GameCategoryIDs = String.Empty;

            WebHelper.GetSelected(cblGameCategory, out GameCategoryTexts, out GameCategoryIDs);
            Campaign.GameCategories = GameCategoryIDs;


            //文章的发布状态
            if (CampaignStatus == -1)//如果没有指定状态就取控件的
            {
                Campaign.Status = WebHelper.GetIntParam(Request, ddlEventStatus.UniqueID, (Int32)EnumStatus.Published);
            }
            else
            {
                Campaign.Status = CampaignStatus;
            }


            #region "关于动态选项的代码"

            List <KeyValueEntity> list          = new List <KeyValueEntity>();
            List <SettingEntity>  ItemSettingDB = Campaign_ItemSettingDB;
            if (ItemSettingDB != null && ItemSettingDB.Count > 0)
            {
                ControlHelper ControlItem = new ControlHelper(ModuleId);

                foreach (SettingEntity ri in ItemSettingDB)
                {
                    KeyValueEntity item = new KeyValueEntity();
                    item.Key   = ri.Name;
                    item.Value = ControlHelper.GetWebFormValue(ri, this);
                    list.Add(item);
                }
            }


            //从动态选项中获取Roadmap启用状态
            if (list.Exists(r => r.Key == "IncludeRoadmap"))
            {
                KeyValueEntity Entity = list.Find(r => r.Key == "IncludeRoadmap");
                Campaign.IncludeRoadmap = Convert.ToBoolean(Entity.Value) ? 0 : 1;
            }

            //伪静态URL
            String FriendlyUrl = String.Empty;
            if (list.Exists(r => r.Key == "FriendlyUrl"))
            {
                KeyValueEntity TitleEntity = list.Find(r => r.Key == "FriendlyUrl");
                FriendlyUrl = TitleEntity.Value.ToString();

                if (String.IsNullOrEmpty(FriendlyUrl) && !String.IsNullOrEmpty(Campaign.Title))
                {
                    FriendlyUrl = Common.FriendlySlug(Campaign.Title);
                }

                Campaign.UrlSlug  = FriendlyUrl;
                TitleEntity.Value = FriendlyUrl;
                list[list.FindIndex(r => r.Key == "FriendlyUrl")] = TitleEntity;
            }
            Campaign.Options = ConvertTo.Serialize <List <KeyValueEntity> >(list);
            #endregion



            //更新项
            Campaign.LastIP   = WebHelper.UserHost;
            Campaign.LastTime = xUserTime.LocalTime();
            Campaign.LastUser = UserId;

            //开始状态和时间
            DateTime oTime           = xUserTime.LocalTime();
            string[] expectedFormats = { "G", "g", "f", "F" };
            string   StartDate       = WebHelper.GetStringParam(Request, txtStartDate.UniqueID, oTime.ToString("MM/dd/yyyy"));
            string   StartTime       = WebHelper.GetStringParam(Request, txtStartTime.UniqueID, oTime.ToString("HH:mm:ss"));
            if (DateTime.TryParseExact(String.Format("{0} {1}", StartDate, StartTime), "MM/dd/yyyy HH:mm:ss", new CultureInfo("en-US", false), DateTimeStyles.AllowWhiteSpaces, out oTime))
            {
                Campaign.StartTime = oTime;
            }


            //发布状态和时间
            DateTime oReleaseTime = xUserTime.LocalTime();
            string   ReleaseDate  = WebHelper.GetStringParam(Request, txtReleaseDate.UniqueID, oTime.ToString("MM/dd/yyyy"));
            string   ReleaseTime  = WebHelper.GetStringParam(Request, txtReleaseTime.UniqueID, oTime.ToString("HH:mm:ss"));
            if (DateTime.TryParseExact(String.Format("{0} {1}", ReleaseDate, ReleaseTime), "MM/dd/yyyy HH:mm:ss", new CultureInfo("en-US", false), DateTimeStyles.AllowWhiteSpaces, out oReleaseTime))
            {
                Campaign.ReleaseDate = oReleaseTime;
            }


            //结束状态和时间
            DateTime EndTime     = xUserTime.LocalTime().AddDays(1);
            string   DisableDate = WebHelper.GetStringParam(Request, txtDisableDate.UniqueID, EndTime.ToString("MM/dd/yyyy"));
            string   DisableTime = WebHelper.GetStringParam(Request, txtDisableTime.UniqueID, EndTime.ToString("HH:mm:ss"));
            if (DateTime.TryParseExact(String.Format("{0} {1}", DisableDate, DisableTime), "MM/dd/yyyy HH:mm:ss", new CultureInfo("en-US", false), DateTimeStyles.AllowWhiteSpaces, out EndTime))
            {
                Campaign.EndTime = EndTime;
            }


            //创建用户改为可以选择
            Campaign.CreateUser = WebHelper.GetIntParam(Request, hfEventAuthor.UniqueID, UserId);


            if (Campaign.ID > 0)
            {
                //更新
            }
            else
            {
                //新增
                Campaign.ModuleId   = ModuleId;
                Campaign.PortalId   = PortalId;
                Campaign.CreateTime = xUserTime.LocalTime();
            }


            int ResultCampaign = 0;

            if (Campaign.ID > 0)
            {
                ResultCampaign = Campaign.Update();
            }
            else
            {
                ResultCampaign = Campaign.ID = Campaign.Insert();
            }

            if (ResultCampaign > 0)
            {
                SaveResult = true;


                //邮件发送
                //if (Campaign.SendMail == 0 && cbNotifySubscribers.Checked)
                if (cbNotifySubscribers.Checked)
                {
                    //利用现成发送邮件
                    var objs = new Dictionary <object, object>();
                    objs.Add("DataItem", Campaign);
                    objs.Add("PortalUrl", PortalUrl);
                    ManagedThreadPool.QueueUserWorkItem(new WaitCallback(ThreadCreateSendMail), objs);


                    //更新发送状态
                    //Playngo_ClientZone_Campaign.Update(String.Format("SendMail={0}", 1), String.Format("ID={0}", Campaign.ID));
                }
            }
            else
            {
                SaveResult = false;
            }
            return(SaveResult);
        }
Example #6
0
        public void Execute(BasePage Context)
        {
            JavaScriptSerializer        jsSerializer = new JavaScriptSerializer();
            Dictionary <String, Object> jsonPictures = new Dictionary <string, Object>();


            TemplateFormat xf = new TemplateFormat();
            QueryParam     qp = new QueryParam();


            qp.PageIndex = WebHelper.GetIntParam(Context.Request, "PageIndex", 1);
            qp.PageSize  = WebHelper.GetIntParam(Context.Request, "PageSize", xf.ViewSettingT <Int32>("General.GameSheets.Pagings", 12));

            //排序的规则
            Int32 Sort = WebHelper.GetIntParam(Context.Request, "Sort", 0);

            if (Sort == (Int32)EnumSortQueryByGame.GameName_DESC)
            {
                qp.Orderfld  = Playngo_ClientZone_GameSheet._.Title;
                qp.OrderType = 1;
            }
            else if (Sort == (Int32)EnumSortQueryByGame.GameName_ASC)
            {
                qp.Orderfld  = Playngo_ClientZone_GameSheet._.Title;
                qp.OrderType = 0;
            }
            else if (Sort == (Int32)EnumSortQueryByGame.GameID_DESC)
            {
                qp.Orderfld  = Playngo_ClientZone_GameSheet._.GameID;
                qp.OrderType = 1;
            }
            else if (Sort == (Int32)EnumSortQueryByGame.GameID_ASC)
            {
                qp.Orderfld  = Playngo_ClientZone_GameSheet._.GameID;
                qp.OrderType = 0;
            }
            else if (Sort == (Int32)EnumSortQueryByGame.ReleaseDate_DESC)
            {
                qp.Orderfld  = Playngo_ClientZone_GameSheet._.ReleaseDate;
                qp.OrderType = 1;
            }
            else if (Sort == (Int32)EnumSortQueryByGame.ReleaseDate_ASC)
            {
                qp.Orderfld  = Playngo_ClientZone_GameSheet._.ReleaseDate;
                qp.OrderType = 0;
            }
            else
            {
                qp.Orderfld  = Playngo_ClientZone_GameSheet._.ID;
                qp.OrderType = 1;
            }


            //查询语句
            qp = CreateQueryParam(qp, Context);

            //权限筛选
            qp = CreateQueryByRoles(qp, Context);

            //区域筛选
            qp = CreateQueryByJurisdictions(qp, Context);

            //游戏分类筛选
            qp = CreateQueryByGameGategorys(qp, Context);



            int RecordCount = 0;
            List <Playngo_ClientZone_GameSheet> GameSheetList = Playngo_ClientZone_GameSheet.FindAll(qp, out RecordCount);


            //配置值
            XmlFormat xmlFormat      = new XmlFormat(Context.Server.MapPath(String.Format("{0}Resource/xml/Config.Setting.GameSheets.xml", Context.ModulePath)));
            var       XmlItemSetting = xmlFormat.ToList <SettingEntity>();


            List <Dictionary <String, Object> > DictFiles = new List <Dictionary <string, object> >();

            foreach (var GameSheetItem in GameSheetList)
            {
                int index = GameSheetList.IndexOf(GameSheetItem); //index 为索引值

                Dictionary <String, Object> jsonDict = new Dictionary <String, Object>();



                //循环输出所有的固定项
                foreach (var Field in Playngo_ClientZone_GameSheet.Meta.Fields)
                {
                    jsonDict.Add(Field.ColumnName, GameSheetItem[Field.ColumnName]);
                }


                if (XmlItemSetting != null && XmlItemSetting.Count > 0)
                {
                    var ItemSettings = ConvertTo.Deserialize <List <KeyValueEntity> >(GameSheetItem.Options);
                    foreach (var ItemSetting in XmlItemSetting)
                    {
                        jsonDict = Common.UpdateDictionary(jsonDict, ItemSetting.Name, xf.ViewItemSetting(GameSheetItem, ItemSetting.Name, ItemSetting.DefaultValue));
                    }
                }


                jsonDict = Common.UpdateDictionary(jsonDict, "ReleaseDateString", GameSheetItem.ReleaseDate.ToShortDateString());
                jsonDict = Common.UpdateDictionary(jsonDict, "Image", xf.ViewLinkUrl(xf.ViewItemSettingT <string>(GameSheetItem, "Image", ""), "", Context));

                jsonDict = Common.UpdateDictionary(jsonDict, "Url", xf.GoUrl(GameSheetItem));
                //未来日期出现Coming Soon
                jsonDict = Common.UpdateDictionary(jsonDict, "ComingSoonDisplay", GameSheetItem.ReleaseDate > xUserTime.LocalTime());


                Int32 NotifyStatus = (Int32)EnumNotificationStatus.None;
                if (GameSheetItem.NotifyInclude == 1) //&& GameSheetItem.StartTime >= xUserTime.LocalTime().AddDays(-xf.ViewSettingT<Int32>("General.ExpiryTimeNotification", 7)))
                {
                    NotifyStatus = GameSheetItem.NotifyStatus;
                }


                jsonDict = Common.UpdateDictionary(jsonDict, "NotificationStatus", EnumHelper.GetEnumTextVal(NotifyStatus, typeof(EnumNotificationStatus)));
                jsonDict = Common.UpdateDictionary(jsonDict, "NotificationStatusClass", EnumHelper.GetEnumTextVal(NotifyStatus, typeof(EnumNotificationStatus)).ToLower());


                DictFiles.Add(jsonDict);
            }

            jsonPictures.Add("data", DictFiles);
            jsonPictures.Add("Pages", qp.Pages);
            jsonPictures.Add("RecordCount", RecordCount);

            //转换数据为json

            ResponseString = jsSerializer.Serialize(jsonPictures);
        }
Example #7
0
        public void Execute(BasePage Context)
        {
            Dictionary <String, Object> jsonDatas = new Dictionary <string, Object>();

            JavaScriptSerializer jsSerializer = new JavaScriptSerializer();
            TemplateFormat       xf           = new TemplateFormat(Context);


            QueryParam qp = new QueryParam();


            qp.Orderfld  = WebHelper.GetStringParam(Context.Request, "Orderfld", "ID");
            qp.OrderType = WebHelper.GetIntParam(Context.Request, "OrderType", 1);


            qp.PageIndex = WebHelper.GetIntParam(Context.Request, "PageIndex", 1);
            qp.PageSize  = WebHelper.GetIntParam(Context.Request, "PageSize", xf.ViewSettingT <Int32>("General.Downloads.Pagings", 10));


            //查询语句
            qp = CreateQueryParam(qp, Context);

            //权限筛选
            qp = CreateQueryByRoles(qp, Context);

            //区域筛选
            qp = CreateQueryByJurisdictions(qp, Context);

            //文件类型筛选
            qp = CreateQueryByFileTypes(qp, Context);

            //游戏分类筛选
            qp = CreateQueryByGameGategorys(qp, Context);



            int RecordCount = 0;
            List <Playngo_ClientZone_DownloadFile> fileList = Playngo_ClientZone_DownloadFile.FindAll(qp, out RecordCount);


            //配置值
            XmlFormat xmlFormat      = new XmlFormat(Context.Server.MapPath(String.Format("{0}Resource/xml/Config.Setting.Downloads.xml", Context.ModulePath)));
            var       XmlItemSetting = xmlFormat.ToList <SettingEntity>();


            List <Dictionary <String, Object> > DictFiles = new List <Dictionary <string, object> >();

            foreach (var fileItem in fileList)
            {
                int index = fileList.IndexOf(fileItem); //index 为索引值

                Dictionary <String, Object> jsonDict = new Dictionary <String, Object>();



                //循环输出所有的固定项
                foreach (var Field in Playngo_ClientZone_DownloadFile.Meta.Fields)
                {
                    jsonDict.Add(Field.ColumnName, fileItem[Field.ColumnName]);
                }


                if (XmlItemSetting != null && XmlItemSetting.Count > 0)
                {
                    var ItemSettings = ConvertTo.Deserialize <List <KeyValueEntity> >(fileItem.Options);
                    foreach (var ItemSetting in XmlItemSetting)
                    {
                        jsonDict = Common.UpdateDictionary(jsonDict, ItemSetting.Name, xf.ViewItemSetting(fileItem, ItemSetting.Name, ItemSetting.DefaultValue));
                    }
                }


                //下载地址
                String DownloadUrl = String.Format("{0}Resource_Service.aspx?ModuleId={1}&Token={2}&TabId={3}&PortalId={4}&language={5}&FileId={6}",
                                                   Context.ModulePath,
                                                   Context.Settings_ModuleID,
                                                   "DownloadFile",
                                                   Context.Settings_TabID,
                                                   Context.PortalId,
                                                   Context.language,
                                                   fileItem.ID);
                jsonDict = Common.UpdateDictionary(jsonDict, "DownloadUrl", DownloadUrl);

                jsonDict = Common.UpdateDictionary(jsonDict, "ReleaseDateString", fileItem.ReleaseDate.ToShortDateString());

                //文件类型转换
                jsonDict = Common.UpdateDictionary(jsonDict, "FileTypesString", Playngo_ClientZone_FileType.ConvertFileTypes(fileItem.FileTypes));

                //订阅状态等
                Int32 NotifyStatus = (Int32)EnumNotificationStatus.None;
                if (fileItem.NotifyInclude == 1) //&& fileItem.StartTime >= xUserTime.LocalTime().AddDays(-xf.ViewSettingT<Int32>("General.ExpiryTimeNotification", 7)))
                {
                    NotifyStatus = fileItem.NotifyStatus;
                }


                jsonDict = Common.UpdateDictionary(jsonDict, "NotificationStatus", EnumHelper.GetEnumTextVal(NotifyStatus, typeof(EnumNotificationStatus)));
                jsonDict = Common.UpdateDictionary(jsonDict, "NotificationStatusClass", EnumHelper.GetEnumTextVal(NotifyStatus, typeof(EnumNotificationStatus)).ToLower());
                //未来日期出现Coming Soon
                jsonDict = Common.UpdateDictionary(jsonDict, "ComingSoonDisplay", fileItem.ReleaseDate > xUserTime.LocalTime());

                DictFiles.Add(jsonDict);
            }

            jsonDatas.Add("data", DictFiles);
            jsonDatas.Add("Pages", qp.Pages);
            jsonDatas.Add("RecordCount", RecordCount);

            //转换数据为json

            ResponseString = jsSerializer.Serialize(jsonDatas);
        }
        /// <summary>
        /// 页面加载
        /// </summary>
        protected void Page_PreRender(object sender, EventArgs e)
        {
            try
            {
                if (GameSheetID > 0)
                {
                    if (GameSheetItem != null && GameSheetItem.ID > 0)
                    {
                        //拷贝需要复制的记录
                        var DBGameSheet = GameSheetItem.Clone() as Playngo_ClientZone_GameSheet;

                        String Title   = DBGameSheet.Title;
                        String UrlSlug = DBGameSheet.UrlSlug;

                        DBGameSheet.ID = 0;

                        DBGameSheet.Title   = String.Format("Copy - {0}", Title);
                        DBGameSheet.UrlSlug = String.Format("copy-{0}", UrlSlug);

                        Int32 i = 1;

                        while (Playngo_ClientZone_GameSheet.FindExists(DBGameSheet))
                        {
                            i = i + 1;
                            DBGameSheet.Title   = String.Format("Copy {0} - {1}", i, Title);
                            DBGameSheet.UrlSlug = String.Format("copy-{0}-{1}", i, UrlSlug);
                        }

                        DBGameSheet.Status     = (Int32)EnumStatus.Pending;
                        DBGameSheet.CreateUser = UserId;
                        DBGameSheet.CreateTime = xUserTime.UtcTime();


                        List <KeyValueEntity> list = ConvertTo.Deserialize <List <KeyValueEntity> >(DBGameSheet.Options);
                        if (list != null && list.Count > 0)
                        {
                            if (list.Exists(r => r.Key == "FriendlyUrl"))
                            {
                                list[list.FindIndex(r => r.Key == "FriendlyUrl")].Value = DBGameSheet.UrlSlug;
                            }

                            DBGameSheet.Options = ConvertTo.Serialize <List <KeyValueEntity> >(list);
                        }



                        DBGameSheet.ID = DBGameSheet.Insert();


                        if (DBGameSheet.ID > 0)
                        {
                            //复制文件关系
                            CopyDownFileRelations(DBGameSheet.ID, GameSheetID);

                            //复制动态模块及内容
                            CopyDynamicModules(DBGameSheet.ID, GameSheetID);

                            mTips.IsPostBack = false;
                            mTips.LoadMessage("CopyGameSheetSuccess", EnumTips.Success, this, new String[] { GameSheetItem.Title });

                            Response.Redirect(xUrl("ID", DBGameSheet.ID.ToString(), "GameSheets-Edit"), false);
                        }
                        else
                        {
                            mTips.IsPostBack = false;
                            mTips.LoadMessage("CopyGameSheetError", EnumTips.Warning, this, new String[] { GameSheetItem.Title });
                            Response.Redirect(xUrl("GameSheets"), false);
                        }
                    }
                    else
                    {
                        //没有查找到数据
                    }
                }
                else
                {
                    //ID传输得不对
                }
            }
            catch (Exception ex)
            {
                ProcessModuleLoadException(ex);
            }
        }
 /// <summary>
 /// 将泛型集合类转换成DataTable
 /// </summary>
 /// <typeparam name="T">集合项类型</typeparam>
 /// <param name="list">集合</param>
 /// <returns>数据集(表)</returns>
 public static DataTable ToDataTable <T>(IList <T> list)
 {
     return(ConvertTo.ToDataTable <T>(list, null));
 }