Skip to content

Commit

Permalink
Fixed to TCG+ Output file
Browse files Browse the repository at this point in the history
- Removed extra space from header
- Fixed (undiscovered) error with opening staff list with 0 players loaded
- Fixes #32 : Penalty details will now be retained on edit. Also enlarged the font of the penalty details entry. Will now set a suggested penalty at the base (but can still be upgrade or downgraded.)
- Fixes #25 : Will now check incoming file for duplicates in non-guest Membership Numbers as Needed.
- Added shortcut to listbox for adding a player to the tournament.
  • Loading branch information
retched committed Apr 7, 2023
1 parent 9c475a8 commit 8c376ff
Show file tree
Hide file tree
Showing 10 changed files with 238 additions and 244 deletions.
2 changes: 1 addition & 1 deletion TCG+ Registration Helper/PlayerInfo.vb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

Public Property SearchHelper As String
Get
Return LastName & ", " & FirstName & ", " & MembershipName
Return (LastName & " " & FirstName & " " & MembershipName).Trim
End Get
Set(value As String)

Expand Down
273 changes: 142 additions & 131 deletions TCG+ Registration Helper/Registration - Individual.Designer.vb

Large diffs are not rendered by default.

84 changes: 0 additions & 84 deletions TCG+ Registration Helper/Registration - Individual.resx
Original file line number Diff line number Diff line change
Expand Up @@ -135,54 +135,6 @@
<metadata name="Panel1.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="Label5.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="Label4.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="txtPlayerNickname.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="Label3.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="txtPlayerLastName.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="Label2.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="txtPlayerFirstName.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="Label1.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="txtMemberNo.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="btnClear.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="btnAddPlayer.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="cboStatus.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="Label6.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="Panel1.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="rbByes_1.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="rbByes_0.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="rbByes_1.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
Expand Down Expand Up @@ -225,30 +177,6 @@
<metadata name="Panel2.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="btnSearchPlayer.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="txtSearchPlayer.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="lbSearchResults.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="btnShowAll.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="Panel2.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="rbMembershipID.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="rbPlayerName.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="rbMemberName.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="rbMembershipID.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
Expand Down Expand Up @@ -300,18 +228,6 @@
<metadata name="btnChangeChecked.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="btnAddFromFile.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="btnDeletePlayer.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="cboChangeStatus.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="btnChangeChecked.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="StatusStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>240, 17</value>
</metadata>
Expand Down
72 changes: 66 additions & 6 deletions TCG+ Registration Helper/Registration - Individual.vb
Original file line number Diff line number Diff line change
Expand Up @@ -633,7 +633,7 @@ Public Class frmIndividual
txtCSVFileName = FileName

Using csvDoc As IO.StreamWriter = My.Computer.FileSystem.OpenTextFileWriter(FileName, False)
csvDoc.WriteLine("""Team ID"",""Team Name"",""Win Point"",""Status"",""Bye Count"",""Membership Number - 1"",""Player Name - 1"",""Seat Order - 1"",""Memo"",""Deck Recipe - 1"", ""SMS Auth""")
csvDoc.WriteLine("""Team ID"",""Team Name"",""Win Point"",""Status"",""Bye Count"",""Membership Number - 1"",""Player Name - 1"",""Seat Order - 1"",""Memo"",""Deck Recipe - 1"",""SMS Auth""")
csvDoc.WriteLine("""Required
Please set the value to 0 for new registrations."",""Optional
Required for team competitions only"",""Uneditable
Expand Down Expand Up @@ -698,7 +698,7 @@ No change in value will have any effect."",""Required
Dim FileName As String = SaveFileDialogCSV.FileName

Using csvDoc As IO.StreamWriter = My.Computer.FileSystem.OpenTextFileWriter(FileName, False)
csvDoc.WriteLine("""Team ID"",""Team Name"",""Win Point"",""Status"",""Bye Count"",""Membership Number - 1"",""Player Name - 1"",""Seat Order - 1"",""Memo"", ""Deck Recipe - 1"", ""SMS Auth""")
csvDoc.WriteLine("""Team ID"",""Team Name"",""Win Point"",""Status"",""Bye Count"",""Membership Number - 1"",""Player Name - 1"",""Seat Order - 1"",""Memo"", ""Deck Recipe - 1"",""SMS Auth""")
csvDoc.WriteLine("""Required
Please set the value to 0 for new registrations."",""Optional
Required for team competitions only"",""Uneditable
Expand Down Expand Up @@ -803,7 +803,8 @@ No change in value will have any effect."",""Required""")
New XElement("PlayerFirstName", team.PlayerA.FirstName),
New XElement("PlayerLastName", team.PlayerA.LastName),
New XElement("SeatOrder", "A"),
New XElement("DeckRecipe", team.PlayerA.DeckRecipe)))))
New XElement("DeckRecipe", team.PlayerA.DeckRecipe),
New XElement("SMSAuth", team.SMSAuth)))))
Next
'tournament.Add(playerNode)

Expand Down Expand Up @@ -891,7 +892,8 @@ No change in value will have any effect."",""Required""")
New XElement("PlayerFirstName", team.PlayerA.FirstName),
New XElement("PlayerLastName", team.PlayerA.LastName),
New XElement("SeatOrder", "A"),
New XElement("DeckRecipe", team.PlayerA.DeckRecipe)))))
New XElement("DeckRecipe", team.PlayerA.DeckRecipe),
New XElement("SMSAuth", team.SMSAuth)))))
Next
'tournament.Add(playerNode)

Expand Down Expand Up @@ -1063,13 +1065,22 @@ No change in value will have any effect."",""Required""")
' status of that player with the incoming file.

For Each player In lstFileData
Dim index As Integer = lstTournTeams.IndexOf(lstTournTeams.Find(Function(p) p.PlayerA.MembershipNumber = player.PlayerA.MembershipNumber And p.TeamID = player.TeamID))
Dim index As Integer = lstTournTeams.IndexOf(lstTournTeams.Find(Function(p) p.PlayerA.MembershipNumber = player.PlayerA.MembershipNumber And p.TeamID = player.TeamID And p.PlayerA.MembershipNumber <> "GUEST99999"))

Dim altIndex As Integer = lstTournTeams.IndexOf(lstTournTeams.Find(Function(p) p.PlayerA.MembershipNumber = player.PlayerA.MembershipNumber And p.TeamID = player.TeamID And p.PlayerA.MembershipNumber <> "GUEST99999"))

Dim teamIDSearch As Integer = lstTournTeams.IndexOf(lstTournTeams.Find(Function(p) p.TeamID = player.TeamID And p.TeamID <> "0"))

If index <> -1 Then
If lstTournTeams(index).Status < player.Status Then
lstTournTeams(index).Status = player.Status
lstTournTeams(index).TeamID = player.TeamID
End If

ElseIf altIndex <> -1 And (player.PlayerA.MembershipNumber <> "GUEST99999" Or player.PlayerA.MembershipNumber <> "0000000986") Then
lstTournTeams(altIndex).TeamID = player.TeamID
lstTournTeams(altIndex).Status = player.Status

Else
lstTournTeams.Add(player)
End If
Expand All @@ -1093,13 +1104,22 @@ No change in value will have any effect."",""Required""")
' status of that player with the incoming file.

For Each player In lstFileData
Dim index As Integer = lstTournTeams.IndexOf(lstTournTeams.Find(Function(p) p.PlayerA.MembershipNumber = player.PlayerA.MembershipNumber And p.TeamID = player.TeamID))
Dim index As Integer = lstTournTeams.IndexOf(lstTournTeams.Find(Function(p) p.PlayerA.MembershipNumber = player.PlayerA.MembershipNumber And p.TeamID = player.TeamID And p.PlayerA.MembershipNumber <> "GUEST99999"))

Dim altIndex As Integer = lstTournTeams.IndexOf(lstTournTeams.Find(Function(p) p.PlayerA.MembershipNumber = player.PlayerA.MembershipNumber And p.TeamID = player.TeamID And p.PlayerA.MembershipNumber <> "GUEST99999"))

Dim teamIDSearch As Integer = lstTournTeams.IndexOf(lstTournTeams.Find(Function(p) p.TeamID = player.TeamID And p.TeamID <> "0"))

If index <> -1 Then
If lstTournTeams(index).Status < player.Status Then
lstTournTeams(index).Status = player.Status
lstTournTeams(index).TeamID = player.TeamID
End If

ElseIf altIndex <> -1 And (player.PlayerA.MembershipNumber <> "GUEST99999" Or player.PlayerA.MembershipNumber <> "0000000986") Then
lstTournTeams(altIndex).TeamID = player.TeamID
lstTournTeams(altIndex).Status = player.Status

Else
lstTournTeams.Add(player)
End If
Expand Down Expand Up @@ -1315,4 +1335,44 @@ No change in value will have any effect."",""Required""")
' Rebuild the list after the change.
'BuildTournamentList()
End Sub

Private Sub ToolStripMenuItem3_Click(sender As Object, e As EventArgs) Handles ToolStripMenuItem3.Click
' This should add the selected player on to the current tournament roster

' See if the player is already on the tournament list.
Dim intListSearch As Integer = lstTournTeams.IndexOf(lstTournTeams.Find(Function(p) p.PlayerA.MembershipNumber = lbSearchResults.SelectedItem.MembershipNumber.ToString))

If intListSearch <> -1 Then
Dim rowIndex As Integer = -1

lstTournTeams(intListSearch).Status = 10

Dim row As DataGridViewRow = dgvPlayers.Rows.Cast(Of DataGridViewRow)().Where(Function(r) r.Cells("dgcMembershipNo").Value.ToString().Equals(lbSearchResults.SelectedItem.MembershipNumber.ToString)).First()

dgvPlayers.Rows(row.Index).Cells("dgcStatus").Value = _status(10)
Else

lstTournTeams.Add(New TournamentTeam() With {
.PlayerA = New PlayerInfo() With {
.FirstName = lstPlayers.Find(Function(x) x.MembershipNumber = lbSearchResults.SelectedValue).FirstName,
.LastName = lstPlayers.Find(Function(x) x.MembershipNumber = lbSearchResults.SelectedValue).LastName,
.MembershipName = lstPlayers.Find(Function(x) x.MembershipNumber = lbSearchResults.SelectedValue).MembershipName,
.MembershipNumber = lstPlayers.Find(Function(x) x.MembershipNumber = lbSearchResults.SelectedValue).MembershipNumber,
.SeatOrder = "A"},
.PlayerB = New PlayerInfo(),
.PlayerC = New PlayerInfo(),
.ByeRounds = 0,
.Status = 10,
.TeamID = 0
})

BuildTournamentList()

End If

dgvPlayers.CurrentRow.Cells("dgcStatus").Value = _status(10)

' Rebuild the list after the change.
'BuildTournamentList()
End Sub
End Class
3 changes: 2 additions & 1 deletion TCG+ Registration Helper/Staff List.vb
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,8 @@
cboStaffPosition.SelectedValue = staffInfo.StaffPosition
End If
Else
cboStaffMember.SelectedIndex = 0

If lstPlayers.Count <> 0 Then cboStaffMember.SelectedIndex = 0


End If
Expand Down
12 changes: 6 additions & 6 deletions TCG+ Registration Helper/StatusDictionary.vb
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
{3, "Waiting list"},
{4, "Unsuccessful"},
{5, "Cancelled"},
{6, "Selected + Checked In"},
{7, "Waiting for Cancellation + Checked In"},
{8, "Absent on Day of Event"},
{9, "Advance Elected"},
{6, "Successful + Checked In"},
{7, "Waiting list + Checked In"},
{8, "Absent from the event"},
{9, "Advance Successful"},
{10, "Participating in Tournament"},
{11, "Dropped"}
}
Expand All @@ -22,7 +22,7 @@
{6, "Floor Judge"}
}

Public _infraction As Dictionary(Of Integer, String) = New Dictionary(Of Integer, String) From {
Public _infrac As New Dictionary(Of Integer, String) From {
{1, "Failing to Observe Game Rules"},
{2, "Forgetting to Resolve Automatic Actions"},
{3, "Looking at Unnecessary Cards"},
Expand Down Expand Up @@ -67,7 +67,7 @@
{19, 4},
{20, 4}
}
Public _penalty As Dictionary(Of Integer, String) = New Dictionary(Of Integer, String) From {
Public _pen As Dictionary(Of Integer, String) = New Dictionary(Of Integer, String) From {
{0, "Caution"},
{1, "Warning"},
{2, "Game Loss"},
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 12 additions & 7 deletions TCG+ Registration Helper/Tournament - Penalty Detail.vb
Original file line number Diff line number Diff line change
@@ -1,24 +1,29 @@
Public Class frmPenaltyDetail
Public Property EditMode As Boolean = False
Public Property Infraction As Integer = 0
Public Property Penalty As Integer = 0

Private Sub frmPenaltyDetail_Load(sender As Object, e As EventArgs) Handles MyBase.Load
' Assign the Infraction Types to the field
cboInfraction.DataSource = New BindingSource(_infraction, Nothing)
cboInfraction.DataSource = New BindingSource(_infrac, Nothing)
cboInfraction.DisplayMember = "Value"
cboInfraction.ValueMember = "Key"

' Assign the Penalty Types to the field
cboPenalty.DataSource = New BindingSource(_penalty, Nothing)
cboPenalty.DataSource = New BindingSource(_pen, Nothing)
cboPenalty.DisplayMember = "Value"
cboPenalty.ValueMember = "Key"

If EditMode Then
cboInfraction.SelectedValue = Infraction

cboPenalty.SelectedValue = Penalty
End If

End Sub

Private Sub cboInfraction_SelectionChangeCommitted(sender As Object, e As EventArgs) Handles cboInfraction.SelectedIndexChanged
If Not EditMode Then
cboPenalty.SelectedValue = _suggested.Item(cboInfraction.SelectedValue.Key)
Private Sub cboInfraction_SelectionChangeCommitted(sender As Object, e As EventArgs) Handles cboInfraction.SelectionChangeCommitted
cboPenalty.SelectedValue = _suggested.Item(cboInfraction.SelectedValue)

EditMode = False
End If
End Sub
End Class
Loading

0 comments on commit 8c376ff

Please sign in to comment.