static string Select(Person model) { StringBuilder strSql = new StringBuilder(); strSql.Append("select top 1 id,username,password,age,registerDate,address from Person "); strSql.Append(" where id=@id"); return(SqlStatementHelper.SqlBuilder(strSql.ToString(), model)); }
static string Insert(Person model) { StringBuilder strSql = new StringBuilder(); strSql.Append("insert into Person("); strSql.Append("username,password,age,registerDate,address)"); strSql.Append(" values ("); strSql.Append("@username,@password,@age,@registerDate,@address)"); return(SqlStatementHelper.SqlBuilder(strSql.ToString(), model)); }
static string Update(Person model) { StringBuilder strSql = new StringBuilder(); strSql.Append("update Person set "); strSql.Append("username=@username,"); strSql.Append("password=@password,"); strSql.Append("age=@age,"); strSql.Append("registerDate=@registerDate,"); strSql.Append("address=@address"); strSql.Append(" where id=@id"); return(SqlStatementHelper.SqlBuilder(strSql.ToString(), model)); }