public override bool StepExecute(int operatorUserID, string param, ref long offset, ref int totalCount, ref int finishedCount, out string title, out bool isLastStep) { AttachmentFilter filter = AttachmentFilter.Parse(param); AuthUser operatorUser = UserBO.Instance.GetAuthUser(operatorUserID); int stepCount; if (PostBOV5.Instance.DeleteSearchAttachments(operatorUser, filter, stepDeleteCount, out stepCount)) // .DeleteDoingsBySearch(filter, 200); { finishedCount += stepCount; isLastStep = stepCount < stepDeleteCount; title = "正在删除附件,总数 " + totalCount + ",已删 " + finishedCount; return(true); } else { isLastStep = false; title = "发生错误"; return(false); } }
public override void AfterExecute(int operatorUserID, string param, bool success, int totalCount, int finishedCount, out string title) { if (success) { title = "删除附件成功,共删除 " + finishedCount + " 个附件"; AttachmentFilter filter = AttachmentFilter.Parse(param); AuthUser operatorUser = UserBO.Instance.GetAuthUser(operatorUserID); Logs.LogManager.LogOperation( new Topic_DeleteAttachmentBySearch(operatorUserID, operatorUser.Name, operatorUser.LastVisitIP, filter, finishedCount) ); } else { title = "删除附件失败"; } }
public override bool BeforeExecute(int operatorUserID, string param, ref long offset, ref int totalCount, out string title) { AttachmentFilter filter = AttachmentFilter.Parse(param); AuthUser operatorUser = UserBO.Instance.GetAuthUser(operatorUserID); int tempTotalCount; AttachmentCollection attachments = PostBOV5.Instance.GetAttachments(operatorUser, filter, 1, out tempTotalCount); if (attachments == null || attachments.Count == 0) { title = "没有数据可以删除"; return(false); } totalCount = tempTotalCount; title = "将删除 " + totalCount + " 个附件"; return(true); }