<%@ Page Title="" Language="vb" AutoEventWireup="false" MasterPageFile="~/FiniqAppMasterPage.Master" CodeBehind="FinIQ_Product_Navigator.aspx.vb" Inherits="FinIQWebApp.FinIQ_Product_Navigator" %>

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


    <%--    <script src="../FinIQJS/jquery-ui.min.js"></script>
    <link href="../FinIQJS/jquery-ui.min.css" rel="stylesheet" />--%>

    <script type="text/javascript">
        //function DoPostBack() {
        //    __doPostBack("txtFind", "TextChanged");
        //}

        //function txtTradeKeydown(e) {
        //    if (e.keyCode == 13) {
        //        // alert(1);

        //        $("#ctl00_MainContent_btnSearch").focus();
        //        // $('#btnSearch').trigger('click');
        //        _doPostBack("txtFind", "TextChanged");
        //    }
        //}
        function DoPostBack() {
            //txtFind_TextChanged(this, "TextChanged");
            $("#ctl00_MainContent_btnSearch").click();
            return true;
        }

        function txtTradeKeydown(e) {
            if (e.keyCode == 13) {
                // alert(1);
                //  $("#ctl00_MainContent_txtFind").change();
                // return true;
                $("#ctl00_MainContent_btnSearch").click();
                return true;
                // $('#btnSearch').trigger('click');
                // _doPostBack("txtFind", "TextChanged");
            }
        }
        //$(document).ready(function () {
        //    $("#ctl00_MainContent_dtlstExhanges td td ").each(function () {
        //        $(this).sortable();
        //    });
        //    $("#ctl00_MainContent_dtlstExhanges a").disableSelection();
        //});


        ////$("#ctl00_MainContent_dtlstExhanges_ctl00_dtlstShares").sortable();
        ////$("#ctl00_MainContent_dtlstExhanges_ctl00_dtlstShares").disableSelection();


        ////$(document).on("keypress", "input", function (e) {
        ////    if (e.which == 13) {
        ////        var inputVal = $(this).val();
        ////        alert("You've entered: " + inputVal);
        ////    }
        ////});

        ////var input = document.getElementById("txtFind");
        ////input.addEventListener("keyup", function (event) {
        ////    if (event.keyCode === 13) {
        ////        event.preventDefault();
        ////        document.getElementById("btnSearch").click();
        ////    }
        ////});


        function NoPostback() {
            event.returnValue = false;
        }

        function OpenDealentry(lnk, event) {
            var templatecode = $(lnk).parent().find('[id$="lbl_TemplateCodeLink"]').text();
            window.open('../UCP/FinIQ_UCPDealEntry.aspx?mode=LRC&TemplateCode=' + templatecode + '&Master_Popup=POPUP#navpanes=0&toolbar=0&statusbar=0&scrollbar=1&pagenum=1&view=fitH,0');
            return false;
        }


    </script>


    <style type="text/css"> 
               /*updated by ShekharL @14-May-2022 BBVASOLAR Assigned by Rushikesh N.  */
#ctl00_MainContent_dtlstExhanges a:link {
    padding: 5px;
    height:14px; 
    display: block;
    vertical-align: middle;
    width: 400px !important;    
    transition: all 0.30s ease-in;
}
/*Added by ShekharL @14-May-2022 BBVASOLAR Assigned by Rushikesh N.  */
#ctl00_MainContent_dtlstExhanges a:link:hover{
    font-weight:500;
    font-size:125%; 
}

        .ShareDetailsContainer {
            display: none;
            border-radius: 10px;
            width: 710px;
            height: auto;
            position: absolute;
            box-shadow: 3px 3px 4px #666;
            border: solid 1px #ddd;
            border-collapse: collapse;
        }

            .ShareDetailsContainer table table {
            }

        .lblInfo_share {
            font: normal 14px/32px Verdana, Helvetica, sans-serif;
            padding: 5px;
        }

        .DispToggle, .CollapseToggle {
            width: 20px !important;
            height: 20px !important;
            outline: 0 !important;
            background-repeat: no-repeat;
        }



        .inputs {
            border: 1px;
        }

        .GridCSS {
            text-decoration: none;
            border-style: none;
        }

        #dvCode table {
            float: left;
            margin: 2px;
        }




        .Grid, .grid {
            border: solid 1px #dddddd;
            border-collapse: collapse;
        }

                /*Added by ShekharL @14-May-2022 BBVASOLAR Assigned by Rushikesh N.  */
.MH_firstcolumn{
    width:28px !important;
}

    </style>

    <asp:ScriptManagerProxy ID="scriptmanagerproxy1" runat="server"></asp:ScriptManagerProxy>

    <asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Always">
        <ContentTemplate>

            <table class="Filter" style="border: none">

                <tr>
                    <td>
                        <asp:Label ID="lblFind" runat="server" Text="Template Name :" CssClass="lbl"></asp:Label>
                        <asp:TextBox ID="txtFind" Width="300px" AutoPostBack="true" runat="server" Style="margin-left: 45px;" CssClass="txt" onkeyup="return txtTradeKeydown(event)"></asp:TextBox>
                        <%--<input type="text" id="txtFind" Style="margin-left: 45px;" Class="txt" runat="server">--%>
                        <asp:Button ID="btnSearch" Style="text-align: center !important; width: 90px; margin-right: 8px" Text="Find" runat="server" CssClass="btn" />
                    </td>
                    <td>

                        <asp:Button ID="btnExpandAll" Visible="true" Style="text-align: center !important; width: 90px; margin-right: 8px" Text="Expand All" runat="server" CssClass="btn" />
                        <asp:Button ID="btnCollapseAll" Visible="true" Style="text-align: center !important; width: 90px; margin-right: 8px" Text="Collapse All" runat="server" CssClass="btn" />
                        <asp:Button ID="btnExport" Visible="true" Style="text-align: center !important; width: 110px; margin-right: 8px" Text="Export To Excel" runat="server" CssClass="btn" />
                        <asp:Label ID="lblMessage" runat="server" Visible="false" ForeColor="#0284e0" Text="Template names in red color is/are not mapped to Deal Entry."></asp:Label>
                    </td>

                </tr>

                <tr>
                </tr>
                <tr>
                    <td colspan="2">
                        <asp:Label ID="lblError" runat="server" CssClass="lblerror"></asp:Label>
                    </td>
                </tr>
            </table>

            <table>
                <tr>
                    <td>
                        <div id="divshares" style="display: inline-block;" runat="server" allowdrag="true" allowdrop="true">
                            <asp:DataList ID="dtlstExhanges" Style="" runat="server" AllowDrag="true" AllowDrop="true" RepeatDirection="Horizontal" RepeatLayout="Table" RepeatColumns="1">
                             <ItemTemplate> 
                                    <div class="SN_HLine" style="padding-top: 10px; display: inline-block; min-width: 100%;">
                                        <table style="width: 100%; min-width: 75vw;">
                                            <tr>
                                                <td class="MH_firstcolumn" style=" max-width:28px; white-space: nowrap;">
                                                    <asp:Button runat="server" ID="btnDisp" OnClick="Expand_exchange" CommandArgument='<%#Eval("Product_Name")%>' class="DispToggle" OnChange="NoPostback()" />
                                                    <asp:Button runat="server" ID="btncollapse" Visible="false" OnClick="Collapse_exchange" CommandArgument='<%#Eval("Product_Name")%>' class="CollapseToggle" OnChange="NoPostback()" />
                                                </td>
                                               <td> 
                                                    <asp:Label ID="lblProductName" Style="display: none;" runat="server" Text='<%#Eval("Product_Name")%>'></asp:Label>
                                                </td>  
                                                <td style="white-space: nowrap; padding: 5px;">
                                                    <asp:Label ID="lblExchangLong" CssClass="SN_lblHeader" runat="server" Text='<%#Eval("Product_Name")%>'></asp:Label>
                                                    <asp:Label ID="lblTemplateCount" CssClass="SN_lblHeader" runat="server" Text='<%#Eval("TemplateCount")%>'></asp:Label>
                                                    </td>  
                                                <td  style="width: 100%;"></td>
                                            </tr>
                                        </table>
                                    </div>
                                    <asp:DataList ID="dtlstShares" Style="margin-top: 10px !important; margin-bottom: 10px; margin-left: 5px !important;" runat="server" OnItemDataBound="InnerDatalist_ItemDataBound" AllowDrag="true" AllowDrop="true" RepeatDirection="Horizontal" RepeatLayout="Table" RepeatColumns="3">
                                        <ItemTemplate>
                                            <asp:Label ID="lbl_TemplateCodeLink" Style="display: none;" runat="server" Text='<%#Eval("Template_Code")%>'></asp:Label>
                                            <asp:LinkButton ID="LinkButton1" runat="server" Style="padding-left: 30px" ForeColor="#0284e0" Text='<%# Eval("Template")%>' OnClientClick="OpenDealentry(this,event); return false;"></asp:LinkButton>
                                             </ItemTemplate>
                                    </asp:DataList>
                                </ItemTemplate>
                            </asp:DataList>
                        </div>
                    </td>
                    <td>
                        <div id="div_lblcode" class="ShareDetailsContainer" runat="server">
                            <table>
                                <tr>
                                    <th>
                                        <asp:Label ID="lblInfo_share" CssClass="lblInfo_share" runat="server"> </asp:Label></th>
                                </tr>
                                <tr>
                                    <td>
                                        <table id="grdSharDetails" style="padding-left: 16px !important" class="Grid" cellspacing="0" cellpading="0" border="0 !important"></table>
                                    </td>
                                </tr>
                            </table>
                        </div>
                    </td>
                </tr>
            </table>
            <table>

                <tr>
                    <td style="width: 163px">
                        <input id="hdnButtonClick" type="hidden" runat="server" />

                        <asp:HiddenField ID="hdnAccountName" runat="server" />
                        <asp:HiddenField ID="FileName" runat="server" />
                        <asp:HiddenField ID="HdnFileFullPath" runat="server" />

                    </td>

                </tr>

            </table>
        </ContentTemplate>
        <Triggers>
            <asp:PostBackTrigger ControlID="btnExport" />

        </Triggers>


    </asp:UpdatePanel>
    <asp:HiddenField ID="hdnSessionID" runat="server" />


    <script type="text/javascript">
        $(document).ready(function () {
            $("#dtlstExhanges").click(function () {
            });
            $(".draggable").draggable({ revert: 'invalid', helper: 'clone' });
            $(".droppable").droppable();
            $(".droppable").bind('drop', function (ev, ui) { itemInSpot(ui.draggable, this); });
        });
        function itemInSpot(drag_item, spot) {
            var oldSpotItem = $(spot).find('img');
            if (oldSpotItem.length > 0) {
                oldSpotItem.remove();
            }
            var item = $('<img />');
            item.attr('src', drag_item.attr('src')).attr('class', drag_item.attr('class')).appendTo(spot).draggable({ revert: 'invalid' });
            //drag_item.remove(); // remove the old object
        }

        function New_Order_Compact(lblcntrl) {
            //
            // var NoteMasterId = $("#ctl00_MainContent_dlProductPriceDetails_ctl0" + lblcntrl + "_lblnotemasterid").text();
            //var CustomerID = document.getElementById('ctl00_MainContent_hdncustid').value;
            //var wflurl = $("#ctl00_MainContent_dlProductPriceDetails_ctl0" + lblcntrl + "_lblWflUrl").text();
            // var prdurl = $("#ctl00_MainContent_dlProductPriceDetails_ctl0" + lblcntrl + "_lblPrdUrl").text();
            var templateID = $("#ctl00_MainContent_dtlstExhanges_ctl00_dtlstShares" + lblcntrl + "_lblTemplateCode")//$("#ctl00_MainContent_dlProductPriceDetails_ctl0" + lblcntrl + "_lbltemplateid").text();lblTemplateCode
            // var FundCode = $("#ctl00_MainContent_dlProductPriceDetails_ctl0" + lblcntrl + "_lblsubscheme").text();
            // var SchemeCode = document.getElementById('ctl00_MainContent_dlProductPriceDetails_ctl0' + lblcntrl + '_lblscheme').innerText; /* Code Added By Dinesh On 21-Apr-2018 Demo*/
            // var FundCcy = $("#ctl00_MainContent_dlProductPriceDetails_ctl0" + lblcntrl + "_lblccy").text().trim();
           // alert(templateID);
            //$("#ctl00_MainContent_dlProductPriceDetails_ctl0" + lblcntrl + "_lbllaunchneworder").html("<iframe id='iframe" + lblcntrl + "' scrolling='yes' frameborder='0' style='height:800px !important;width:1500px !important' src='../UCP/FinIQ_UCPDealEntry.aspx?WorkflowMode=UCPWFL&DealNum=N:" + NoteMasterId + "&Master_Popup=POPUP#navpanes=0&toolbar=0&statusbar=0&scrollbar=1&pagenum=1&view=fitH,0'></iframe>");
            $("#ctl00_MainContent_dlProductPriceDetails_ctl0" + lblcntrl + "_lbllaunchneworder").html("<iframe id='iframe" + lblcntrl + "' scrolling='yes' frameborder='0' style='height:800px !important;width:1500px !important' src='../UCP/FinIQ_UCPDealEntry.aspx?WorkflowMode=UCPQEN&TemplateCode=" + templateID + "&Master_Popup=POPUP#navpanes=0&toolbar=0&statusbar=0&scrollbar=1&pagenum=1&view=fitH,0'></iframe>");
        }
    </script>
</asp:Content>

