protected void BtnSubmitServer_Click(object sender, EventArgs e)
 {
     try
     {
         AdminPage.WriteSuccessMsg(SmsMessage.SendMessage(this.TxtSendNum.Text, this.TxtContent.Text, this.SendTiming.Value, this.SendTime.Value, PEContext.Current.Admin.AdminName), "SmsMessageToContacter.aspx");
     }
     catch (CustomException exception)
     {
         AdminPage.WriteErrMsg(exception.Message);
     }
 }
Пример #2
0
        public static string ChangeStateSendMessageToUser(string userName, string sendContent, string title, string state)
        {
            if (string.IsNullOrEmpty(sendContent))
            {
                return("");
            }
            string str = IsUserMobile(userName);

            if (!string.IsNullOrEmpty(str))
            {
                return(str);
            }
            string str2 = state;

            if (str2 != null)
            {
                if (!(str2 == "99"))
                {
                    if (str2 == "0")
                    {
                        state = "有待审核";
                    }
                    else if (str2 == "-1")
                    {
                        state = "草稿";
                    }
                    else if (str2 == "-2")
                    {
                        state = "退稿";
                    }
                    else if (str2 == "-3")
                    {
                        state = "删除";
                    }
                    else if (str2 == "100")
                    {
                        state = "归档";
                    }
                }
                else
                {
                    state = "审核通过";
                }
            }
            sendContent = sendContent.Replace("{$UserName}", userName);
            sendContent = sendContent.Replace("{$Title}", title);
            sendContent = sendContent.Replace("{$State}", state);
            return("<li>" + SmsMessage.SendMessage(userName, sendContent, "0", "", PEContext.Current.Admin.AdminName) + "</li>");
        }
Пример #3
0
        public override void Send()
        {
            string str = string.Empty;

            switch (this.m_SendType)
            {
            case SendType.SendToUser:
                str = "会员";
                if (string.IsNullOrEmpty(this.m_SendNum))
                {
                    ContacterInfo contacterByUserName = Contacter.GetContacterByUserName(this.m_OrderInfo.UserName);
                    this.m_SendNum = contacterByUserName.Mobile;
                    if (string.IsNullOrEmpty(this.m_SendNum))
                    {
                        this.m_SendNum = contacterByUserName.Phs;
                    }
                }
                break;

            case SendType.SendToContacter:
                str = "收货人";
                if (string.IsNullOrEmpty(this.m_SendNum))
                {
                    this.m_SendNum = this.m_OrderInfo.Mobile;
                }
                break;

            case SendType.SendToAdmin:
                str = "管理员";
                break;
            }
            if (string.IsNullOrEmpty(this.m_SendNum))
            {
                base.ErrorMsg.Append("<br>未指定接收号码,向" + str + "发送手机短信失败!");
            }
            else if (string.IsNullOrEmpty(base.MessageBody))
            {
                base.ErrorMsg.Append("<br>短信内容为空,向" + str + "发送手机短信失败!");
            }
            else
            {
                SmsMessage.SendMessage(this.m_SendNum, base.MessageBody, "0", DateTime.Now.ToString(), this.m_Reserve);
                base.SuccessMsg.Append("<br>已经向" + str + "发送了一条手机短信,通知他");
                base.SuccessMsg.Append(base.OperationMsg);
                base.SuccessMsg.Append("!");
            }
        }
Пример #4
0
 protected void BtnSubmitServer_Click(object sender, EventArgs e)
 {
     try
     {
         string successMessage = SmsMessage.SendMessage(this.TxtSendNum.Text, this.TxtContent.Text, this.SendTiming.Value, this.SendTime.Value, PEContext.Current.Admin.AdminName);
         if (!string.IsNullOrEmpty(BasePage.RequestString("CartID")))
         {
             ShoppingCart.UpdateInformState(BasePage.RequestString("CartID"), 1);
             AdminPage.WriteSuccessMsg(successMessage, "../Shop/ShoppingCartManage.aspx");
         }
         AdminPage.WriteSuccessMsg(successMessage, "SmsMessageToUser.aspx");
     }
     catch (CustomException exception)
     {
         AdminPage.WriteErrMsg(exception.Message);
     }
 }
Пример #5
0
        public static string SendMessageToUser(UserInfo userInfo, string sendContent)
        {
            if (string.IsNullOrEmpty(sendContent))
            {
                return("");
            }
            string str = IsUserMobile(userInfo.UserName);

            if (string.IsNullOrEmpty(str))
            {
                sendContent = sendContent.Replace("{$UserName}", userInfo.UserName);
                sendContent = sendContent.Replace("{$Balance}", userInfo.Balance.ToString());
                sendContent = sendContent.Replace("{$UserPoint}", userInfo.UserPoint.ToString());
                sendContent = sendContent.Replace("{$ValidDays}", GetValidNum(userInfo.EndTime));
                return("<li>" + SmsMessage.SendMessage(userInfo.UserName, sendContent, "0", "", PEContext.Current.Admin.AdminName) + "</li>");
            }
            return(str);
        }