Untitled

mail@pastecode.io avatar
unknown
plain_text
3 years ago
5.1 kB
4
Indexable
Never
strFilter = "INSERT INTO tblBuyoutsRetained (GMID, NomFamille, Prenom, NomComplet, ContractType, Equipe, EquipeTo, PlayerPosition, [Year1], [Year2], [Year3], [Year4], [Year5], [Year6], [Year7], [Year8], [Year9], [Year10], [Year11], [Year12], [Year13], [Year14], [Year15], [Year16], [Replaced]) "
                strFilter = strFilter & "VALUES (@GMID, @NomFamille, @Prenom, @NomComplet, @ContractType, @Equipe, @EquipeTo, @PlayerPosition, @Year1, @Year2, @Year3, @Year4, @Year5, @Year6, @Year7, @Year8, @Year9, @Year10, @Year11, @Year12, @Year13, @Year14, @Year15, @Year16, @Replaced)"
                cmd = New OleDbCommand(strFilter, Con)

                cmd.Parameters.AddWithValue("@GMID", PlayerID)
                cmd.Parameters.AddWithValue("@NomFamille", DS.Tables(0).Rows(0)("NomFamille").ToString)
                cmd.Parameters.AddWithValue("@Prenom", DS.Tables(0).Rows(0)("Prenom").ToString)
                cmd.Parameters.AddWithValue("@NomComplet", DS.Tables(0).Rows(0)("FullName").ToString)
                cmd.Parameters.AddWithValue("@ContractType", "Buyout")
                cmd.Parameters.AddWithValue("@Equipe", MainTeam)
                cmd.Parameters.AddWithValue("@EquipeTo", "NA")
                cmd.Parameters.AddWithValue("@PlayerPosition", DS.Tables(0).Rows(0)("PlayerPosition").ToString)

                If BuyoutDuration >= 1 Then
                    cmd.Parameters.AddWithValue("@Year1", BuyoutAmount)
                Else
                    cmd.Parameters.AddWithValue("@Year1", 0)
                End If
                If BuyoutDuration >= 2 Then
                    cmd.Parameters.AddWithValue("@Year2", BuyoutAmount)
                Else
                    cmd.Parameters.AddWithValue("@Year2", 0)
                End If
                If BuyoutDuration >= 3 Then
                    cmd.Parameters.AddWithValue("@Year3", BuyoutAmount)
                Else
                    cmd.Parameters.AddWithValue("@Year3", 0)
                End If
                If BuyoutDuration >= 4 Then
                    cmd.Parameters.AddWithValue("@Year4", BuyoutAmount)
                Else
                    cmd.Parameters.AddWithValue("@Year4", 0)
                End If
                If BuyoutDuration >= 5 Then
                    cmd.Parameters.AddWithValue("@Year5", BuyoutAmount)
                Else
                    cmd.Parameters.AddWithValue("@Year5", 0)
                End If
                If BuyoutDuration >= 6 Then
                    cmd.Parameters.AddWithValue("@Year6", BuyoutAmount)
                Else
                    cmd.Parameters.AddWithValue("@Year6", 0)
                End If
                If BuyoutDuration >= 7 Then
                    cmd.Parameters.AddWithValue("@Year7", BuyoutAmount)
                Else
                    cmd.Parameters.AddWithValue("@Year7", 0)
                End If
                If BuyoutDuration >= 8 Then
                    cmd.Parameters.AddWithValue("@Year8", BuyoutAmount)
                Else
                    cmd.Parameters.AddWithValue("@Year8", 0)
                End If
                If BuyoutDuration >= 9 Then
                    cmd.Parameters.AddWithValue("@Year9", BuyoutAmount)
                Else
                    cmd.Parameters.AddWithValue("@Year9", 0)
                End If
                If BuyoutDuration >= 10 Then
                    cmd.Parameters.AddWithValue("@Year10", BuyoutAmount)
                Else
                    cmd.Parameters.AddWithValue("@Year10", 0)
                End If
                If BuyoutDuration >= 11 Then
                    cmd.Parameters.AddWithValue("@Year11", BuyoutAmount)
                Else
                    cmd.Parameters.AddWithValue("@Year11", 0)
                End If
                If BuyoutDuration >= 12 Then
                    cmd.Parameters.AddWithValue("@Year12", BuyoutAmount)
                Else
                    cmd.Parameters.AddWithValue("@Year12", 0)
                End If
                If BuyoutDuration >= 13 Then
                    cmd.Parameters.AddWithValue("@Year13", BuyoutAmount)
                Else
                    cmd.Parameters.AddWithValue("@Year13", 0)
                End If
                If BuyoutDuration >= 14 Then
                    cmd.Parameters.AddWithValue("@Year14", BuyoutAmount)
                Else
                    cmd.Parameters.AddWithValue("@Year14", 0)
                End If
                If BuyoutDuration >= 15 Then
                    cmd.Parameters.AddWithValue("@Year15", BuyoutAmount)
                Else
                    cmd.Parameters.AddWithValue("@Year15", 0)
                End If
                If BuyoutDuration >= 16 Then
                    cmd.Parameters.AddWithValue("@Year16", BuyoutAmount)
                Else
                    cmd.Parameters.AddWithValue("@Year16", 0)
                End If

                cmd.Parameters.AddWithValue("@Replaced", False)

                cmd.ExecuteNonQuery()