All pastes #285904 Raw Edit

Miscellany

public text v1 · immutable
#285904 ·published 2006-12-20 03:49 UTC
rendered paste body

Partial Class scores
    Inherits System.Web.UI.Page

    Protected Sub btnSaveScores_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnSaveScores.Click

        Dim x As Integer
        Dim game_id As String
        Dim home_score As String
        Dim away_score As String
        Dim txtTeamScore As TextBox

        For x = 0 To GridView1.Rows.Count - 1
            game_id = GridView1.Rows(x).Cells(GridColumns.ID).Text
            txtTeamScore = GridView1.Rows(x).Cells(GridColumns.home_team_score).FindControl("txtHTeamScore")

            home_score = txtTeamScore.Text
            txtTeamScore = GridView1.Rows(x).Cells(GridColumns.away_team_score).FindControl("txtATeamScore")

            away_score = txtTeamScore.Text
            P5Controller.UpdateScores(game_id, home_score, away_score)
        Next   

        GridView1.DataBind()
    End Sub
    Private Enum GridColumns
        ID = 0
        game_datetime = 1
        homeTeam = 2
        awayTeam = 3
        home_team_score = 4
        away_team_score = 5
    End Enum


    Protected Sub btnHome_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnHome.Click
        Response.Redirect("games.aspx")
    End Sub
End Class