Ejemplo n.º 1
0
        public void SendType(Tdms_Admin taAdmin, Tdms_Info daInfo, Tdms_Winservice item)
        {
            Vnet_Reginfo daVinfo = new Vnet_Reginfo();

            if (!daVinfo.SelectByPK(taAdmin.NodeId))
            {
                return;
            }
            //TODO:接入消息中心,此方法屏蔽掉,直接新建一个类似的方法
            //装饰者
            NotifyAdmin notify = new NotifyAdmin();

            //装饰EMail发送功能
            notify           = EMailNotify.New(notify);
            notify.Address   = taAdmin.Email;
            notify.RunResult = item.RunResult;
            notify.Content   = string.Format("[{0}]{2}监控到{1}条非法数据。", daInfo.Title, item.RunResult, DateTime.Now.ToString("MM月dd日"));

            if ((taAdmin.SendType & SqlSendType.短信) == SqlSendType.短信)
            {
                if ((taAdmin.IsSend == SqlIsSend.发送) ||
                    (DateTime.Now.Hour >= 8))
                {
                    //装饰短信发送功能
                    notify         = SMSNotify.New(notify);
                    notify.Address = daVinfo.Mobileno;
                }
            }
            notify.Send();
        }
Ejemplo n.º 2
0
        public override void Deliver(string description)
        {
            EmailNotify emailNotify = new EmailNotify();

            emailNotify.Notify(description);
            SMSNotify smsNotify = new SMSNotify();

            smsNotify.Notify(description);
        }
Ejemplo n.º 3
0
 public void Remove(PhoneMessage message)
 {
     messages.Remove(message);
     SMSNotify?.Invoke($"Message from {message.UserContact.GetContact()} was deleted");
     ShowPhoneMessages();
 }
Ejemplo n.º 4
0
 public void AddMessage(PhoneMessage message)
 {
     messages.Add(message);
     SMSNotify?.Invoke($"New message has been received from {message.UserContact.GetContact()}");
     ShowPhoneMessages();
 }