<%@ Page Title="" Language="vb" AutoEventWireup="false" MasterPageFile="Application.master" CodeBehind="DrivingExperience.aspx.vb" Inherits="Web.DrivingExperience" %>
<%@ MasterType VirtualPath="Application.Master" %>
<%@ Register TagPrefix="ctrl" Namespace="Web" Assembly="Web" %>
<%@ Register Src="~/_include/controls/StatePicker.ascx" TagPrefix="ctrl" TagName="StatePicker" %>
<%@ Register Src="~/_include/controls/YesNoPicker.ascx" TagPrefix="ctrl" TagName="YesNoPicker" %>
<asp:Content ID="Content1" ContentPlaceHolderID="phContent" runat="server">

    <h1>Driving Experience</h1>


    <h3>Driving Licenses for Past (3) Years Prior to Application Date</h3>

    <ctrl:FormList ID="rptLicenses" runat="server" AddText="Add License"><ItemTemplate>
        <asp:HiddenField ID="hidLicenseId" runat="server" Value="0" />
        <section>
            <div style="float: right; display: inline-block;">
                <asp:Button ID="btnRemoveLicense" runat="server" 
                    CausesValidation="false" OnClick="btnRemoveLicense_Click" 
                    Text="Remove" />
            </div>
            <h1><%# If(Container.ItemIndex = 0,
                "Current Driver's License",
                "License " & CStr(Container.ItemIndex + 1)) %></h1>

            <ul class="formFields">
                <li class="left">
                    <asp:RequiredFieldValidator runat="server" ControlToValidate="txtLicenseNumber"
                        Text="required" Display="Dynamic" CssClass="required" />
                    <asp:Label runat="server" AssociatedControlID="txtLicenseNumber"
                        Text="License Number" />
                    <asp:TextBox ID="txtLicenseNumber" runat="server" MaxLength="128" />
                </li>
                <li class="right">
                    <asp:RequiredFieldValidator runat="server" ControlToValidate="ddlLicenseState"
                        Text="required" Display="Dynamic" CssClass="required" />
                    <asp:Label runat="server" AssociatedControlID="ddlLicenseState"
                        Text="State of Issue" />
                    <ctrl:StatePicker ID="ddlLicenseState" runat="server" />
                </li>
                <li class="left">
                    <asp:Label runat="server" AssociatedControlID="txtLicenseType"
                        Text="Class" />
                    <asp:TextBox ID="txtLicenseType" runat="server" MaxLength="50" />
                </li>
                <li class="right">
                    <asp:RequiredFieldValidator runat="server" ControlToValidate="txtLicenseExpires"
                        Text="required" Display="Dynamic" CssClass="required" />
                    <asp:Label runat="server" AssociatedControlID="txtLicenseExpires"
                        Text="Expiration Date" />
                    <asp:TextBox ID="txtLicenseExpires" runat="server" MaxLength="50" TextMode="Date" />
                </li>
                <li>
                    <asp:RequiredFieldValidator runat="server" ControlToValidate="ynCDL"
                        Text="required" Display="Dynamic" CssClass="required" />
                    <asp:Label runat="server" AssociatedControlID="ynCDL"
                        Text="Is this a Commercial Driver's License (CDL)?" />
                    <ctrl:YesNoPicker ID="ynCDL" runat="server" />
                </li>
                <li class="small">
                    <label>Endorsements</label>
                    <asp:CheckBox ID="chkN" runat="server" Text="N" />
                    <asp:CheckBox ID="chkS" runat="server" Text="S" />
                    <asp:CheckBox ID="chkH" runat="server" Text="H" />
                    <asp:CheckBox ID="chkX" runat="server" Text="X" />
                    <asp:CheckBox ID="chkT" runat="server" Text="T" />
                    <asp:CheckBox ID="chkP" runat="server" Text="P" />
                </li>
                <li class="right">
                    <asp:Label runat="server" AssociatedControlID="txtLicenseRestrictions" 
                        Text="Restrictions" />
                    <asp:TextBox ID="txtLicenseRestrictions" runat="server" MaxLength="50" />
                </li>
            </ul>
        </section>
    </ItemTemplate></ctrl:FormList>


    <h3>Driving Experience in the Operation of Motor Vehicles</h3>

    <ctrl:FormList ID="rptVehicles" runat="server" AddText="Add Vehicle"><ItemTemplate>
        <asp:HiddenField ID="hidVehicleId" runat="server" Value="0" />
        <section>
            <div style="float: right; display: inline-block;">
                <asp:Button ID="btnRemoveVehicle" runat="server" 
                    CausesValidation="false" OnClick="btnRemoveVehicle_Click" 
                    Text="Remove" />
            </div>
            <h1>Vehicle <%# Container.ItemIndex + 1 %></h1>

            <ul class="formFields">
                <li>
                    <asp:RequiredFieldValidator runat="server" ControlToValidate="ddlEquipmentType"
                        Text="required" Display="Dynamic" CssClass="required" />
                    <asp:Label runat="server" AssociatedControlID="ddlEquipmentType"
                        Text="Equipment Type" />
                    <asp:DropDownList ID="ddlEquipmentType" runat="server">
                        <asp:ListItem Text="Bus" />
                        <asp:ListItem Text="Straight Truck" />
                        <asp:ListItem Text="Truck Tractor" />
                        <asp:ListItem Text="Other" />
                    </asp:DropDownList>
                    <ul class="dependent"
                        data-dependency='<asp:Literal ID="litId_ddlEquipmentType" runat="server"/>'
                        data-value="Other">
                        <li>
                            <asp:Label runat="server" AssociatedControlID="txtEquipmentType"
                                Text="Other" style="min-width: 69px;" />
                            <asp:TextBox ID="txtEquipmentType" runat="server" MaxLength="50" />
                        </li>
                    </ul>
                </li>
                <li>
                    <asp:RequiredFieldValidator runat="server" ControlToValidate="txtEquipmentYears"
                        Text="required" Display="Dynamic" CssClass="required" />
                    <asp:Label runat="server" AssociatedControlID="txtEquipmentYears"
                        Text="# of Years Experience" />
                    <asp:TextBox ID="txtEquipmentYears" runat="server" MaxLength="50" TextMode="Number" />
                </li>
                <li>
                    <asp:Label runat="server" AssociatedControlID="txtEquipmentMiles"
                        Text="Approximate Number of Miles Driven (Total)" />
                    <asp:TextBox ID="txtEquipmentMiles" runat="server" MaxLength="50" TextMode="Number" />
                </li>
                <li>
                    <asp:RequiredFieldValidator runat="server" ControlToValidate="ynRequiredCDL"
                        Text="required" Display="Dynamic" CssClass="required" />
                    <asp:Label runat="server" AssociatedControlID="ynRequiredCDL"
                        Text="Does this vehicle required a CDL?" />
                    <ctrl:YesNoPicker ID="ynRequiredCDL" runat="server" />
                </li>
            </ul>
        </section>
    </ItemTemplate></ctrl:FormList>


    <h3>Accident Record for the Past (3) years Prior to Application Date</h3>

    <section>
        <ul class="formFields">
            <li>
                <asp:RequiredFieldValidator runat="server" ControlToValidate="ynThreeYearsAccidents"
                    Text="required" Display="Dynamic" CssClass="required" />
                <asp:Label runat="server" AssociatedControlID="ynThreeYearsAccidents"
                    Text="Have you had any accidents in the past three (3) years?" />
                <ctrl:YesNoPicker ID="ynThreeYearsAccidents" runat="server" />
            </li>
        </ul>
    </section>

    <ctrl:FormList ID="rptAccidents" runat="server" AddText="Add Accident" TargetCount="0"><ItemTemplate>
        <asp:HiddenField ID="hidAccidentId" runat="server" Value="0" />
        <section>
            <div style="float: right; display: inline-block;">
                <asp:Button ID="btnRemoveAccident" runat="server" 
                    CausesValidation="false" OnClick="btnRemoveAccident_Click" 
                    Text="Remove" />
            </div>
            <h1><%# If(Container.ItemIndex = 0,
                "Most Recent",
                "Accident " & CStr(Container.ItemIndex + 1)) %></h1>

            <ul class="formFields">
                <li>
                    <asp:RequiredFieldValidator runat="server" ControlToValidate="txtAccidentDate"
                        Text="required" Display="Dynamic" CssClass="required" />
                    <asp:Label runat="server" AssociatedControlID="txtAccidentDate"
                        Text="Accident Date" />
                    <asp:TextBox ID="txtAccidentDate" runat="server" MaxLength="50" TextMode="Date" />
                </li>
                <li>
                    <asp:RequiredFieldValidator runat="server" ControlToValidate="txtAccidentNature"
                        Text="required" Display="Dynamic" CssClass="required" />
                    <asp:Label runat="server" AssociatedControlID="txtAccidentNature"
                        Text="Nature of Accident" />
                    <asp:TextBox ID="txtAccidentNature" runat="server" MaxLength="50" />
                    <span class="hint">passenger vehicle, head-on, rear-end, etc.</span>
                </li>
                <li>
                    <asp:RequiredFieldValidator runat="server" ControlToValidate="txtAccidentConsequences"
                        Text="required" Display="Dynamic" CssClass="required" />
                    <asp:Label runat="server" AssociatedControlID="txtAccidentConsequences"
                        Text="Injuries/Fatalities" />
                    <asp:TextBox ID="txtAccidentConsequences" runat="server" MaxLength="50" />
                </li>
                <li>
                    <asp:Label runat="server" AssociatedControlID="txtAccidentComments"
                        Text="Comments" />
                    <asp:TextBox ID="txtAccidentComments" runat="server" TextMode="MultiLine" MaxLength="256" />
                </li>
            </ul>
        </section>
    </ItemTemplate></ctrl:FormList>

    
    <header>
        <h3>Traffic Convictions &amp; Forfeitures in the Past (3) Years Prior to Application Date</h3>
    </header>

    <section>
        <ul class="formFields">
            <li>
                <asp:RequiredFieldValidator runat="server" ControlToValidate="ynThreeYearsConvictions"
                    Text="required" Display="Dynamic" CssClass="required" />
                <asp:Label runat="server" AssociatedControlID="ynThreeYearsConvictions"
                    Text="Have you had any traffic violation convictions or forfeitures (other than parking violations) in the past three (3) years prior to the application date?" />
                <ctrl:YesNoPicker ID="ynThreeYearsConvictions" runat="server" />
            </li>
        </ul>
    </section>
    
    <ctrl:FormList ID="rptViolations" runat="server" AddText="Add Violation" TargetCount="0"><ItemTemplate>
        <asp:HiddenField ID="hidViolationId" runat="server" Value="0" />
        <section>
            <div style="float: right; display: inline-block;">
                <asp:Button ID="btnRemoveViolation" runat="server" 
                    CausesValidation="false" OnClick="btnRemoveViolation_Click" 
                    Text="Remove" />
            </div>
            <h1><%# If(Container.ItemIndex = 0,
                "Most Recent",
                "Violation " & CStr(Container.ItemIndex + 1)) %></h1>

            <ul class="formFields">
                <li class="left">
                    <asp:RequiredFieldValidator runat="server" ControlToValidate="txtConvictionDate"
                        Text="required" Display="Dynamic" CssClass="required" />
                    <asp:Label runat="server" AssociatedControlID="txtConvictionDate"
                        Text="Conviction Date" />
                    <asp:TextBox ID="txtConvictionDate" runat="server" MaxLength="50" TextMode="Date" />
                </li>
                <li class="left">
                    <asp:RequiredFieldValidator runat="server" ControlToValidate="ddlConvictionState"
                        Text="required" Display="Dynamic" CssClass="required" />
                    <asp:Label runat="server" AssociatedControlID="ddlConvictionState" 
                        Text="Location" />
                    <ctrl:StatePicker ID="ddlConvictionState" runat="server" />
                </li>
                <li class="right">
                    <asp:RequiredFieldValidator runat="server" ControlToValidate="txtConvictionCharge"
                        Text="required" Display="Dynamic" CssClass="required" />
                    <asp:Label runat="server" AssociatedControlID="txtConvictionCharge"
                        Text="Charge" />
                    <asp:TextBox ID="txtConvictionCharge" runat="server" MaxLength="128" />
                </li>
                <li class="right">
                    <asp:RequiredFieldValidator runat="server" ControlToValidate="txtConvictionPenalty"
                        Text="required" Display="Dynamic" CssClass="required" />
                    <asp:Label runat="server" AssociatedControlID="txtConvictionPenalty"
                        Text="Penalty" />
                    <asp:TextBox ID="txtConvictionPenalty" runat="server" MaxLength="128" />
                </li>
            </ul>
        </section>
    </ItemTemplate></ctrl:FormList>


    <section>
        <h3>General</h3>

        <ul class="formFields">
            <li>
                <asp:RequiredFieldValidator runat="server" ControlToValidate="ynLicenseDenied"
                    Text="required" Display="Dynamic" CssClass="required" />
                <asp:Label runat="server" AssociatedControlID="ynLicenseDenied"
                    Text="Have you ever been denied a license, permit, or privilege to operate a motor vehicle?" />
                <ctrl:YesNoPicker ID="ynLicenseDenied" runat="server" />
                <ul class="dependent"
                    data-dependency="<%= ynLicenseDenied.ClientID %>"
                    data-value="true">
                    <li>
                    <ctrl:RequiredDependentFieldValidator runat="server" ControlToValidate="txtLicenseDeniedExplanation"
                        DependencyControl="ynLicenseDenied" WhenValue="true"
                        Text="required" Display="Dynamic" CssClass="required" />
                        <asp:Label runat="server" AssociatedControlID="txtLicenseDeniedExplanation"
                            Text="If yes, please explain" />
                        <asp:TextBox ID="txtLicenseDeniedExplanation" runat="server"
                            TextMode="MultiLine" MaxLength="256" />
                    </li>
                </ul>
            </li>
        </ul>

        <ul class="formFields">
            <li>
                <asp:RequiredFieldValidator runat="server" ControlToValidate="ynLicenseRevoked"
                    Text="required" Display="Dynamic" CssClass="required" />
                <asp:Label runat="server" AssociatedControlID="ynLicenseRevoked"
                    Text="Have you ever had any license, permit, or privilege to operate ever suspended or revoked?" />
                <ctrl:YesNOPicker ID="ynLicenseRevoked" runat="server" />
                <ul class="dependent"
                    data-dependency="<%= ynLicenseRevoked.ClientID %>"
                    data-value="true">
                    <li>
                    <ctrl:RequiredDependentFieldValidator runat="server" ControlToValidate="txtLicenseRevokedExplanation"
                        DependencyControl="ynLicenseRevoked" WhenValue="true"
                        Text="required" Display="Dynamic" CssClass="required" />
                        <asp:Label runat="server" AssociatedControlID="txtLicenseRevokedExplanation"
                            Text="If yes, please explain" />
                        <asp:TextBox ID="txtLicenseRevokedExplanation" runat="server"
                            TextMode="MultiLine" MaxLength="256" />
                    </li>
                </ul>
            </li>
        </ul>
    </section>

</asp:Content>
