Esempio n. 1
0
        private void BtnKey_Click(object sender, System.EventArgs e)
        {
            if (string.IsNullOrEmpty(this.txtkey.Value.Trim()))
            {
                this.ShowMsg("关键词不能为空!", false);
                return;
            }
            ReplyKeyInfo replyKeyInfo = new ReplyKeyInfo();

            replyKeyInfo.Keys = this.txtkey.Value;
            replyKeyInfo.Type = 1;
            if (!string.IsNullOrEmpty(this.hidid.Value))
            {
                replyKeyInfo.Id = int.Parse(this.hidid.Value);
                if (WeiboHelper.UpdateReplyKeyInfo(replyKeyInfo))
                {
                    this.ShowMsg("关键词修改成功!", true);
                    this.bind();
                    return;
                }
                this.ShowMsg("关键词修改失败!", false);
                return;
            }
            else
            {
                if (WeiboHelper.SaveReplyKeyInfo(replyKeyInfo))
                {
                    this.ShowMsg("关键词添加成功!", true);
                    this.bind();
                    return;
                }
                this.ShowMsg("关键词添加失败!", false);
                return;
            }
        }