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;
            }
        }
Esempio n. 2
0
 public bool SaveReplyKeyInfo(ReplyKeyInfo replyKeyInfo)
 {
     System.Data.Common.DbCommand sqlStringCommand = this.database.GetSqlStringCommand("INSERT INTO Weibo_ReplyKeys (Keys,Type,Matching) VALUES(@Keys, @Type,0)");
     this.database.AddInParameter(sqlStringCommand, "Keys", System.Data.DbType.String, replyKeyInfo.Keys);
     this.database.AddInParameter(sqlStringCommand, "Type", System.Data.DbType.Int32, replyKeyInfo.Type);
     return(this.database.ExecuteNonQuery(sqlStringCommand) == 1);
 }
Esempio n. 3
0
 public bool UpdateMatching(ReplyKeyInfo replyKeyInfo)
 {
     System.Data.Common.DbCommand sqlStringCommand = this.database.GetSqlStringCommand("UPDATE Weibo_ReplyKeys SET Matching = @Matching  WHERE id = @id");
     this.database.AddInParameter(sqlStringCommand, "Matching", System.Data.DbType.Int32, replyKeyInfo.Matching);
     this.database.AddInParameter(sqlStringCommand, "id", System.Data.DbType.Int32, replyKeyInfo.Id);
     return(this.database.ExecuteNonQuery(sqlStringCommand) == 1);
 }
Esempio n. 4
0
        public bool UpdateReplyKeyInfo(ReplyKeyInfo replyKeyInfo)
        {
            DbCommand sqlStringCommand = this.database.GetSqlStringCommand("UPDATE Weibo_ReplyKeys SET Keys = @Keys  WHERE id = @id");

            this.database.AddInParameter(sqlStringCommand, "Keys", DbType.String, replyKeyInfo.Keys);
            this.database.AddInParameter(sqlStringCommand, "id", DbType.Int32, replyKeyInfo.Id);
            return(this.database.ExecuteNonQuery(sqlStringCommand) == 1);
        }
        public void reply(HttpContext context)
        {
            ReplyKeyInfo replyKeyInfo = new ReplyKeyInfo();
            string       s            = "{\"status\":\"0\"}";

            replyKeyInfo.Id       = int.Parse(context.Request["ID"]);
            replyKeyInfo.Matching = context.Request["Matching"];
            if (WeiboHelper.UpdateMatching(replyKeyInfo))
            {
                s = "{\"status\":\"1\"}";
            }
            context.Response.Write(s);
        }
Esempio n. 6
0
 public static bool SaveReplyKeyInfo(ReplyKeyInfo replyKeyInfo)
 {
     return(new ReplyDao().SaveReplyKeyInfo(replyKeyInfo));
 }
Esempio n. 7
0
 public static bool UpdateMatching(ReplyKeyInfo replyKeyInfo)
 {
     return(new ReplyDao().UpdateMatching(replyKeyInfo));
 }
Esempio n. 8
0
 public static bool UpdateReplyKeyInfo(ReplyKeyInfo replyKeyInfo)
 {
     return(new ReplyDao().UpdateReplyKeyInfo(replyKeyInfo));
 }