/// <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_Event Event = Playngo_ClientZone_Event.FindByKeyForEdit(btnRemove.CommandArgument); if (Event != null && Event.ID > 0) { if (Event.Status == (Int32)EnumStatus.Recycle) { if (Event.Delete() > 0) { //操作成功 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> 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_Event Event = Playngo_ClientZone_Event.FindByKeyForEdit(IDX); if (Event != null && Event.ID > 0) { if (Event.Status == (Int32)EnumStatus.Recycle && Status == (Int32)EnumStatus.Recycle) { if (Event.Delete() > 0) { } } 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); } }