<%@ Page Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="JobTitle.aspx.cs" Inherits="Maintenance_HR_JobTitle" Title="<%$ Resources: SiteMapLocalizations, Maintenance_JobTitleEdit %>" %>
<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="20"
        AutoGenerateColumns="False" CellPadding="4" DataKeyNames="TitleName" DataSourceID="ObjectDataSource1" EmptyDataText="null"
        ForeColor="#333333" GridLines="None" OnRowCommand="GridView1_RowCommand" OnRowCreated="GridView1_RowCreated" >
        <FooterStyle BackColor="#CCFFEE" Font-Bold="True" ForeColor="White" />

        <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, JobTitle_TitleName %>">
                <EditItemTemplate>
                    <asp:Label ID="lblTitleName" runat="server" Text='<%# Eval("TitleName") %>' />
                </EditItemTemplate>
                <ItemTemplate>
                    <asp:Label ID="lblTitleName" runat="server" Text='<%# Eval("TitleName") %>' />
                </ItemTemplate>
                <FooterTemplate>
                    <asp:TextBox ID="txtTitleName" runat="server" Text='<%# Bind("TitleName") %>' MaxLength="10" />
                     <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="txtTitleName"
                        ErrorMessage="<%$ resources:Universal, Msg_Remind_TitleName %>" ValidationGroup="AddValidationControls">*</asp:RequiredFieldValidator>
               </FooterTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="<%$ resources:Universal, JobTitle_JobGrade %>" SortExpression="JobGrade">
                <EditItemTemplate>
                    <asp:TextBox ID="txtJobGrade" runat="server" Text='<%# Bind("JobGrade") %>' />
                </EditItemTemplate>
                <ItemTemplate>
                    <asp:Label ID="lblJobGrade" runat="server" Text='<%# Eval("JobGrade") %>' />
                </ItemTemplate>
                <FooterTemplate>
                    <asp:TextBox ID="txtJobGrade" runat="server" Text='<%# Bind("JobGrade") %>' />
                </FooterTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="<%$ resources:Universal, JobTitle_IsLeader %>" SortExpression="IsLeader">
                <EditItemTemplate>
                    <asp:CheckBox ID="chkIsLeader" runat="Server" Checked='<%# Bind("IsLeader") %>' />
                </EditItemTemplate>
                <ItemTemplate>
                    <asp:Label ID="lblIsLeader" runat="server" Text='<%# Convert.ToBoolean(Eval("IsLeader")) ? "V" : "X" %>' />
                </ItemTemplate>
                <FooterTemplate>
                    <asp:CheckBox ID="chkIsLeader" runat="Server" Checked='<%# Bind("IsLeader") %>' />
                </FooterTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="<%$ resources:Universal, Comm_Description %>">
                <EditItemTemplate>
                    <asp:TextBox ID="DescriptionBox" runat="server" Text='<%# Bind("Description") %>' />
                </EditItemTemplate>
                <ItemTemplate>
                    <asp:Label ID="DescriptionLabel" runat="server" Text='<%# Eval("Description") %>' />
                </ItemTemplate>
                <FooterTemplate>
                    <asp:TextBox ID="DescriptionBox" runat="server" Text='<%# Bind("Description") %>' />
                </FooterTemplate>
            </asp:TemplateField>
            <asp:TemplateField ShowHeader="False">
                <EditItemTemplate>
                    <asp:LinkButton ID="LinkButtonUpdate" runat="server" ValidationGroup="EditValidationControls" 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="AddValidationControls" 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="#FAFAF3" ForeColor="#333333" />
        <EditRowStyle BackColor="#FF9999" />
        <SelectedRowStyle BackColor="#FFCCD6" Font-Bold="True" ForeColor="#333333" />
        <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
        <HeaderStyle BackColor="#5DCC9D" Font-Bold="True" ForeColor="#FFFFFF" />
        <AlternatingRowStyle BackColor="#CCDD9D" ForeColor="#284775" />
    </asp:GridView>
</p>
    <p class="masterpageContentTop">
    <asp:ObjectDataSource ID="ObjectDataSource1" runat="server" TypeName="HR_JobTitleData"
        SelectMethod="Select" InsertMethod="Insert" OldValuesParameterFormatString="original_{0}" 
        UpdateMethod="Update" DeleteMethod="Delete"
        OnSelected="ObjectDataSourceMain_Selected">
        <InsertParameters>
            <asp:Parameter Name="TitleName" Type="String" />
            <asp:Parameter Name="JobGrade" Type="String" />
            <asp:Parameter Name="IsLeader" Type="Boolean" />
            <asp:Parameter Name="Description" Type="String" />
        </InsertParameters>
        <UpdateParameters>
            <asp:Parameter Name="JobGrade" Type="String" />
            <asp:Parameter Name="IsLeader" Type="Boolean" />
            <asp:Parameter Name="Description" Type="String" />
            <asp:Parameter Name="original_TitleName" Type="String" />
        </UpdateParameters>
        <DeleteParameters>
            <asp:Parameter Name="original_TitleName" Type="String" />
        </DeleteParameters>
    </asp:ObjectDataSource>



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

