<%@ Page Title="User Designation" Language="C#" MasterPageFile="~/Master.Master" AutoEventWireup="true" CodeBehind="UserDesignation.aspx.cs" Inherits="ZFJINV.Administration.UserDesignation" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">

    <div class="row">
        <div class="col-md-12 mySpace">
            <div class="caption">

                <span class="caption-subject font-blue sbold" style="font-size: 150%;">User Designations</span>

            </div>

            <asp:UpdatePanel runat="server">
                <ContentTemplate>
                    <div class="portlet-body">
                        <div class="tabbable-line">
                            <ul class="nav nav-tabs ">
                                <li class="active">
                                    <a href="#tab_addProduct" data-toggle="tab"
                                        style="font-size: 13px; color: #2E4053; font-weight: 700;">Add Designation</a>
                                </li>
                                <li>
                                    <a href="#tab_productList" onclick="" data-toggle="tab"
                                        style="font-size: 13px; color: #2E4053; font-weight: 700;">Designations List</a>
                                </li>

                            </ul>
                            <div class="tab-content">
                                <div class="tab-pane active" id="tab_addProduct">
                                    <div class="ui segment">
                                        <div class="ui stackable form">

                                            <div class="col-md-3">
                                                <label class="lbStyle">Designation ID:</label>
                                                <asp:TextBox ID="txtDesignationID" CssClass="myInput" runat="server" title="Username" ></asp:TextBox>
                                            </div>

                                            <div class="col-md-3">
                                                <label class="lbStyle">Department Name:</label>
                                                <asp:DropDownList ID="txtDepartment" CssClass="myInput" runat="server" title="UserDepartment"></asp:DropDownList>
                                            </div>

                                            <div class="col-md-3">
                                                <label class="lbStyle">Designation Name:</label>
                                                <asp:TextBox ID="txtDesignationName" runat="server" CssClass="myInput" required="required"></asp:TextBox>
                                            </div>

                                            <div class="col-md-3">
                                                <label class="lbStyle">Tier ID:</label>
                                                <asp:DropDownList ID="txtTierID" CssClass="myInput" runat="server" title="UserTier">
                                                    <asp:ListItem Text="--Select Tier--" Value="0"></asp:ListItem>
                                                    <asp:ListItem Text="Tier 1" Value="1"></asp:ListItem>
                                                    <asp:ListItem Text="Tier 2" Value="2"></asp:ListItem>
                                                    <asp:ListItem Text="Tier 3" Value="3"></asp:ListItem>
                                                    <asp:ListItem Text="Tier 4" Value="4"></asp:ListItem>
                                                    <asp:ListItem Text="Tier 5" Value="5"></asp:ListItem>
                                                    <asp:ListItem Text="Tier 6" Value="6"></asp:ListItem>
                                                    <asp:ListItem Text="Tier 7" Value="7"></asp:ListItem>
                                                    <asp:ListItem Text="Tier 8" Value="8"></asp:ListItem>
                                                    <asp:ListItem Text="Tier 9" Value="9"></asp:ListItem>
                                                    <asp:ListItem Text="Tier 10" Value="10"></asp:ListItem>
                                                </asp:DropDownList>
                                            </div>

                                            <img src="../assets/global/img/default.gif" style="display: none" id="loaderCity" />

                                            <div class="col-md-6">
                                                <label class="lbStyle"></label>

                                            </div>

                                            <div class="newButton">

                                                <img src="../assets/global/img/ripples.gif" style="display: none; padding: 0;" id="loaderButton" />
                                                <asp:Button ID="btnAdd" runat="server" OnClick="btnAdd_Click" CssClass="btn green-meadow" Text="Save" OnClientClick="showLoader('Button')" />
                                                <asp:Button ID="btnCancel" runat="server" formnovalidate="formnovalidate" CssClass="btn red-mint " Text="Cancel" OnClick="btnCancel_Click" />
                                            </div>

                                            <div class="row">
                                            </div>
                                        </div>
                                    </div>
                                    <div class="col-md-8 ">
                                        <div class="messagealert" id="alert_container">
                                        </div>
                                    </div>
                                </div>
                                <div class="tab-pane" id="tab_productList">
                                    <asp:TextBox ID="search_textbox" runat="server" CssClass="myInput" onkeyup="Search_Gridview(this, 'gvTest')"></asp:TextBox><br />
                                    <div class="rounded-corners">
                                        <div style="width: 100%; overflow: auto;">
                                            <asp:GridView ID="grdDesignation" runat="server" AllowPaging="True" AllowSorting="False"
                                                AutoGenerateColumns="False"
                                                DataKeyNames="Designation ID"
                                                GridLines="Horizontal"
                                                BorderColor="#ECF0F1"
                                                BorderRadius="15px"
                                                PageSize="20"
                                                AlternatingRowStyle-BackColor="#F2F3F4"
                                                RowStyle-Wrap="false"
                                                HeaderStyle-Wrap="false"
                                                RowStyle-BorderColor="#e8e8ec"
                                                CssClass="gridviewdesign "
                                                RowStyle-CssClass="GV"
                                                OnSelectedIndexChanged="grdDesignation_SelectedIndexChanged"
                                                OnRowCommand="grdDesignation_RowCommand"
                                                OnRowDeleting="grdDesignation_RowDeleting"
                                                OnPageIndexChanging="grdDesignation_PageIndexChanging"
                                                EmptyDataText="No Designation to display">
                                                <Columns>
                                                    <asp:CommandField
                                                        HeaderStyle-CssClass="gridView1" ItemStyle-CssClass="gridviewBody"
                                                        ButtonType="Image"
                                                        HeaderText="Actions"
                                                        DeleteImageUrl="~/assets/global/img/deletee.png"
                                                        SelectImageUrl="~/assets/global/img/edit.png"
                                                        ShowDeleteButton="True"
                                                        ShowHeader="True"
                                                        ShowSelectButton="True" />
                                                    <asp:BoundField DataField="Designation ID" HtmlEncode="False" Visible="true" HeaderText="Designation ID" ReadOnly="True" SortExpression="Designation ID" HeaderStyle-CssClass="gridView1" ItemStyle-CssClass="gridviewBody" />
                                                    <asp:BoundField DataField="Department Name" HtmlEncode="False" HeaderText="Department Name" SortExpression="Department Name" HeaderStyle-CssClass="gridView1" ItemStyle-CssClass="gridviewBody" />
                                                    <asp:BoundField DataField="Designation Name" HtmlEncode="False" HeaderText="Designation Name" SortExpression="Designation Name" HeaderStyle-CssClass="gridView1" ItemStyle-CssClass="gridviewBody" />
                                                    <asp:BoundField DataField="User Tier" HtmlEncode="False" HeaderText="User Tier" SortExpression="User Tier" HeaderStyle-CssClass="gridView1" ItemStyle-CssClass="gridviewBody" />
                                                </Columns>
                                                <PagerStyle CssClass="pagination-ys" />
                                            </asp:GridView>
                                        </div>
                                    </div>
                                    <br />
                                </div>
                            </div>
                        </div>
                    </div>
                </ContentTemplate>
                <Triggers>
                    <asp:AsyncPostBackTrigger ControlID="grdDesignation" />
                </Triggers>
            </asp:UpdatePanel>
        </div>
    </div>

    <script type="text/javascript">
        function Search_Gridview(strKey, strGV) {
            var strGV = '<%= grdDesignation.ClientID %>';
            var strData = strKey.value.toLowerCase().split(" ");
            var tblData = document.getElementById(strGV);
            var rowData;
            for (var i = 1; i < tblData.rows.length; i++) {
                rowData = tblData.rows[i].innerHTML;
                var styleDisplay = 'me';
                for (var j = 0; j < strData.length; j++) {
                    if (rowData.toLowerCase().indexOf(strData[j].toLowerCase()) != -1)
                        styleDisplay = '';
                    else {
                        styleDisplay = 'none';
                        break;
                    }
                }
                tblData.rows[i].style.display = styleDisplay;
            }
        }
    </script>
    <%--  <script type="text/javascript">
        $(function () {
            $('.search_textbox').each(function (i) {
                $(this).quicksearch("[id*=GridView1] tr:not(:has(th))", {
                    'testQuery': function (query, txt, row) {
                        return $(row).children(":eq(" + i + ")").text().toLowerCase().indexOf(query[0].toLowerCase()) != -1;
                    }
                });
            });
        });
</script>--%>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="footerContent" runat="server">
</asp:Content>
