Ejemplo n.º 1
0
        public bool SendToReceive(NotifyMessageModel model, out string errMsg)
        {
            bool isSuccess;

            errMsg = "";
            NotifyMessage notifyMsg;

            try
            {
                Check.IsNull(model, string.Format("消息补推MessageId【{0}】对象", model.MessageId ?? ""));
                notifyMsg = MappingHelper.From <NotifyMessage, NotifyMessageModel>(model);
                Check.IsNull(notifyMsg, string.Format("消息补推MessageId【{0}】对象", model.MessageId ?? ""));
                ReceiveServiceClient rsClient = new ReceiveServiceClient();
                rsClient.Notify(notifyMsg);
                Process.Info("消息补推", "DifferentShowBusiness.SendToReceive", (model.MessageId ?? ""), "补推成功", "");
                isSuccess = true;
                if (!string.IsNullOrWhiteSpace(model.MessageId))
                {
                    NotifyMessageBusiness notifyBus = new NotifyMessageBusiness();
                    notifyBus.Delete(model.MessageId);
                }
            }
            catch (Exception ex)
            {
                Process.Error("消息补推", "DifferentShowBusiness.SendToReceive", (model.MessageId ?? ""), "补推失败,ex:" + ex.ToString(), "");
                errMsg    = ex.GetString();
                isSuccess = false;
            }
            return(isSuccess);
        }
Ejemplo n.º 2
0
 private bool SendOrder(NotifyMessage message, out string errMsg)
 {
     try
     {
         NotifyMessageResult result = m_client.Notify(message);
         errMsg = result.ErrMsg;
         return(result.Success);
     }
     catch (Exception ex)
     {
         errMsg = "发送订单信息到消息接收中心-发送异常";
         if (m_client.State == CommunicationState.Closed ||
             m_client.State == CommunicationState.Faulted)
         {
             m_client = new ReceiveServiceClient();
         }
         Process.Error(message.MessageKey, "发送订单信息到消息接收中心", "SendOrder", message.MessageKey, string.Format("异常,ex【{0}】", ex.GetString()), "");
         return(false);
     }
 }