<%@ Page Language="VB" AutoEventWireup="false" CodeFile="HuntSP.aspx.vb" Inherits="mobile_recruit_HuntSP" MasterPageFile="~/mobile.master" MaintainScrollPositionOnPostback="true"  %>
<%@ Register Src="~/recruit/uc/uc_Pager.ascx" TagPrefix="uc" TagName="pager" %>

<%-- [Webフォーム]head Start --%>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<%-- [Webフォーム]head End --%>

<%-- [Webフォーム]body Start --%>
<asp:Content ID="Content2" ContentPlaceHolderID="msp_asp_cph1" runat="server">
<%-- SqlDataSource Start --%>
<asp:SqlDataSource
    ID="sql_就職活動一覧" ConnectionString="<%$ ConnectionStrings:ConStr_PT %>"
    SelectCommand="SP活動個人" SelectCommandType="StoredProcedure"
    InsertCommand="SP活動作成" InsertCommandType="StoredProcedure"
    UpdateCommand="SP活動編集" UpdateCommandType="StoredProcedure"
    DeleteCommand="SP活動削除" DeleteCommandType="StoredProcedure" runat="server"
>
    <SelectParameters>
        <asp:SessionParameter Name="学籍NO" SessionField="COM_UserCD" Type="String" />
    </SelectParameters>
    <InsertParameters>
        <asp:SessionParameter Name="学籍NO" SessionField="COM_UserCD" Type="String" />
        <asp:Parameter Name="活動年度" Type="Int16" />
        <asp:Parameter Name="企業CD" Type="String" />
        <asp:Parameter Name="拠点CD" Type="String" />
        <asp:Parameter Name="区分CD" Type="String" />
        <asp:Parameter Name="勤務CD" Type="String" />
        <asp:Parameter Name="職種CD" Type="String" />
        <asp:Parameter Name="活動日" Type="DateTime" />
        <asp:Parameter Name="採否" Type="String" />
        <asp:Parameter Name="採否日" Type="DateTime" />
    </InsertParameters>
    <UpdateParameters>
        <asp:Parameter Name="請求NO" Type="Int32" />
        <asp:Parameter Name="活動年度" Type="Int16" />
        <asp:Parameter Name="企業CD" Type="String" />
        <asp:Parameter Name="拠点CD" Type="String" />
        <asp:Parameter Name="区分CD" Type="String" />
        <asp:Parameter Name="勤務CD" Type="String" />
        <asp:Parameter Name="職種CD" Type="String" />
        <asp:Parameter Name="活動日" Type="DateTime" />
        <asp:Parameter Name="採否" Type="String" />
        <asp:Parameter Name="採否日" Type="DateTime" />
    </UpdateParameters>
    <DeleteParameters>
        <asp:Parameter Name="請求NO" Type="Int32" />
        <asp:Parameter Name="活動年度" Type="Int16" />
        <asp:Parameter Name="企業CD" Type="String" />
        <asp:Parameter Name="拠点CD" Type="String" />
        <asp:Parameter Name="区分CD" Type="String" />
    </DeleteParameters>
</asp:SqlDataSource>
    
<asp:SqlDataSource ID="sql_活動区分" runat="server" 
    ConnectionString="<%$ ConnectionStrings:ConStr_PT %>" 
    SelectCommand="SPCMB活動区分" SelectCommandType="StoredProcedure">
</asp:SqlDataSource>

<asp:SqlDataSource ID="sql_企業" runat="server"
    ConnectionString="<%$ ConnectionStrings:ConStr_PT %>" 
    SelectCommand="SPCMB活動企業" SelectCommandType="StoredProcedure">
    <SelectParameters>
        <asp:Parameter Name="企業名" Type="String" DefaultValue="" ConvertEmptyStringToNull="false" />
    </SelectParameters>
</asp:SqlDataSource>

<asp:SqlDataSource ID="sql_職種" runat="server" 
    ConnectionString="<%$ ConnectionStrings:ConStr_PT %>" 
    SelectCommand="SPCMB職種" SelectCommandType="StoredProcedure">
</asp:SqlDataSource>
    
<asp:SqlDataSource ID="sql_勤務" runat="server" 
    ConnectionString="<%$ ConnectionStrings:ConStr_PT %>" 
    SelectCommand="SPCMB勤務地" SelectCommandType="StoredProcedure">
</asp:SqlDataSource>

<asp:SqlDataSource ID="sql_採否" runat="server" 
    ConnectionString="<%$ ConnectionStrings:ConStr_PT %>" 
    SelectCommand="SPCMB採否" SelectCommandType="StoredProcedure">
</asp:SqlDataSource>
<%-- SqlDataSource End --%>
<%-- エラーメッセージ Start --%>
<div id="div_Error">
    <asp:Label ID="lbl_Error" class="error" runat="server" />
</div>
<%-- エラーメッセージ End --%>
<%-- 就職活動一覧 Start --%>
<asp:ListView
    ID="lv_就職活動一覧" DataSourceID="sql_就職活動一覧"
    DataKeyNames="請求NO,活動年度,企業CD,拠点CD,区分CD" InsertItemPosition="FirstItem" runat="server"
>
    <LayoutTemplate>
        <div ID="div_就職活動一覧_top" class="pager" runat="server">
            <uc:pager ID="pg_就職活動一覧_top" PagedControlID="lv_就職活動一覧" runat="server" PageSize="10" />
        </div>
        <table class="list3 hunt">
            <colgroup>
                <col style="width:25%" />
                <col style="width:25%" />
                <col style="width:25%" />
                <col style="width:25%" />
            </colgroup>
            <thead>
                <tr>
                    <th>
                        活動年度
                    </th>
                    <th>
                        活動日
                    </th>
                    <th>
                        活動区分
                    </th>
                    <th>
                        企業
                    </th>
                </tr>
                <tr>
                    <th>
                        職種
                    </th>
                    <th>
                        勤務地
                    </th>
                    <th>
                        採否
                    </th>
                    <th>
                        採否日
                    </th>
                </tr>                
            </thead>
            <tbody>
                <tr id="itemPlaceholder" runat="server"></tr>
            </tbody>
        </table>
        <div class="vertical_space"></div>
        <div ID="div_就職活動一覧_bottom" class="pager" runat="server">
              <uc:pager ID="pg_就職活動一覧_bottom" runat="server" PagedControlID="lv_就職活動一覧" PageSize="10"/>
        </div>
    </LayoutTemplate>
    <ItemTemplate>
        <tr runat="server" class='<%# If(Container.DataItemIndex Mod 2 = 0, "alt-row", "")%>'>
            <td class="td-class">
                <asp:Label ID="活動年度" Text='<%# Eval("活動年度")%>' runat="server" />
            </td>
            <td class="td-class">
                <asp:Label ID="活動日" Text='<%# Bind("活動日", "{0:yyyy/MM/dd}")%>' runat="server" />
            </td>
            <td class="td-class">
                <asp:Label ID="活動区分" runat="server" Text='<%# Eval("活動区分")%>' />
            </td>
            <td class="td-class td_left">
                <asp:Label ID="企業" Text='<%# Eval("企業名")%>' runat="server" />
            </td>            
        </tr>
        <tr runat="server" class='<%# If(Container.DataItemIndex Mod 2 = 0, "alt-row", "")%>'>
            <td class="td-class">
                <asp:Label ID="職種" Text='<%# Eval("職種名")%>' runat="server" />
            </td>
            <td class="td-class">
                <asp:Label ID="勤務地" Text='<%# Eval("勤務地名")%>' runat="server" />
            </td>
            <td class="td-class">
                <asp:Label ID="採否" Text='<%# Eval("採否")%>' runat="server" />
            </td>
            <td class="td-class">
                <asp:Label ID="採否日" Text='<%# Bind("採否日", "{0:yyyy/MM/dd}")%>' runat="server" />
            </td>
        </tr>
        <tr runat="server" class='<%# If(Container.DataItemIndex Mod 2 = 0, "alt-row", "")%>'>
            <td class="td-class td_right border_double" colspan="4" style="padding-right:10px;">
                <asp:Button ID="編集" Text="編集" CommandName="Edit" CssClass="buttonBig buttonBig-blue" Width="50px" runat="server" />
                &nbsp;
                <asp:Button ID="削除" Text="削除" CommandName="Delete" CssClass="buttonBig buttonBig-red" Width="50px" OnClientClick="return confirm('削除してもよろしいですか？');" runat="server" />
            </td>
        </tr>
    </ItemTemplate>
    <InsertItemTemplate>
        <tr>
            <td class="td-class">
                <asp:TextBox ID="活動年度" Text='<%# Bind("活動年度")%>' CssClass="input"
                    Width="90%" autocomplete="off" runat="server" />
            </td>
            <td class="td-class">
                <asp:TextBox ID="活動日" Text='<%# Bind("活動日")%>' CssClass="input" 
                    Width="90%" autocomplete="off" runat="server" />
                <ajaxToolkit:CalendarExtender ID="活動日_CalendarExtender" TargetControlID="活動日" Format="yyyy/MM/dd" runat="server" />
            </td>
            <td class="td-class">
                <asp:DropDownList
                    ID="区分CD" Text='<%# Bind("区分CD")%>' DataSourceID="sql_活動区分" DataTextField="名前"
                    DataValueField="区分CD" AppendDataBoundItems="true" CssClass="input" Width="90%" runat ="server"
                >
                    <asp:ListItem Text="--未選択--" Value="" />
                </asp:DropDownList>
            </td>
            <td class="td-class">
                絞込:
                <asp:TextBox ID="企業名" OnTextChanged="企業名_TextChanged" AutoPostBack="true" CssClass="input" 
                    Width="80%" autocomplete="off" runat="server" />
                <br />
                選択:
                <asp:DropDownList
                    ID="企業選択" DataSourceID="sql_企業" DataTextField="企業名"
                    DataValueField="企業拠点CD" AppendDataBoundItems="true" CssClass="input" Width="80%" runat="server"
                >
                    <asp:ListItem Text="--未選択--" Value="" />
                </asp:DropDownList>
            </td>            
        </tr>
        <tr>
            <td class="td-class">
                <asp:DropDownList
                    ID="職種CD" DataSourceID="sql_職種" DataTextField="名前"
                    DataValueField="職種CD" SelectedValue='<%# Bind("職種CD")%>' AppendDataBoundItems="true" CssClass="input" 
                    Width="90%" runat="server"
                >
                    <asp:ListItem Text="--未選択--" Value="" />
                </asp:DropDownList>
            </td>
            <td class="td-class">
                <asp:DropDownList
                    ID="勤務CD" DataSourceID="sql_勤務" DataTextField="名前"
                    DataValueField="勤務CD" SelectedValue='<%# Bind("勤務CD")%>' AppendDataBoundItems="true" CssClass="input" 
                    Width="90%" runat="server"
                >
                    <asp:ListItem Text="--未選択--" Value="" />
                </asp:DropDownList>
            </td>
            <td class="td-class">
                <asp:DropDownList
                    ID="採否" DataSourceID="sql_採否" DataTextField="採否" DataValueField="採否"
                    SelectedValue='<%# Bind("採否")%>' CssClass="input" runat="server"
                />
            </td>
            <td class="td-class">
                <asp:TextBox ID="採否日" Text='<%# Bind("採否日")%>' CssClass="input" Width="90%" autocomplete="off" runat="server" />
                <ajaxToolkit:CalendarExtender ID="採否日_CalendarExtender" TargetControlID="採否日" Format="yyyy/MM/dd" runat="server" />
            </td>
        </tr>
        <tr>
            <td class="td-class td_right border_double" colspan="4" style="padding-right:10px;">
                <asp:Button ID="追加" Text="追加" CommandName="Insert" CssClass="buttonBig buttonBig-blue" Width="50px" OnClientClick="return confirm('追加してもよろしいですか？');" runat="server" />
            </td>
        </tr>
    </InsertItemTemplate>
    <EditItemTemplate>
        <tr runat="server" class='<%# If(Container.DataItemIndex Mod 2 = 0, "alt-row", "")%>'>
            <td class="td-class">
                <asp:Label ID="活動年度" Text='<%# Eval("活動年度")%>' runat="server" />
            </td>
            <td class="td-class">
                <asp:TextBox ID="活動日" Text='<%# Bind("活動日", "{0:yyyy/MM/dd}")%>' CssClass="input" 
                    Width="90%" autocomplete="off" runat="server" />
                <ajaxToolkit:CalendarExtender ID="活動日_CalendarExtender" TargetControlID="活動日" Format="yyyy/MM/dd" runat="server" />
            </td>
            <td class="td-class">
                <asp:Label ID="活動区分" Text='<%# Eval("活動区分")%>' runat="server" />
            </td>
            <td class="td-class td_left">
                <asp:Label ID="企業" Text='<%# Eval("企業名")%>' runat="server" />
            </td>            
        </tr>
        <tr runat="server" class='<%# If(Container.DataItemIndex Mod 2 = 0, "alt-row", "")%>'>
            <td class="td-class border_double">
                <asp:DropDownList
                    ID="職種CD" DataSourceID="sql_職種" DataTextField="名前"
                    DataValueField="職種CD" SelectedValue='<%# Bind("職種CD")%>' AppendDataBoundItems="true"
                    CssClass="input" Width="90%" runat="server"
                >
                    <asp:ListItem Text="--未選択--" Value="" />
                </asp:DropDownList>
            </td>
            <td class="td-class border_double">
                <asp:DropDownList
                        ID="勤務CD" DataSourceID="sql_勤務" DataTextField="名前"
                    DataValueField="勤務CD" SelectedValue='<%# Bind("勤務CD")%>' AppendDataBoundItems="true"
                    CssClass="input" Width="90%" runat="server"
                >
                    <asp:ListItem Text="-未選択 -" Value="" />
                </asp:DropDownList>
            </td>
            <td class="td-class border_double">
                <asp:DropDownList
                    ID="採否" DataSourceID="sql_採否" DataTextField="採否"
                    DataValueField="採否" SelectedValue='<%# Bind("採否")%>' AppendDataBoundItems="true"
                    CssClass="input" runat="server"
                />
            </td>
            <td class="td-class border_double">
                <asp:TextBox ID="採否日" Text='<%# Bind("採否日", "{0:yyyy/MM/dd}")%>' CssClass="input" Width="90%" autocomplete="off" runat="server" />
                <ajaxToolkit:CalendarExtender ID="採否日_CalendarExtender" TargetControlID="採否日" Format="yyyy/MM/dd" runat="server" />
            </td>
        </tr>
        <tr runat="server" class='<%# If(Container.DataItemIndex Mod 2 = 0, "alt-row", "")%>'>
            <td class="td-class td_right border_double" colspan="4" style="padding-right:10px;">
                <asp:Button ID="取消" Text="取消" CommandName="Cancel" CssClass="buttonBig buttonBig-blue" Width="50px" runat="server" />
                &nbsp;
                <asp:Button ID="更新" Text="更新" CommandName="Update" CssClass="buttonBig buttonBig-red" Width="50px" OnClientClick="return confirm('更新してもよろしいですか？');" runat="server" />
            </td>
        </tr>
    </EditItemTemplate>
</asp:ListView>
<%-- 就職活動一覧 End --%>
    <div class="vertical_space"></div>
    <div class="vertical_space"></div>
</asp:Content>
<%-- [Webフォーム]body End --%>