public void Update(Model.CMS.Tag entity) { entity.LastTime = DateTime.Now; using (IDbConnection conn = SqlString.GetSqlConnection()) { conn.Execute("UPDATE cms_tag SET TagName=@TagName,TagDes=@TagDes,LastTime=@LastTime WHERE Tag_Id =@Tag_Id", entity); } }
public bool Insert(Model.CMS.Tag entity) { entity.LastTime = DateTime.Now; using (IDbConnection conn = SqlString.GetSqlConnection()) { int i = conn.Execute("INSERT INTO cms_tag(TagName,TagDes,LastTime,CreateTime)" + "VALUES(@TagName,@TagDes,@LastTime,@CreateTime)", entity); if (i > 0) { return(true); } else { return(false); } } }