<%@ page language="C#" autoeventwireup="true" inherits="Pages_MaterialManagement_Procurement_StockEnquiry, App_Web_tvvzwpls" masterpagefile="~/Pages/Common/MasterPages/MainMasterPage_new.master" uiculture="auto" meta:resourcekey="PageResource1" enableEventValidation="false" viewStateEncryptionMode="Never" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajaxToolkit" %>
<%@ Register Src="~/UserControls/GridViewPager/GridViewPager.ascx" TagName="GridViewPager"
    TagPrefix="uc1" %>
<%@ Register Src="~/UserControls/AutoComplete/AutoCompleteControl.ascx" TagName="AutoCompleteControl"
    TagPrefix="acc" %>
<%@ Register Src="~/UserControls/Common/ScreenGroup/ScreenGroup.ascx" TagName="ScreenGroupControl"
    TagPrefix="ScreenGroup" %>
<%@ Register Src="~/UserControls/Common/CommonSearch/AlphabetSearchCommonControl.ascx" TagName="AlphabetSearchCommonControl"
    TagPrefix="ACS" %>
<%@ Register Src="~/UserControls/Common/Stock/StockDetailBoxControl.ascx" TagName="StockControl" TagPrefix="Stock" %>

<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">

    <asp:UpdatePanel ID="StockEnquiryUpdatePanel" runat="server">
        <ContentTemplate>
            <ACS:AlphabetSearchCommonControl ID="AlphabetCommonSearch" runat="server" Visible="false" />
            <div id="divContentPage" class="divcontentpagemargin">
                <!-- ContentPlaceHolder Box Starts -->

                <div class="dashBoardLeftCont" valign="top">
                    <div class="himssuHeader3WireBox">
                        <%--<div class="himsBoxHeader">
                                        <div class="leftdiv">
                                        </div>
                                        <div class="himsBoxTitle">
                                            <div class="headerText">
                                            <asp:Label runat="server" ID="ScreenGroupNameLabel"></asp:Label>    
                                            </div>
                                        </div>
                                    </div>--%>
                        <table width="0px" cellpadding="0" cellspacing="0">
                            <tr>
                                <td>
                                    <div class="himsBoxContent">
                                        <div class="leftUlMenu">
                                            <ScreenGroup:ScreenGroupControl EnableViewState="true" ID="ScreenGroupControl" ScreenGroupId="160"
                                                Visible="true" runat="server" />
                                        </div>
                                    </div>
                                </td>
                            </tr>
                        </table>
                    </div>
                </div>
                <div class="whiteboxpaddingleft row">
                    <Stock:StockControl ID="StockUserControl" runat="server" Visible="true" />
                    <div class="card card-box">
                        <!-- Sub Container Box1 Start -->
                        <div class="himssuHeader2WireBox">
                            <div class="himsBoxHeader card-head">
                                <asp:Panel ID="Panel1" runat="server" meta:resourcekey="Panel1Resource1">
                                    <div class="leftdiv">
                                    </div>
                                    <div class="himsBoxTitle">
                                        <asp:Image ID="Image2" runat="server" class="fLeft"
                                            meta:resourcekey="Image2Resource1" />
                                        <div class="headerText">
                                            <header>
                                                <i class="fas fa-asterisk"></i>
                                                <asp:Label ID="Label3" runat="server" Text="Criteria"
                                                    meta:resourcekey="Label3Resource1"></asp:Label>
                                            </header>
                                            <%--    <cc1:CollapsiblePanelExtender ID="CollapsiblePanelExtender1" runat="server" TargetControlID="DetailPanel"
                                                        ExpandControlID="Image2" CollapseControlID="Image2" TextLabelID="Label3"
                                                        ImageControlID="Image2" ExpandedImage="~/images/buttonCollapse.gif"
                                                        CollapsedImage="~/images/buttonExpand.gif" Enabled="True" />--%>
                                        </div>
                                    </div>
                                </asp:Panel>
                            </div>
                            <div class="himsBoxContent card-body">
                                <asp:Panel ID="DetailPanel" runat="server"
                                    meta:resourcekey="DetailPanelResource1">
                                    <div class="contentHolder">
                                        <asp:Panel ID="SearchCriteriaPanel" runat="server"
                                            meta:resourcekey="SearchCriteriaPanelResource1">
                                            <div class="outerBox pTop5 col-md-3" runat="server" visible="false">
                                                <div class="controlLabelWidth">
                                                    <asp:Label ID="DepartmentLabel" runat="server" Text="Location"
                                                        meta:resourcekey="DepartmentLabelResource1"></asp:Label>
                                                </div>
                                                <div class="fLeft">
                                                    <asp:DropDownList ID="DepartmentDropDownList" runat="server" CssClass="form-control" SkinID="CustomWidthDropDownList"
                                                        onmouseleave="showHideTooltip()" onmouseenter="showHideTooltip()"
                                                        meta:resourcekey="DepartmentDropDownListResource1">
                                                    </asp:DropDownList>
                                                </div>
                                            </div>
                                            <div class="outerBox pTop5 col-md-3">
                                                <div class="controlLabelWidth">
                                                    <asp:Label ID="ItemCodeLabel" runat="server" Text="Item Code"
                                                        CssClass="mandatory" meta:resourcekey="ItemCodeLabelResource1"></asp:Label>
                                                </div>
                                                <div class="fLeft pRight5 display-flex">
                                                    <acc:AutoCompleteControl ID="ItemCodeAutoCompleteControl" runat="server" MinimumPrefixLength="2"
                                                        IsCacheEnabled="false" AutoPostBack="true"
                                                        DisplayLoadingStatus="true" FirstRowSelected="false"
                                                        ContextKey="Ip.StockItemMasterCode" MaxLength="20" ValidateOnTextChanged="false"
                                                        OnTextChanged="ItemCodeAutoCompleteControl_TextChanged" />
                                                    <asp:ImageButton ID="ItemCodeSearchImageButton" ToolTip="Item Code Search" SkinID="FindImage"
                                                        OnClick="ItemCodeSearchImageButton_Click" runat="server"
                                                        meta:resourcekey="ItemCodeSearchImageButtonResource1" />
                                                </div>
                                            </div>
                                            <div class="outerBox pTop5 col-md-3">
                                                <div class="controlLabelWidth">
                                                    <asp:Label ID="ItemNameLabel" runat="server" Text="Item Name" CssClass="mandatory"
                                                        meta:resourcekey="ItemNameLabelResource1"></asp:Label>
                                                </div>
                                                <div class="fLeft pRight5 display-flex">
                                                    <acc:AutoCompleteControl ID="ItemNameAutoCompleteControl" runat="server" MinimumPrefixLength="2"
                                                        IsCacheEnabled="false" AutoPostBack="true"
                                                        DisplayLoadingStatus="true" FirstRowSelected="false"
                                                        ContextKey="InventoryPlanning.ItemTitleAll" MaxLength="50" ValidateOnTextChanged="false"
                                                        OnTextChanged="ItemNameAutoCompleteControl_TextChanged" />
                                                    <asp:ImageButton ID="ItemNameSearchImageButton" ToolTip="Item Name Search" SkinID="FindImage"
                                                        OnClick="ItemNameSearchImageButton_Click" runat="server"
                                                        meta:resourcekey="ItemNameSearchImageButtonResource1" />
                                                </div>
                                            </div>
                                            <div class="cBoth">
                                            </div>
                                            <div class="alignCenter pTop5">
                                                <asp:Button ID="SearchButton" CssClass="btn btn-search fas" Text="&#xf002; Search" runat="server"
                                                    OnClick="SearchButton_Click"
                                                    SkinID="0" />
                                                <asp:Button ID="ClearButton" Text="&#xf12d; Reset" CssClass="btn btn-reset fas" SkinID="0" onblur="fnClearTabIndexChange()" runat="server"
                                                    OnClick="ClearButton_Click"
                                                    meta:resourcekey="ClearButtonResource1" />
                                            </div>
                                        </asp:Panel>


                                        <div id="StockEnquirySearchListDiv" class="himssuHeader7WireBox pTop15 col-md-12" runat="server">
                                            <div id="StockEnquiryDiv" runat="server">

                                                <div class="himsBoxHeader" id="PatientRelationDiv" runat="server">
                                                    <div class="leftdiv">
                                                    </div>
                                                    <div class="himsBoxTitle">
                                                        <div class="headerText">
                                                            <div class="fLeft">
                                                                <asp:Label ID="StockEnquirySearchListGridViewLabel" Text="" runat="server"
                                                                    Font-Bold="True"
                                                                    meta:resourcekey="StockEnquirySearchListGridViewLabelResource1" />
                                                            </div>
                                                        </div>
                                                        <div align="right" class="fRight" style="margin-top: 0px;">
                                                            <uc1:GridViewPager ID="StockEnquirySearchListGridView_GridViewPager" runat="server"
                                                                OnFirstRecordClick="StockEnquirySearchListGridView_GridViewPager_FirstRecordClick"
                                                                OnLastRecordClick="StockEnquirySearchListGridView_GridViewPager_LastRecordClick"
                                                                OnNextRecordClick="StockEnquirySearchListGridView_GridViewPager_NextRecordClick"
                                                                OnPrevRecordClick="StockEnquirySearchListGridView_GridViewPager_PrevRecordClick"
                                                                OnTextBoxValueChange="StockEnquirySearchListGridView_GridViewPager_TextBoxValueChange"
                                                                ParentGridView="StockEnquirySearchListGridView" />
                                                        </div>
                                                    </div>
                                                </div>
                                                <!--StockEnquirySearchListGrid starts-->
                                                <div class="himsBoxContent">
                                                    <div id="Div2" runat="server" class="table-responsive">
                                                        <asp:GridView ID="StockEnquirySearchListGridView" runat="server" Width="100%" AutoGenerateColumns="False"
                                                            AllowPaging="True" PageSize="5" OnRowDataBound="grd_RowDataBound" ShowHeader="true"
                                                            meta:resourcekey="StockEnquirySearchListGridViewResource1"
                                                            CssClass="table table-striped table-bordered table-hover">
                                                            <Columns>
                                                                <asp:TemplateField HeaderText="Id" SortExpression="Id" Visible="False"
                                                                    meta:resourcekey="TemplateFieldResource1">
                                                                    <ItemTemplate>
                                                                        <asp:Label ID="IdLabel" runat="server"
                                                                            Text='<%# DataBinder.Eval(Container.DataItem, "Department.DepartmentId") %>'
                                                                            meta:resourcekey="IdLabelResource1"></asp:Label>
                                                                    </ItemTemplate>
                                                                </asp:TemplateField>
                                                                <asp:TemplateField HeaderText="Sub Location" HeaderStyle-HorizontalAlign="Left"
                                                                    meta:resourcekey="TemplateFieldResource2">
                                                                    <ItemTemplate>
                                                                        <asp:Label ID="DepartmentNameLabel" runat="server"
                                                                            Text='<%# DataBinder.Eval(Container.DataItem, "Department.DepartmentName") %>'
                                                                            meta:resourcekey="DepartmentNameLabelResource1"></asp:Label>
                                                                    </ItemTemplate>
                                                                    <HeaderStyle Width="40%" />
                                                                    <ItemStyle Width="40%" />
                                                                </asp:TemplateField>
                                                                <asp:TemplateField HeaderText="Item Name" HeaderStyle-HorizontalAlign="Left"
                                                                    meta:resourcekey="TemplateFieldResource3">
                                                                    <ItemTemplate>
                                                                        <asp:Label ID="ItemNameLabel" runat="server"
                                                                            Text='<%# DataBinder.Eval(Container.DataItem,"StockItem.StockItemName") %>'
                                                                            meta:resourcekey="ItemNameLabelResource2"></asp:Label>
                                                                    </ItemTemplate>
                                                                    <HeaderStyle Width="40%" />
                                                                    <ItemStyle Width="40%" />
                                                                </asp:TemplateField>
                                                                <asp:TemplateField HeaderText="Quantity" HeaderStyle-HorizontalAlign="Left"
                                                                    meta:resourcekey="TemplateFieldResource4">
                                                                    <ItemTemplate>
                                                                        <asp:LinkButton ID="QuantityLinkButton" Text='<%# DataBinder.Eval(Container.DataItem, "Department.Quantity") %>'
                                                                            runat="server" CommandArgument='<%# DataBinder.Eval(Container.DataItem, "Department.DepartmentId") + "," + DataBinder.Eval(Container.DataItem, "StockItem.StockItemCode") + "," + DataBinder.Eval(Container.DataItem, "StockItem.StockItemName") %>'
                                                                            OnClick="QuantityLinkButton_Click"
                                                                            meta:resourcekey="QuantityLinkButtonResource1"></asp:LinkButton>
                                                                    </ItemTemplate>
                                                                    <HeaderStyle HorizontalAlign="Right" Width="15%" />
                                                                    <ItemStyle HorizontalAlign="Right" Width="15%" />
                                                                </asp:TemplateField>
                                                            </Columns>
                                                            <PagerSettings Visible="False" />
                                                        </asp:GridView>
                                                    </div>
                                                </div>
                                                <!--StockEnquirySearchListGrid Ends-->
                                            </div>
                                        </div>

                                    </div>
                                </asp:Panel>

                                <!-- Sub Container1 Box End -->

                                <!-- Sub Container2 Box Start -->
                                <div class="spacer">
                                    <asp:Image ID="Image5" runat="server" ImageUrl="~/Images/spacer.gif"
                                        meta:resourcekey="Image5Resource1" />
                                </div>

                                <div id="Div1" class="himssuHeader7WireBox col-md-12" runat="server">
                                    <div id="StockEnquiryDetailListDiv" runat="server">
                                        <div class="himsBoxHeader">
                                            <div class="leftdiv">
                                            </div>
                                            <div class="himsBoxTitle pTop10" style="width: 99%;padding-left:2px">
                                                <div class="headerText">
                                                    <div class="fLeft">
                                                        <asp:Label ID="StockEnquiryDetailLabel" runat="server"
                                                            meta:resourcekey="StockEnquiryDetailLabelResource1"></asp:Label>
                                                    </div>
                                                </div>
                                                <div align="right" class="fRight">
                                                    <uc1:GridViewPager ID="StockEnquiryDetailGridView_GridViewPager" runat="server"
                                                        OnFirstRecordClick="StockEnquiryDetailGridView_GridViewPager_FirstRecordClick"
                                                        OnLastRecordClick="StockEnquiryDetailGridView_GridViewPager_LastRecordClick"
                                                        OnNextRecordClick="StockEnquiryDetailGridView_GridViewPager_NextRecordClick"
                                                        OnPrevRecordClick="StockEnquiryDetailGridView_GridViewPager_PrevRecordClick"
                                                        OnTextBoxValueChange="StockEnquiryDetailGridView_GridViewPager_TextBoxValueChange"
                                                        ParentGridView="StockEnquiryDetailGridView" />
                                                </div>
                                            </div>
                                        </div>
                                        <!--Grid Starts-->
                                        <div class="himsBoxContent card-body">
                                            <div class="himsBoxContentMsg" id="GridMessageDiv" runat="server"
                                                visible="False">
                                            </div>
                                            <div id="Div3" runat="server" class="table-responsive">
                                                <asp:GridView ID="StockEnquiryDetailGridView" runat="server" Width="100%" AutoGenerateColumns="False"
                                                    DataKeyNames="Id" AllowPaging="True" PageSize="5" ShowHeader="true"
                                                    EmptyDataText="No Records Found"
                                                    meta:resourcekey="StockEnquiryDetailGridViewResource1"
                                                    CssClass="table table-striped table-bordered table-hover">
                                                    <Columns>
                                                        <asp:TemplateField HeaderText="Id" SortExpression="Id" Visible="False"
                                                            meta:resourcekey="TemplateFieldResource5">
                                                            <ItemTemplate>
                                                                <asp:Label ID="IdLabel" runat="server"
                                                                    Text='<%# DataBinder.Eval(Container.DataItem, "Department.DepartmentId") %>'
                                                                    meta:resourcekey="IdLabelResource2"></asp:Label>
                                                            </ItemTemplate>
                                                        </asp:TemplateField>
                                                        <asp:TemplateField HeaderText="Sub Location" HeaderStyle-HorizontalAlign="Left"
                                                            meta:resourcekey="TemplateFieldResource6">
                                                            <ItemTemplate>
                                                                <asp:Label ID="DepartmentNameLabel" runat="server"
                                                                    Text='<%# DataBinder.Eval(Container.DataItem, "Department.DepartmentName") %>'
                                                                    meta:resourcekey="DepartmentNameLabelResource2"></asp:Label>
                                                            </ItemTemplate>
                                                            <HeaderStyle Width="30%" />
                                                            <ItemStyle Width="30%" />
                                                        </asp:TemplateField>
                                                        <asp:TemplateField HeaderText="UOM" meta:resourcekey="TemplateFieldResource7" HeaderStyle-HorizontalAlign="Left">
                                                            <ItemTemplate>
                                                                <asp:Label ID="UOMLabel" runat="server"
                                                                    Text='<%# DataBinder.Eval(Container.DataItem, "StockItem.StockItemDetailList.UOM") %>'
                                                                    meta:resourcekey="UOMLabelResource1"></asp:Label>
                                                            </ItemTemplate>
                                                            <HeaderStyle Width="20%" />
                                                            <ItemStyle Width="20%" />
                                                        </asp:TemplateField>
                                                        <asp:TemplateField HeaderText="Batch" meta:resourcekey="TemplateFieldResource8">
                                                            <ItemTemplate>
                                                                <asp:Label ID="BatchLabel" runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "StockItem.StockItemDetailList.BatchNumber") %>'
                                                                    meta:resourcekey="BatchLabelResource1"></asp:Label>
                                                            </ItemTemplate>
                                                            <HeaderStyle Width="20%" />
                                                            <ItemStyle Width="20%" />
                                                        </asp:TemplateField>
                                                        <asp:TemplateField HeaderText="Exp Date" meta:resourcekey="TemplateFieldResource9">
                                                            <ItemTemplate>
                                                                <asp:Label ID="ExpiryDateLabel" runat="server" Text='<%# ((DateTime)DataBinder.Eval(Container.DataItem, "StockItem.StockItemDetailList.ExpiryDate"))== DateTime.MinValue ? "" : Eval("StockItem.StockItemDetailList.ExpiryDate", "{0:d}") %>'
                                                                    meta:resourcekey="ExpiryDateLabelResource1"></asp:Label>
                                                            </ItemTemplate>
                                                            <HeaderStyle Width="15%" />
                                                            <ItemStyle Width="15%" />
                                                        </asp:TemplateField>

                                                        <asp:TemplateField HeaderText="System Qty"
                                                            meta:resourcekey="TemplateFieldResource10">
                                                            <ItemTemplate>
                                                                <asp:Label ID="SystemQtyLabel" runat="server"
                                                                    Text='<%# DataBinder.Eval(Container.DataItem, "StockItem.StockItemDetailList.SQuantity") %>'
                                                                    meta:resourcekey="SystemQtyLabelResource1"></asp:Label>
                                                            </ItemTemplate>
                                                            <HeaderStyle HorizontalAlign="Right" Width="10%" />
                                                            <ItemStyle HorizontalAlign="Right" Width="10%" />
                                                        </asp:TemplateField>
                                                    </Columns>
                                                    <PagerSettings Visible="False" />
                                                </asp:GridView>
                                            </div>
                                            <!--Grid Ends-->
                                        </div>
                                    </div>
                                </div>

                                <!-- Sub Container2 Box End -->
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <div class="spacer">
                <img src="../../../Images/spacer.gif" />
            </div>
        </ContentTemplate>
    </asp:UpdatePanel>
    <%--<script data-main="../../../JavaScript/rjs/encrypt/stock-enquiry-encrypt" src="../../../JavaScript/rjs/require.js"></script>--%>
    <script data-main='<%=ResolveUrl("~/JavaScript/rjs/stock-enquiry")%>' src='<%=ResolveUrl("~/JavaScript/rjs/require.js")%>'></script>
</asp:Content>
