Exemple #1
0
        /// <summary>
        /// GameSheets
        /// 将事件实体查询出来并填充到数据中
        /// </summary>
        /// <param name="DictDataItem"></param>
        /// <param name="ItemId"></param>
        /// <returns></returns>
        public Dictionary <String, Object> GetDictDataItemsByGameSheets(Dictionary <String, Object> DictDataItem, Int32 ItemId, BasePage Context)
        {
            var DataItem = Playngo_ClientZone_GameSheet.FindByKeyForEdit(ItemId);

            if (DataItem != null && DataItem.ID > 0)
            {
                //循环输出所有的固定项
                foreach (var Field in Playngo_ClientZone_GameSheet.Meta.Fields)
                {
                    DictDataItem.Add(Field.ColumnName, DataItem[Field.ColumnName]);
                }

                //移除累赘的字典项
                DictDataItem = Common.RemoveDictionary(DictDataItem, "Options");
                DictDataItem = Common.RemoveDictionary(DictDataItem, "Files");

                TemplateFormat xf = new TemplateFormat(Context);

                DictDataItem = Common.UpdateDictionary(DictDataItem, "Image", xf.ViewLinkUrl(xf.ViewItemSettingT <string>(DataItem, "Image", ""), "", Context));
                DictDataItem = Common.UpdateDictionary(DictDataItem, "Summary", xf.ViewItemSettingT <string>(DataItem, "Summary", ""));
                DictDataItem = Common.UpdateDictionary(DictDataItem, "Url", xf.GoUrl(DataItem));
                DictDataItem = Common.UpdateDictionary(DictDataItem, "ReleaseDateStr", String.Format("{0} {1}{2},{3}", DataItem.ReleaseDate.ToString("MMM"), DataItem.ReleaseDate.Day, xf.GetDaySuffix(DataItem.ReleaseDate.Day), DataItem.ReleaseDate.ToString("yyyy")));
            }
            return(DictDataItem);
        }
Exemple #2
0
        /// <summary>
        /// 更新文章
        /// </summary>
        protected void cmdUpdate_Click(object sender, EventArgs e)
        {
            try
            {
                // 设置方案项
                Playngo_ClientZone_GameSheet GameSheet = new Playngo_ClientZone_GameSheet();
                Boolean SaveResult = SaveDataItem(-1, out GameSheet);

                if (SaveResult)
                {
                    mTips.LoadMessage("SaveSuccess", EnumTips.Success, this, new String[] { GameSheet.Title });
                    //Response.Redirect(xUrl("GameSheetID", GameSheet.ID.ToString(), "EditLoading", String.Format("ReturnUrl={0}", HttpUtility.UrlEncode( xUrl("GameSheets")))) ,false);
                    Response.Redirect(xUrl("ID", GameSheet.ID.ToString(), "GameSheets-Edit"), false);
                }
                else
                {
                    mTips.IsPostBack = false;
                    mTips.LoadMessage("SaveGameSheetError", EnumTips.Warning, this, new String[] { GameSheet.Title });
                }
            }
            catch (Exception ex)
            {
                ProcessModuleLoadException(ex);
            }
        }
Exemple #3
0
        /// <summary>
        /// 发送邮件(多篇文章)-订阅列表中的角色+邮箱
        /// </summary>
        /// <param name="Articles"></param>
        /// <returns></returns>
        public Int32 SendMail(Playngo_ClientZone_GameSheet DataItem)
        {
            Int32 RecordCount = 0;

            Int32 UserRecordCount = 0;
            var   UserList        = Common.Split <UserInfo>(UserController.GetUsersByProfileProperty(DataItem.PortalId, "Newsletter_GameSheets", "True", 0, Int32.MaxValue, ref UserRecordCount), 1, Int32.MaxValue);

            if (UserList != null && UserList.Count > 0)
            {
                foreach (var UserItem in UserList)
                {
                    //验证邮件地址符合规则
                    if (Mail.IsValidEmailAddress(UserItem.Email, Null.NullInteger))
                    {
                        //验证用户是否有权限接受邮件
                        if (ValidUserRole(DataItem.Per_AllUsers, DataItem.Per_Roles, UserItem))
                        {
                            //验证用户区域
                            if (ValidUserJurisdictions(DataItem.Per_AllJurisdictions, DataItem.Per_Jurisdictions, UserItem))
                            {
                                //创建邮件
                                EmailInfo email = CreateMailHtml(DataItem, UserItem);
                                //推送邮件
                                MailScheduler.AssignMessage(email);

                                RecordCount++;
                            }
                        }
                    }
                }
            }


            return(RecordCount);
        }
Exemple #4
0
        /// <summary>
        /// 文章软删除(删除到回收站)
        /// </summary>
        protected void cmdDelete_Click(object sender, EventArgs e)
        {
            try
            {
                Playngo_ClientZone_GameSheet GameSheet = Playngo_ClientZone_GameSheet.FindByKeyForEdit(GameSheetID);
                GameSheet.Status = (Int32)EnumStatus.Recycle;

                if (GameSheet != null && GameSheet.ID > 0 && GameSheet.Update() > 0)
                {
                    //操作成功
                    mTips.LoadMessage("DeleteGameSheetSuccess", EnumTips.Success, this, new String[] { GameSheet.Title });
                    Response.Redirect(xUrl("GameSheets"), false);
                }
                else
                {
                    mTips.IsPostBack = false;
                    //操作失败
                    mTips.LoadMessage("DeleteGameSheetError", EnumTips.Success, this, new String[] { GameSheet.Title });
                }
            }
            catch (Exception ex)
            {
                ProcessModuleLoadException(ex);
            }
        }
Exemple #5
0
        /// <summary>
        /// 保存草稿
        /// </summary>
        protected void cmdSaveDraft_Click(object sender, EventArgs e)
        {
            try
            {
                Int32 GameSheetStatus = (Int32)EnumStatus.Draft;
                Playngo_ClientZone_GameSheet GameSheet = new Playngo_ClientZone_GameSheet();
                Boolean SaveResult = SaveDataItem(GameSheetStatus, out GameSheet);



                if (SaveResult)
                {
                    mTips.LoadMessage("SaveGameSheetSuccess", EnumTips.Success, this, new String[] { GameSheet.Title });
                    Response.Redirect(xUrl("ID", GameSheet.ID.ToString(), "GameSheets-Edit"), false);
                }
                else
                {
                    mTips.IsPostBack = false;
                    mTips.LoadMessage("SaveGameSheetError", EnumTips.Success, this, new String[] { GameSheet.Title });
                }
            }
            catch (Exception ex)
            {
                ProcessModuleLoadException(ex);
            }
        }
        public void RowDataBoundByGameSheets(GridViewRowEventArgs e)
        {
            //还原出数据
            Playngo_ClientZone_GameSheet DataItem = e.Row.DataItem as Playngo_ClientZone_GameSheet;

            if (DataItem != null && DataItem.ID > 0)
            {
                TemplateFormat xf = new TemplateFormat(this);


                HyperLink hlFileName = e.Row.FindControl("hlFileName") as HyperLink;
                hlFileName.Text = DataItem.Title;

                Image imgFileName = e.Row.FindControl("imgFileName") as Image;

                //发布者信息
                e.Row.Cells[2].Text = "--";
                if (DataItem.LastUser > 0)
                {
                    UserInfo uInfo = UserController.GetUserById(PortalId, DataItem.LastUser);
                    if (uInfo != null && uInfo.UserID > 0)
                    {
                        e.Row.Cells[2].Text = String.Format("{0}<br />{1}", uInfo.Username, uInfo.DisplayName);
                    }
                }


                //发布时间
                e.Row.Cells[3].Text = DataItem.CreateTime.ToShortDateString();

                //状态
                e.Row.Cells[4].Text = EnumHelper.GetEnumTextVal(DataItem.Status, typeof(EnumStatus));
            }
        }
        /// <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);
        }
Exemple #8
0
        public void Execute(BasePage Context)
        {
            TemplateFormat xf = new TemplateFormat(Context);

            QueryParam qp = new QueryParam();

            qp.ReturnFields = "ID,Title";


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

            //排序的规则
            qp.OrderType = WebHelper.GetIntParam(Context.Request, "OrderType", 1);
            qp.Orderfld  = "ID"; //WebHelper.GetStringParam(Context.Request, "Orderfld", "ID");


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

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

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



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

            Dictionary <String, Object> jsonPictures = new Dictionary <string, Object>();


            JavaScriptSerializer jsSerializer = new JavaScriptSerializer();

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

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

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

                jsonDict.Add("ID", EventItem.ID);
                jsonDict.Add("Title", EventItem.Title);

                DictFiles.Add(jsonDict);
            }

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

            //转换数据为json
            ResponseString = jsSerializer.Serialize(jsonPictures);
        }
Exemple #9
0
        /// <summary>
        /// 列表上的项删除事件
        /// </summary>
        protected void btnRemove_Click(object sender, EventArgs e)
        {
            try
            {
                LinkButton btnRemove = (LinkButton)sender;

                if (btnRemove != null && !String.IsNullOrEmpty(btnRemove.CommandArgument))
                {
                    mTips.IsPostBack = true;

                    Playngo_ClientZone_GameSheet Event = Playngo_ClientZone_GameSheet.FindByKeyForEdit(btnRemove.CommandArgument);

                    if (Event != null && Event.ID > 0)
                    {
                        if (Event.Status == (Int32)EnumStatus.Recycle)
                        {
                            if (Event.Delete() > 0)
                            {
                                //删除相关的动态模块和项
                                Playngo_ClientZone_DynamicModule.DeleteAll(Event);

                                //操作成功
                                mTips.LoadMessage("DeleteEventSuccess", EnumTips.Success, this, new String[] { Event.Title });
                            }
                            else
                            {
                                //操作失败
                                mTips.LoadMessage("DeleteEventError", EnumTips.Success, this, new String[] { Event.Title });
                            }
                        }
                        else
                        {
                            Event.Status = (Int32)EnumStatus.Recycle;
                            if (Event.Update() > 0)
                            {
                                //移动到回收站操作成功
                                mTips.LoadMessage("DeleteEventSuccess", EnumTips.Success, this, new String[] { Event.Title });
                            }
                            else
                            {
                                //移动到回收站操作失败
                                mTips.LoadMessage("DeleteEventError", EnumTips.Success, this, new String[] { Event.Title });
                            }
                        }
                        BindDataList();
                    }
                }
            }
            catch (Exception ex)
            {
                ProcessModuleLoadException(ex);
            }
        }
Exemple #10
0
        /// <summary>
        /// 绑定动态模块到页面
        /// </summary>
        private void BindRelationPages()
        {
            if (DownloadID > 0)
            {
                divRelationPages.Visible = true;
                hlSelectRelationPages.Attributes.Add("data-href", String.Format("{0}Resource_Masters.aspx?PortalId={1}&TabId={2}&ModuleId={3}&language={4}&Master=Manager_Modal_RelationPages", ModulePath, PortalId, TabId, ModuleId, language));
            }



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


            QueryParam qp = new QueryParam();

            qp.OrderType = 0;
            qp.Orderfld  = " PageType ASC,Sort ";
            Int32 RecordCount = 0;

            qp.Where.Add(new SearchParam(Playngo_ClientZone_DownloadRelation._.DownloadID, DownloadID, SearchType.Equal));

            var Relations = Playngo_ClientZone_DownloadRelation.FindAll(qp, out RecordCount);


            if (Relations != null && Relations.Count > 0)
            {
                foreach (var Relation in Relations)
                {
                    if (Relation.PageType == (Int32)EnumDisplayModuleType.Campaigns)
                    {
                        var Item = Playngo_ClientZone_Campaign.FindByKeyForEdit(Relation.ItemID);
                        Items.Add(new { ID = Relation.ID, Sort = Relation.ID, ItemID = Item.ID, Title = Item.Title, PageType = (Int32)EnumDisplayModuleType.Campaigns, PageTypeText = "Campaigns" });
                    }
                    else if (Relation.PageType == (Int32)EnumDisplayModuleType.Events)
                    {
                        var Item = Playngo_ClientZone_Event.FindByKeyForEdit(Relation.ItemID);
                        Items.Add(new { ID = Relation.ID, ItemID = Item.ID, Title = Item.Title, PageType = (Int32)EnumDisplayModuleType.Events, PageTypeText = "Events" });
                    }
                    else
                    {
                        var Item = Playngo_ClientZone_GameSheet.FindByKeyForEdit(Relation.ItemID);
                        Items.Add(new { ID = Relation.ID, ItemID = Item.ID, Title = Item.Title, PageType = (Int32)EnumDisplayModuleType.GameSheets, PageTypeText = "Game Sheets" });
                    }
                }
            }


            //绑定参数项
            RepeaterRelationPages.DataSource = Items;
            RepeaterRelationPages.DataBind();
        }
Exemple #11
0
        /// <summary>
        /// 绑定列表
        /// </summary>
        private void BindDataList()
        {
            QueryParam qp = new QueryParam();

            qp.OrderType = OrderType;
            if (!String.IsNullOrEmpty(Orderfld))
            {
                qp.Orderfld = Orderfld;
            }
            else
            {
                qp.Orderfld = Playngo_ClientZone_GameSheet._.ID;
            }

            #region "分页的一系列代码"


            int RecordCount = 0;
            qp.PageSize  = Settings_General_ManagerPerPage;
            qp.PageIndex = PageIndex;


            #endregion

            //查询的方法
            qp.Where = BindSearch();

            List <Playngo_ClientZone_GameSheet> Events = Playngo_ClientZone_GameSheet.FindAll(qp, out RecordCount);
            qp.RecordCount      = RecordCount;
            RecordPages         = qp.Pages;
            lblRecordCount.Text = String.Format("{0} {2} / {1} {3}", RecordCount, RecordPages, ViewResourceText("Title_Items", "Items"), ViewResourceText("Title_Pages", "Pages"));


            Boolean is_admin = !IsAdministrator && !IsAdmin;


            hlAllEvent.Text        = String.Format("{1} ({0})", Playngo_ClientZone_GameSheet.FindCountByStatus(ModuleId, -1, is_admin, UserId), ViewResourceText("hlAllEvent", "All"));
            hlPublishedEvent.Text  = String.Format("{1} ({0})", Playngo_ClientZone_GameSheet.FindCountByStatus(ModuleId, (Int32)EnumStatus.Published, is_admin, UserId), ViewResourceText("hlPublishedEvent", "Published"));
            hlPendingEvent.Text    = String.Format("{1} ({0})", Playngo_ClientZone_GameSheet.FindCountByStatus(ModuleId, (Int32)EnumStatus.Pending, is_admin, UserId), ViewResourceText("hlPendingEvent", "Pending"));
            hlDraftsEvent.Text     = String.Format("{1} ({0})", Playngo_ClientZone_GameSheet.FindCountByStatus(ModuleId, (Int32)EnumStatus.Draft, is_admin, UserId), ViewResourceText("hlDraftsEvent", "Drafts"));
            hlRecycleBinEvent.Text = String.Format("{1} ({0})", Playngo_ClientZone_GameSheet.FindCountByStatus(ModuleId, (Int32)EnumStatus.Recycle, is_admin, UserId), ViewResourceText("hlRecycleBinEvent", "Recycle Bin"));



            gvEventList.DataSource = Events;
            gvEventList.DataBind();
            BindGridViewEmpty <Playngo_ClientZone_GameSheet>(gvEventList, new Playngo_ClientZone_GameSheet());
        }
Exemple #12
0
        /// <summary>
        /// 状态应用按钮事件
        /// </summary>
        protected void btnApply_Click(object sender, EventArgs e)
        {
            try
            {
                Int32 Status = WebHelper.GetIntParam(Request, ddlStatus.UniqueID, -1);

                if (Status >= 0)
                {
                    string   Checkbox_Value       = WebHelper.GetStringParam(Request, "Checkbox", "");
                    string[] Checkbox_Value_Array = Checkbox_Value.Split(',');
                    Int32    IDX = 0;
                    for (int i = 0; i < Checkbox_Value_Array.Length; i++)
                    {
                        if (Int32.TryParse(Checkbox_Value_Array[i], out IDX))
                        {
                            Playngo_ClientZone_GameSheet Event = Playngo_ClientZone_GameSheet.FindByKeyForEdit(IDX);
                            if (Event != null && Event.ID > 0)
                            {
                                if (Event.Status == (Int32)EnumStatus.Recycle && Status == (Int32)EnumStatus.Recycle)
                                {
                                    if (Event.Delete() > 0)
                                    {
                                        //删除相关的动态模块和项
                                        Playngo_ClientZone_DynamicModule.DeleteAll(Event);
                                    }
                                }
                                else
                                {
                                    Event.Status = Status;
                                    if (Event.Update() > 0)
                                    {
                                    }
                                }
                            }
                        }
                    }
                    BindDataList();

                    mTips.IsPostBack = true;
                    mTips.LoadMessage("ApplyStatusSuccess", EnumTips.Success, this, new String[] { EnumHelper.GetEnumTextVal(Status, typeof(EnumStatus)) });
                }
            }
            catch (Exception ex)
            {
                ProcessModuleLoadException(ex);
            }
        }
Exemple #13
0
        /// <summary>
        /// 利用线程发送订阅邮件
        /// </summary>
        /// <param name="ObjectItem"></param>8
        public void ThreadCreateSendMail(Object ObjectItem)
        {
            var objs = (Dictionary <object, object>)ObjectItem;


            Playngo_ClientZone_GameSheet DataItem = (Playngo_ClientZone_GameSheet)objs["DataItem"];

            if (DataItem != null && DataItem.ID > 0)
            {
                //这里需要调用所有邮件的信息
                NotificationEmail NotEmail = new NotificationEmail();
                //所有区域
                NotEmail.AllJurisdictions = Playngo_ClientZone_Jurisdiction.FindAllByModuleID(DataItem.ModuleId);
                //邮件设置
                NotEmail.MailSetting = Playngo_ClientZone_MailSetting.FindByModuleId(ModuleId, "Notification.GameSheets");
                if (NotEmail.MailSetting != null && NotEmail.MailSetting.Status == 1)
                {
                    NotEmail.Settings = Settings;
                    NotEmail.Settings.Add("PortalUrl", objs["PortalUrl"]);

                    NotEmail.SendMail(DataItem);
                }
            }
        }
        public void Execute(BasePage Context)
        {
            Int32 ItemId = WebHelper.GetIntParam(Context.Request, "ID", 0);

            if (ItemId > 0)
            {
                Int32 ItemType = WebHelper.GetIntParam(Context.Request, "Type", (Int32)EnumDisplayModuleType.GameSheets);

                TemplateFormat xf = new TemplateFormat(Context);

                if (ItemType == (Int32)EnumDisplayModuleType.Events)
                {
                    var Item = Playngo_ClientZone_Event.FindByKeyForEdit(ItemId);
                    Context.Response.Redirect(xf.GoUrl(Item));
                }
                else if (ItemType == (Int32)EnumDisplayModuleType.Campaigns)
                {
                    var Item = Playngo_ClientZone_Campaign.FindByKeyForEdit(ItemId);
                    Context.Response.Redirect(xf.GoUrl(Item));
                }
                else if (ItemType == (Int32)EnumDisplayModuleType.Downloads)
                {
                    Context.Response.Redirect(xf.GoUiUrl("Downloads"));
                }
                else
                {
                    var Item = Playngo_ClientZone_GameSheet.FindByKeyForEdit(ItemId);
                    Context.Response.Redirect(xf.GoUrl(Item));
                }
            }
            else
            {
                IsResponseWrite = true;
                ResponseString  = "传过来的文件编号都不对";
            }
        }
        /// <summary>
        /// 绑定列表
        /// </summary>
        private void BindDataListByGameSheets()
        {
            QueryParam qp = new QueryParam();

            qp.OrderType = OrderType;
            if (!String.IsNullOrEmpty(Orderfld))
            {
                qp.Orderfld = Orderfld;
            }
            else
            {
                qp.Orderfld = Playngo_ClientZone_GameSheet._.ID;
            }

            #region "分页的一系列代码"


            int RecordCount = 0;
            int pagesize    = qp.PageSize = 10;
            qp.PageIndex = PageIndex;


            #endregion

            //查询的方法
            qp.Where = BindSearch();

            List <Playngo_ClientZone_GameSheet> Events = Playngo_ClientZone_GameSheet.FindAll(qp, out RecordCount);
            qp.RecordCount      = RecordCount;
            RecordPages         = qp.Pages;
            lblRecordCount.Text = String.Format("{0} {2} / {1} {3}", RecordCount, RecordPages, ViewResourceText("Title_Items", "Items"), ViewResourceText("Title_Pages", "Pages"));

            gvList.DataSource = Events;
            gvList.DataBind();
            BindGridViewEmpty <Playngo_ClientZone_GameSheet>(gvList, new Playngo_ClientZone_GameSheet());
        }
Exemple #16
0
        public void Execute(BasePage Context)
        {
            TemplateFormat xf = new TemplateFormat(Context);

            JavaScriptSerializer jsSerializer = new JavaScriptSerializer();

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



            //创建 DownloadFile 查询的浅度拷贝
            var DownloadFileQP = SqlQueryTable(xf, Context);
            //Cookie中保存的最后点击事件
            var ClickTime = GetCookieClickTime(EnumDisplayModuleType.Downloads.ToString());

            if (ClickTime != DateTime.MinValue)
            {
                DownloadFileQP.Where.Add(new SearchParam("StartTime", ClickTime, SearchType.GtEqual));
            }

            DictFiles.Add("DownloadFileCount", Playngo_ClientZone_DownloadFile.FindCount(DownloadFileQP));


            //创建 Campaign 查询的浅度拷贝
            var CampaignQP = SqlQueryTable(xf, Context);

            //Cookie中保存的最后点击事件
            ClickTime = GetCookieClickTime(EnumDisplayModuleType.Campaigns.ToString());
            if (ClickTime != DateTime.MinValue)
            {
                CampaignQP.Where.Add(new SearchParam("StartTime", ClickTime, SearchType.GtEqual));
            }
            DictFiles.Add("CampaignCount", Playngo_ClientZone_Campaign.FindCount(CampaignQP));



            //创建 Event 查询的浅度拷贝
            var EventQP = SqlQueryTable(xf, Context);

            //Cookie中保存的最后点击事件
            ClickTime = GetCookieClickTime(EnumDisplayModuleType.Events.ToString());
            if (ClickTime != DateTime.MinValue)
            {
                EventQP.Where.Add(new SearchParam("StartTime", ClickTime, SearchType.GtEqual));
            }
            DictFiles.Add("EventCount", Playngo_ClientZone_Event.FindCount(EventQP));



            //创建 GameSheet 查询的浅度拷贝
            var GameSheetQP = SqlQueryTable(xf, Context);

            //Cookie中保存的最后点击事件
            ClickTime = GetCookieClickTime(EnumDisplayModuleType.GameSheets.ToString());
            if (ClickTime != DateTime.MinValue)
            {
                GameSheetQP.Where.Add(new SearchParam("StartTime", ClickTime, SearchType.GtEqual));
            }
            DictFiles.Add("GameSheetCount", Playngo_ClientZone_GameSheet.FindCount(GameSheetQP));



            ResponseString = jsSerializer.Serialize(DictFiles);
        }
Exemple #17
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);
        }
Exemple #18
0
 /// <summary>
 /// 删除数据所关联的所有动态模块项
 /// </summary>
 /// <param name="DataId"></param>
 /// <param name="DMType"></param>
 /// <returns></returns>
 public static Int32 DeleteAll(Playngo_ClientZone_GameSheet DataItem)
 {
     return(DeleteAll(DataItem.ID, DataItem.ModuleId, (Int32)EnumDynamicModuleType.GameSheet));
 }
Exemple #19
0
 public String FormatThumbnailUrl(Playngo_ClientZone_GameSheet DataItem)
 {
     return(String.Format("{0}{1}Resource_Service.aspx?Token=Thumbnail&PortalId={2}&TabId={3}&ID={4}&width={5}&height={6}&mode={7}&language={8}", PortalUrl, MailSetting.ModulePath, DataItem.PortalId, MailSetting.TabID, DataItem.ID, 500, 500, "W", "en-US"));
 }
Exemple #20
0
 public String FormatItemUrl(Playngo_ClientZone_GameSheet DataItem)
 {
     return(String.Format("{0}{1}Resource_Service.aspx?Token=GoItemLinkUrl&PortalId={2}&TabId={3}&ModuleId={4}&ID={5}&Type={6}", PortalUrl, MailSetting.ModulePath, DataItem.PortalId, MailSetting.TabID, DataItem.ModuleId, DataItem.ID, (Int32)EnumDisplayModuleType.GameSheets));
 }
Exemple #21
0
        /// <summary>
        /// 创建邮件内容
        /// </summary>
        /// <param name="EmailTo"></param>
        /// <returns></returns>
        public EmailInfo CreateMailHtml(Playngo_ClientZone_GameSheet DataItem, UserInfo UserItem)
        {
            //构造邮件信息
            EmailInfo emailItem = new EmailInfo();

            emailItem.Settings = Settings;
            emailItem.PushSettings();


            //事件作者
            UserInfo EventUser = UserController.GetUserById(DataItem.PortalId, DataItem.CreateUser);

            string Template_Subject = NetHelper.ReplaceNoCase(MailSetting.MailSubject, "[TITLE]", DataItem.Title);

            Template_Subject = NetHelper.ReplaceNoCase(Template_Subject, "[MAILSETTING_TIME]", MailSetting.MailTime.ToString());



            Template_Subject = NetHelper.ReplaceNoCase(Template_Subject, "[AUTHOR_MAIL]", EventUser.Email);
            Template_Subject = NetHelper.ReplaceNoCase(Template_Subject, "[AUTHOR_USERNAME]", EventUser.Username);
            Template_Subject = NetHelper.ReplaceNoCase(Template_Subject, "[AUTHOR_DISPLAYNAME]", EventUser.DisplayName);



            emailItem.Subject = Template_Subject;

            #region "构造邮件信息"

            String Template_Content = NetHelper.ReplaceNoCase(MailSetting.MailBody, "[TITLE]", DataItem.Title);
            //Template_Content = NetHelper.ReplaceNoCase(Template_Content, "[CONTENTTEXT]", HttpUtility.HtmlDecode(DataItem.ContentText));
            Template_Content = NetHelper.ReplaceNoCase(Template_Content, "[CREATETIME]", DataItem.CreateTime.ToString());
            Template_Content = NetHelper.ReplaceNoCase(Template_Content, "[CREATEDATE]", DataItem.CreateTime.ToShortDateString());
            Template_Content = NetHelper.ReplaceNoCase(Template_Content, "[MAILSETTING_TIME]", MailSetting.MailTime.ToString());
            Template_Content = NetHelper.ReplaceNoCase(Template_Content, "[DATETIME_NOW]", xUserTime.LocalTime().ToString());


            //注册的信息丢进来
            Template_Content = NetHelper.ReplaceNoCase(Template_Content, "[AUTHOR_MAIL]", EventUser.Email);
            Template_Content = NetHelper.ReplaceNoCase(Template_Content, "[AUTHOR_USERNAME]", EventUser.Username);
            Template_Content = NetHelper.ReplaceNoCase(Template_Content, "[AUTHOR_DISPLAYNAME]", EventUser.DisplayName);

            //订阅用户的信息丢进来
            Template_Content = NetHelper.ReplaceNoCase(Template_Content, "[USER_MAIL]", UserItem.Email);
            Template_Content = NetHelper.ReplaceNoCase(Template_Content, "[USER_USERNAME]", UserItem.Username);
            Template_Content = NetHelper.ReplaceNoCase(Template_Content, "[USER_DISPLAYNAME]", UserItem.DisplayName);


            //图片替换
            if (Common.Contains(Template_Content, "[PICTURE]"))
            {
                Template_Content = NetHelper.ReplaceNoCase(Template_Content, "[PICTURE]", FormatThumbnailUrl(DataItem));
            }

            //文章链接
            if (Common.Contains(Template_Content, "[LINK]"))
            {
                Template_Content = NetHelper.ReplaceNoCase(Template_Content, "[LINK]", FormatItemUrl(DataItem));
            }

            emailItem.Content = Template_Content;
            #endregion



            emailItem.MailTo = MailSetting.MailTo;
            if (MailSetting.MailTo.ToUpper() == "[AUTHOR_MAIL]")//用户邮件需要发送给作者
            {
                emailItem.MailTo = EventUser.Email;
            }
            else if (MailSetting.MailTo.ToUpper() == "[USER_MAIL]")//用户邮件需要发送给用户
            {
                emailItem.MailTo = UserItem.Email;
            }
            emailItem.MailCC = MailSetting.MailCC;

            return(emailItem);
        }
Exemple #22
0
        /// <summary>
        /// 绑定数据项
        /// </summary>
        private void BindDataItem()
        {
            Playngo_ClientZone_GameSheet GameSheet = GameSheetItem;

            //验证文章是否存在
            if (GameSheetID > 0 && (GameSheet == null || GameSheetID != GameSheet.ID))
            {
                //需要给出提示,载入文章错误
                mTips.LoadMessage("LoadingGameSheetError", EnumTips.Error, this, new String[] { "" });
                Response.Redirect(xUrl("GameSheets"), false);
            }

            if (GameSheet == null)
            {
                GameSheet = new Playngo_ClientZone_GameSheet();
            }



            //这里需要验证一下权限,当作者进入到别人的文章时,需要跳到列表页面
            if (GameSheet != null && GameSheet.ID > 0 && (!IsAdministrator && !IsAdmin) && GameSheet.CreateUser != UserId)
            {
                //需要给出提示,你无权编辑其他作者的文章
                mTips.LoadMessage("NoPermissionGameSheetAlert", EnumTips.Warning, this, new String[] { GameSheet.Title });
                Response.Redirect(xUrl("GameSheets"), false);
            }


            if (GameSheet != null && GameSheet.ID > 0)
            {
                liLastUpdated.Text = GameSheet.LastTime.ToString("MM/dd/yyyy hh:mm tt", System.Globalization.DateTimeFormatInfo.InvariantInfo);
            }


            txtTitle.Text        = Common.RestoreEscape(GameSheet.Title);
            txtGameID.Text       = GameSheet.GameID;
            txtGameIDMobile.Text = GameSheet.GameID_Mobile;
            txtVersion.Text      = GameSheet.Version;

            //文件集合
            //hfDownLoadFiles.Value = GameSheetItem.Files;


            cbIncludeNotification.Checked = GameSheet.NotifyInclude == 1;
            WebHelper.SelectedListByValue(ddlNotificationStatus, GameSheet.NotifyStatus);
            cbNotifySubscribers.Checked = GameSheet.NotifySubscribers == 1;


            txtStartDate.Text = GameSheet.StartTime.ToString("MM/dd/yyyy", System.Globalization.DateTimeFormatInfo.InvariantInfo);
            txtStartTime.Text = GameSheet.StartTime.ToString("HH:mm:ss", System.Globalization.DateTimeFormatInfo.InvariantInfo);

            txtReleaseDate.Text = GameSheet.ReleaseDate.ToString("MM/dd/yyyy", System.Globalization.DateTimeFormatInfo.InvariantInfo);
            txtReleaseTime.Text = GameSheet.ReleaseDate.ToString("HH:mm:ss", System.Globalization.DateTimeFormatInfo.InvariantInfo);

            txtDisableDate.Text = GameSheet.EndTime.ToString("MM/dd/yyyy", System.Globalization.DateTimeFormatInfo.InvariantInfo);
            txtDisableTime.Text = GameSheet.EndTime.ToString("HH:mm:ss", System.Globalization.DateTimeFormatInfo.InvariantInfo);


            //角色
            DotNetNuke.Security.Roles.RoleController rc = new DotNetNuke.Security.Roles.RoleController();
            WebHelper.BindList(cblPermissionsRoles, rc.GetPortalRoles(PortalId), "RoleName", "RoleName");
            WebHelper.SelectedListMultiByValue(cblPermissionsRoles, GameSheet.Per_Roles);
            cbPermissionsAllUsers.Checked = GameSheet.Per_AllUsers == 0;



            //区域
            cbAllJurisdictions.Checked = GameSheet.Per_AllJurisdictions == 0;
            WebHelper.BindList(cblJurisdictions, Playngo_ClientZone_Jurisdiction.GetAllCheckList(ModuleId), "Name", "ID");
            WebHelper.SelectedListMultiByValue(cblJurisdictions, GameSheet.Per_Jurisdictions);

            //Game Categorys
            WebHelper.BindList(cblGameCategory, Playngo_ClientZone_GameCategory.GetAllCheckList(ModuleId), "Name", "ID");
            WebHelper.SelectedListMultiByValue(cblGameCategory, GameSheet.GameCategories);



            GameSheet.CreateUser = GameSheet.CreateUser == 0 ? UserId : GameSheet.CreateUser;
            UserInfo CreateUserInfo = UserController.GetUserById(PortalId, GameSheet.CreateUser);

            hfEventAuthor.Value     = GameSheet.CreateUser.ToString();
            lbEventAuthor.Text      = CreateUserInfo != null && CreateUserInfo.UserID > 0 ? CreateUserInfo.DisplayName : "None";
            imgEventAuthor.ImageUrl = ViewUserPic(CreateUserInfo);

            WebHelper.SelectedListByValue(ddlEventStatus, GameSheet.Status);
        }
        /// <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>
 /// 是否到了发布日期
 /// </summary>
 /// <param name="DataItem"></param>
 /// <returns></returns>
 public Boolean IsPublishTime(Playngo_ClientZone_GameSheet DataItem)
 {
     return(DataItem.StartTime <= xUserTime.LocalTime());
 }
Exemple #25
0
 public static String FriendlyUrl(Playngo_ClientZone_GameSheet DataItem, Int32 TabId, Boolean Preview, BasePage page)
 {
     return(FriendlyUrl(DataItem.ID, DataItem.Title, DataItem.UrlSlug, TabId, Preview, page));
 }
Exemple #26
0
        /// <summary>
        /// 列表行绑定
        /// </summary>
        protected void gvEventList_RowDataBound(object sender, GridViewRowEventArgs e)
        {
            if (e.Row.RowType == DataControlRowType.DataRow)
            {
                //还原出数据
                Playngo_ClientZone_GameSheet Event = e.Row.DataItem as Playngo_ClientZone_GameSheet;

                if (Event != null && Event.ID > 0)
                {
                    HyperLink  hlEdit               = e.Row.FindControl("hlEdit") as HyperLink;
                    HyperLink  hlMobileEdit         = e.Row.FindControl("hlMobileEdit") as HyperLink;
                    HyperLink  hlCopy               = e.Row.FindControl("hlCopy") as HyperLink;
                    HyperLink  hlMobileCopy         = e.Row.FindControl("hlMobileCopy") as HyperLink;
                    LinkButton btnRemove            = e.Row.FindControl("btnRemove") as LinkButton;
                    LinkButton btnMobileRemove      = e.Row.FindControl("btnMobileRemove") as LinkButton;
                    HyperLink  hlNewsletter         = e.Row.FindControl("hlNewsletter") as HyperLink;
                    Literal    liNewsletterClientID = e.Row.FindControl("liNewsletterClientID") as Literal;
                    HyperLink  hlRegisters          = e.Row.FindControl("hlRegisters") as HyperLink;


                    HyperLink hlRepeats         = e.Row.FindControl("hlRepeats") as HyperLink;
                    Literal   liRepeatsClientID = e.Row.FindControl("liRepeatsClientID") as Literal;


                    HyperLink HLEventTitle = e.Row.FindControl("HLEventTitle") as HyperLink;
                    //设置按钮的CommandArgument
                    btnRemove.CommandArgument = btnMobileRemove.CommandArgument = Event.ID.ToString();
                    //设置删除按钮的提示
                    if (Event.Status == (Int32)EnumStatus.Recycle)
                    {
                        btnRemove.Attributes.Add("onClick", "javascript:return confirm('" + Localization.GetString("DeleteItem") + "');");
                        btnMobileRemove.Attributes.Add("onClick", "javascript:return confirm('" + Localization.GetString("DeleteItem") + "');");
                    }
                    else
                    {
                        btnRemove.Attributes.Add("onClick", "javascript:return confirm('" + ViewResourceText("DeleteRecycleItem", "Are you sure to move it to recycle bin?") + "');");
                        btnMobileRemove.Attributes.Add("onClick", "javascript:return confirm('" + ViewResourceText("DeleteRecycleItem", "Are you sure to move it to recycle bin?") + "');");
                    }

                    hlEdit.NavigateUrl = hlMobileEdit.NavigateUrl = xUrl("ID", Event.ID.ToString(), "GameSheets-Edit");

                    hlCopy.NavigateUrl = hlMobileCopy.NavigateUrl = xUrl("ID", Event.ID.ToString(), "GameSheets-Copy");



                    HLEventTitle.Text        = Event.Title;
                    HLEventTitle.NavigateUrl = CommonFriendlyUrls.FriendlyUrl(Event, ViewSettingT <Int32>("ClientZone_DisplayTab_GameSheets", TabId), true, this);

                    //获取用户名称
                    DotNetNuke.Entities.Users.UserInfo createUser = new DotNetNuke.Entities.Users.UserController().GetUser(PortalId, Event.CreateUser);
                    e.Row.Cells[4].Text = createUser != null && createUser.UserID > 0 ? createUser.Username : "";
                    //文章状态
                    e.Row.Cells[7].Text = EnumHelper.GetEnumTextVal(Event.Status, typeof(EnumStatus));

                    //格式化3种时间为短日期格式
                    e.Row.Cells[5].Text = Event.ReleaseDate.ToShortDateString();
                    e.Row.Cells[6].Text = Event.StartTime.ToShortDateString();
                    //e.Row.Cells[7].Text = Event.CreateTime.ToShortDateString();
                }
            }
        }
Exemple #27
0
        /// <summary>
        /// 保存文章
        /// </summary>
        /// <param name="GameSheetStatus">文章状态(为-1的时候取选项的值)</param>
        private Boolean SaveDataItem(Int32 GameSheetStatus, out Playngo_ClientZone_GameSheet GameSheet)
        {
            Boolean SaveResult = false;

            GameSheet = GameSheetItem;

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



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

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

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


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

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


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

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


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


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

            List <KeyValueEntity> list          = new List <KeyValueEntity>();
            List <SettingEntity>  ItemSettingDB = GameSheet_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");
                GameSheet.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(GameSheet.Title))
                {
                    FriendlyUrl = Common.FriendlySlug(GameSheet.Title);
                }

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



            //更新项
            GameSheet.LastIP   = WebHelper.UserHost;
            GameSheet.LastTime = xUserTime.LocalTime();
            GameSheet.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))
            {
                GameSheet.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))
            {
                GameSheet.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))
            {
                GameSheet.EndTime = EndTime;
            }


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


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


            int ResultGameSheet = 0;

            if (GameSheet.ID > 0)
            {
                ResultGameSheet = GameSheet.Update();
            }
            else
            {
                ResultGameSheet = GameSheet.ID = GameSheet.Insert();
            }

            if (ResultGameSheet > 0)
            {
                SaveResult = true;


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


                    //更新发送状态
                    //Playngo_ClientZone_GameSheet.Update(String.Format("SendMail={0}", 1), String.Format("ID={0}", GameSheet.ID));
                }
            }
            else
            {
                SaveResult = false;
            }
            return(SaveResult);
        }