<%@ Page Title="" Language="C#" MasterPageFile="~/Site1.Master" AutoEventWireup="true" CodeBehind="Flight_Record_Creation.aspx.cs" Inherits="VMT.Flight_Record_Creation" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <style type="text/css">
        .auto-style2 {
            width: 100%;
        }

        .auto-style3 {
            height: 17px;
        }

        .auto-style4 {
            height: 16px;
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="cphJavaScriptContentPlaceHolder" runat="server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="cphPageTitleContentPlaceHolder" runat="server">
    <div id="CssPageTitle">
        <h1>Create Flight Record 
        </h1>
    </div>
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="cphMainContentPlaceHolder" runat="server">
    <asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
    <asp:UpdatePanel ID="UpdatePanel2" runat="server">
        <ContentTemplate>
            <div id="loaderdiv">
                <asp:UpdateProgress ID="UpdateProgress1" runat="server" AssociatedUpdatePanelID="UpdatePanel2" DynamicLayout="true">
                    <ProgressTemplate>
                        <img src="resource_gallery/graphics/loader.gif" class="ajax-loader">
                    </ProgressTemplate>
                </asp:UpdateProgress>

            </div>
            <div style="text-align: right;"><a href="default.aspx">Home</a> <strong>&#8249;&#8249;</strong> <a href="CurrentYTD.aspx">Current</a> <strong>&#8249;&#8249;</strong> Create Flight Record </div>

            <fieldset class="masterform">
                <legend>Create Flight Record</legend>
                <div style="width: 100%; height: 70px;">
                    <table style="width: 100%;">
                        <caption>

                            <tr>
                                <td>Flight Type:
                                </td>
                                <td>Flight Year:
                                </td>
                                <td>Flight Inspector:
                                </td>
                                <td rowspan="2">

                                    <asp:Button ID="btnAddnew" runat="server" OnClick="btnAddnew_Click" Text="Add New" CssClass="FormButton" />
                                </td>
                            </tr>
                        </caption>
                        <tr>
                            <td>
                                <asp:DropDownList ID="ddlFlightType0" runat="server" AutoPostBack="true" OnSelectedIndexChanged ="ddlFlightType0_SelectedIndexChanged" OnDataBound="ddlFlightType0_DataBound">
                                </asp:DropDownList>
                            </td>
                            <td>
                                <asp:DropDownList ID="ddlFlightYear0" runat="server" AutoPostBack="true" OnSelectedIndexChanged="ddlFlightYear0_SelectedIndexChanged">
                                </asp:DropDownList>
                            </td>
                            <td>
                                <asp:DropDownList ID="ddlFlightInspector" runat="server" AutoPostBack="true" OnSelectedIndexChanged="ddlFlightInspector_SelectedIndexChanged"></asp:DropDownList>
                            </td>
                        </tr>
                    </table>
                    <br />
                </div>
            </fieldset>

            <div style="text-align: left; width: 100%;">
                <fieldset class="masterform">
                    <legend>Manage Flight Record</legend>

                    <div style="width: 100%; height: 240px; overflow-y: scroll;">
                        <br />
                        <asp:GridView ID="gdv_list" runat="server" BorderColor="#014567" CellPadding="3" Width="96%" AutoGenerateColumns="false" DataKeyNames="flight_record_id" OnRowCreated="gdv_list_RowCreated"
                            OnRowEditing="gdv_list_RowEditing"
                            OnRowUpdating="gdv_list_RowUpdating"
                            OnRowDeleting="gdv_list_RowDeleting"
                            OnRowCancelingEdit ="gdv_list_RowCancelingEdit" 
                            OnRowDataBound ="gdv_list_RowDataBound">
                            <AlternatingRowStyle BackColor="#E9EFF2" />
                            <Columns>
                                <%--<asp:TemplateField ShowHeader="False">
                                    <ItemTemplate>
                                        <asp:LinkButton ID="LinkButton3" runat="server" CausesValidation="False" CommandName="Edit"><img src="resource_gallery/graphics/Icon_Edit.png" /></asp:LinkButton>
                                    </ItemTemplate>

                                    <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" Width="30px" />
                                </asp:TemplateField>
                                <asp:TemplateField ShowHeader="False">
                                    <ItemTemplate>
                                        <asp:LinkButton ID="LinkButton4" runat="server" CausesValidation="False" CommandName="Delete"><img src="resource_gallery/graphics/icon_delete.png" /></asp:LinkButton>
                                    </ItemTemplate>
                                    <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" Width="30px" />

                                </asp:TemplateField>--%>
                                <asp:TemplateField HeaderText="Record Name">
                                    <EditItemTemplate>
                                        <asp:HiddenField ID="HiddenField1" Value='<%#Eval("flight_type_id") %>' runat="server" />
                                        <asp:TextBox ID="txtRecordName" runat="server" Width="300px" Text='<%#Eval("flight_record_name") %>'/>
                                    </EditItemTemplate>
                                    <ItemTemplate>
                                        <asp:Label ID="lblRecordName" runat="server" Text='<%#Eval("flight_record_name") %>'/>
                                    </ItemTemplate>
                                    <ItemStyle Width="40%" />
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="Start Date">
                                    <ItemTemplate>
                                        <asp:Label ID="lblStartDate" runat="server" Text='<%#Eval("flight_start_date") %>'/>
                                    </ItemTemplate>
                                    <ItemStyle Width="16%" />
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="Open By">
                                    <ItemTemplate>
                                        <asp:Label ID="lblOpenBy" runat="server" Text='<%#Eval("flight_open_by") %>'/>
                                    </ItemTemplate>
                                    <ItemStyle Width="16%" />
                                </asp:TemplateField>
                                 <asp:TemplateField HeaderText="Inspector">
                                     <EditItemTemplate>
                                        <asp:DropDownList ID="ddlInspector" runat="server">
                                        </asp:DropDownList>
                                    </EditItemTemplate>
                                    <ItemTemplate>
                                        <asp:HiddenField ID="HiddenField1" Value='<%#Eval("INSPECTOR") %>' runat="server" />
                                        <asp:Label ID="lblInspector" runat="server" Text='<%#Eval("inspector_name") %>'/>
                                    </ItemTemplate>
                                    <ItemStyle Width="16%" />
                                </asp:TemplateField>
                                <asp:TemplateField ShowHeader="false">
                                    <EditItemTemplate>
                                        <asp:ImageButton ID="imgbtnUpdate" CommandName="Update" runat="server" ImageUrl="~/resource_gallery/graphics/icon-save.png" ToolTip="Update" Height="20px" Width="20px" />
                                        <asp:ImageButton ID="imgbtnCancel" runat="server" CommandName="Cancel" ImageUrl="~/resource_gallery/graphics/icon-cancel.png" ToolTip="Cancel" Height="20px" Width="20px" />
                                    </EditItemTemplate>
                                    <ItemTemplate>
                                        <asp:ImageButton ID="imgbtnEdit" CommandName="Edit" runat="server" ImageUrl="~/resource_gallery/graphics/Icon_Edit.png" ToolTip="Edit" Height="20px" Width="20px" />
                                        <asp:ImageButton ID="imgbtnDelete" CommandName="Delete" Text="Edit" runat="server" ImageUrl="~/resource_gallery/graphics/icon_delete.png" ToolTip="Delete" Height="20px" Width="20px" />
                                    </ItemTemplate>    
                                    <ItemStyle Width="12%" />                                
                                </asp:TemplateField>
                            </Columns>
                            <HeaderStyle BackColor="#98C8DE" Font-Bold="True" />
                            <SelectedRowStyle BackColor="#FFE98F" />
                        </asp:GridView>


                        <td></td>


                    </div>
                </fieldset>
                <br />
            </div>
        </ContentTemplate>
    </asp:UpdatePanel>
</asp:Content>


