protected void Push_Btn_Click(object sender, EventArgs e)
        {
            M_Mobile_PushAPI apiMod = apiBll.SelReturnModel(Convert.ToInt32(APPList_DP.SelectedValue));
            C_JPush          jpush  = new C_JPush(apiMod);
            M_Mobile_PushMsg msgMod = new M_Mobile_PushMsg();

            msgMod.MsgContent = MsgContent_T.Text.Trim();
            msgMod.MsgType    = "手动发送";
            msgMod.PushPlat   = 1;
            msgMod.PushType   = Request.Form["pushtype_rad"];
            msgMod.Result     = jpush.SendPush(msgMod).ToString();
            msgBll.Insert(msgMod);
            function.WriteSuccessMsg("发送完成", "Default.aspx");
        }
Exemple #2
0
        /// <summary>
        /// 发送推送,消息内容不能超过72个字
        /// </summary>
        public string SendPush(M_Mobile_PushMsg msgMod)
        {
            MessageResult result = new MessageResult();

            switch (msgMod.PushType)
            {
            case "sms":
                result = SendSMS(msgMod);
                break;

            case "alter":
            default:
                result = SendAlter(msgMod);
                break;
            }
            if (result.isResultOK())
            {
                return("成功");
            }
            else
            {
                return("失败,原因:" + result.ResponseResult.exceptionString);
            }
        }
Exemple #3
0
        /// <summary>
        /// 以手机短信的形式发送通知,会产生相关费用
        /// </summary>
        public MessageResult SendSMS(M_Mobile_PushMsg msgMod)
        {
            PushPayload payload = PushSendSmsMessage(msgMod.MsgContent, msgMod.MsgContent);

            return(client.SendPush(payload));
        }
Exemple #4
0
        public MessageResult SendAlter(M_Mobile_PushMsg msgMod)
        {
            PushPayload payload = PushObject_All_All_Alert(msgMod.MsgContent);

            return(client.SendPush(payload));
        }