public void Add(DdJyjlbModel model) { StringBuilder strSql = new StringBuilder(); strSql.Append("insert into dd_jyjlb("); strSql.Append("ddbh,jyjlbh,zffs,jyje,sfzfcg)"); strSql.Append(" values ("); strSql.Append("@ddbh,@jyjlbh,@zffs,@jyje,@sfzfcg)"); using (IDbConnection conn = new DapperConnection().DbConnection) { conn.Execute(strSql.ToString(), model); } }
public void Update(DdJyjlbModel model) { StringBuilder strSql = new StringBuilder(); strSql.Append("update dd_jyjlb set "); strSql.Append("ddbh=@ddbh,"); strSql.Append("jyjlbh=@jyjlbh,"); strSql.Append("zffs=@zffs,"); strSql.Append("sfzfcg=@sfzfcg"); strSql.Append(" where id=@id"); using (IDbConnection conn = new DapperConnection().DbConnection) { conn.Execute(strSql.ToString(), model); } }