Example #1
0
        private void makeLog(AdminValue av)
        {
            List <ForumTopic> topics = GetByIds(av.Ids);

            foreach (ForumTopic topic in topics)
            {
                logService.AddTopic(av.User, av.AppId, topic.Id, av.ActionId, av.Reason, av.Ip);

                // 发送短信通知
                if (!av.IsSendMsg)
                {
                    continue;
                }

                String msg   = ForumLogAction.GetLable(av.ActionId);
                String title = string.Format(alang.get(typeof(ForumApp), "adminPostMsgTitle"), topic.Title, msg);

                String topicInfo = "<a href='" + alink.ToAppData(topic) + "'>" + topic.Title + "</a>";
                if (av.ActionId == ForumLogAction.Delete)
                {
                    topicInfo = topic.Title;
                }

                String body = string.Format(alang.get(typeof(ForumApp), "adminPostMsgBody"), topicInfo, msg, DateTime.Now, av.Reason);

                msgService.SiteSend(title, body, topic.Creator);
            }
        }
Example #2
0
        private void log(String idList, int actionId)
        {
            String reason = getReason();

            List <ForumTopic> topics = topicService.GetByIds(idList);

            foreach (ForumTopic topic in topics)
            {
                logService.AddTopic((User)ctx.viewer.obj, ctx.app.Id, topic.Id, actionId, reason, ctx.Ip);

                // 发送短信通知
                if (ctx.PostIsCheck("IsSendMsg") != 1)
                {
                    continue;
                }

                String msg   = ForumLogAction.GetLable(actionId);
                String title = string.Format(alang("adminPostMsgTitle"), topic.Title, msg);

                String topicInfo = "<a href='" + alink.ToAppData(topic) + "'>" + topic.Title + "</a>";
                if (actionId == ForumLogAction.Delete)
                {
                    topicInfo = topic.Title;
                }

                String body = string.Format(alang("adminPostMsgBody"), topicInfo, msg, DateTime.Now, reason);

                msgService.SiteSend(title, body, topic.Creator);
            }
        }