<%@ page title="" language="C#" masterpagefile="~/Pages/Common/MasterPages/MainMasterPage_new.master" autoeventwireup="true" inherits="Pages_MaterialManagement_Procurement_PrefixSetup, App_Web_reu4ptl4" uiculture="auto" enableEventValidation="false" viewStateEncryptionMode="Never" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajaxToolkit" %>
<%@ Register Src="~/UserControls/GridViewPager/GridViewPager.ascx" TagName="GridViewPager" TagPrefix="uc1" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
<%@ Register Src="~/UserControls/DatePicker/DatePickerControl.ascx" TagName="DataPickerControl"
    TagPrefix="HIMS" %>
<%@ Register Src="~/UserControls/Common/ScreenGroup/ScreenGroup.ascx" TagName="ScreenGroupControl"
    TagPrefix="ScreenGroup" %>
<%--<%@ Register Src="~/UserControls/Emrd/EmrdPatientSearch.ascx" TagName="EmrdPtSearch" TagPrefix="EPS" %>
<%@ Register Src="~/UserControls/Common/PatientSearch/PatientSearch.ascx" TagName="PatientSearchUserControl" TagPrefix="PS" %>--%>
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
    <asp:UpdatePanel ID="OTQueueListingUpdatePanel" runat="server">
        <ContentTemplate>

            <div id="divContentPage" class="divcontentpagemargin">
                <!-- ContentPlaceHolder Box Starts -->
             
                            <div class="dashBoardLeftCont">
                                <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>
                                        <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">
                                <div class="himssuHeader1WireBox card card-box">
                                    <div class="himsBoxHeader card-head" id="Div4" runat="server" visible="True">
                                        <div class="leftdiv">
                                        </div>

                                        <div class="himsBoxTitle">
                                            <div class="headerText fLeft">
                                                  <header>
                                          <i class="fas fa-wrench"></i>
                                                <asp:Label ID="Label4" Text="Prefix Setup Master"
                                                    runat="server" />
                                                      </header>
                                            </div>
                                        </div>
                                    </div>

                                    <div class="himsBoxContent card-body">


                                        <asp:Panel ID="DetailPanel" runat="Server">


                                            <div class="spacer">
                                                <asp:Image ID="Image1" runat="server" ImageUrl="~/Images/spacer.gif" meta:resourcekey="Image1Resource1" />
                                            </div>

                                            <div class="alignCenter col-md-12">
                                                <div class="col-md-4">
                                                                                                    <asp:Button ID="ApplyDefaultPrefixButton" runat="server" Text="Apply Default Prefix" OnClick="ApplyDefaultPrefixButton_Click" CssClass="btn btn-apply fas pull-right" SkinID="0"/>

                                                </div>
                                                <div class="col-md-3 alignCenter">
                                                                                                    &nbsp; &nbsp;<asp:TextBox ID="ApplyPrefixLengthTextBox" MaxLength="2" onkeypress="return isNumberKey(event)" Onchange="return ValidateNumeric(this);" runat="server" CssClass="margin_left"></asp:TextBox>

                                                </div>
                                                <div class="col-md-4">
                                                &nbsp; &nbsp; <asp:Button ID="ApplyPrefixLengthButton" runat="server" Text="Apply Prefix Length to All" OnClick="ApplyPrefixLengthButton_Click" CssClass="btn btn-apply fas pull-left" SkinID="0"/>
                                            </div>
                                                </div>

                                            <div class="contentHolder">
                                                <div class="himssuHeader6WireBox col-md-12">
                                                    <div class="himsBoxHeader card-head inner" id="GridViewPagerDiv" runat="server" visible="True">
                                                        <div class="leftdiv">
                                                        </div>
                                                        <div class="himsBoxTitle">
                                                            <div class="gridHeaderText fLeft">
                                                                <header>
                                                                <asp:Label ID="GridViewLabel" Text="Available Functionality Area To Select" runat="server" />
                                                                    <br /><div class="cBoth"></div>
                                                                    </header>

                                                            </div>
                                                            <div class="fRight">
                                                                <uc1:GridViewPager ID="PrefixSetupGridViewPager" Visible="false" runat="server"
                                                                    ParentGridView="PrefixSetupGridView" />
                                                            </div>
                                                        </div>
                                                    </div>
                                                    <div class="himsBoxContent pTop10">
                                                        <div id="GridViewMessageDiv" class="himsBoxContentMsg" runat="server"
                                                            visible="False">
                                                        </div>
                                                           <div id="Div2" runat="server" class="table-responsive">
                                                        <asp:GridView ID="PrefixSetupGridView" runat="server" Width="100%" AutoGenerateColumns="False"
                                                            EmptyDataText="No Records Found !!"
                                                            AllowPaging="False" OnRowDataBound="PrefixSetupGridView_RowDataBound" CssClass="table table-striped table-bordered table-hover"
                                                            DataKeyNames="Id,PrefixFunctionalityId,PrefixFunctionality,Prefix,SpecifiedPrefixLength,EffectiveDate">
                                                            <Columns>

                                                                <asp:BoundField DataField="Id" HeaderText="Id" Visible="false"></asp:BoundField>
                                                                <asp:BoundField DataField="PrefixFunctionalityId" HeaderText="PrefixFunctionalityId" Visible="false"></asp:BoundField>
                                                                <asp:TemplateField HeaderStyle-HorizontalAlign="Center" ItemStyle-Width="1%" ItemStyle-Wrap="true">
                                                                    <HeaderTemplate>
                                                                         <label class="rt-chkbox rt-chkbox-outline">
                                                                        <asp:CheckBox ID="HeaderSelectCheckBox" runat="server" AutoPostBack="true"
                                                                            OnCheckedChanged="HeaderSelectCheckBox_OnCheckedChanged" />
                                                                                <span></span>
                                                                                    </label>
                                                                    </HeaderTemplate>
                                                                    <ItemTemplate>
                                                                         <label class="rt-chkbox rt-chkbox-outline">
                                                                        <asp:CheckBox ID="SelectCheckBox" runat="server" />
                                                                                <span></span>
                                                                                    </label>
                                                                    </ItemTemplate>
                                                                    <ItemStyle HorizontalAlign="Center" />
                                                                </asp:TemplateField>
                                                                <asp:BoundField DataField="PrefixFunctionality" HeaderText="PrefixFunctionality" ItemStyle-Width="25%" HeaderStyle-HorizontalAlign="Left"></asp:BoundField>
                                                                <asp:BoundField DataField="CurrentNumber" HeaderText="Last Number" ItemStyle-Width="10%" HeaderStyle-HorizontalAlign="Left"></asp:BoundField>
                                                                

                                                                <asp:TemplateField HeaderText="Prefix" ItemStyle-Width="20%" ItemStyle-Wrap="true" HeaderStyle-HorizontalAlign="Left">
                                                                    <ItemTemplate>

                                                                        <asp:TextBox ID="PrefixTextBox" runat="server" ClientIDMode="Static" Text='<%# Bind("Prefix") %>'
                                                                            SkinID="MultilineTextBox"></asp:TextBox>

                                                                    </ItemTemplate>
                                                                </asp:TemplateField>

                                                                <asp:TemplateField HeaderText="Prefix Length" ItemStyle-Width="20%" ItemStyle-Wrap="true" HeaderStyle-HorizontalAlign="Left">
                                                                    <ItemTemplate>

                                                                        <asp:TextBox ID="PrefixLengthTextBox" runat="server" onkeypress="return isNumberKey(event)" Onchange="return ValidateNumeric(this);" ClientIDMode="Static" Text='<%# Bind("SpecifiedPrefixLength") %>'
                                                                            SkinID="MultilineTextBox"></asp:TextBox>

                                                                    </ItemTemplate>
                                                                </asp:TemplateField>

                                                                <asp:TemplateField HeaderText="Effective Date" ItemStyle-Width="20%" ItemStyle-Wrap="true" HeaderStyle-HorizontalAlign="Left">
                                                                    <ItemTemplate>
                                                                       
                                                                        <HIMS:DataPickerControl ID="EffectiveDateTextBox" AutoCompleteType="Disabled" DisplayDatePicker="true" Text='<%# Bind("EffectiveDate","{0:d}") %>'
                                                                            runat="server" />
                                                                           
                                                                    </ItemTemplate>
                                                                </asp:TemplateField>

                                                            </Columns>
                                                            <PagerSettings Visible="False" />
                                                        </asp:GridView>
                                                               </div>
                                                    </div>
                                                </div>
                                            </div>
                                        </asp:Panel>
                                    </div>
                                </div>

                            </div>
                    
            </div>
            <div class="spacer">
                <img src="../../../Images/spacer.gif" />
            </div>
        </ContentTemplate>
    </asp:UpdatePanel>
    <%--<script data-main="../../../JavaScript/rjs/encrypt/prefix-setup-master-encrypt" src="../../../JavaScript/rjs/require.js"></script>--%>
    <script data-main='<%=ResolveUrl("~/JavaScript/rjs/prefix-setup-master")%>' src='<%=ResolveUrl("~/JavaScript/rjs/require.js")%>'></script>    
    <script>
        $(document).ready(function () {
            $("#ApplyPrefixLengthTextBox").keydown(function (e) {
                // Allow: backspace, delete, tab, escape, enter and .
                if ($.inArray(e.keyCode, [46, 8, 9, 27, 13, 110, 190]) !== -1 ||
                    // Allow: Ctrl+A, Command+A
                    (e.keyCode === 65 && (e.ctrlKey === true || e.metaKey === true)) ||
                    // Allow: home, end, left, right, down, up
                    (e.keyCode >= 35 && e.keyCode <= 40)) {
                    // let it happen, don't do anything
                    return;
                }
                // Ensure that it is a number and stop the keypress
                if ((e.shiftKey || (e.keyCode < 48 || e.keyCode > 57)) && (e.keyCode < 96 || e.keyCode > 105)) {
                    e.preventDefault();
                }
            });
        });
    </script>
</asp:Content>
