예제 #1
0
 public bool UpdateSeekKeyWord(SeekHotWord keyword, int id)
 {
     try
     {
         return(handler.UpdateSeekKeyWord(keyword, id));
     }
     catch (Exception ex)
     {
         logger.Log(Level.Error, ex, "UpdateSeekKeyWord");
         throw;
     }
 }
예제 #2
0
 public bool IsRepeatSeekKeyWord(SeekHotWord keyword)
 {
     try
     {
         return(handler.IsRepeatSeekKeyWord(keyword));
     }
     catch (Exception ex)
     {
         logger.Log(Level.Error, ex, "IsRepeatSeekKeyWord");
         throw;
     }
 }
예제 #3
0
        public static bool UpdateSeekKeyWord(SqlConnection conn, SeekHotWord model, int id)
        {
            string sql = @"UPDATE  [Marketing].[dbo].[tbl_HotWord] SET [HotWord]=@keyWord , CreateTime= GETDATE(),OnOff=@OnOff  WHERE id=@id";

            var sqlPrams = new SqlParameter[]
            {
                new SqlParameter("@keyWord", model.HotWord),
                new SqlParameter("@OnOff", model.OnOff),
                new SqlParameter("@id", id)
            };

            return(SqlHelper.ExecuteNonQuery(conn, CommandType.Text, sql, sqlPrams) > 0);
        }
예제 #4
0
        public static bool InsertSeekKeyWord(SqlConnection conn, SeekHotWord model)
        {
            string sql       = @"  INSERT INTO [Marketing].dbo.tbl_HotWord
                                      (  HotWord, CreateTime, OnOff
                                      )
                              VALUES  (
                                        @HotWord, GETDATE() ,@OnOff
                                      )";
            var    sqlPrarms = new SqlParameter[]
            {
                new SqlParameter("@HotWord", model.HotWord),
                new SqlParameter("@OnOff", model.OnOff)
            };

            return(SqlHelper.ExecuteNonQuery(conn, CommandType.Text, sql, sqlPrarms) > 0);
        }
예제 #5
0
        public static bool IsRepeatSeekKeyWord(SqlConnection conn, SeekHotWord model)
        {
            string sqlstr = @"SELECT COUNT(1) FROM [Marketing].[dbo].[tbl_HotWord] WITH (NOLOCK) WHERE [HotWord]=@HotWord AND id !=@id";

            var sqlPrams = new SqlParameter[]
            {
                new SqlParameter("@HotWord", model.HotWord),
                new SqlParameter("@id", model.id)
            };
            object obj = SqlHelper.ExecuteScalar(conn, CommandType.Text, sqlstr, sqlPrams);

            if ((int)obj > 0)
            {
                return(true);
            }
            return(false);
        }
예제 #6
0
 public bool UpdateSeekKeyWord(SeekHotWord keyword, int id)
 {
     return(dbManager.Execute(conn => DalArticle.UpdateSeekKeyWord(conn, keyword, id)));
 }
예제 #7
0
 public bool IsRepeatSeekKeyWord(SeekHotWord keyword)
 {
     return(dbManager.Execute(conn => DalArticle.IsRepeatSeekKeyWord(conn, keyword)));
 }