/// <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; DNNGo_DNNGalleryPro_Slider Article = DNNGo_DNNGalleryPro_Slider.FindByKeyForEdit(btnRemove.CommandArgument); if (Article != null && Article.ID > 0) { if (Article.Status == (Int32)EnumStatus.RecycleBin) { if (Article.Delete() > 0) { //删除相关的的层 DNNGo_DNNGalleryPro_Layer.Deletes(Article); //操作成功 mTips.LoadMessage("DeleteGallerySuccess", EnumTips.Success, this); } else { //操作失败 mTips.LoadMessage("DeleteGalleryError", EnumTips.Success, this); } } else { Article.Status = (Int32)EnumStatus.RecycleBin; if (Article.Update() > 0) { //移动到回收站操作成功 mTips.LoadMessage("DeleteGallerySuccess", EnumTips.Success, this); } else { //移动到回收站操作失败 mTips.LoadMessage("DeleteGalleryError", EnumTips.Success, this); } } 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)) { DNNGo_DNNGalleryPro_Slider Article = DNNGo_DNNGalleryPro_Slider.FindByKeyForEdit(IDX); if (Article != null && Article.ID > 0) { if (Article.Status == (Int32)EnumStatus.RecycleBin && Status == (Int32)EnumStatus.RecycleBin) { if (Article.Delete() > 0) { //删除相关的的层 DNNGo_DNNGalleryPro_Layer.Deletes(Article); } } else { Article.Status = Status; if (Article.Update() > 0) { } } } } } BindDataList(); mTips.IsPostBack = true; mTips.LoadMessage("ApplyStatusSuccess", EnumTips.Success, this, new String[] { EnumHelper.GetEnumTextVal(Status, typeof(EnumStatus)) }); } } catch (Exception ex) { ProcessModuleLoadException(ex); } }