<%@ page language="C#" masterpagefile="~/MasterPage.master" autoeventwireup="true" CodeFile="FAB.aspx.cs" inherits="Maintenance_Customers_FAB" title="Maintenance_Customers_FAB" theme="white" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<center>
<p class="masterpageContentTop" >
<asp:Button ID="btnAddNew" runat="Server" Width="100px" Text="<%$ resources:Universal,Data_AddNew %>" OnClick="AddButton1_Click" />
    <asp:GridView ID="GridView1" runat="server" AllowPaging="True" AllowSorting="True"  PageSize="40"
        AutoGenerateColumns="False" CellPadding="4" DataKeyNames="FABID" DataSourceID="ObjectDataSource1" EmptyDataText="null"
        ForeColor="#333333" GridLines="None" OnRowCommand="GridView1_RowCommand" OnDataBound="GridView1_DataBound" >
        <Columns>
            <asp:CommandField UpdateText="<%$ resources:Universal,Data_Update %>"
            CancelText="<%$ resources:Universal,Data_Cancel %>" EditText="<%$ resources:Universal,Data_Edit %>"
            DeleteText="<%$ resources:Universal,Data_Delete %>"  />

            <asp:TemplateField HeaderText="<%$ resources:Universal, Comm_FABID %>" SortExpression="FABID">
                <EditItemTemplate>
                    <asp:TextBox ID="txtEditFABID" runat="server" Text='<%# Bind("FABID") %>' Width="60px" />
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="txtEditFABID"
                        ErrorMessage="<%$ resources:Universal, Msg_Remind_FABID %>" ValidationGroup="ValidationControls">*</asp:RequiredFieldValidator>
                </EditItemTemplate>
                <ItemTemplate>
                    <asp:Label ID="lblFABID" runat="server" Text='<%# Eval("FABID") %>' />
                </ItemTemplate>
                <FooterTemplate>
                    <asp:TextBox ID="txtAddFABID" runat="server" Text='<%# Bind("FABID") %>' Width="60px" />
                     <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="txtAddFABID"
                        ErrorMessage="<%$ resources:Universal, Msg_Remind_FABID %>" ValidationGroup="ValidationControls">*</asp:RequiredFieldValidator>
               </FooterTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="<%$ resources:Universal, Comm_Abbreviation %>" SortExpression="Abbreviation">
                <EditItemTemplate>
                    <asp:TextBox ID="txtAbbreviation" runat="server" Text='<%# Bind("Abbreviation") %>' Width="60px" />
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" ControlToValidate="txtAbbreviation"
                        ErrorMessage="<%$ resources:Universal, Msg_Remind_Abbreviation %>" ValidationGroup="ValidationControls">*</asp:RequiredFieldValidator>
                </EditItemTemplate>
                <ItemTemplate>
                    <asp:Label ID="lblAbbreviation" runat="server" Text='<%# Eval("Abbreviation") %>' />
                </ItemTemplate>
                <FooterTemplate>
                    <asp:TextBox ID="txtAbbreviation" runat="server" Text='<%# Bind("Abbreviation") %>' Width="60px" />
                     <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" ControlToValidate="txtAbbreviation"
                        ErrorMessage="<%$ resources:Universal, Msg_Remind_Abbreviation %>" ValidationGroup="ValidationControls">*</asp:RequiredFieldValidator>
               </FooterTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="<%$ resources:Universal, CompanyID %>" SortExpression="CompanyID">
                <EditItemTemplate>
                    <asp:TextBox ID="txtEditCompanyID" runat="server" Text='<%# Bind("CompanyID") %>' Width="60px" />
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ControlToValidate="txtEditCompanyID"
                        ErrorMessage="<%$ resources:Universal, Msg_Remind_CompanyID %>" ValidationGroup="ValidationControls">*</asp:RequiredFieldValidator>
                </EditItemTemplate>
                <ItemTemplate>
                    <asp:Label ID="lbltxtCompanyID" runat="server" Text='<%# Eval("CompanyID") %>' />
                </ItemTemplate>
                <FooterTemplate>
                    <asp:TextBox ID="txtAddCompanyID" runat="server" Text='<%# Bind("CompanyID") %>' Width="60px" />
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ControlToValidate="txtAddCompanyID"
                        ErrorMessage="<%$ resources:Universal, Msg_Remind_CompanyID %>" ValidationGroup="ValidationControls">*</asp:RequiredFieldValidator>
                </FooterTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="<%$ resources:Universal, CompanyName %>" SortExpression="CompanyName">
                <EditItemTemplate>
                    <asp:TextBox ID="txtEditCompanyName" runat="server" Text='<%# Bind("CompanyName") %>' Width="60px" />
                </EditItemTemplate>
                <ItemTemplate>
                    <asp:Label ID="lblCompanyName" runat="server" Text='<%# Eval("CompanyName") %>' />
                </ItemTemplate>
                <FooterTemplate>
                    <asp:TextBox ID="txtAddCompanyName" runat="server" Text='<%# Bind("CompanyName") %>' Width="60px" />
                </FooterTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="<%$ resources:Universal,Comm_Address %>">
                <EditItemTemplate>
                    <asp:TextBox ID="txtEditAddress" runat="server" Text='<%# Bind("Address") %>' Width="360px" />
                </EditItemTemplate>
                <ItemTemplate>
                    <asp:Label ID="lblAddress" runat="server" Text='<%# Eval("Address") %>' />
                </ItemTemplate>
                <FooterTemplate>
                    <asp:TextBox ID="txtAddAddress" runat="server" Text='<%# Bind("Address") %>' Width="360px" />
                </FooterTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="<%$ resources:Universal,Comm_Tel %>">
                <EditItemTemplate>
                    <asp:TextBox ID="txtEditTel" runat="server" Text='<%# Bind("Tel") %>' Width="80px" />
                </EditItemTemplate>
                <ItemTemplate>
                    <asp:Label ID="lblTel" runat="server" Text='<%# Eval("Tel") %>' />
                </ItemTemplate>
                <FooterTemplate>
                    <asp:TextBox ID="txtAddTel" runat="server" Text='<%# Bind("Tel") %>' Width="80px" />
                </FooterTemplate>
            </asp:TemplateField>
            <asp:TemplateField ShowHeader="False">
                <EditItemTemplate>
                    <asp:LinkButton ID="LinkButtonUpdate" runat="server" ValidationGroup="ValidationControls" CausesValidation="true" CommandName="Update"
                        Text="<%$ resources:Universal,Data_Update %>" />
                    <asp:LinkButton ID="LinkButtonCancel" runat="server" CommandName="Cancel"
                        Text="<%$ resources:Universal,Data_Cancel %>" />
                </EditItemTemplate>
                <ItemTemplate>
                    <asp:LinkButton ID="LinkButtonEdit" runat="server" CausesValidation="False" CommandName="Edit"
                        Text="<%$ resources:Universal,Data_Edit %>" />
                    <asp:LinkButton ID="LinkButtonDelete" runat="server" CausesValidation="False" CommandName="Delete"
                        OnClientClick="<%$ resources: Universal, Msg_DelConfirm %>" Text="<%$ resources:Universal,Data_Delete %>" />
                </ItemTemplate>
                <FooterTemplate>
                    <asp:Button ID="btnSave" runat="server" ValidationGroup="ValidationControls" CausesValidation="true" 
                        Text="<%$ resources:Universal,Data_Save %>" CommandName="Save" OnClick="btnSave_Click" />
                    <asp:Button ID="btnInsertCancel" runat="server" Text="<%$ resources:Universal,Data_Cancel %>" OnClick="btnInsertCancel_Click" />
               </FooterTemplate>
            </asp:TemplateField>
        </Columns>
     
        <RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
        <EditRowStyle BackColor="#999999" />
        <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
        <SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
        <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
        <HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
        <AlternatingRowStyle BackColor="White" ForeColor="#284775" />
    </asp:GridView>
    </p>
    <p class="masterpageContentTop">
        <asp:ObjectDataSource ID="ObjectDataSource1" runat="server" TypeName="Customer_FABData"
        SelectMethod="Select" InsertMethod="Insert" OldValuesParameterFormatString="original_{0}" 
        UpdateMethod="Update" DeleteMethod="Delete"
        OnSelected="ObjectDataSourceMain_Selected">
        <InsertParameters>
            <asp:Parameter Name="FABID" Type="String" />
            <asp:Parameter Name="Abbreviation" Type="String" />
            <asp:Parameter Name="CompanyID" Type="String" />
            <asp:Parameter Name="CompanyName" Type="String" />
            <asp:Parameter Name="Address" Type="String" />
            <asp:Parameter Name="Tel" Type="String" />
        </InsertParameters>
        <UpdateParameters>
            <asp:Parameter Name="FABID" Type="String" />
            <asp:Parameter Name="Abbreviation" Type="String" />
            <asp:Parameter Name="CompanyID" Type="String" />
            <asp:Parameter Name="CompanyName" Type="String" />
            <asp:Parameter Name="Address" Type="String" />
            <asp:Parameter Name="original_FABID" Type="String" />
        </UpdateParameters>
        <DeleteParameters>
            <asp:Parameter Name="original_FABID" Type="String" />
        </DeleteParameters>
    </asp:ObjectDataSource>



    <asp:ValidationSummary ID="ValidationSummary1" runat="server" ShowMessageBox="True"
         ShowSummary="False" ValidationGroup="ValidationControls" />
    </p>
</center>
</asp:Content>

