Exemplo n.º 1
0
 /// <summary>
 /// 给聊天工具发送提示信息
 /// </summary>
 /// <param name="systemName">系统名称</param>
 /// <param name="modelName">模块名称</param>
 /// <param name="uri">模块地址(一般不需要填写(输入null))</param>
 /// <param name="data">与模块相关的数据(没有不填(输入null))</param>
 /// <param name="accounts">要提醒的人员帐户(多人以逗号分隔)</param>
 /// <param name="message">提醒的信息</param>
 /// <param name="type">消息显示类型(0:不启动管理平台,1:启动管理平台)</param>
 /// <returns></returns>
 public static bool SendMessage(string systemName, string modelName, string uri, object data, string accounts, string message, int type, string msgID)
 {
     string[] tem = new string[7];
     tem[0] = systemName;
     tem[1] = modelName;
     tem[2] = uri;
     tem[3] = data + "";
     tem[4] = accounts;
     tem[5] = type + "";
     tem[6] = string.Format(message);
     return(MsgSenderHelper.SendApprove(msgID, accounts, tem));
 }
Exemplo n.º 2
0
        private static void MessageInform(string message)
        {
            string    Path    = Application.StartupPath + @"\TargetList.xml";
            XDocument doc     = XDocument.Load(Path);
            var       feilian = doc.Descendants("FeiLian").First();
            string    modelName;
            string    account;
            string    flMessage;

            try
            {
                modelName = "服务检测";
                account   = feilian.Element("Accounts").Value;//工号 分隔用;
                flMessage = message + "\r\n" + feilian.Element("InformMessage").Value;
            }
            catch
            {
                log.WriteLog("飞联配置读取失败");
                return;
            }
            try
            {
                //检查多受众
                if (account.Contains(";"))
                {
                    string[] accounts = account.Split(';');
                    foreach (var ac in accounts)
                    {
                        MsgSenderHelper.SendPersonnelMsg(modelName, ac, message);
                        log.WriteLog("{0}飞联消息发送成功", ac);
                    }
                }
                else
                {
                    MsgSenderHelper.SendPersonnelMsg(modelName, account, message);
                    log.WriteLog("{0}飞联消息发送成功", account);
                }
            }
            catch (Exception ex)
            {
                log.WriteLog(ex.ToString());
                log.WriteLog("飞联消息发送失败");
            }
        }
Exemplo n.º 3
0
        /// <summary>
        /// 线程池待执行发送消息函数。
        /// </summary>
        /// <param name="arg">待发送消息。</param>
        static void SendMessageAction(object arg)
        {
            Message message = arg as Message;

            if (message == null)
            {
                return;
            }

            MsgSenderHelper.SendApprove(message.MsgId, message.Accounts, new[]
            {
                message.SystemName,
                message.ModuleName,
                message.Uri,
                message.Args,
                message.Accounts,
                message.IsNeedStartMuerpUI ? "1"  : "0",
                message.Content
            });
        }