/// <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); }
/// <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); } }
/// <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); } }
/// <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(); }
/// <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); } }
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 = "传过来的文件编号都不对"; } }