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

<%@ Register Src="~/UserControls/GridViewPager/GridViewPager.ascx" TagName="GridViewPager"
    TagPrefix="uc1" %>
<%@ Register Src="~/UserControls/AutoComplete/AutoCompleteControl.ascx" TagName="AutoCompleteControl"
    TagPrefix="acc" %>
<%@ Register Src="~/UserControls/DatePicker/DatePickerControl.ascx" TagName="DataPickerControl"
    TagPrefix="HIMS" %>
<%@ Register Src="~/UserControls/MaterialManagement/Procurement/BatchUpdation.ascx"
    TagPrefix="BUC" TagName="BatchUserControl" %>
<%@ Register Src="~/UserControls/Common/CommonSearch/CommonSearch.ascx" TagName="CommonSearchUserControl"
    TagPrefix="uc1" %> 
        <%@ Register Src="~/UserControls/Common/CommonSearch/AlphabetSearchCommonControl.ascx" TagName="AlphabetSearchCommonControl"
TagPrefix="ACS" %>
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
    <asp:UpdatePanel ID="StockTransferUpdatePanel" runat="server">
        <ContentTemplate>
          <uc1:CommonSearchUserControl ID="CommonSearchControl" Visible ="false" runat="server" />
          <ACS:AlphabetSearchCommonControl ID="AlphabetCommonSearch" runat="server" Visible="false" />
            <div class="himssuHeader1WireBox">
                <div class="himsBoxHeader">
                    <div class="leftdiv">
                    </div>
                    <div class="himsBoxTitle">
                        <div class="headerText" id="codeHeader">
                            Stock Transfer</div>
                    </div>
                </div>
                <div class="himsBoxContent">
                    <div class="contentHolder">
                        <div class="outerBox pTop5">
                            <div class="controlLabelWidth">
                                <asp:Label ID="TransferNoLabel" runat="server" Text="Transfer No" 
                                    meta:resourcekey="TransferNoLabelResource1"></asp:Label>
                            </div>
                            <div class="fLeft">
                                <acc:AutoCompleteControl ID="TransferNoTextBox" runat="server" MinimumPrefixLength="2"
                                    Width="100px" ContextKey="Procurement.StockTransferNumber" AutoPostBack="true"
                                    DisplayLoadingStatus="true" FirstRowSelected="false" MaxLength="20" 
                                    ValidateOnTextChanged="false" />
                                <asp:ImageButton ID="TransferNoSearchImageButton" ToolTip="Transfer No. Search" SkinID="FindImage"
                                    OnClick="TransferNoSearchImageButton_Click" runat="server" 
                                    meta:resourcekey="TransferNoSearchImageButtonResource1" />
                            </div>
                        </div>
                        <div class="outerBox pTop5">
                            <div class="controlLabelWidth">
                                <asp:Label ID="TransferDateLabel" runat="server" Text="Transferred Date" 
                                    meta:resourcekey="TransferDateLabelResource1"></asp:Label>
                            </div>
                            <div class="fLeft pRight5">
                                <asp:TextBox SkinID="DisabledTextbox" ReadOnly="True" ID="TransferredDateLabel" 
                                    runat="server" meta:resourcekey="TransferredDateLabelResource1"></asp:TextBox>
                            </div>
                        </div>
                        <div class="cBoth">
                        </div>
                        <div class="outerBox pTop5">
                            <div class="controlLabelWidth">
                                <asp:Label ID="RequestNoLabel" runat="server" Text="Req. No" 
                                    meta:resourcekey="RequestNoLabelResource1"></asp:Label>
                            </div>
                            <div class="fLeft">
                                <acc:AutoCompleteControl ID="RequestNoTextBox" runat="server" MinimumPrefixLength="2"
                                    Width="100px" ContextKey="sProcurement.StockTransferRequestNumber" AutoPostBack="true"
                                    DisplayLoadingStatus="true" FirstRowSelected="false" MaxLength="20" 
                                    ValidateOnTextChanged="false" />
                                <asp:ImageButton ID="RequestNoSearchImageButton" ToolTip="Request No. Search" SkinID="FindImage"
                                    OnClick="RequestNoSearchImageButton_Click" runat="server" 
                                    meta:resourcekey="RequestNoSearchImageButtonResource1" />
                            </div>
                        </div>
                        <div class="outerBox pTop5">
                            <div class="controlLabelWidth">
                                <asp:Label ID="RequestDateLabel" runat="server" Text="Req. Date" 
                                    meta:resourcekey="RequestDateLabelResource1"></asp:Label>
                            </div>
                            <div class="fLeft pRight5">
                                <asp:TextBox SkinID="DisabledTextbox" ReadOnly="True" ID="RequestedDateDisplayLabel"
                                    runat="server" meta:resourcekey="RequestedDateDisplayLabelResource1"></asp:TextBox>
                            </div>
                        </div>
                        <div class="cBoth">
                        </div>
                        <div class="outerBox pTop5">
                            <div class="controlLabelWidth">
                                <asp:Label ID="FromLocationLabel" SkinID="mandatoryLabel" runat="server" 
                                    Text="From Location" meta:resourcekey="FromLocationLabelResource1"></asp:Label>
                            </div>
                            <div class="fLeft">
                                <asp:DropDownList ID="FromLocationDropDownList" runat="server" AutoPostBack="True"
                                    SkinID="CustomWidthDropDownList" Width="104px" OnTextChanged="FromLocationDropDownList_SelectedIndexChanged"
                                    onmouseleave="showHideTooltip()" onmouseenter="showHideTooltip()" 
                                    meta:resourcekey="FromLocationDropDownListResource1">
                                </asp:DropDownList>
                            </div>
                        </div>
                        <div class="outerBox pTop5">
                            <div class="controlLabelWidth">
                                <asp:Label ID="ToLocationLabel" SkinID="mandatoryLabel" runat="server" 
                                    Text="To Location" meta:resourcekey="ToLocationLabelResource1"></asp:Label>
                            </div>
                            <div class="fLeft pRight5">
                                <asp:DropDownList ID="ToLocationDropDownList" runat="server" onmouseleave="showHideTooltip()"
                                    SkinID="CustomWidthDropDownList" Width="104px" AutoPostBack="True" onmouseenter="showHideTooltip()"
                                    OnTextChanged="ToLocationDropDownList_SelectedIndexChanged" 
                                    meta:resourcekey="ToLocationDropDownListResource1">
                                </asp:DropDownList>
                            </div>
                        </div>
                        <div class="outerBox pTop5">
                            <div class="controlLabelWidth">
                                <asp:Label ID="TransferredByLabel" runat="server" Text="Transferred By" 
                                    meta:resourcekey="TransferredByLabelResource1"></asp:Label>
                            </div>
                            <div class="fLeft pRight5">
                                <asp:TextBox ID="TransferredByTextBox" SkinID="CustomWidthTextBox" Width="150px"
                                    runat="server" MaxLength="100" onmouseleave="showHideTooltip()" 
                                    onmouseenter="showHideTooltip()" 
                                    meta:resourcekey="TransferredByTextBoxResource1"></asp:TextBox>
                            </div>
                        </div>
                        <div class="cBoth">
                        </div>
                    </div>
                </div>
                <!-- Sub Container Box Ends -->
                <div class="spacer">
                    <asp:Image ID="Image2" runat="server" ImageUrl="~/Images/spacer.gif" 
                        meta:resourcekey="Image2Resource1" /></div>
                <!-- Sub Container Box Start -->
                <div class="himssuHeader1WireBox">
                    <div class="himsBoxHeader">
                        <div class="leftdiv">
                        </div>
                        <div class="himsBoxTitle">
                            <div class="headerText">
                                Stock Transfer Details</div>
                        </div>
                    </div>
                    <div class="himsBoxContent">
                        <div class="contentHolder">
                            <div class="outerBox pTop5">
                                <div class="controlLabelWidth">
                                    <asp:Label ID="ItemCodeLabel" SkinID="mandatoryLabel" runat="server" 
                                        Text="Item Code" meta:resourcekey="ItemCodeLabelResource1"></asp:Label>
                                </div>
                                <div class="fLeft">
                                    <acc:AutoCompleteControl ID="StockItemCodeTextBox" runat="server" MinimumPrefixLength="2"
                                     IsCacheEnabled="false"   Width="100px" ContextKey="Common.ItemTitleAll" 
                                        AutoPostBack="true" DisplayLoadingStatus="true"
                                        FirstRowSelected="false" MaxLength="20" ValidateOnTextChanged="false" />
                                    <asp:ImageButton ID="ItemCodeSearchButton" ToolTip="Item Code Search" SkinID="FindImage"
                                        OnClick="ItemCodeSearchButton_Click" runat="server" 
                                        meta:resourcekey="ItemCodeSearchButtonResource1" />
                                </div>
                            </div>
                            <div class="outerBox pTop5">
                                <div class="controlLabelWidth">
                                    <asp:Label ID="NameLabel" runat="server" Text="Item Name" 
                                        meta:resourcekey="NameLabelResource1"></asp:Label>
                                </div>
                                <div class="fLeft pRight5">
                                    <acc:AutoCompleteControl ID="StockItemNameTextBox" runat="server" MinimumPrefixLength="2"
                                      IsCacheEnabled="false"  Width="100px" 
                                        ContextKey="InventoryPlanning.ItemTitleAll" AutoPostBack="true"
                                        DisplayLoadingStatus="true" FirstRowSelected="false" MaxLength="300" 
                                        ValidateOnTextChanged="false" />
                                    <asp:ImageButton ID="ItemNameSearchButton" ToolTip="Item Name Search" SkinID="FindImage"
                                        OnClick="ItemNameSearchButton_Click" runat="server" 
                                        meta:resourcekey="ItemNameSearchButtonResource1" />
                                </div>
                            </div>
                            <div class="outerBox pTop5">
                                <div class="controlLabelWidth">
                                    <asp:Label ID="RequestedQtyLabel" runat="server" Text="Requested Qty" 
                                        meta:resourcekey="RequestedQtyLabelResource1"></asp:Label>
                                </div>
                                <div class="fLeft pRight5">
                                    <asp:TextBox ID="RequestedQtyTextBox" runat="server" MaxLength="13"  
                                          Style="text-align: right;" 
                                        onKeypress="javascript:return MaskDecimal(event,10,2)"
                                    onBlur="javascript:return fnValidateDecimal(this,10,2)" onmouseleave="showHideTooltip()"
                                    onmouseenter="showHideTooltip()" 
                                        meta:resourcekey="RequestedQtyTextBoxResource1"></asp:TextBox>
                                <%--<asp:TextBox ID="RequestedQtyTextBox" runat="server" Width="150px" SkinID="CustomWidthTextbox"
                                    AutoPostBack="True" MaxLength="13" AutoCompleteType="Disabled" TabIndex="10"
                                    Style="text-align: right;"   onKeypress="javascript:return MaskDecimal(event,12,2)"
                                    onBlur="javascript:return fnValidateDecimal(this,12,2)" onmouseleave="showHideTooltip()"
                                    onmouseenter="showHideTooltip()" 
                                    meta:resourcekey="RequestedQtyTextBoxResource1"></asp:TextBox>--%>
                                </div>
                            </div>
                            <div class="cBoth">
                            </div>
                            <div class="outerBox pTop5">
                                <div class="controlLabelWidth">
                                    <asp:Label ID="TransferQtyLabel" runat="server" SkinID="mandatoryLabel" 
                                        Text="Transfer Qty" meta:resourcekey="TransferQtyLabelResource1"></asp:Label>
                                </div>
                                <div class="fLeft">

                                    <asp:TextBox ID="TransferQtyTextBox" runat="server" MaxLength="13" onblur="javascript:return fnValidateDecimal(this,10,2)"
                                        onKeypress="javascript:return MaskDecimal(event,10,2)" onmouseleave="showHideTooltip()"
                                        onmouseenter="showHideTooltip()" Style="text-align: right;" 
                                        meta:resourcekey="TransferQtyTextBoxResource1"></asp:TextBox>
                                    <asp:ImageButton ID="TransferQtyAddImageButton" ToolTip="Add Batch" ImageUrl="~/Images/icons/icon_visit.gif"
                                        OnClick="TransferQtyAddImageButton_Click" runat="server" 
                                        CssClass="CursorHand" meta:resourcekey="TransferQtyAddImageButtonResource1" />
                                </div>
                            </div>
                            <div class="outerBox pTop5">
                                <div class="controlLabelWidth">
                                    <asp:Label ID="RemarksLabel" runat="server" Text="Remarks" 
                                        meta:resourcekey="RemarksLabelResource1"></asp:Label>
                                </div>
                                <div class="fLeft pRight5">
                                    <asp:TextBox ID="RemarksTextBox" runat="server" Style="border-color: #7F9DB9; border-width: 1px;
                                        border-style: Solid; font-size: 11px; height: 40px; width: 390px;" TextMode="MultiLine"
                                        MaxLength="300" onKeypress="javascript:return fnMaxLength(this, 300)" onblur="javascript:return CheckLength(this, 300)"
                                        onmouseleave="showHideTooltip()" onmouseenter="showHideTooltip()" 
                                        meta:resourcekey="RemarksTextBoxResource1"></asp:TextBox>
                                </div>
                            </div>
                            <div class="cBoth">
                            </div>
                        </div>
                         <div class="alignCenter pTop5">
                             <asp:Button ID="AddToListButton" runat="server" Width="60px" SkinID="CustomWidthButton"
                                    class="buttonLBlue" Text="Add" OnClick="AddToListButton_Click" 
                                    meta:resourcekey="AddToListButtonResource1" />
                                     <asp:Button ID="ClearDetailButton" runat="server" class="buttonLBlue" Width="60px" Text="Clear" 
                                    OnClick="ClearDetail_Click" meta:resourcekey="ClearButtonResource1" />
                                </div>
                            <asp:Image ID="Image5" runat="server" ImageUrl="~/Images/spacer.gif" 
                            meta:resourcekey="Image5Resource1" /></div>
                </div>
                <!--Grid starts-->
                <div id="StockTransferDetailDiv" runat="server">
                    <div class="spacer">
                        <asp:Image ID="Image14" runat="server" ImageUrl="~/Images/spacer.gif" 
                            meta:resourcekey="Image14Resource1" />
                    </div>
                    <div class="himsBoxHeader" id="PatientRelationDiv" runat="server">
                        <div class="leftdiv">
                        </div>
                        <div class="himsBoxTitle" style="width: 99%">
                            <div class="headerText">
                                <div class="fLeft">
                                    <asp:Label ID="GridViewLabel" Text="List" runat="server" Font-Bold="True" 
                                        meta:resourcekey="GridViewLabelResource1" />
                                </div>
                            </div>
                            <div align="right" class="fRight" style="margin-top: -3px;">
                                <uc1:GridViewPager ID="StockTransferDetailGridView_GridViewPager" runat="server"
                                    OnFirstRecordClick="StockTransferDetailGridView_GridViewPager_FirstRecordClick"
                                    OnLastRecordClick="StockTransferDetailGridView_GridViewPager_LastRecordClick"
                                    OnNextRecordClick="StockTransferDetailGridView_GridViewPager_NextRecordClick"
                                    OnPrevRecordClick="StockTransferDetailGridView_GridViewPager_PrevRecordClick"
                                    OnTextBoxValueChange="StockTransferDetailGridView_GridViewPager_TextBoxValueChange"
                                    ParentGridView="StockTransferDetailGridView" />
                            </div>
                        </div>
                    </div>
                    <div class="himsBoxContent">
                       <%-- <div id="DivHeader" style="vertical-align: top; width: 100%;">
                            <asp:Table ID="TransferGridViewTable" runat="server" CellPadding="0" CellSpacing="0"
                                BackColor="#E8E8E8" ForeColor="Black" Width="100%" GridLines="Both" CssClass="GridViewTableRow"
                                meta:resourcekey="TransferGridViewTableResource1">
                            </asp:Table>
                        </div>--%>
                        <div class="himsBoxContentMsg" id="GridMessageDiv" runat="server" 
                            visible="False">
                        </div>
                        <%--<div id="DivData" class="Container" style="vertical-align: top; height: 100px; width: 99.6%;">--%>
                            <asp:GridView ID="StockTransferDetailGridView" runat="server" Width="100%" AutoGenerateColumns="False"
                                OnDataBound="StockTransferDetailGridView_DataBound" OnRowDataBound="StockTransferDetailGridView_RowDataBound"
                                OnPageIndexChanging="StockTransferDetailGridView_PageIndexChanging" AllowPaging="True"
                                PageSize="5" OnDataBinding="StockTransferDetailGridView_DataBinding" 
                                DataKeyNames="Id,StockItemId" EmptyDataText="No Records Found" 
                                ShowHeader="True" meta:resourcekey="StockTransferDetailGridViewResource1">
                                <Columns>
                                    <asp:TemplateField HeaderText="Item Code" HeaderStyle-HorizontalAlign="Left"
                                        meta:resourcekey="TemplateFieldResource1">
                                        <ItemTemplate>
                                            <asp:LinkButton ID="StockItemCodeLinkButton" runat="server" OnClick="StockItemCodeLinkButton_Click"
                                                ToolTip='<%# Bind("StockItemCode") %>' Text='<%# Bind("StockItemCode") %>' Width="70px"
                                                CausesValidation="False" CommandArgument='<%# Eval("StockItemId") %>' 
                                                Enabled='<%# Eval("IsBatchWiseTracking") %>'></asp:LinkButton>
                                        </ItemTemplate>
                                        <HeaderStyle Width="20%" />
                                        <ItemStyle HorizontalAlign="Left" Width="20%" />
                                    </asp:TemplateField>
                                    <asp:TemplateField HeaderText="Item Name" HeaderStyle-HorizontalAlign="Left"
                                        meta:resourcekey="TemplateFieldResource2">
                                        <ItemTemplate>
                                            <asp:Label CssClass="boxEllips" ToolTip='<%# Bind("StockItemName") %>' ID="NameLabel"
                                                runat="server" Text='<%# Bind("StockItemName") %>' Width="200px"></asp:Label>
                                        </ItemTemplate>
                                        <HeaderStyle Width="30%" />
                                        <ItemStyle Width="30%" />
                                    </asp:TemplateField>
                                    <asp:BoundField DataField="UOM" HeaderText="UOM" 
                                        meta:resourcekey="BoundFieldResource1" >
                                        <HeaderStyle HorizontalAlign="Left" Width="25%" />
                                        <ItemStyle HorizontalAlign="Left" Width="25%" />
                                    </asp:BoundField>
                                    <asp:BoundField DataField="RequestedQuantity" HeaderText="Requested Qty" 
                                        DataFormatString="{0:F}" meta:resourcekey="BoundFieldResource2" >
                                        <HeaderStyle HorizontalAlign="Right" Width="10%" />
                                        <ItemStyle HorizontalAlign="Right" Width="10%" />
                                    </asp:BoundField>
                                    <asp:TemplateField HeaderText="Transferred Qty" HeaderStyle-HorizontalAlign="Right"
                                        meta:resourcekey="TemplateFieldResource3">
                                        <ItemTemplate>
                                            <asp:TextBox ID="TransferQuantityTextBoxGrid" Enabled='<%# GetTransferQuantityTextBoxGridBehavior(Eval("IsBatchWiseTracking"), Eval("Id"),Eval("IsFreezed")) %>'
                                                runat="server" Text='<%# String.Format("{0:F}", Eval("TransferredQuantity")) %>'
                                                Width="80px" MaxLength="13" onblur="javascript:return fnValidateDecimal(this,10,2)"
                                                onKeypress="javascript:return MaskDecimal(event,10,2)" onmouseleave="showHideTooltip()" EnableViewState = "true"
                                                onmouseenter="showHideTooltip()" Style="text-align: right;" AutoPostBack="True"
                                                SkinID="CustomWidthTextBox" 
                                                OnTextChanged="TransferQuantityTextBoxGrid_TextChanged" 
                                                meta:resourcekey="TransferQuantityTextBoxGridResource1"></asp:TextBox>
                                        </ItemTemplate>
                                       <%-- <HeaderStyle HorizontalAlign="Left" Width="20%" />--%>
                                        <ItemStyle HorizontalAlign="Right" Width="10%" />
                                    </asp:TemplateField>
                                    <asp:TemplateField HeaderText="Delete" 
                                        meta:resourcekey="TemplateFieldResource4">
                                        <ItemTemplate>
                                            <asp:ImageButton ID="DeleteImageButton" runat="server" CommandName="Delete" CommandArgument='<%# Eval("StockItemId") %>'
                                                OnClick="DeleteImageButton_Click" SkinID="DeleteImage" ToolTip="Delete" 
                                                Enabled='<%# GetDeleteImageGridBehavior(Eval("Id")) %>' 
                                                meta:resourcekey="DeleteImageButtonResource1" />
                                        </ItemTemplate>
                                        <HeaderStyle HorizontalAlign="Center" Width="10%" />
                                        <ItemStyle HorizontalAlign="Center" Width="10%" />
                                    </asp:TemplateField>
                                </Columns>
                                <PagerSettings Visible="False" />
                            </asp:GridView>
                       <%-- </div>--%>
                    </div>
                </div>
                <!--Grid Ends-->
                <BUC:BatchUserControl ID="BatchUpdationCtrl" runat="server" />
            </div>
        </ContentTemplate>
    </asp:UpdatePanel>
    <%--<script data-main="../../../JavaScript/rjs/encrypt/stock-transfer-encrypt" src="../../../JavaScript/rjs/require.js"></script>--%> 
    <script data-main='<%=ResolveUrl("~/JavaScript/rjs/stock-transfer")%>' src='<%=ResolveUrl("~/JavaScript/rjs/require.js")%>'></script>    
</asp:Content>
