Imports System.Data
Imports AppCommon
Imports AppVariable
Imports AppVariable_student

Partial Class mobile_student_AttendDetailSP
    Inherits System.Web.UI.Page

#Region "******************** ページイベント ********************"
    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        
    End Sub
#End Region

#Region "***************** コントロールイベント *****************"

    Protected Sub sql_学生_Init(sender As Object, e As EventArgs) Handles sql_学生.Init
        sql_学生_select()
    End Sub

    Protected Sub sql_出席状況_Init(sender As Object, e As EventArgs) Handles sql_出席状況.Init
        sql_出席状況_select()
    End Sub

    Protected Sub btn_戻る_Click(sender As Object, e As EventArgs) Handles btn_戻る1.Click, btn_戻る2.Click
        '講座一覧ページに遷移
        Response.Redirect(Com_Get_Content("menu_km_008_mb"))
    End Sub

    Protected Sub frm_学生_DataBound(sender As Object, e As EventArgs) Handles frm_学生.DataBound

        Dim row As FormViewRow = frm_学生.Row

        If row.RowType = DataControlRowType.DataRow Then
            CType(frm_学生.FindControl("lb_履修年度"), Label).Text = Session(S_Attend_Selected_Risyu_Nendo)
            CType(frm_学生.FindControl("lb_科目CD"), Label).Text = Session(S_Attend_Selected_Kamoku_CD)
            CType(frm_学生.FindControl("lb_講座CD"), Label).Text = Session(S_Attend_Selected_Kouza_CD)
            CType(frm_学生.FindControl("lb_講座名"), Label).Text = Session(S_Attend_Selected_Kouza_Name)
            CType(frm_学生.FindControl("lb_期間"), Label).Text = Session(S_Attend_Selected_Kouza_Kikan)
        End If
    End Sub

    Protected Sub lsv_出席状況_ItemDataBound(sender As Object, e As ListViewItemEventArgs) Handles lsv_出席状況.ItemDataBound
        If e.Item.ItemType = ListViewItemType.DataItem Then
            Dim lb_色CD As Label = CType(e.Item.FindControl("lb_色CD"), Label)
            Dim lb_出欠名 As Label = CType(e.Item.FindControl("lb_出欠名"), Label)

            If lb_色CD.Text <> "" Then
                CType(e.Item.FindControl("datarow"), HtmlTableRow).BgColor = lb_色CD.Text
            ElseIf lb_出欠名.Text = "" Then
                CType(e.Item.FindControl("datarow"), HtmlTableRow).BgColor = "#F0F0F0"
            End If
        End If
    End Sub
    
#End Region

#Region "******************* Sub及びFunction ********************"

    Private Sub sql_学生_select()
        Dim sds As SqlDataSource = sql_学生
        WebControlsUtil.DeclareSP(sds, "共通_学生_個別_SELECT")
        With sds
            .SelectParameters.Add("学籍NO", Session(S_COM_UserCD))
        End With
    End Sub

    Private Sub sql_出席状況_select()
        Dim sds As SqlDataSource = sql_出席状況
        WebControlsUtil.DeclareSP(sds, "出欠_モバイル_出欠詳細_学生別_SELECT")
        With sds
            .SelectParameters.Add("学籍NO", DbType.String, Session(S_COM_UserCD))
            .SelectParameters.Add("履修年度", DbType.Int32, Session(S_Attend_Selected_Risyu_Nendo))
            .SelectParameters.Add("成績年度", DbType.Int32, Session(S_Attend_Selected_Seiseki_Nendo))
            .SelectParameters.Add("分野CD", DbType.String, Session(S_Attend_Selected_Bunya_CD))
            .SelectParameters.Add("科目CD", DbType.String, Session(S_Attend_Selected_Kamoku_CD))
            .SelectParameters.Add("講座CD", DbType.String, Session(S_Attend_Selected_Kouza_CD))
        End With
    End Sub

#End Region

    
    
    
End Class
