forked from EVEIPH/EVE-IPH
-
Notifications
You must be signed in to change notification settings - Fork 0
/
frmCharacterStandings.vb
98 lines (72 loc) · 3.29 KB
/
frmCharacterStandings.vb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
Imports System.Data.SQLite
Public Class frmCharacterStandings
Public Sub New()
' This call is required by the designer.
InitializeComponent()
' Add any initialization after the InitializeComponent() call.
lstStandings.Columns.Add("NPC Type", 75, HorizontalAlignment.Left)
lstStandings.Columns.Add("NPC Name", 184, HorizontalAlignment.Left)
lstStandings.Columns.Add("Standing", 70, HorizontalAlignment.Right)
End Sub
Private Sub btnClose_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnClose.Click
Me.Hide()
End Sub
' Load the skills
Private Sub frmCharacterStandings_Shown(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Shown
Me.Refresh()
Application.DoEvents()
lblCharacterName.Text = SelectedCharacter.Name
Call LoadStandings()
End Sub
Private Sub LoadStandings()
Dim SQL As String
Dim readerStandings As SQLiteDataReader
Dim lstViewRow As ListViewItem
SQL = "SELECT NPC_TYPE, NPC_NAME, STANDING FROM CHARACTER_STANDINGS "
SQL = SQL & "WHERE CHARACTER_ID = " & SelectedCharacter.ID & " "
If rbtnNegative.Checked Then
SQL = SQL & "AND STANDING < 0 "
ElseIf rbtnPostive.Checked Then
SQL = SQL & "AND STANDING >= 0 "
End If
If rbtnSortName.Checked Then
SQL = SQL & "ORDER BY NPC_TYPE DESC, NPC_NAME"
ElseIf rbtnSortStanding.Checked Then
SQL = SQL & "ORDER BY NPC_TYPE DESC, STANDING DESC"
End If
DBCommand = New SQLiteCommand(SQL, EVEDB.DBREf)
readerStandings = DBCommand.ExecuteReader
If readerStandings.HasRows Then
lstStandings.BeginUpdate()
lstStandings.Items.Clear()
While readerStandings.Read
Application.DoEvents()
lstViewRow = New ListViewItem(readerStandings.GetString(0))
'The remaining columns are subitems
lstViewRow.SubItems.Add(readerStandings.GetString(1))
lstViewRow.SubItems.Add(FormatNumber(readerStandings.GetDouble(2), 2))
Call lstStandings.Items.Add(lstViewRow)
End While
lstStandings.EndUpdate()
End If
readerStandings.Close()
readerStandings = Nothing
DBCommand = Nothing
End Sub
Private Sub rbtnPostive_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles rbtnPostive.CheckedChanged
Call LoadStandings()
End Sub
Private Sub rbtnNegative_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles rbtnNegative.CheckedChanged
Call LoadStandings()
End Sub
Private Sub rbtnBoth_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles rbtnBoth.CheckedChanged
Call LoadStandings()
End Sub
Private Sub rbtnSortName_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles rbtnSortName.CheckedChanged
Call LoadStandings()
End Sub
Private Sub rbtnSortStanding_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles rbtnSortStanding.CheckedChanged
Call LoadStandings()
End Sub
End Class