Exemplo n.º 1
0
        /// <summary>
        /// 提交 消息推送
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            int flag = operate.InsertMessage(this.txtMessageTitle.Text, this.txtMessage.Text, currentUser.Name);

            if (flag > 0)
            {
                Dictionary <string, object> extra = new Dictionary <string, object>();
                extra.Add("mid", flag);
                //极光推送消息
                var obj = JPush.SendPushJiGuang(this.txtMessageTitle.Text, this.txtMessage.Text, 0, extra, null);
                if (obj != null)
                {
                    this.txtMessageTitle.Text = "";
                    this.txtMessage.Text      = "";
                    PageContext.RegisterStartupScript(ActiveWindow.GetHideRefreshReference());
                    Alert.ShowInParent("推送成功");
                }
                else
                {
                    Alert.ShowInParent("推送失败");
                }
            }
            else
            {
                Alert.ShowInParent("保存失败");
            }
        }