X-Git-Url: https://fbox.kageds.com/gitweb/NEATEST.git/blobdiff_plain/94fa2b4542b570f7a9206d1d38cbd5eb954edde4..refs/heads/master:/NEA/Store.xaml.vb diff --git a/NEA/Store.xaml.vb b/NEA/Store.xaml.vb index 754a0af..5e6b4fc 100644 --- a/NEA/Store.xaml.vb +++ b/NEA/Store.xaml.vb @@ -8,41 +8,37 @@ Public Class Store Dim dr As System.Data.DataRow Dim da As New NEADataSetTableAdapters.GamesTableAdapter Dim dt As System.Data.DataTable + Dim search As String + search = LCase(txtSearch.Text) dt = ds.Tables("Games") da.Fill(dt) For Each dr In dt.Rows - If String.Compare(dr("Name"), txtSearch.Text) = 0 Then - - - Dim Q As String = "[Name] = '" & txtSearch.Text & "'" + If String.Compare(dr("Name"), search) = 0 Then + Dim Q As String = "[Name] = '" & search & "'" Dim result() As NEADataSet.GamesRow = dt.Select(Q) - id = result(0).GameID - - GoTo LineBreak + Else + MsgBox("The game you entered is not in the database", vbExclamation) End If Next - MsgBox("The game you entered is not in the database", vbExclamation) + LineBreak: ds.Dispose() - For Each dr In dt.Rows If String.Compare(dr("GameID"), id) = 0 Then txtname.AppendText(dr.Item("Name")) - - - - + btnBuy.Content = "Buy for £" & dr.Item("Price") + lblPublisher.Content = "Publisher: " & dr.Item("Publisher") + lblRating.Content = "This game is rated " & dr.Item("Rating") & " out of 5" + lblReviews.Content = "Gamer review: " Dim bytes As [Byte]() = dr.Item("Icon") Dim ms As New MemoryStream(bytes) - Dim bi As New BitmapImage() bi.BeginInit() bi.StreamSource = ms bi.EndInit() - - imglogo.Source = bi + imgLogo.Source = bi End If Next