/// <summary>
        /// 发送  改成异步发送了
        /// </summary>
        /// <param name="userList"></param>
        /// <param name="message"></param>
        /// <param name="title"></param>
        /// <param name="notifyenum"></param>
        private static void Notify(NotifyContext noticontext, List<IssuedType> notifyenum)
        {
            Task.Factory.StartNew(() =>
            {
                try
                {
                    notifyenum.ForEach(p =>
                    {
                        BaseNotifier noti = null;
                        #region 实例
                        //邮件
                        if (p == IssuedType.Mail)
                        {
                            noti = new MailNotifier();
                        }
                        //App
                        if (p == IssuedType.App)
                        {
                            noti = new AppNotifier();
                        }
                        //短信
                        if (p == IssuedType.SMS)
                        {
                            noti = new SMSNotifier();
                        }
                        #endregion

                        #region 赋值发送
                        if (noti != null)
                        {
                            noti.Context = noticontext;
                            noti.Notify();


                        }
                        #endregion
                    });
                }
                catch (Exception ex) { Dao.Get().ExecuteNonQuery("insert into vinson_msg(msg) values('" + ex.Message + "')"); }
            });
        }

 

posted on 2018-05-28 16:27  vinsonLu  阅读(258)  评论(0编辑  收藏  举报