Exemple #1
0
        /// <summary>
        /// 发送出团提醒短信
        /// </summary>
        /// <param name="model">出回团提醒短信任务实体</param>
        /// <param name="message">短信内容(未替换)</param>
        private void SendMessage(MSmsTourTimePlan model, string message)
        {
            if (model == null || string.IsNullOrEmpty(model.CompanyId) || model.Traveller == null ||
                model.Traveller.Count < 1 || string.IsNullOrEmpty(message))
            {
                return;
            }

            string smscontent = message.Replace("[线路名称]", model.RouteName).Replace("[出团时间]", model.LeaveTime.ToString("yyyy-MM-dd")).Replace("[集合方式]", model.Gather).Replace("[本团导游]", model.DaoYouName).Replace("[导游电话]", model.DaoYouTelephone);

            foreach (var t in model.Traveller)
            {
                var sendMessage = new EyouSoft.BackgroundServices.SmsApi.MSendMessage
                {
                    CompanyId = model.CompanyId,
                    Mobiles   =
                        new[] { new EyouSoft.BackgroundServices.SmsApi.MSmsNumber {
                                    Code = t.Code
                                } },
                    SendChannel  = 0,
                    SendTime     = DateTime.Now,
                    SendType     = SendType.直接发送,
                    SmsContent   = smscontent.Replace("[游客姓名]", t.Traveller),
                    UserFullName = string.Empty,                      //直接包含在内容中
                    UserId       = model.SellerId
                };

                SmsUtils.GetSmsApi().SendMessage(sendMessage);
            }
        }
Exemple #2
0
 public MSendResult SendMessage(MSendMessage message)
 {
     object[] results = this.Invoke("SendMessage", new object[] {
         message
     });
     return((MSendResult)(results[0]));
 }
Exemple #3
0
 /// <remarks/>
 public void SendMessageAsync(MSendMessage message, object userState)
 {
     if ((this.SendMessageOperationCompleted == null))
     {
         this.SendMessageOperationCompleted = new System.Threading.SendOrPostCallback(this.OnSendMessageOperationCompleted);
     }
     this.InvokeAsync("SendMessage", new object[] {
         message
     }, this.SendMessageOperationCompleted, userState);
 }
Exemple #4
0
 /// <remarks/>
 public void SendMessageAsync(MSendMessage message)
 {
     this.SendMessageAsync(message, null);
 }