Imports System.Data
Imports AppVariable

Partial Class StudentKarte
    Inherits System.Web.UI.Page

#Region "************************* 定数 *************************"

    Private Const SESSION_TAB_SELECTED As String = "COM_KARTE_TAB_SELECTED" '選択中のタブ

#End Region

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

    Protected Sub FRM学生基礎_ItemCommand(ByVal sender As Object, ByVal e As FormViewCommandEventArgs) Handles FRM学生基礎.ItemCommand
        If String.Equals(e.CommandName, "cmd_tab") Then
            '選択されたタブをセッションに保持
            Session(SESSION_TAB_SELECTED) = e.CommandArgument

            ChangeTab(CType(e.CommandArgument, String))
        End If
    End Sub

    Protected Sub FRM学生基礎_DataBound(ByVal sender As Object, ByVal e As System.EventArgs) Handles FRM学生基礎.DataBound
        Dim row As FormViewRow = FRM学生基礎.Row

        If row.RowType = DataControlRowType.DataRow Then
            'フォーマットを設定
            Dim strControl As String = ""
            Dim strValue As String = ""

            strControl = "学生_郵便"
            strValue = CType(FRM学生基礎.FindControl(strControl), Label).Text
            If strValue.Length = 7 Then
                CType(FRM学生基礎.FindControl(strControl), Label).Text = strValue.Substring(0, 3) + "-" + strValue.Substring(3, 4)
            End If

            strControl = "学費_郵便"
            strValue = CType(FRM学生基礎.FindControl(strControl), Label).Text
            If strValue.Length = 7 Then
                CType(FRM学生基礎.FindControl(strControl), Label).Text = strValue.Substring(0, 3) + "-" + strValue.Substring(3, 4)
            End If

            strControl = "学費_請求先"
            If CType(FRM学生基礎.FindControl(strControl), Label).Text <> "本人" Then
                strControl = "学費_注記_ラベル"
                CType(FRM学生基礎.FindControl(strControl), Label).Visible = False
            End If

            If Not IsNothing(Session(SESSION_TAB_SELECTED)) Then
                '【要注意】
                'ポートフォリオのサムネイルリストのページ指定がどうしても上手くいかない為、
                '別途JavaScriptを直接実行
                'If Session(SESSION_TAB_SELECTED) <> "ポートフォリオ" Then
                'セッションに保持されたタブを選択
                ChangeTab(Session(SESSION_TAB_SELECTED))
                'End If
            End If
        End If
    End Sub

    Protected Sub lv面談_DataBound(sender As Object, e As EventArgs)
        '追加ボタンに確認ダイアログをハンドル
        CType(CType(FRM学生基礎.FindControl("lv面談"), ListView).InsertItem.FindControl("btn追加"), Button).Attributes("onclick") = "return confirm(""追加してもよろしいですか？"")"

        'マスタ一覧の行数分、ループ処理
        For Each lv As ListViewItem In CType(FRM学生基礎.FindControl("lv面談"), ListView).Items
            If (Not lv.FindControl("btn更新") Is Nothing) Then
                '更新ボタンに確認ダイアログをハンドル
                CType(lv.FindControl("btn更新"), Button).Attributes("onclick") = "return confirm(""更新してもよろしいですか？"")"
            End If

            If (Not lv.FindControl("btn削除") Is Nothing) Then
                '削除ボタンに確認ダイアログをハンドル
                CType(lv.FindControl("btn削除"), Button).Attributes("onclick") = "return confirm(""削除してもよろしいですか？"")"
            End If
        Next
    End Sub

    Protected Sub lv面談_ItemDataBound(ByVal sender As Object, ByVal e As ListViewItemEventArgs)
        If (Not e.Item.FindControl("ddl面談_特記種別") Is Nothing) AndAlso (Not e.Item.FindControl("hf面談_特記種別") Is Nothing) Then
            CType(e.Item.FindControl("ddl面談_特記種別"), DropDownList).SelectedValue = CType(e.Item.FindControl("hf面談_特記種別"), HiddenField).Value
        End If
        If (Not e.Item.FindControl("ddl面談_特記CD") Is Nothing) AndAlso (Not e.Item.FindControl("hf面談_特記CD") Is Nothing) Then
            CType(e.Item.FindControl("ddl面談_特記CD"), DropDownList).SelectedValue = CType(e.Item.FindControl("hf面談_特記CD"), HiddenField).Value
        End If

        If (Not e.Item.FindControl("ddl面談_特記CD") Is Nothing) AndAlso (Not e.Item.FindControl("ddl面談_特記種別") Is Nothing) Then
            Dim dts As New DataSet()
            Dim ddl As New DropDownList()

            dts = GetDataSet特記(CType(e.Item.FindControl("ddl面談_特記種別"), DropDownList).SelectedValue)

            ddl = CType(e.Item.FindControl("ddl面談_特記CD"), DropDownList)
            ddl.DataSource = dts.Tables(0)
            ddl.DataValueField = dts.Tables(0).Columns(0).ColumnName.ToString
            ddl.DataTextField = dts.Tables(0).Columns(1).ColumnName.ToString
            ddl.DataBind()
        End If
    End Sub

    Protected Sub lv面談_ItemCommand(ByVal sender As Object, ByVal e As ListViewCommandEventArgs)
        Dim lblエラーメッセージ As Label = CType(FRM学生基礎.FindControl("lblエラーメッセージ_面談"), Label)
        lblエラーメッセージ.Text = ""

        If String.Equals(e.CommandName, "cmd_insert") Then
            '****************************** 登録 ******************************
            '値を取得
            Dim str学籍NO As String = Session(S_COM_Selected_Gakuseki_No)
            Dim str日付 As String = CType(e.Item.FindControl("txt面談_日付"), TextBox).Text
            Dim str特記種別 As String = CType(e.Item.FindControl("ddl面談_特記種別"), DropDownList).SelectedValue
            Dim str特記CD As String = CType(e.Item.FindControl("ddl面談_特記CD"), DropDownList).SelectedValue
            Dim str備考 As String = CType(e.Item.FindControl("txt面談_備考"), TextBox).Text
            Dim str登録者CD As String = Session(S_COM_UserCD)

            '入力チェック
            '・必須チェック
            If "".Equals(str日付) Then
                lblエラーメッセージ.Text = "日付を入力してください。"
                Exit Sub
            End If

            If "".Equals(str特記種別) Then
                lblエラーメッセージ.Text = "大分類を入力してください。"
                Exit Sub
            End If

            If "".Equals(str特記CD) Then
                lblエラーメッセージ.Text = "小分類を入力してください。"
                Exit Sub
            End If

            '・形式チェック
            Try
                Dim dateWork As Date = Date.Parse(str日付)
            Catch ex As Exception
                lblエラーメッセージ.Text = "日付が正しくありません。"
                Exit Sub
            End Try

            '・桁数チェック
            If System.Text.Encoding.GetEncoding("Shift_JIS").GetByteCount(str備考) > 500 Then
                lblエラーメッセージ.Text = "備考の入力が多すぎます。"
                Exit Sub
            End If

            '・重複チェック
            For Each lv As ListViewItem In CType(FRM学生基礎.FindControl("lv面談"), ListView).Items()
                Dim lblKEY_日付 As Label = CType(lv.FindControl("lbl面談_日付"), Label)
                Dim lblKEY_特記種別 As Label = CType(lv.FindControl("lbl面談_特記種別"), Label)
                Dim hfKEY_特記CD As HiddenField = CType(lv.FindControl("hf面談_特記CD"), HiddenField)

                If (Not lblKEY_日付 Is Nothing) And _
                        (Not lblKEY_特記種別 Is Nothing) And _
                        (Not hfKEY_特記CD Is Nothing) Then
                    If (lblKEY_日付.Text = str日付) And _
                            (lblKEY_特記種別.Text = str特記種別) And _
                            (hfKEY_特記CD.Value = str特記CD) Then
                        lblエラーメッセージ.Text = "日付、大分類、小分類が同じです。"
                        Exit Sub
                    End If
                End If
            Next

            '登録
            Using spm As New StoredProcedureManager("SPMendan_INSERT")
                Try
                    spm.AddPrmIn("@学籍NO", Data.SqlDbType.VarChar, str学籍NO)
                    spm.AddPrmIn("@日付", Data.SqlDbType.DateTime, str日付)
                    spm.AddPrmIn("@特記種別", Data.SqlDbType.VarChar, str特記種別)
                    spm.AddPrmIn("@特記CD", Data.SqlDbType.VarChar, str特記CD)
                    spm.AddPrmIn("@備考", Data.SqlDbType.VarChar, str備考)
                    spm.Exec()
                Catch ex As Exception
                    lblエラーメッセージ.Text = "登録処理でエラーが発生しました。"
                    Exit Sub
                End Try
            End Using

            '再表示
            DataBind_sql面談()
        ElseIf String.Equals(e.CommandName, "cmd_update") Then
            '****************************** 更新 ******************************
            '値を取得
            Dim strKEY_学籍NO As String = Session(S_COM_Selected_Gakuseki_No)
            Dim strKEY_日付 As String = CType(e.Item.FindControl("hf面談_日付"), HiddenField).Value
            Dim strKEY_特記種別 As String = CType(e.Item.FindControl("hf面談_特記種別"), HiddenField).Value
            Dim strKEY_特記CD As String = CType(e.Item.FindControl("hf面談_特記CD"), HiddenField).Value
            '--
            Dim str日付 As String = CType(e.Item.FindControl("txt面談_日付"), TextBox).Text
            Dim str特記種別 As String = CType(e.Item.FindControl("ddl面談_特記種別"), DropDownList).SelectedValue
            Dim str特記CD As String = CType(e.Item.FindControl("ddl面談_特記CD"), DropDownList).SelectedValue
            Dim str備考 As String = CType(e.Item.FindControl("txt面談_備考"), TextBox).Text
            Dim str更新者CD As String = Session(S_COM_UserCD)

            '入力チェック
            '・必須チェック
            If "".Equals(str日付) Then
                lblエラーメッセージ.Text = "日付を入力してください。"
                Exit Sub
            End If

            If "".Equals(str特記種別) Then
                lblエラーメッセージ.Text = "大分類を入力してください。"
                Exit Sub
            End If

            If "".Equals(str特記CD) Then
                lblエラーメッセージ.Text = "小分類を入力してください。"
                Exit Sub
            End If

            '・形式チェック
            Try
                Dim dateWork As Date = Date.Parse(str日付)
            Catch ex As Exception
                lblエラーメッセージ.Text = "日付が正しくありません。"
                Exit Sub
            End Try

            '・桁数チェック
            If System.Text.Encoding.GetEncoding("Shift_JIS").GetByteCount(str備考) > 500 Then
                lblエラーメッセージ.Text = "備考の入力が多すぎます。"
                Exit Sub
            End If

            '・重複チェック
            For Each lv As ListViewItem In CType(FRM学生基礎.FindControl("lv面談"), ListView).Items()
                Dim lblKEY_日付 As Label = CType(lv.FindControl("lbl面談_日付"), Label)
                Dim lblKEY_特記種別 As Label = CType(lv.FindControl("lbl面談_特記種別"), Label)
                Dim hfKEY_特記CD As HiddenField = CType(lv.FindControl("hf面談_特記CD"), HiddenField)

                If (Not lblKEY_日付 Is Nothing) And _
                        (Not lblKEY_特記種別 Is Nothing) And _
                        (Not hfKEY_特記CD Is Nothing) Then
                    If (lblKEY_日付.Text = str日付) And _
                            (lblKEY_特記種別.Text = str特記種別) And _
                            (hfKEY_特記CD.Value = str特記CD) Then
                        lblエラーメッセージ.Text = "日付、大分類、小分類が同じです。"
                        Exit Sub
                    End If
                End If
            Next

            '更新
            Using spm As New StoredProcedureManager("SPMendan_UPDATE")
                Try
                    spm.AddPrmIn("@KEY_学籍NO", Data.SqlDbType.VarChar, strKEY_学籍NO)
                    spm.AddPrmIn("@KEY_日付", Data.SqlDbType.DateTime, strKEY_日付)
                    spm.AddPrmIn("@KEY_特記種別", Data.SqlDbType.VarChar, strKEY_特記種別)
                    spm.AddPrmIn("@KEY_特記CD", Data.SqlDbType.VarChar, strKEY_特記CD)
                    spm.AddPrmIn("@日付", Data.SqlDbType.DateTime, str日付)
                    spm.AddPrmIn("@特記種別", Data.SqlDbType.VarChar, str特記種別)
                    spm.AddPrmIn("@特記CD", Data.SqlDbType.VarChar, str特記CD)
                    spm.AddPrmIn("@備考", Data.SqlDbType.VarChar, str備考)
                    spm.Exec()
                Catch ex As Exception
                    lblエラーメッセージ.Text = "更新処理でエラーが発生しました。"
                    Exit Sub
                End Try
            End Using

            '再表示
            CType(FRM学生基礎.FindControl("lv面談"), ListView).EditIndex = -1 '編集モードを取り消し
            DataBind_sql面談()
        ElseIf String.Equals(e.CommandName, "cmd_delete") Then
            '****************************** 削除 ******************************
            '削除
            Using spm As New StoredProcedureManager("SPMendan_DELETE")
                Try
                    spm.AddPrmIn("@KEY_学籍NO", Data.SqlDbType.VarChar, Session(S_COM_Selected_Gakuseki_No))
                    spm.AddPrmIn("@KEY_日付", Data.SqlDbType.DateTime, CType(e.Item.FindControl("lbl面談_日付"), Label).Text)
                    spm.AddPrmIn("@KEY_特記種別", Data.SqlDbType.VarChar, CType(e.Item.FindControl("lbl面談_特記種別"), Label).Text)
                    spm.AddPrmIn("@KEY_特記CD", Data.SqlDbType.VarChar, CType(e.Item.FindControl("hf面談_特記CD"), HiddenField).Value)
                    spm.Exec()
                Catch ex As Exception
                    lblエラーメッセージ.Text = "削除処理でエラーが発生しました。"
                    Exit Sub
                End Try
            End Using

            '再表示
            DataBind_sql面談()
        ElseIf String.Equals(e.CommandName, "Edit") Then
            '****************************** 編集 ******************************
            '再表示
            DataBind_sql面談()
        ElseIf String.Equals(e.CommandName, "Cancel") Then
            '****************************** 取消 ******************************
            '再表示
            DataBind_sql面談()
        End If
    End Sub

    Protected Sub ddl面談_特記種別_SelectedIndexChanged_INSERT(ByVal sender As Object, ByVal e As System.EventArgs)
        Dim dts As New DataSet()
        Dim ddl特記 As New DropDownList()

        dts = GetDataSet特記(sender.SelectedValue)

        ddl特記 = CType(CType(FRM学生基礎.FindControl("lv面談"), ListView).InsertItem.FindControl("ddl面談_特記CD"), DropDownList)

        ddl特記.Items.Clear()
        ddl特記.DataSource = dts.Tables(0)
        ddl特記.DataValueField = dts.Tables(0).Columns(0).ColumnName.ToString
        ddl特記.DataTextField = dts.Tables(0).Columns(1).ColumnName.ToString
        ddl特記.DataBind()

        ddl特記.Items.Insert(0, "")
    End Sub

    Protected Sub ddl面談_特記種別_SelectedIndexChanged_UPDATE(ByVal sender As Object, ByVal e As System.EventArgs)
        Dim dts As New DataSet()
        Dim ddl特記種別 As New DropDownList()
        Dim ddl特記 As New DropDownList()

        dts = GetDataSet特記(sender.SelectedValue)

        '一覧の行数分、ループ処理
        For Each lv As ListViewItem In CType(FRM学生基礎.FindControl("lv面談"), ListView).Items()
            ddl特記種別 = CType(lv.FindControl("ddl面談_特記種別"), DropDownList)
            If (Not ddl特記種別 Is Nothing) Then
                If CType(sender, DropDownList).ID = ddl特記種別.ID Then
                    ddl特記 = CType(lv.FindControl("ddl面談_特記CD"), DropDownList)

                    ddl特記.Items.Clear()
                    ddl特記.DataSource = dts.Tables(0)
                    ddl特記.DataValueField = dts.Tables(0).Columns(0).ColumnName.ToString
                    ddl特記.DataTextField = dts.Tables(0).Columns(1).ColumnName.ToString
                    ddl特記.DataBind()

                    ddl特記.Items.Insert(0, "")
                End If
            End If
        Next
    End Sub

    Protected Sub sql_dd_特記種別_Init(sender As Object, e As EventArgs) Handles sql_dd_特記種別.Init
        sql_dd_特記種別_select()
    End Sub

    Protected Sub grd年次_PageIndexChanging(ByVal sender As Object, ByVal e As GridViewPageEventArgs)
        CType(sender, GridView).PageIndex = e.NewPageIndex
        DataBind_sql年次()
    End Sub

    Protected Sub grd異動_PageIndexChanging(ByVal sender As Object, ByVal e As GridViewPageEventArgs)
        CType(sender, GridView).PageIndex = e.NewPageIndex
        DataBind_sql異動()
    End Sub

    Protected Sub grd履修状況_前期_時間外_PageIndexChanging(ByVal sender As Object, ByVal e As GridViewPageEventArgs)
        CType(sender, GridView).PageIndex = e.NewPageIndex
        DataBind_sql履修状況_前期_時間外()
    End Sub

    Protected Sub grd履修状況_後期_時間外_PageIndexChanging(ByVal sender As Object, ByVal e As GridViewPageEventArgs)
        CType(sender, GridView).PageIndex = e.NewPageIndex
        DataBind_sql履修状況_後期_時間外()
    End Sub

    Protected Sub grd成績状況_PageIndexChanging(ByVal sender As Object, ByVal e As GridViewPageEventArgs)
        CType(sender, GridView).PageIndex = e.NewPageIndex
        DataBind_sql成績状況()
    End Sub

    Protected Sub grd出欠状況_PageIndexChanging(ByVal sender As Object, ByVal e As GridViewPageEventArgs)
        CType(sender, GridView).PageIndex = e.NewPageIndex
        DataBind_sql出欠状況()
    End Sub

    Protected Sub grd就職活動_PageIndexChanging(ByVal sender As Object, ByVal e As GridViewPageEventArgs)
        CType(sender, GridView).PageIndex = e.NewPageIndex
        DataBind_sql就職活動()
    End Sub

#End Region

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

    Private Sub ChangeTab(ByVal strArg As String)
        CType(Me.FRM学生基礎.FindControl("pnl学生情報"), Panel).Visible = False
        CType(Me.FRM学生基礎.FindControl("pnl学費支払者"), Panel).Visible = False
        CType(Me.FRM学生基礎.FindControl("pnl入学前情報"), Panel).Visible = False
        CType(Me.FRM学生基礎.FindControl("pnl在籍記録"), Panel).Visible = False
        CType(Me.FRM学生基礎.FindControl("pnl履修状況"), Panel).Visible = False
        CType(Me.FRM学生基礎.FindControl("pnl成績状況"), Panel).Visible = False
        CType(Me.FRM学生基礎.FindControl("pnl出欠状況"), Panel).Visible = False
        CType(Me.FRM学生基礎.FindControl("pnl就職活動"), Panel).Visible = False
        'CType(Me.FRM学生基礎.FindControl("pnlポートフォリオ"), Panel).Visible = False
        CType(Me.FRM学生基礎.FindControl("pnl在籍後情報"), Panel).Visible = False

        CType(Me.FRM学生基礎.FindControl("lb学生情報"), LinkButton).CssClass = "tab tab-color1"
        CType(Me.FRM学生基礎.FindControl("lb学費支払者"), LinkButton).CssClass = "tab tab-color1"
        CType(Me.FRM学生基礎.FindControl("lb入学前情報"), LinkButton).CssClass = "tab tab-color1"
        CType(Me.FRM学生基礎.FindControl("lb在籍記録"), LinkButton).CssClass = "tab tab-color2"
        CType(Me.FRM学生基礎.FindControl("lb履修状況"), LinkButton).CssClass = "tab tab-color2"
        CType(Me.FRM学生基礎.FindControl("lb成績状況"), LinkButton).CssClass = "tab tab-color2"
        CType(Me.FRM学生基礎.FindControl("lb出欠状況"), LinkButton).CssClass = "tab tab-color2"
        CType(Me.FRM学生基礎.FindControl("lb就職活動"), LinkButton).CssClass = "tab tab-color2"
        'CType(Me.FRM学生基礎.FindControl("lbポートフォリオ"), LinkButton).CssClass = "tab tab-color2"
        CType(Me.FRM学生基礎.FindControl("lb在籍後情報"), LinkButton).CssClass = "tab tab-color3"

        If Not "".Equals(strArg) Then
            CType(Me.FRM学生基礎.FindControl("pnl" & strArg), Panel).Visible = True
            CType(Me.FRM学生基礎.FindControl("lb" & strArg), LinkButton).CssClass = _
            CType(Me.FRM学生基礎.FindControl("lb" & strArg), LinkButton).CssClass & "-current"
        End If

        'パフォーマンスを考慮し、タブごとにデータを取得
        If strArg = "在籍記録" Then
            DataBind_sql年次()
            DataBind_sql異動()
            DataBind_sql面談()
        ElseIf strArg = "履修状況" Then
            DataBind_sql履修状況_前期()
            DataBind_sql履修状況_前期_時間外()
            DataBind_sql履修状況_後期()
            DataBind_sql履修状況_後期_時間外()
        ElseIf strArg = "成績状況" Then
            DataBind_sql成績状況()
        ElseIf strArg = "出欠状況" Then
            DataBind_sql出欠状況()
        ElseIf strArg = "就職活動" Then
            DataBind_sql就職活動()
            'ElseIf strArg = "ポートフォリオ" Then
            '    Session(S_UC_PORTFOLIO_LIST_KEY) = Session(S_COM_Selected_Gakuseki_No)
            '    Session(S_UC_LESSON_STUDENT_NO) = Session(S_COM_Selected_Gakuseki_No)
            '
            '    'ポートフォリオ入力画面のユーザコントロールuc_InfoStudentで必要
            '    Session(S_UC_STUDENT_NO) = Session(S_COM_Selected_Gakuseki_No)
            '
            '    'この画面に戻ってくるために必要
            '    If Session(S_COM_PortalKbn) = "教員" Then
            '        Session(S_Portfolio_Prev_Page_Url) = "kyo_01_01"
            '    Else
            '        Session(S_Portfolio_Prev_Page_Url) = "syo_01_01"
            '    End If
            '
            '    CType(Me.FRM学生基礎.FindControl("pnlポートフォリオ").FindControl("uc_ThumnailList"), uc_ThumnailList).CreateList()
            '    CType(Me.FRM学生基礎.FindControl("pnlポートフォリオ").FindControl("uc_ThumnailList"), uc_ThumnailList).SetCurrentPage()
        End If
    End Sub

    Private Sub sql_dd_特記種別_select()
        Dim sds As SqlDataSource = sql_dd_特記種別
        WebControlsUtil.DeclareSP(sds, "共通_カスタム_DDL")
        With sds
            .SelectParameters.Add("TABLE", DbType.String, "VW_CD特記")
            .SelectParameters.Add("GROUPBY", DbType.String, "特記種別")
            .SelectParameters.Add("ORDERBY", DbType.String, "特記種別")
            .SelectParameters.Add("DESC", DbType.String, "")
        End With
    End Sub

    Private Function GetDataSet特記(ByVal str特記種別 As String) As DataSet
        Using spm As New StoredProcedureManager("SPCMB特記")
            spm.AddPrmIn("@特記種別", Data.SqlDbType.VarChar, 20, str特記種別)
            spm.Fill()

            Return spm.ds
        End Using
    End Function

    Private Sub DataBind_sql年次()
        Dim sds As SqlDataSource = sql年次
        WebControlsUtil.DeclareSP(sds, "SPNenzi")
        With sds
            .SelectParameters.Add("学籍NO", DbType.String, Session(S_COM_Selected_Gakuseki_No))
        End With
    End Sub

    Private Sub DataBind_sql異動()
        Dim sds As SqlDataSource = sql異動
        WebControlsUtil.DeclareSP(sds, "SPIdou")
        With sds
            .SelectParameters.Add("学籍NO", DbType.String, Session(S_COM_Selected_Gakuseki_No))
        End With
    End Sub

    Private Sub DataBind_sql面談()
        Dim sds As SqlDataSource = sql面談
        WebControlsUtil.DeclareSP(sds, "SPMendan")
        With sds
            .SelectParameters.Add("学籍NO", DbType.String, Session(S_COM_Selected_Gakuseki_No))
        End With
    End Sub

    Private Sub DataBind_sql履修状況_前期()
        Dim sds As SqlDataSource = sql履修状況_前期
        WebControlsUtil.DeclareSP(sds, "SPTimeTable")
        With sds
            .SelectParameters.Add("学籍NO", DbType.String, Session(S_COM_Selected_Gakuseki_No))
            .SelectParameters.Add("期間", DbType.String, "前期")
        End With
    End Sub

    Private Sub DataBind_sql履修状況_前期_時間外()
        Dim sds As SqlDataSource = sql履修状況_前期_時間外
        WebControlsUtil.DeclareSP(sds, "時間割_履修_時間割外_SELECT")
        With sds
            .SelectParameters.Add("期間", DbType.String, "前期")
            .SelectParameters.Add("USERCD", DbType.String, Session(S_COM_Selected_Gakuseki_No))
        End With
    End Sub

    Private Sub DataBind_sql履修状況_後期()
        Dim sds As SqlDataSource = sql履修状況_後期
        WebControlsUtil.DeclareSP(sds, "SPTimeTable")
        With sds
            .SelectParameters.Add("学籍NO", DbType.String, Session(S_COM_Selected_Gakuseki_No))
            .SelectParameters.Add("期間", DbType.String, "後期")
        End With
    End Sub

    Private Sub DataBind_sql履修状況_後期_時間外()
        Dim sds As SqlDataSource = sql履修状況_後期_時間外
        WebControlsUtil.DeclareSP(sds, "時間割_履修_時間割外_SELECT")
        With sds
            .SelectParameters.Add("期間", DbType.String, "後期")
            .SelectParameters.Add("USERCD", DbType.String, Session(S_COM_Selected_Gakuseki_No))
        End With
    End Sub

    Private Sub DataBind_sql成績状況()
        Dim sds As SqlDataSource = sql成績状況
        WebControlsUtil.DeclareSP(sds, "SPRishu")
        With sds
            .SelectParameters.Add("学籍NO", DbType.String, Session(S_COM_Selected_Gakuseki_No))
        End With
    End Sub

    Private Sub DataBind_sql出欠状況()
        Dim sds As SqlDataSource = sql出欠状況
        WebControlsUtil.DeclareSP(sds, "SPShukketu")
        With sds
            .SelectParameters.Add("学籍NO", DbType.String, Session(S_COM_Selected_Gakuseki_No))
        End With
    End Sub

    Private Sub DataBind_sql就職活動()
        Dim sds As SqlDataSource = sql就職活動
        WebControlsUtil.DeclareSP(sds, "SPShushoku")
        With sds
            .SelectParameters.Add("学籍NO", DbType.String, Session(S_COM_Selected_Gakuseki_No))
        End With
    End Sub

    '【要注意】
    'ポートフォリオのサムネイルリストのページ指定がどうしても上手くいかない為、
    '生成されるJavaScriptを直接実行
    'Protected Function IsChangeTabPortfolio() As String
    '    If Not IsPostBack AndAlso Session(SESSION_TAB_SELECTED) = "ポートフォリオ" Then
    '        Session("ポートフォリオの検索条件を復元") = "1"    '※どうしてもうまくいかない為
    '        Return "1"
    '    End If
    '
    '    Return "0"
    'End Function

#End Region

End Class
