<%@ Page Title="Ware House" Language="C#" MasterPageFile="~/Master.Master" AutoEventWireup="true" CodeBehind="WareHouse.aspx.cs" Inherits="ZFJINV.Definitions.WareHouse" %>

<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">
                <!-- <i class="icon-settings font-red"></i> -->
                <span class="caption-subject font-blue sbold" style="font-size: 150%;">Warehouse</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_addWarehouse" data-toggle="tab"
                                        style="font-size: 13px; color: #2E4053; font-weight: 700;">Add Warehoue </a>
                                </li>
                                <li>
                                    <a href="#tab_warehouetList" data-toggle="tab"
                                        style="font-size: 13px; color: #2E4053; font-weight: 700;">Warehoue List </a>
                                </li>

                            </ul>

                            <div class="tab-content">
                                <div class="tab-pane active" id="tab_addWarehouse">
                                    <div class="ui segment" style="min-height: 160px;">
                                        <div class="ui stackable form">


                                            <div class="col-md-3">
                                                <label class="lbStyle">W.H. ID:</label>
                                                <asp:TextBox ID="txtWHID" runat="server" title="Ware House ID" CssClass="myInput" required="required"></asp:TextBox>
                                            </div>

                                            <div class="col-md-3">
                                                <label class="lbStyle">W.H. Name:</label>
                                                <asp:TextBox ID="txtWHName" runat="server" title="Ware House Name" CssClass="myInput" required="required"></asp:TextBox>
                                            </div>
                                            <div class="col-md-3">
                                                <label class="lbStyle">W.H. Address:</label>
                                                <asp:TextBox ID="txtWHLocation" runat="server" title="Ware House Address" CssClass="myInput" required="required"></asp:TextBox>
                                            </div>


                                            <div class="col-md-3">
                                                <label class="lbStyle">W.H. Country:</label>

                                                <asp:DropDownList ID="txtWHCountry" AutoPostBack="True" runat="server" CssClass="select2 form-control " required="required"
                                                    AppendDataBoundItems="true" OnSelectedIndexChanged="txtWHCountry_OnSelectedIndexChanged" onchange="showLoader('City')">
                                                </asp:DropDownList>
                                            </div>

                                            <div class="col-md-3">

                                                <label class="lbStyle">W.H. City:</label>
                                                <asp:DropDownList ID="txtWHCity" AutoPostBack="False" runat="server" CssClass="select2 form-control " required="required"></asp:DropDownList>
                                                <img src="../assets/global/img/default.gif" style="display: none" id="loaderCity" />

                                            </div>

                                           <%-- <div class="col-md-3">
                                                <label class="lbStyle">W.H. Incharge:</label>
                                                <asp:DropDownList ID="txtWHIncharge" runat="server" class="select2 form-control "></asp:DropDownList>
                                            </div>--%>


                                            <div class="col-md-3">
                                                <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_OnClick" 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_warehouetList">
                                    <asp:TextBox ID="search_textbox" runat="server" CssClass="myInput" Font-Size="18px" onkeyup="Search_Gridview(this, 'gvTest')"></asp:TextBox><br />
                                    <div class="rounded-corners">
                                        <div style="width: 100%; overflow: auto;">
                                            <asp:GridView ID="GridView1" runat="server" AllowPaging="True" AutoGenerateColumns="False"
                                                GridLines="Horizontal" BorderColor="#ECF0F1" AlternatingRowStyle-BackColor="#F2F3F4" RowStyle-Wrap="false"
                                                HeaderStyle-Wrap="false" RowStyle-BorderColor="#e8e8ec"
                                                PageSize="20"
                                                CssClass="gridviewdesign" RowStyle-CssClass="GV"
                                                OnSelectedIndexChanged="GridView1_OnSelectedIndexChanged"
                                                OnRowCommand="GridView1_OnRowCommand"
                                                OnRowDeleting="GridView1_OnRowDeleting"
                                                OnPageIndexChanging="GridView1_OnPageIndexChanging"
                                                EmptyDataText="No data to display">
                                                <Columns>
                                                    <asp:CommandField
                                                        HeaderStyle-CssClass="gridView1" ItemStyle-CssClass="gridviewBody"
                                                        ButtonType="Image"
                                                        HeaderText="Actions"
                                                        SelectImageUrl="~/assets/global/img/edit.png"
                                                        ShowHeader="True"
                                                        ShowSelectButton="True" />
                                                    <asp:BoundField DataField="ID" HeaderText="ID" SortExpression="ID" HeaderStyle-CssClass="gridView1" ItemStyle-CssClass="gridviewBody" />
                                                    <asp:BoundField DataField="WHName" HeaderText="Name" SortExpression="Name" HeaderStyle-CssClass="gridView1" ItemStyle-CssClass="gridviewBody" />
                                                    <asp:BoundField DataField="Incharge" HeaderText="Incharge" SortExpression="Incharge" HeaderStyle-CssClass="gridView1" ItemStyle-CssClass="gridviewBody" Visible="false" />
                                                    <asp:BoundField DataField="Location" HeaderText="Address" SortExpression="Address" HeaderStyle-CssClass="gridView1" ItemStyle-CssClass="gridviewBody" />
                                                    <asp:BoundField DataField="City" HeaderText="City" SortExpression="City" HeaderStyle-CssClass="gridView1" ItemStyle-CssClass="gridviewBody" />
                                                    <asp:BoundField DataField="Country" HeaderText="Country" SortExpression="Country" 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="GridView1" />
                </Triggers>
            </asp:UpdatePanel>
        </div>
    </div>
    <script type="text/javascript">
        function Search_Gridview(strKey, strGV) {
            var strGV = '<%= GridView1.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>
</asp:Content>
