public bool UpdateSeekKeyWord(SeekHotWord keyword, int id) { try { return(handler.UpdateSeekKeyWord(keyword, id)); } catch (Exception ex) { logger.Log(Level.Error, ex, "UpdateSeekKeyWord"); throw; } }
public bool IsRepeatSeekKeyWord(SeekHotWord keyword) { try { return(handler.IsRepeatSeekKeyWord(keyword)); } catch (Exception ex) { logger.Log(Level.Error, ex, "IsRepeatSeekKeyWord"); throw; } }
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); }
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); }
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); }
public bool UpdateSeekKeyWord(SeekHotWord keyword, int id) { return(dbManager.Execute(conn => DalArticle.UpdateSeekKeyWord(conn, keyword, id))); }
public bool IsRepeatSeekKeyWord(SeekHotWord keyword) { return(dbManager.Execute(conn => DalArticle.IsRepeatSeekKeyWord(conn, keyword))); }