-
Notifications
You must be signed in to change notification settings - Fork 36
/
frmChangeDummyCharacter.vb
52 lines (36 loc) · 1.65 KB
/
frmChangeDummyCharacter.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
Imports System.Data.SQLite
Public Class frmChangeDummyCharacter
Private Sub btnSave_Click(sender As Object, e As EventArgs) Handles btnSave.Click
Call SaveName()
End Sub
Private Sub btnClose_Click(sender As Object, e As EventArgs) Handles btnClose.Click
Me.Close()
End Sub
Private Sub frmChangeDummyCharacter_Shown(sender As Object, e As EventArgs) Handles Me.Shown
Dim rsData As SQLiteDataReader
DBCommand = New SQLiteCommand("SELECT CHARACTER_NAME FROM ESI_CHARACTER_DATA WHERE CHARACTER_ID = " & CStr(DummyCharacterID), EVEDB.DBREf)
rsData = DBCommand.ExecuteReader
rsData.Read()
lblCurrentName.Text = rsData.GetString(0)
rsData.Close()
Call txtName.Focus()
End Sub
Private Sub SaveName()
If Trim(txtName.Text) = "" Then
MsgBox("You cannot enter a blank name.", vbInformation, Application.ProductName)
Exit Sub
End If
' Just save what they enter and put a asterisk on the end to singify it's a dummy account
Try
Call EVEDB.ExecuteNonQuerySQL("UPDATE ESI_CHARACTER_DATA SET CHARACTER_NAME = '" & FormatDBString(Trim(txtName.Text)) & "*' WHERE CHARACTER_ID = " & CStr(DummyCharacterID))
MsgBox("Dummy Character Name updated.", vbInformation, Application.ProductName)
Catch ex As Exception
MsgBox("Could not save name. Error: " & ex.Message)
End Try
End Sub
Private Sub txtName_KeyDown(sender As Object, e As KeyEventArgs) Handles txtName.KeyDown
If e.KeyCode = Keys.Enter Then
Call SaveName()
End If
End Sub
End Class