键2个函数
函数名称1:新房
dim 项目名称 as string =args(0)
dim wb as stringbuilder
wb.AppendLine("<div class='house-wrap k'>")
wb.AppendLine("<div class='house-pic'>")
wb.AppendLine("<img src='/New house/" & 项目名称 & "/" & 项目名称 & "x" & ".jpg' alt='" & 项目名称 & "'>")
wb.AppendLine("</div>")
wb.AppendLine("</div>")
return wb.tostring
函数名称2:二手房
dim 房产编号 as string =args(0)
dim 小区名称 as string =args(1)
dim 楼层 as string =args(2)
dim wb as stringbuilder
wb.AppendLine("<div class='house-wrap k'>")
wb.AppendLine("<a class='house pr hor-view box' href='fyxx.htm?khbh=" & khbh & "&id=" & 房产编号& "' sap-expo='true'>")
wb.AppendLine("<div class='house-info'>")
wb.AppendLine("<p class='house-name line-clamp-1'>" & 小区名称 & " " & 楼层 & "</p>")
wb.AppendLine("</a>")
wb.AppendLine("</div>")
return wb.tostring
调用
For Each r2 As DataRow In dt.DataRows
Dim r3 As DataRow = DataTables("新房信息").SQLFind("房产编号 = '" & r2("房产编号") & "'")
If r3 IsNot Nothing Then '''新房
wb.Append(Functions.Execute("新房",r3("项目名称")))
Else '''二手房
Dim r As DataRow = DataTables("房产信息").SQLFind("房产编号 = '" & r2("房产编号") & "'")
If r IsNot Nothing Then
wb.Append(Functions.Execute("二手房",r("房产编号"),r("小区名称"),r("楼层")))
End If
End If
Next