Public Class UpdateStatus
    Inherits System.Web.UI.Page

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        If IsPostBack Then
            ' ポストバック時
        Else
            ' 初期表示時
            Page.Header.Title = MyProperty.システムＭ.選挙コード名称 + MyConstant.管理画面タイトル

            Select Case MyProperty.システムＭ.投票制御フラグ
                Case "1"
                    Rdo1.Checked = True
                Case "2"
                    Rdo2.Checked = True
                Case "3"
                    Rdo3.Checked = True
                Case "4"
                    Rdo4.Checked = True
            End Select
        End If
    End Sub

    Protected Sub BtnUpdate_Click(sender As Object, e As EventArgs) Handles BtnUpdate.Click
        ' システムMの投票制御フラグを更新する
        Dim flag As Short = 0
        If Rdo1.Checked Then
            flag = 1
        ElseIf Rdo2.Checked Then
            flag = 2
        ElseIf Rdo3.Checked Then
            flag = 3
        ElseIf Rdo4.Checked Then
            flag = 4
        End If
        Using myDataBase As MyDataBase = New MyDataBase()
            myDataBase.UpdateシステムM投票制御フラグ(flag)
        End Using

        LblMessage.Text = MyMessage.管理者画面.更新終了
    End Sub

    Protected Sub Rdo1_CheckedChanged(sender As Object, e As EventArgs) Handles Rdo1.CheckedChanged
        If Rdo1.Checked Then
            Rdo2.Checked = False
            Rdo3.Checked = False
            Rdo4.Checked = False
        End If
    End Sub

    Protected Sub Rdo2_CheckedChanged(sender As Object, e As EventArgs) Handles Rdo2.CheckedChanged
        If Rdo2.Checked Then
            Rdo1.Checked = False
            Rdo3.Checked = False
            Rdo4.Checked = False
        End If
    End Sub

    Protected Sub Rdo3_CheckedChanged(sender As Object, e As EventArgs) Handles Rdo3.CheckedChanged
        If Rdo3.Checked Then
            Rdo1.Checked = False
            Rdo2.Checked = False
            Rdo4.Checked = False
        End If
    End Sub

    Protected Sub Rdo4_CheckedChanged(sender As Object, e As EventArgs) Handles Rdo4.CheckedChanged
        If Rdo4.Checked Then
            Rdo1.Checked = False
            Rdo2.Checked = False
            Rdo3.Checked = False
        End If
    End Sub

End Class