Ejemplo n.º 1
0
        /// <summary>
        /// 发送手机消息
        /// </summary>
        /// <param name="tel">手机号</param>
        /// <param name="doc">手机内容</param>
        public static void SendSMS(string tel, string doc)
        {
            // 如果不启用消息机制.
            if (BP.WF.Glo.IsEnableSysMessage == false)
            {
                return;
            }

            SMS sms = new SMS();

            sms.MyPK        = DBAccess.GenerGUID();
            sms.HisMsgSta   = MsgSta.UnRun;
            sms.MsgAccepter = tel;
            sms.Title       = doc;
            sms.Sender      = BP.Web.WebUser.No;
            sms.RDT         = BP.DA.DataType.CurrentDataTime;

            sms.MsgType = 1;  // 0 邮件 1,短信。

            try
            {
                sms.Insert();
            }
            catch
            {
                sms.CheckPhysicsTable();
                sms.Insert();
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 发送邮件消息
        /// </summary>
        /// <param name="email">邮件地址</param>
        /// <param name="mailTitle">邮件标题</param>
        /// <param name="mailDoc">发送内容</param>
        /// <param name="msgFlag">标志</param>
        public static void SendEmail(string email, string mailTitle, string mailDoc, string msgFlag)
        {
            // 如果不启用消息机制.
            if (BP.WF.Glo.IsEnableSysMessage == false)
            {
                return;
            }

            SMS sms = new SMS();

            sms.CheckPhysicsTable();

            sms.MyPK      = DBAccess.GenerGUID();
            sms.HisMsgSta = MsgSta.UnRun;

            sms.MsgAccepter = email;
            sms.Title       = mailTitle;
            sms.Doc         = mailDoc;

            sms.Sender = BP.Web.WebUser.No;
            sms.RDT    = BP.DA.DataType.CurrentDataTime;

            sms.MsgFlag = msgFlag; // 消息标志.
            sms.Insert();
        }