public int Insert(CompanyModel.Reply model) { StringBuilder strSql = new StringBuilder(); strSql.Append("insert into Reply("); strSql.Append("keys,contents,createtime,type,resid,searchtype,title)"); strSql.Append(" values ("); strSql.Append("@keys,@contents,@createtime,@type,@resid,@searchtype,@title)"); strSql.Append(";select @@IDENTITY"); return(DBHelper.ExecuteSql(strSql.ToString(), model)); }
public int Update(CompanyModel.Reply model) { StringBuilder strSql = new StringBuilder(); strSql.Append("update Reply set "); strSql.Append("keys=@keys,"); strSql.Append("contents=@contents,"); strSql.Append("createtime=@createtime,"); strSql.Append("type=@type,"); strSql.Append("searchtype=@searchtype,"); strSql.Append("title=@title,"); strSql.Append("resid=@resid"); strSql.Append(" where id=@id"); return(DBHelper.ExecuteSql(strSql.ToString(), model)); }