Beispiel #1
0
        public void Update(AdKeywordInfo entity)
        {
            using (var conn = new SqlConnection(connectString))
            {
                string sql = @"UPDATE AdKeyword SET Name = @Name, Url = @Url, OrderId = @OrderId, Remark = @Remark, Tm = @Tm
                            where Id=@Id";

                conn.Execute(sql, entity);
            }
        }
Beispiel #2
0
        public int Add(AdKeywordInfo entity)
        {
            using (var conn = new SqlConnection(connectString))
            {
                string sql = @"INSERT INTO AdKeyword( Name,Url,OrderId,Remark,Tm) VALUES(@Name,@Url,@OrderId,@Remark,@Tm);
                            select SCOPE_IDENTITY()";

                return(conn.Query <int>(sql, entity).Single());
            }
        }
Beispiel #3
0
 public static void Update(AdKeywordInfo entity)
 {
     dal.Update(entity);
     CacheHelper.Remove(cacheKey);
 }
Beispiel #4
0
 public static int Add(AdKeywordInfo entity)
 {
     entity.Id = dal.Add(entity);
     CacheHelper.Remove(cacheKey);
     return(entity.Id);
 }