Beispiel #1
0
        public override void After(object returnValue, MethodInfo method, object[] args, object target)
        {
            if (method.Name == "DeleteToTrash")
            {
                ForumTopic topic = args[0] as ForumTopic;
                Microblog  mblog = Microblog.find("DataId=:id and DataType=:dtype")
                                   .set("id", topic.Id)
                                   .set("dtype", typeof(ForumTopic).FullName)
                                   .first();

                if (mblog != null)
                {
                    mblog.delete();
                }
            }

            else if (method.Name == "DeleteList")
            {
                AdminValue av = args[0] as AdminValue;
                if (strUtil.HasText(av.Ids))
                {
                    String str = "DataType='" + typeof(ForumTopic).FullName + "' and DataId in (" + av.Ids + ")";
                    Microblog.deleteBatch(str);
                }
            }
        }
        public virtual void DeleteBatch(string ids)
        {
            int[] arrIds = cvt.ToIntArray(ids);
            if (arrIds.Length == 0)
            {
                return;
            }

            Microblog.deleteBatch("id in (" + ids + ")");
        }