Example #1
0
        /// <summary>
        /// 插入之后执行的方法.
        /// </summary>
        protected override void afterInsert()
        {
            try
            {
                CCInterface.PortalInterfaceSoapClient soap = null;
                if (this.HisEmailSta == MsgSta.UnRun)
                {
                    /*发送邮件*/
                    //soap = BP.WF.Glo.GetPortalInterfaceSoapClient();
                    //soap.SendToEmail(this.MyPK, WebUser.No, this.SendToEmpNo, this.Email, this.Title, this.DocOfEmail);
                    SendEmailNow(this.Email, this.Title, this.DocOfEmail);
                    return;
                }

                if (this.HisMobileSta == MsgSta.UnRun)
                {
                    string tag = "@MsgFlag=" + this.MsgFlag + "@MsgType=" + this.MsgType + this.AtPara + "@Sender=" + this.Sender + "@SenderName=" + BP.Web.WebUser.Name;
                    switch (BP.WF.Glo.ShortMessageWriteTo)
                    {
                    case BP.WF.ShortMessageWriteTo.ToSMSTable:     //写入消息表。
                        break;

                    case BP.WF.ShortMessageWriteTo.ToWebservices:     // 写入webservices.
                        soap = BP.WF.Glo.GetPortalInterfaceSoapClient();

                        soap.SendToWebServices(this.MyPK, WebUser.No, this.SendToEmpNo, this.Mobile, this.MobileInfo, tag, this.Title, this.OpenURL);
                        //soap.SendToWebServices(this.MyPK, WebUser.No, this.SendToEmpNo, "17699430990", this.MobileInfo, tag, this.Title, this.OpenURL);


                        break;

                    case BP.WF.ShortMessageWriteTo.ToDingDing:     // 写入dingding.
                        soap = BP.WF.Glo.GetPortalInterfaceSoapClient();
                        soap.SendToDingDing(this.MyPK, WebUser.No, this.SendToEmpNo, this.Mobile, this.MobileInfo);
                        break;

                    case BP.WF.ShortMessageWriteTo.ToWeiXin:     // 写入微信.
                        soap = BP.WF.Glo.GetPortalInterfaceSoapClient();
                        soap.SendToWeiXin(this.MyPK, WebUser.No, this.SendToEmpNo, this.Mobile, this.MobileInfo);
                        break;

                    case BP.WF.ShortMessageWriteTo.CCIM:     // 写入即时通讯系统.
                        soap = BP.WF.Glo.GetPortalInterfaceSoapClient();
                        soap.SendToCCIM(this.MyPK, WebUser.No, this.SendToEmpNo, this.MobileInfo, tag);
                        break;

                    default:
                        break;
                    }
                }
            }
            catch (Exception ex)
            {
                BP.DA.Log.DebugWriteError("@消息机制没有配置成功." + ex.Message);
            }
            base.afterInsert();
        }
Example #2
0
        /// <summary>
        /// 插入之后执行的方法.
        /// </summary>
        protected override void afterInsert()
        {
            try
            {
                CCInterface.PortalInterfaceSoapClient soap = null;
                if (this.HisEmailSta == MsgSta.UnRun)
                {
                    /*发送邮件*/
                    //soap = BP.WF.Glo.GetPortalInterfaceSoapClient();
                    //soap.SendToEmail(this.MyPK, WebUser.No, this.SendToEmpNo, this.Email, this.Title, this.DocOfEmail);
                    if (DataType.IsNullOrEmpty(this.Email) == true)
                    {
                        return;
                    }

                    string emailStrs = this.Email;
                    emailStrs = emailStrs.Replace(",", ";");
                    emailStrs = emailStrs.Replace(",", ";");

                    //包含多个邮箱
                    if (emailStrs.Contains(";") == true)
                    {
                        string[] emails = emailStrs.Split(';');
                        foreach (string email in emails)
                        {
                            if (DataType.IsNullOrEmpty(email) == true)
                            {
                                continue;
                            }

                            SendEmailNow(email, this.Title, this.DocOfEmail);
                        }
                    }
                    else
                    {   //单个邮箱
                        SendEmailNow(this.Email, this.Title, this.DocOfEmail);
                    }
                    return;
                }

                if (this.HisMobileSta == MsgSta.UnRun)
                {
                    string tag = "@MsgFlag=" + this.MsgFlag + "@MsgType=" + this.MsgType + this.AtPara + "@Sender=" + this.Sender + "@SenderName=" + BP.Web.WebUser.Name;
                    switch (BP.WF.Glo.ShortMessageWriteTo)
                    {
                    case BP.WF.ShortMessageWriteTo.ToSMSTable:     //写入消息表。
                        break;

                    case BP.WF.ShortMessageWriteTo.ToWebservices:     // 写入webservices.
                        soap = BP.WF.Glo.GetPortalInterfaceSoapClient();

                        soap.SendToWebServices(this.MyPK, WebUser.No, this.SendToEmpNo, this.Mobile, this.MobileInfo, tag, this.Title, this.OpenURL);
                        //soap.SendToWebServices(this.MyPK, WebUser.No, this.SendToEmpNo, "17699430990", this.MobileInfo, tag, this.Title, this.OpenURL);


                        break;

                    case BP.WF.ShortMessageWriteTo.ToDingDing:     // 写入dingding.
                        soap = BP.WF.Glo.GetPortalInterfaceSoapClient();
                        soap.SendToDingDing(this.MyPK, WebUser.No, this.SendToEmpNo, this.Mobile, this.MobileInfo);
                        break;

                    case BP.WF.ShortMessageWriteTo.ToWeiXin:     // 写入微信.
                        soap = BP.WF.Glo.GetPortalInterfaceSoapClient();
                        soap.SendToWeiXin(this.MyPK, WebUser.No, this.SendToEmpNo, this.Mobile, this.MobileInfo);
                        break;

                    case BP.WF.ShortMessageWriteTo.CCIM:     // 写入即时通讯系统.
                        soap = BP.WF.Glo.GetPortalInterfaceSoapClient();
                        soap.SendToCCIM(this.MyPK, WebUser.No, this.SendToEmpNo, this.MobileInfo, tag);
                        break;

                    default:
                        break;
                    }
                }
            }
            catch (Exception ex)
            {
                BP.DA.Log.DebugWriteError("@消息机制没有配置成功." + ex.Message);
            }
            base.afterInsert();
        }