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

<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");

        //}
        /* <ShekharL / ManasiA || 26-May-2021 || UBPINT-853 || Code changes to prevent logout on enter/tab key >*/
        function DoPostBack() {
            //txtFind_TextChanged(this, "TextChanged");
            $("#ctl00_MainContent_btnSearch_Verifier").click();
            return true;
        }

        function txtTradeKeydown(e) {
            if (e.keyCode == 13) {
                // alert(1);
                //  $("#ctl00_MainContent_txtFind").change();
                // return true;
                $("#ctl00_MainContent_btnSearch_Verifier").click();
                return true;
                // $('#btnSearch').trigger('click');
                // _doPostBack("txtFind", "TextChanged");
            }
        }
        /* <ShekharL / ManasiA || 26-May-2021 || UBPINT-853 || Code changes to prevent logout on enter/tab key >*/
        Sys.WebForms.PageRequestManager.getInstance().add_initializeRequest(
            function () {
         
                if (document.getElementById) {
                    wt = $(document).width();
                    ht = $(document).height()

                    $(".UpdateProgress").width(wt);
                    $(".UpdateProgress").height(ht);
                    $(".Progress").width(wt);
                }
            }
        )
        function txtTradeKeydown(event) {
            //  
            if (event.keyCode == 13) {
                //alert(1);
               // 
                $("#ctl00_MainContent_btnSearch_Verifier").focus();
                // $('#btnSearch').trigger('click');
                _doPostBack("txtFind_Verifier", "TextChanged");
            }
        }



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

        function hideshow(txt, event) {
            //
            var lbl_ScriptResult = document.getElementById("<%=lbl_ScriptResult.ClientID %>");
            lbl_ScriptResult.innerHTML = "";

            $("#grdScriptDetails").empty();
            var lbl_ScriptInfo = document.getElementById("<%=lbl_ScriptInfo.ClientID %>");
            lbl_ScriptInfo.innerHTML = "";
            var div_lblScript = document.getElementById("<%=div_lblScript.ClientID %>");
            div_lblScript.style.display = "none";

            var div_lblcode = document.getElementById("<%=div_lblcode.ClientID %>");
            var Template = $(txt).context.innerHTML;

            if (Template == "") {
                Template = sessionStorage.getItem("Template_Name");
            }
            Template = Template.split("(")[0];
            sessionStorage.setItem("Template_Name", Template)

            div_lblcode.style.display = "none";
            if (div_lblcode.style.display == "none") {
                event = window.event ? window.event : event;
                event.stopPropagation();
                var x = event.pageX;
                var y = event.pageY;

                div_lblcode.style.display = "block";
                div_lblcode.style.right = "400px";//Number(x) + "px";
                div_lblcode.style.top = (Number(y)) - 30 + "px";
                div_lblcode.style.position = "absolute";


                $(document).on("click", function () {

                    return true;
                });


            }

            var path_Name = window.location.pathname;
            var myPageName = path_Name.substring(path_Name.lastIndexOf('/') + 1);
            $.ajax({
                type: "POST",
                url: "" + path_Name + "/display_TemplateInfornmation",
                cache: false,
                async: true,

                data: "{'Template':'" + Template + "'}",
                dataType: "text",
                contentType: "application/json; charset=utf-8",
                crossDomain: true,
                complete: function (XMLHttpRequest, textStatus, errorThrown) {

                },
                success: OnSuccess,
                failure: function (response) {

                },
                error: function (response) {

                }

            });
        }

        function OnSuccess(response) {

           // 
          
            $("#grdSharDetails").empty();

            var $tr = $('<tr class="GridHeader">').append(
                $('<th style="width:250px;" class="centerAlign">').text("TimeStamp"),
                $('<th style="width:150px;" class="centerAlign">').text("User ID"),
                $('<th style="width:120px;" class="centerAlign">').text("Tab Name")

            ).appendTo("#grdSharDetails");

            //
            if (response != null || response != undefined) {

                if ($.parseJSON(response).d.length > 0) {
                    var obj = $.parseJSON(response).d;
                    var trHTML = '';
                    $(obj).each(function (i, item) {



                        var $tr = $('<tr class="GridItem">').append(
                            $('<td style="width:250px;" class="centerAlign">').text(item.LastActionTime),
                            $('<td style="width:150px;" class="centerAlign">').text(item.User_ID),
                            $('<td style="width:120px;"class="centerAlign">').text(item.UAL_ID4)
                        ).appendTo("#grdSharDetails");

                    });

                }
            }
            try {
                SetSorting_Filter1();
            } catch (er) { }
        }

        //New Script-Info Details 
        function Show_ScriptDetails(txt, event) {
            //
            var lbl_ScriptResult = document.getElementById("<%=lbl_ScriptResult.ClientID %>");
            lbl_ScriptResult.innerHTML = "";
            var div_lblScript = document.getElementById("<%=div_lblScript.ClientID %>");

            var div_ScriptInfo = document.getElementById("<%=div_ScriptInfo.ClientID %>");
            div_ScriptInfo.style.display = "none";
            var Template = '';
            Template = sessionStorage.getItem("Template_Name");
            div_lblScript.style.display = "none";
            div_ScriptInfo.style.display = "none";
            if (div_ScriptInfo.style.display == "none") {
                event = window.event ? window.event : event;
                event.stopPropagation();
                var x = event.pageX;
                var y = event.pageY;

                div_ScriptInfo.style.display = "block";
                div_ScriptInfo.style.right = "400px";//Number(x) + "px";
                div_ScriptInfo.style.top = (Number(y)) - 30 + "px";
                div_ScriptInfo.style.position = "absolute";


                $(document).on("click", function () {

                    return true;
                });


            }

            var path_Name = window.location.pathname;
            var myPageName = path_Name.substring(path_Name.lastIndexOf('/') + 1);
            $.ajax({
                type: "POST",
                url: "" + path_Name + "/display_ScriptInfornmation",
                cache: false,
                async: true,

                data: "{'Template':'" + Template + "'}",
                dataType: "text",
                contentType: "application/json; charset=utf-8",
                crossDomain: true,
                complete: function (XMLHttpRequest, textStatus, errorThrown) {

                },
                success: OnSuccess_Script,
                failure: function (response) {

                },
                error: function (response) {

                }
            });
        }

        function OnSuccess_Script(response) {


            $("#grdScriptDetails").empty();

            var $tr = $('<tr class="GridHeader">').append(
                $('<th style="width:150px;" class="centerAlign">').text("Version No"),
                $('<th style="width:150px;" class="centerAlign">').text("Modified By"),
                $('<th style="width:120px;" class="centerAlign">').text("Modified At"),
                $('<th style="width:120px;" class="centerAlign">').text(""),
                $('<th style="width:120px;" class="centerAlign">').text("")
            ).appendTo("#grdScriptDetails");


            if (response != null || response != undefined) {

                if ($.parseJSON(response).d.length > 0) {
                    var obj = $.parseJSON(response).d;
                    var trHTML = '';
                    $(obj).each(function (i, item) {



                        var $tr = $('<tr class="GridItem">').append(
                            $('<td style="width:150px;" class="centerAlign">').text(item.Version_No),
                            $('<td style="width:150px;" class="centerAlign">').text(item.ModifiedBY),
                            $('<td style="width:120px;"class="centerAlign">').text(item.Modified_AT),
                            $('<td style="width:60px;" class="centerAlign" id="tdDownload">').html('<asp:LinkButton type="submit" OnClientClick="javascript:DownloadFile(this,  ' + item.Version_No + ');return false;" runat="Server" Text="Download"></asp:LinkButton>'),
                            // $('<td style="width:60px;" class="centerAlign" id="tdDownload">').html('<a href="#" onclick="DownloadFile(' + item.Version_No + ')">' + "Download" + '</a>'),
                            $('<td style="width:60px;" class="centerAlign">').html('<a href="#" onclick="Recreate_Script(' + item.Version_No + ')">' + "Recreate" + '</a>')
                        ).appendTo("#grdScriptDetails");

                    });

                }
            }
            try {
                SetSorting_Filter1();
            } catch (er) { }
        }



        function DownloadFile(that, VersionNo) {
           // 
            var Template = '';
            Template = sessionStorage.getItem("Template_Name");
            VersionNo = $(that).parents('tr.GridItem')[0].cells[0].innerText;
            $('[id$="HdnTemplateName"]').val(Template);
            $('[id$="HdnVersionNo"]').val(VersionNo);
            $('[id$="btnDownload"]').click();
            // 
            // _doPostBack("btnDownload", VersionNo)
        }

        function showDiv(Version_No) {

            var url = '';
            var url_string = window.location.href;
            var lbl_ScriptInfo = document.getElementById("<%=lbl_ScriptInfo.ClientID %>");
            var path_Name = window.location.pathname;
            var Template = '';
            Template = sessionStorage.getItem("Template_Name");
            var myPageName = path_Name.substring(path_Name.lastIndexOf('/') + 1);
            //
            $.ajax({
                type: "POST",
                url: "" + path_Name + "/View_ScriptInfo",
                cache: false,
                async: true,

                data: "{'Version_no':'" + Version_No + "', 'TemplateName':'" + Template + "'}",
                dataType: "text",
                contentType: "application/json; charset=utf-8",
                crossDomain: true,
                complete: function (XMLHttpRequest, textStatus, errorThrown) {

                },

                success: function (response) {  }
                ,
                failure: function (response) {

                },
                error: function (response) {

                }

            });



        }

        function Recreate_Script(Version_No) {
           // 

            var div_Recreate = document.getElementById("<%=div_Recreate.ClientID %>");
            div_Recreate.style.display = "none";
            sessionStorage.setItem("Version_No", Version_No);

            if (div_Recreate.style.display == "none") {
                event = window.event ? window.event : event;
                event.stopPropagation();
                var x = event.pageX;
                var y = event.pageY;

                div_Recreate.style.display = "block";
                div_Recreate.style.right = "400px";//Number(x) + "px";
                div_Recreate.style.top = (Number(y)) + 80 + "px";
                div_Recreate.style.position = "absolute";

                $(document).on("click", function () {

                    return true;
                });


            }


        }
        function div_Close(txt, event) {

            var div_lblcode = document.getElementById("<%=div_lblcode.ClientID %>");
            div_lblcode.style.display = "none";

        }

        function divScript_Close(txt, event) {

            var div_Recreate = document.getElementById("<%=div_Recreate.ClientID %>");
            div_Recreate.style.display = "none";

        }

        function Execute_Scripts(txt, event) {
 //
            var url = '';
            var Str_OTP = '';
            var Version_No = '';
            Version_No = sessionStorage.getItem("Version_No");
            var div_Recreate = document.getElementById("<%=div_Recreate.ClientID %>");
            var txtEnter_OTP = document.getElementById("<%=txtEnter_OTP.ClientID %>");
            var url_string = window.location.href;
            var lbl_ScriptResult = document.getElementById("<%=lbl_ScriptResult.ClientID %>");
            var path_Name = window.location.pathname;
            var myPageName = path_Name.substring(path_Name.lastIndexOf('/') + 1);
            Str_OTP = txtEnter_OTP.value;
            var Template = '';
            Template = sessionStorage.getItem("Template_Name");


            $.ajax({
                type: "POST",
                url: "" + path_Name + "/Recreate_Script",
                cache: false,
                async: true,

                data: "{'Version_no':'" + Version_No + "', 'Str_OTP':'" + Str_OTP + "', 'Str_Template':'" + Template + "'}",
                dataType: "text",
                contentType: "application/json; charset=utf-8",
                crossDomain: true,
                complete: function (XMLHttpRequest, textStatus, errorThrown) {

                },
                success: function (response) {
                    lbl_ScriptResult.innerHTML = "Scripts Executed Successfully";
                    div_Recreate.style.display = "none";
                },

                failure: function (response) {

                    lbl_ScriptResult.innerHTML = "Error while Scripts Execution";

                },
                error: function (response) {

                }

            });
        }



        function Show_gridScript(txt, event) {
            //
            var div_lblScript = document.getElementById("<%=div_lblScript.ClientID %>");
            var div_ScriptInfo = document.getElementById("<%=div_ScriptInfo.ClientID %>");
            div_ScriptInfo.style.display = "none";
            $("#grdScriptDetails").empty();




            var Template = $(txt).context.innerHTML;
            Template = Template.split("(")[0];
            $("#grdSharDetails").empty();

            div_lblScript.style.display = "none";

            if (div_lblScript.style.display == "none") {
                event = window.event ? window.event : event;
                event.stopPropagation();
                var x = event.pageX;
                var y = event.pageY;

                div_lblScript.style.display = "block";
                //div_lblScript.style.right = "75px";//Number(x) + "px";
                //div_lblScript.style.top = (Number(y)) - 20 + "px";
                div_lblScript.style.position = "absolute";


                $(document).on("click", function () {

                    return true;
                });


            }
            div_ScriptInfo.style.display = "none";
        }







    </script>

    <style type="text/css">
        td.topAlign {
            vertical-align: top;
        }

        td.centerAlign {
            text-align: center;
        }

        #ctl00_MainContent_dtlstExhanges a:link {
            padding: 5px;
            display: block;
            vertical-align: middle;
        }

        .tdPadding {
            padding: 10px;
        }


        .snooker, #ctl00_MainContent_dtlstCustomers_ctl00_dtlstPortfolios_ctl00_dtlstTransactions td input, .snooker input {
            margin: 5px;
            padding: 0px;
            width: 4em;
            height: 4em;
            border-radius: 4em;
            box-sizing: border-box;
            border: solid 0px #FFF !important;
            border-collapse: collapse;
            background-image: url(../App_Resources/snooker.png);
            background-repeat: no-repeat;
            background-size: 105%;
            background-attachment: scroll;
            background-position: center;
            color: #FFF;
            font: normal 14px/3em verdana;
            text-align: center;
            text-decoration: none;
            display: block;
            vertical-align: middle;
            /*box-shadow: 0px 39px 18px -20px rgba(0,0,0,0.5);*/
            text-shadow: 1px 1px 1px #000;
            opacity: 1;
        }

            .snooker a:hover, #ctl00_MainContent_dtlstCustomers_ctl00_dtlstPortfolios_ctl00_dtlstTransactions td input:hover {
                box-shadow: 0px 0px 20px 2px #ff76ff;
                opacity: 1;
            }


        .linkbutton_verifier {
            font: normal 14px Verdana, Helvetica, sans-serif, Montserrat;
        }


        .solid {
            background-color: #e2aa75;
        }

            .solid:hover {
                background-color: #40c5ff;
            }

        .btn_ballcss {
            background-color: #F2F2F2; /* Gray */
            border: none;
            padding: 20px;
            text-align: center;
            text-decoration: none;
            display: inline-block;
            font-size: 14px;
            margin: 4px 2px;
            cursor: pointer;
            border-radius: 50%;
        }

        .ShareDetailsContainer {
            display: none;
            border-radius: 10px;
            width: 550px;
            position: absolute;
            /*box-shadow: 3px 3px 4px #666;*/
           /* border: solid 1px #ddd;*/                            /* Commented By RizwanS for common css use / Asked By ShekharL / 04 Oct 2021 */
            border-collapse: collapse;
            position: absolute;
            overflow-y: auto;
            height: 250px;
            width: 564px;
        }

        .ShareDetails_Container {
            display: none;
            width: 550px;
            position: absolute;
            position: absolute;
            height: 227px;
            width: 564px;
        }

        .ShareDetailsContainer table table {
        }

        .lblInfo_share {
            font: normal 14px/32px Verdana, Helvetica, sans-serif !important;
         /*   color: #000;*/                                                            /* Commented By RizwanS for common css use / Asked By ShekharL / 04 Oct 2021 */
            padding: 5px;
        }

        .DispToggle, .CollapseToggle {
            width: 20px !important;
            height: 20px !important;
           /* border: none 0px #FFF !important;*/
           /* color: #FFF !important;*/
           /* background-color: #FFFFFF;*/                                            /* Commented By RizwanS for common css use / Asked By ShekharL / 04 Oct 2021 */
            outline: 0 !important;
            background-repeat: no-repeat;
        }

     /*   .DispToggle {
            background-image: url("../App_Resources/plus1.png");
        }

        .CollapseToggle {
            background-image: url("../App_Resources/minus_1.png");
        }*/                                                                            /* Commented By RizwanS for common css use / Asked By ShekharL / 04 Oct 2021 */                                                             

        .inputs {
            border: 1px;
            /*color: white;*/                                                           /* Commented By RizwanS for common css use / Asked By ShekharL / 04 Oct 2021 */
        }

        .showToggle {
            background-image: url("../App_Resources/Embedded_Actions.png");
        }

        .hideToggle, .showToggle, .EnableToggle, .DisableToggle {
            width: 196px;  /*Changed by Rohit T. 12-May-2022*/
            height: 28px;  /*Changed by Rohit T. 12-May-2022*/
           /* border: none 0px #FFF !important;*/
           /* color: #FFF !important;*/
           /*  background-color: #FFFFFF;*/                                            /* Commented By RizwanS for common css use / Asked By ShekharL / 04 Oct 2021 */
            outline: 0 !important;                                     
            background-repeat: no-repeat;
            background-size: contain;
        }

        .hideToggle {
            background-image: url("../App_Resources/Regular_Action.png");
        }

        .GridCSS {
           /* border-bottom: 1px solid #000;*/                                       
           /*border: White;*/                                                        /* Commented By RizwanS for common css use / Asked By ShekharL / 04 Oct 2021 */
           text-decoration: none;
           border-style: none;
           
        }

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

        /*.lblHeader {
            font: normal 18px/18px Verdana, Helvetica, sans-serif !important;*/
            /*color: #000000 !important;*/
            /*margin: 0px !important;
        }*/

     /*   .btn, .btn:hover {
            text-align: left !important;
            box-shadow: 0px 2px #ddd !important;
            outline: none !important;
        }*/                                                                            /* Commented By RizwanS for common css use / Asked By ShekharL / 04 Oct 2021 */

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

        .lockTemplate {
            background-image: url("../App_Resources/Locked-Unlock.png");
            height: 29px;
            width: 175px;
        }

        .unlockTemplate {
            background-image: url("../App_Resources/Lock-Unlocked.png");
            height: 29px;
            width: 175px;
        }

        .tdlockUnlock {
            width: 250px;
            vertical-align: top;
        }

        .divPadding5 {
            padding: 5px 5px 5px 0px;
        }
        /*Added by ShekharL @14-May-2022 BBVASOLAR Assigned by Rushikesh N.  */
.MH_firstcolumn{
    width:28px !important;
}
    </style>

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

    <asp:UpdatePanel ID="UpdatePanel_Verifier" runat="server" UpdateMode="Conditional">
        <ContentTemplate>

            <div id="div_Recreate" class="ShareDetails_Container" style="display: none; background: #f6f6f6; z-index: 1; width: 270px; height: 120px; border: solid 1px #ddd;" runat="server">

                <asp:Button ID="btn_CloseDiv" BackColor="#e8af75" runat="server" Style="float: right" OnClientClick="divScript_Close(this,event); return false;" Text="X" CssClass="btn" />
                <asp:Label runat="server" Text="Please Enter password to Execute script!" Style="margin: 5px 15px 18px 9px;" CssClass="lbl"></asp:Label>
                <asp:TextBox ID="txtEnter_OTP" Style="margin: 5px 5px 1px 9px;" runat="server"></asp:TextBox>
                <asp:Button ID="btn_SaveScript1" BackColor="#FFA64D" runat="server" Style="margin: 5px 5px 1px 9px;" OnClientClick="Execute_Scripts(this,event); return false;" Text="EXECUTE" CssClass="btn" />
            </div>
            <div id="div_lblcode" class="ShareDetailsContainer" runat="server">
                <table style="padding: 0px 5px 5px 5px;">
                    <tr>
                        <asp:Button Style="text-align: center !important; width: 253px; margin: 5px 5px 5px 5px;" Text="Timeline of Changes via GUI" runat="server" CssClass="btn" OnClientClick="hideshow(this, event); return false;" />
                        <asp:Button Style="text-align: center !important; width: 253px; margin: 5px 0px 5px 5px;" Text="Script Based Operations" runat="server" BackColor="#FFA64D" CssClass="btn" OnClientClick="Show_gridScript(this,event); return false;" />
                        <asp:Button ID="btn_Close" BackColor="#e8af75" runat="server" Style="float: right; margin: 5px 0px 5px 5px;" OnClientClick="div_Close(this,event); return false;" Text="X" CssClass="btn" />
                        <asp:Label runat="server" ID="lbl_ScriptResult" Width="300px" Style="margin: 5px 5px 1px 9px;" CssClass="lbl"></asp:Label>
                    </tr>

                    <tr>
                        <div id="div_lblcode_inside">
                            <td colspan="2" style="max-height: 300px !important">
                                <table id="grdSharDetails" style="padding-left: 16px !important; overflow: scroll; height: auto;" borderstyle="none" class="Grid" cellspacing="0" cellpading="0" border="0 !important"></table>
                            </td>
                        </div>

                    </tr>
                    <tr>

                        <div id="div_lblScript" class="ShareDetails_Container" style="display: none; width: 300px; height: 200px;" runat="server">
                            <asp:UpdatePanel ID="UpdatePanel_Verifier1" runat="server" UpdateMode="Conditional">
                                <ContentTemplate>
                                    <div style="border-radius: 10px; width: 550px; position: absolute; box-shadow: 3px 3px 4px #666; border: solid 1px #ddd; border-collapse: collapse;">
                                        <asp:Label runat="server" ID="lbl_ScriptInfo" Width="300px" Style="margin: 5px 5px 1px 9px;" CssClass="lbl"></asp:Label>
                                        <asp:Button ID="btnExport_Script" runat="server" Width="253px" Height="30px" Style="margin: 5px 26px 5px 5px;" BackColor="#FFA64D" Text="Generate Fresh Script(Read Only)" CssClass="btn" />
                                        <asp:Button ID="btnScript_Save" runat="server" Width="253px" Height="30px" Style="margin: 5px 26px 5px 5px;" BackColor="#FFA64D" Text="Generate & Record Fresh Script into DB" CssClass="btn" />
                                        <div id="div_SavingScript" runat="server" visible="false">
                                            <asp:Label runat="server" ID="lbl_ScriptAlert" Text="Please Enter passowrd to save script!" Style="margin: 5px 5px 1px 9px;" CssClass="lbl"></asp:Label>
                                            <asp:TextBox ID="txtOtp_validation" runat="server"></asp:TextBox>
                                            <asp:Button ID="btn_SaveScript" runat="server" Text="SAVE" CssClass="btn" />
                                        </div>

                                        <asp:Button ID="btnRecreate" runat="server" Width="253px" Height="30px" Style="margin: 5px 5px 5px 5px;" BackColor="#FFA64D" Text="Recreate Template From Old Script" CssClass="btn" OnClientClick="Show_ScriptDetails(this, event); return false;" />


                                    </div>

                                </ContentTemplate>
                            </asp:UpdatePanel>
                        </div>
                    </tr>
                    <tr>
                        <div id="div_ScriptInfo" class="ShareDetails_Container" style="display: none; width: 300px; height: 200px;" runat="server">
                            <td colspan="2" style="max-height: 300px !important">
                                <table id="grdScriptDetails" style="padding-left: 16px !important; overflow: scroll; height: auto;" borderstyle="none" class="Grid" cellspacing="0" cellpading="0" border="0 !important"></table>
                            </td>
                            <td>

                                <asp:Button ID="btnDownload" Style="display: none; text-align: center !important; width: 110px; margin-right: 8px" runat="server" CssClass="btn" />

                            </td>
                        </div>
                    </tr>

                </table>
            </div>

            <div style="width: 1200px; height: 1000px; position: absolute; overflow: auto; box-shadow: 2px 2px 2px #000; display: none">
                <table id="grdScriptView" style="padding-left: 16px !important; background-color: #ddd; overflow: scroll; height: 500px;" borderstyle="none" class="Grid" cellspacing="0" cellpading="0" border="0 !important"></table>
            </div>


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


                 <%--Added and removed unwanted inline css and class by RizwanS for common css use / Asked By ShekharL / 04 Oct 2021 */--%>
                <tr>
                    <td>
                        <asp:Label ID="lblFind_Verifier" runat="server" Text="Template Name" Font-Size="16px" CssClass="lbl"></asp:Label>
                        <asp:TextBox ID="txtFind_Verifier" 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_Verifier" Style="text-align: center !important; width: 90px;" Text="Find" runat="server" CssClass="btn" />
                    </td>
                    <td>
                        <asp:Button ID="btnLoad" Visible="true" Style="text-align: center !important; width: 90px;" Text="Load" runat="server" CssClass="btn" />
                        <%--Added by TejaswiniB on 20-May-2021 for load functionality--%>
                        <asp:Button ID="btnExpandAll_Verifier" Visible="true" Style="text-align: center !important; width: 90px; " Text="Expand All" runat="server" CssClass="btn" />
                        <asp:Button ID="btnCollapseAll_Verifier" Visible="true" Style="text-align: center !important; width: 90px; " Text="Collapse All" runat="server" CssClass="btn" />
                        <asp:Button ID="btnExport_Verifier" Visible="true" Style="text-align: center !important; width: 110px;" Text="Export To Excel" runat="server" CssClass="btn" />
                        <asp:Label ID="lblMessage_Verifier" runat="server" Visible="false" ForeColor="#4da6ff" Text="Template names in red color is/are not mapped to Deal Entry."></asp:Label>
                    </td>



                    <td style="vertical-align: top;">
                        <asp:Button runat="server" ID="btnEmbedded" Visible="False" Text="" class="showToggle" />
                        <asp:Button runat="server" ID="btnRegular" Visible="True" Text="" class="hideToggle" />
                    </td>


                </tr>

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

            <table id="tbl_Verifier">
                <tr>
                    <td>
                        <div id="divshares_Verifier" style="display: inline-block;" runat="server" allowdrag="true" allowdrop="true">
                            <asp:DataList ID="dtlstExhanges_Verifier" Style="" runat="server" AllowDrag="true" AllowDrop="true" RepeatDirection="Horizontal" RepeatLayout="Table" RepeatColumns="1">
                                 <%--Removed unwanted inline css by RizwanS for common css use / Asked By ShekharL / 04 Oct 2021 */--%>
                                <ItemTemplate> 
                                    <div class="UCPCTLP_HLine" style="padding-top: 10px; display: inline-block; min-width: 100%;">
                                        <%--Added css class by RizwanS for common css use / Asked By ShekharL / 04 Oct 2021 */--%>
                                        <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_Verifier" OnClick="Expand_exchange" CommandArgument='<%#Eval("Product_Name")%>' class="DispToggle" OnChange="NoPostback()" />
                                                    <asp:Button runat="server" ID="btncollapse_Verifier" Visible="false" OnClick="Collapse_exchange" CommandArgument='<%#Eval("Product_Name")%>' class="CollapseToggle" OnChange="NoPostback()" />
                                                </td> 
                                                <td>
                                                    <asp:Label ID="lblProductName_Verifier" Style="display: none;" runat="server" Text='<%#Eval("Product_Name")%>'></asp:Label>
                                                </td>
                                                <td style="white-space: nowrap; padding: 5px;">
                                                    <asp:Label ID="lblExchangLong_Verifier" CssClass="UCPCTLP_lblHeader" runat="server" Text='<%#Eval("Product_Name")%>'></asp:Label>
                                                    <asp:Label ID="lblTemplateCount_Verifier" CssClass="UCPCTLP_lblHeader" runat="server" Text='<%#Eval("TemplateCount")%>'></asp:Label>
                                                 <%--Added css class by RizwanS for common css use / Asked By ShekharL / 04 Oct 2021 */--%>
                                                </td>
                                                 <td  style="width: 100%;"></td>
                                            </tr>
                                        </table>
                                    </div>
                                    <asp:DataList ID="dtlstShares_Verifier" Style="margin-top: 5px !important; margin-bottom: 10px; margin-left: 5px !important;" runat="server" OnItemDataBound="InnerDatalist_ItemDataBound" AllowDrag="true" AllowDrop="true" RepeatDirection="Horizontal" RepeatLayout="Table" RepeatColumns="1">
                                        <ItemTemplate>
                                            <table id="tbl_Balls">
                                                <tr>
                                                    <td style="width: 250px; vertical-align: top; padding-top: 34px;">
                                                        <asp:Label ID="lbl_TemplateCodeLink_Verifier" Style="display: none;" runat="server" Text='<%#Eval("Template_Code")%>'></asp:Label>
                                                        <asp:Label ID="LinkButton1_Verifier" runat="server" CssClass="linkbutton_verifier lnkNavigator" Style="padding-left: 0px" ForeColor="#4da6ff" Text='<%# Eval("Template")%>' onClick="hideshow(this, event);"></asp:Label>
                                                    </td>
                                                    <td class="tdPadding">
                                                        <asp:Button runat="server" ID="btn_Ball1_LD" CssClass="Snooker solid" Text="LD" CommandName='<%# Eval("Template_Code")%>' CommandArgument='<%#Eval("Product_Name")%>' OnClick="btn_Ball1_LD_Clicked" ToolTip="Layout Designer" />
                                                    </td>                                                    
                                                    <td class="tdPadding">
                                                        <asp:Button runat="server" ID="btn_Ball22_LSM" CssClass="Snooker solid" CommandName='<%# Eval("Template_Code")%>' Text="LSM" CommandArgument='<%#Eval("Product_Name")%>' OnClick="btn_ball22_LSM_Clicked" ToolTip="Layout Style Mapping" />
                                                    </td>
                                                    <td class="tdPadding">
                                                        <asp:Button runat="server" ID="btn_Ball2_FD" CssClass="Snooker solid" CommandName='<%# Eval("Template_Code")%>' Text="FD" CommandArgument='<%#Eval("Product_Name")%>' OnClick="btn_Ball2_FD_Clicked" ToolTip="Function Definition" />
                                                    </td>
                                                    <td class="tdPadding">
                                                        <asp:Button runat="server" ID="btn_Ball3_IF" CssClass="Snooker solid" CommandName='<%# Eval("Template_Code")%>' Text="IF" CommandArgument='<%#Eval("Product_Name")%>' OnClick="btn_Ball3_IF_Clicked" ToolTip="Intersection Fields" />
                                                    </td>
                                                    <td class="tdPadding">
                                                        <asp:Button runat="server" ID="btn_Ball4_TM" CssClass="Snooker solid" CommandName='<%# Eval("Template_Code")%>' Text="TM" CommandArgument='<%#Eval("Product_Name")%>' OnClick="btn_Ball4_TM_Clicked" ToolTip="Tab Mapping" />
                                                    </td>
                                                    <td class="tdPadding">
                                                        <asp:Button runat="server" ID="btn_Ball5_CT" CssClass="Snooker solid" CommandName='<%# Eval("Template_Code")%>' Text="CT" CommandArgument='<%#Eval("Product_Name")%>' OnClick="btn_Ball5_CT_Clicked" ToolTip="Custom Tab" />
                                                    </td>
                                                    <%--<td class="tdPadding">		<%-- Commented by BhagyashriB on 24-Sept-2021 | as discussed with HemataA, UWI-186 
                                                        <asp:Button runat="server" ID="btn_Ball6_CA" CssClass="Snooker solid" CommandName='<%# Eval("Template_Code")%>' Text="CA" CommandArgument='<%#Eval("Product_Name")%>' OnClick="btn_Ball6_CA_Clicked" ToolTip="Custom Array" />
                                                    </td>--%>
                                                </tr>
                                                <tr>
                                                    <td class="tdlockUnlock">
                                                        <div class="divPadding5">
                                                            <asp:Label ID="lblTemplatelock" Text="Template Lock:" runat="server" CssClass="lbl"></asp:Label>
                                                        </div>
                                                        <div>
                                                            <asp:UpdateProgress ID="UpdateProgress2" runat="server" DisplayAfter="0">
                                                                <ProgressTemplate>
                                                                    <div class="Progress divLoading" style="font: bold 12px/14px verdana; color: #333333; padding: 10px; height: auto; width: 100%; vertical-align: middle; z-index: 999999; position: absolute; text-align: left;">
                                                                        <img alt="Loading" src="../App_Resources/ajax-loader7.gif" width="50" height="50" /><span class="">Loading...</span>
                                                                    </div>
                                                                </ProgressTemplate>
                                                            </asp:UpdateProgress>
                                                        </div>
                                                        <asp:Button runat="server" ID="btnUnlock" Text="" Visible="false" class="lockTemplate" OnClick="btnUnlock_Clicked" />
                                                        <asp:Button runat="server" ID="btnLock" Text="" class="unlockTemplate" OnClick="btnLock_Clicked" />
                                                        <div class="divPadding5">
                                                            <asp:Label ID="lblInfo_LU" Text="" runat="server" CssClass="lblInfo"></asp:Label>
                                                        </div>
                                                    </td>
                                                    <td class="tdPadding">
                                                        <asp:Button runat="server" ID="btn_Ball7_CGM" CssClass="Snooker solid" CommandName='<%# Eval("Template_Code")%>' Text="CG" CommandArgument='<%#Eval("Product_Name")%>' OnClick="btn_Ball7_CGM_Clicked" ToolTip="Customer Grid Mapping" />
                                                    </td>
                                                    <td class="tdPadding">
                                                        <asp:Button runat="server" ID="btn_Ball8_ER" CssClass="Snooker solid" CommandName='<%# Eval("Template_Code")%>' Text="ER" CommandArgument='<%#Eval("Product_Name")%>' OnClick="btn_Ball8_ER_Clicked" ToolTip="Edit Right" />
                                                    </td>
                                                    <td class="tdPadding">
                                                        <asp:Button runat="server" ID="btn_Ball9_PR" CssClass="Snooker solid" CommandName='<%# Eval("Template_Code")%>' Text="PR" CommandArgument='<%#Eval("Product_Name")%>' OnClick="btn_Ball9_PR_Clicked" ToolTip="Product Reciepe" />
                                                    </td>
                                                    <td class="tdPadding">
                                                        <asp:Button runat="server" ID="btn_Ball10_DCG" CssClass="Snooker solid" CommandName='<%# Eval("Template_Code")%>' Text="DC" CommandArgument='<%#Eval("Product_Name")%>' OnClick="btn_Ball10_DCG_Clicked" ToolTip="Dynamic Customer Grid" />
                                                    </td>
                                                    <td class="tdPadding">
                                                        <asp:Button runat="server" ID="btn_Ball11_FTM" CssClass="Snooker solid" CommandName='<%# Eval("Template_Code")%>' Text="FT" CommandArgument='<%#Eval("Product_Name")%>' OnClick="btn_Ball11_FTM_Clicked" ToolTip="Field Tab mapping" />
                                                    </td>
                                                    <td class="tdPadding">
                                                        <asp:Button runat="server" ID="btn_Ball12_LOM" CssClass="Snooker solid" CommandName='<%# Eval("Template_Code")%>' Text="LO" CommandArgument='<%#Eval("Product_Name")%>' OnClick="btn_Ball12_LOM_Clicked" ToolTip="Layout Override Mapping" />
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td></td>
                                                    <td class="tdPadding">
                                                        <asp:Button runat="server" ID="btn_Ball13_QSB" CssClass="Snooker solid" CommandName='<%# Eval("Template_Code")%>' Text="SB" CommandArgument='<%#Eval("Product_Name")%>' OnClick="btn_Ball13_QSB_Clicked" ToolTip="Queue Static Button" />
                                                    </td>
                                                    <td class="tdPadding">
                                                        <asp:Button runat="server" ID="btn_Ball14_UM" CssClass="Snooker solid" CommandName='<%# Eval("Template_Code")%>' Text="UM" CommandArgument='<%#Eval("Product_Name")%>' OnClick="btn_Ball14_UM_Clicked" ToolTip="UDF Metadata" />
                                                    </td>
                                                    <td class="tdPadding">
                                                        <asp:Button runat="server" ID="btn_Ball15_DE" CssClass="Snooker solid" CommandName='<%# Eval("Template_Code")%>' Text="DE" CommandArgument='<%#Eval("Product_Name")%>' OnClick="btn_Ball15_DE_Clicked" ToolTip="Deal Entry" />
                                                    </td>
                                                    <td class="tdPadding">
                                                        <asp:Button runat="server" ID="btn_Ball16_DSN" CssClass="Snooker solid" CommandName='<%# Eval("Template_Code")%>' Text="LR" CommandArgument='<%#Eval("Product_Name")%>' OnClick="btn_Ball16_DSN_Clicked" ToolTip="DSN Report" />
                                                    </td>
                                                    <td class="tdPadding">
                                                        <asp:Button runat="server" ID="btn_Ball17_IDL" CssClass="Snooker solid" CommandName='<%# Eval("Template_Code")%>' Text="IDL" CommandArgument='<%#Eval("Product_Name")%>' OnClick="btn_Ball17_IDL_Clicked" ToolTip="Invalid Design Locator" />
                                                    </td>
                                                    <td class="tdPadding">
                                                        <asp:Button runat="server" ID="btn_Ball18_TM" CssClass="Snooker solid" CommandName='<%# Eval("Template_Code")%>' Text="TMP" CommandArgument='<%#Eval("Product_Name")%>' OnClick="btn_Ball18_TM_Clicked" ToolTip="Template Master" />
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td></td>
                                                    <td class="tdPadding">
                                                        <asp:Button runat="server" ID="btn_Ball19_RDL" CssClass="Snooker solid" CommandName='<%# Eval("Template_Code")%>' Text="RDL" CommandArgument='<%#Eval("Product_Name")%>' OnClick="btn_Ball19_RDL_Clicked" ToolTip="Rule Definition Library" />
                                                    </td>

                                                    <%--'For testing purpose only . Please Remove after Testing '17-July-2020 Added By Neeral--%>
                                                    <td class="tdPadding">
                                                        <asp:Button runat="server" ID="btn_Ball20_FD" CssClass="Snooker solid" CommandName='<%# Eval("Template_Code")%>' Text="NFD" CommandArgument='<%#Eval("Product_Name")%>' OnClick="btn_Ball20_FD_Clicked" ToolTip="New Function Definition" />
                                                    <td class="tdPadding">
                                                        <asp:Button runat="server" ID="btn_Ball21_SAM" CssClass="Snooker solid" CommandName='<%# Eval("Template_Code")%>' Text="SAM" CommandArgument='<%#Eval("Product_Name")%>' OnClick="btn_Ball21_SAM_Clicked" ToolTip="Static Access Matrix " />
                                                    </td>
                                                    <td class="tdPadding">
                                                        <asp:Button runat="server" ID="btn_Ball22_TIM" CssClass="Snooker solid" CommandName='<%# Eval("Template_Code")%>' Text="TIM" CommandArgument='<%#Eval("Product_Name")%>' OnClick="btn_Ball22_TIM_Clicked" ToolTip="Tab Index Mapping" />
                                                    </td>
                                                </tr>
                                            </table> 
                                        </ItemTemplate>
                                    </asp:DataList>
                                </ItemTemplate>
                            </asp:DataList>
                        </div>
                    </td>
                    <td>
                        <div id="div_lblcode_Verifier" class="ShareDetailsContainer" runat="server">
                            <table>
                                <tr>
                                    <th>
                                        <asp:Label ID="lblInfo_share_Verifier" CssClass="lblInfo_share" runat="server"> </asp:Label></th>
                                </tr>
                                <tr>
                                    <td>
                                        <table id="grdSharDetails_Verifier" style="padding-left: 16px !important" class="Grid" cellspacing="0" cellpading="0" border="0 !important"></table>
                                    </td>
                                </tr>
                            </table>
                        </div>
                    </td>

            </table>
            <table>

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

                        <asp:HiddenField ID="hdnAccountName_Verifier" runat="server" />
                        <asp:HiddenField ID="FileName_Verifier" runat="server" />
                        <asp:HiddenField ID="HdnFileFullPath_Verifier" runat="server" />
                        <asp:HiddenField ID="HdnVersionNo" runat="server" />
                        <asp:HiddenField ID="HdnTemplateName" runat="server" />
                    </td>

                </tr>

            </table>
        </ContentTemplate>
        <Triggers>
            <asp:PostBackTrigger ControlID="btnExport_Verifier" />
            <asp:PostBackTrigger ControlID="btnExport_Script" />
            <asp:PostBackTrigger ControlID="btnDownload" />

        </Triggers>
    </asp:UpdatePanel>
    <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' });

        }

        function New_Order_Compact(lblcntrl) {


            var templateID = $("#ctl00_MainContent_dtlstExhanges_ctl00_dtlstShares" + lblcntrl + "_lblTemplateCode")
        
            $("#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>

    <script type="text/javascript">
        function openPage(uPath) {
            try {
                //  
                //  alert(uPath);
                uPath = window.origin + "/FinIQWebApp" + uPath + "&Master_Popup=POPUP";
                window.open(uPath, "_blank");

            } catch (er) { console.log(er.message); }
        }
    </script>
</asp:Content>

