''''######################################################################################################################################''''''' ''''################################## Advert showing function############################################################################''''''' ''''######################################################################################################################################''''''' Dim district As Integer = Request.QueryString("d") Dim county As Integer = Request.QueryString("c") Dim querstring As String = "SELECT code_ams FROM Ams_Position WHERE 1 = 1" ' First fill by district If Request.QueryString("d") <> "" Then Dim querydistrict As String = "SELECT COUNT(code_ams) As count FROM Ams_Position WHERE idDistrict =" & district & "" Dim ds As DataSet = advert(querstring) Dim count As Integer = Convert.ToInt32(ds.Tables(0).Rows(0)(0).ToString) If count < 10 Then Dim i As Integer Dim sql2 As String = querstring + " and idDistrict = " & district & "" Dim ds2 As DataSet = advert(sql2) Dim array(i) As String For i = 0 To count array(i) = Convert.ToInt32(ds2.Tables(0).Rows(i)("code_ams").ToString) Next Dim sql1 As String = querstring + " and idCountyCity = " & county & "" Dim ds1 As DataSet = advert(sql1) For i = count + 1 To 9 array(i) = Convert.ToInt32(ds1.Tables(0).Rows(i)("code_ams").ToString) Next position0.Text = array(0) position1.Text = array(1) position2.Text = array(2) position3.Text = array(3) position4.Text = array(4) position5.Text = array(5) position6.Text = array(6) position7.Text = array(7) position8.Text = array(8) position9.Text = array(9) Else Dim i As Integer Dim sql2 As String = querstring + " and idDistrict = " & district & "" Dim ds2 As DataSet = advert(sql2) Dim array(i) As String For i = 0 To 9 array(i) = ds2.Tables(0).Rows(i)("code_ams").ToString Next position0.Text = array(0) position1.Text = array(1) position2.Text = array(2) position3.Text = array(3) position4.Text = array(4) position5.Text = array(5) position6.Text = array(6) position7.Text = array(7) position8.Text = array(8) position9.Text = array(9) End If Else Dim i As Integer Dim Array(i) As String Dim sql1 As String = querstring + " and idCountyCity = " & county & "" Dim ds1 As DataSet = advert(sql1) For i = 1 To 9 Array(i) = Convert.ToInt32(ds1.Tables(0).Rows(i)("code_ams").ToString) Next position0.Text = Array(0) position1.Text = Array(1) position2.Text = Array(2) position3.Text = Array(3) position4.Text = Array(4) position5.Text = Array(5) position6.Text = Array(6) position7.Text = Array(7) position8.Text = Array(8) position9.Text = Array(9) End If ' second fill by county If Request.QueryString("c") <> "" Then Dim querycounty As String = "SELECT COUNT(code_ams) AS count FROM Ams_Position WHERE idCountyCity =" & county & "" Dim ds As DataSet = advert(querstring) Dim count As Integer = Convert.ToInt32(ds.Tables(0).Rows(0)(0).ToString) If count < 10 Then Dim i As Integer Dim sql2 As String = querstring + " and idCountyCity = " & county & "" Dim ds2 As DataSet = advert(sql2) Dim array(i) As String For i = 0 To count array(i) = Convert.ToInt32(ds2.Tables(0).Rows(i)("code_ams").ToString) Next Dim sql1 As String = querstring Dim ds1 As DataSet = advert(sql1) For i = count + 1 To 9 array(i) = Convert.ToInt32(ds1.Tables(0).Rows(i)("code_ams").ToString) Next position0.Text = array(0) position1.Text = array(1) position2.Text = array(2) position3.Text = array(3) position4.Text = array(4) position5.Text = array(5) position6.Text = array(6) position7.Text = array(7) position8.Text = array(8) position9.Text = array(9) Else Dim i As Integer Dim sql2 As String = querstring + " and idCountyCity = " & county & "" Dim ds2 As DataSet = advert(sql2) Dim array(i) As String For i = 0 To 9 array(i) = ds2.Tables(0).Rows(i)("code_ams").ToString Next position0.Text = array(0) position1.Text = array(1) position2.Text = array(2) position3.Text = array(3) position4.Text = array(4) position5.Text = array(5) position6.Text = array(6) position7.Text = array(7) position8.Text = array(8) position9.Text = array(9) End If Else Dim i As Integer Dim Array(i) As String Dim sql1 As String = querstring Dim ds1 As DataSet = advert(sql1) For i = 1 To 9 Array(i) = Convert.ToInt32(ds1.Tables(0).Rows(i)("code_ams").ToString) Next position0.Text = Array(0) position1.Text = Array(1) position2.Text = Array(2) position3.Text = Array(3) position4.Text = Array(4) position5.Text = Array(5) position6.Text = Array(6) position7.Text = Array(7) position8.Text = Array(8) position9.Text = Array(9) End If '''''''#############################################################################################################################################''''' ''''''##############################################################################################################################################'''''
本版积分规则 发表回复 回帖并转播 回帖后跳转到最后一页
QQ咨询|关于我们|Archiver|手机版|小黑屋|( 辽ICP备15012455号-4 ) Powered by 期权论坛 X3.2 © 2001-2016 期权工具网&期权论坛 Inc.
下载期权论坛手机APP