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

<%@ Register Assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" Namespace="System.Web.UI" TagPrefix="asp" %>

<asp:Content ID="TrasactionContent" ContentPlaceHolderID="MainContent" runat="server">
    <style>
        .tblConfigFIX td {
            vertical-align: top;
        }

        .listitem {
            font-size: 14px;
            margin: 10px;
            height: 25px !important;
        }

        .SlideToggleDocShow {
            float: right;
            /*overflow-y: scroll;*/
            overflow-x: hidden;
            /*border: 1px solid #DDDDDD;*/
            padding: 6px;
            background-color: #FFFFFF !important;
            width: 350px;
            max-height: 65vh;
            height: 670px;
        }

        .fieldSetBorder {
            border: 1px solid #dcdcdc;
        }

        .fieldsetlegend {
            font-size: 14px;
            color: red;
        }

        .BlueColur {
            color: #0368b6;
        }

        .auto-style1 {
            height: 76px;
        }


        /*.divtreeview:after {
             content: " ";
             margin: 0 500px;
             position: absolute;
             height: auto;
             top: 15%;
             bottom: 10%;
             width: 1px;
             background: #666666;
             opacity: 0.4;
             height: auto;
         }*/

        .divtreeview {
            border-right: solid;
            border-right-color: rgba(102, 102, 102, 0.4);
            border-right-width: 1px;
            /*opacity: 0.4;
            .divtreeview {
            border: solid;
            border-color: rgba(102, 102, 102, 0.4);
            border-width: 1px;
            height:auto;
            min-height:700px;
            /*opacity: 0.4;*/
        }

        .TreeViewBody {
            font-family: Verdana, sans-serif;
            font-size: 14px;
            font-weight: bolder;
            color: #0284e0;
        }

        .TreeViewLeafNode {
            font-family: Verdana, sans-serif;
            font-size: 12px;
            font-weight: normal;
            color: #0284e0;
        }

        .divchildtreeview:empty {
            display: none;
        }

        .Toggle {
            border-radius: 5px;
            border: solid 1px #dddddd;
            word-wrap: break-word;
            white-space: normal;
        }

        .attributeToggle, .fieldToggle {
            width: 126px !important;
            height: 28px !important;
            border: none 0px #FFF !important;
            color: #FFF !important;
            outline: 0 !important;
            background-color: #FFFFFF;
            background-repeat: no-repeat;
            /*margin-top: 6px;*/
            opacity: 0.7;
        }

            .attributeToggle:focus, .fieldToggle:focus, .attributeToggle:active, .fieldToggle:active, .attributeToggle:hover, .fieldToggle:hover, {
                outline: 0 !important;
                border: none 0px #FFF !important;
            }

        .fieldToggle {
            background-image: url("../App_Resources/Attribute.png");
        }

        .attributeToggle {
            background-image: url("../App_Resources/Field.png");
        }

        .SetupToggle, .ViewToggle {
            width: 126px !important;
            height: 28px !important;
            border: none 0px #FFF !important;
            color: #FFF !important;
            outline: 0 !important;
            background-color: #FFFFFF;
            background-repeat: no-repeat;
            /*margin-top: 6px;*/
            opacity: 0.7;
        }

            .SetupToggle:focus, .ViewToggle:focus, .SetupToggle:active, .fieldToggleViewToggleactive, .SetupToggle:hover, .ViewToggle:hover, {
                outline: 0 !important;
                border: none 0px #FFF !important;
            }

        .ViewToggle {
            background-image: url("../App_Resources/Setup.png");
        }

        .SetupToggle {
            background-image: url("../App_Resources/view.png");
        }
    </style>

    <script>
        function allowDrop(ev) {
            ev.preventDefault();
        }

        function drag(ev) {
            ev.dataTransfer.setData("text", ev.target.id);
        }

        function drop(ev) {

            ev.preventDefault();
            var data = ev.dataTransfer.getData("text");

            ev.target.value = document.getElementById(data).innerText;
            //Added by Mahima G on 23 Sept 2021 | CFIXINT-1
            var button = document.getElementById('<%=hdnButton.ClientID%>');
            button.click();

        }
        function SearchColumn(ctl, event) {

            if (event.keyCode == 13) {
                $('[id$="btnFind"]').click();
                return false;
            }
            //event.preventDefault();
            return true;
        }

        //Removed by Atharva M || 14 April 2022
        //Added by Mahima G on 8th Sept 2021 for CFIXINT-6
        <%--function CopyOriginalXML() {
            debugger;
            var controlValue = document.getElementById('<%=txtOriginalXML.ClientID%>').value;
            let text = controlValue.replaceAll('><', '>\n<');
            //window.clipboardData.setData('Text', controlValue);
            navigator.clipboard.writeText(text);

        }
        //Added by Mahima G on 8th Sept 2021 for CFIXINT-6
        function CopyModifiedXML() {
            var controlValue = document.getElementById('<%=txtViewXML.ClientID%>').value;
            let text = controlValue.replaceAll('><', '>\n<');
            navigator.clipboard.writeText(text);

        }--%>
    </script>

    <asp:UpdatePanel ID="UpdatePanel" runat="server" class="PanelPad">
        <ContentTemplate>
            <%--Drag and Drop Functionality Button--%>
            <asp:Button runat="server" ID="hdnButton" Style="display: none;" />

            <%--Removed by Atharva M || 13 April 2022--%>
            <%--View and Save MDD--%>
            <%--<div id="ViewXML" runat="server" visible="false">
                <table>
                    <tr>
                        <td>
                            <asp:Label ID="lblOriginalDD" runat="server" Text="Original XML" />
                        </td>
                        <%--Added by Mahima G on 8th Sept 2021 for CFIXINT-6
                        <td>
                            <asp:Button ID="CopyOriginalXML" Text="Copy" runat="server" CssClass="btn" Width="100px" autopostback="true" Style="margin-left: 75%" OnClientClick="CopyOriginalXML()" />
                        </td>
                        <td style="padding-left: 3% !important">
                            <asp:Label ID="lblModifiedDD" runat="server" Text="Modified XML" />
                        </td>
                        <%--Added by Mahima G on 8th Sept 2021 for CFIXINT-6
                        <td>
                            <asp:Button ID="CopyModifiedXML" Text="Copy" runat="server" CssClass="btn" Width="100px" autopostback="true" Style="margin-left: 80%" OnClientClick="CopyModifiedXML()" />
                        </td>
                    </tr>
                    <tr>
                        <td colspan="2">
                            <asp:TextBox ID="txtOriginalXML" Style="width: 45vw" runat="server" Height="50%" Enabled="false" TextMode="MultiLine" Rows="25"></asp:TextBox>
                        </td>
                        <td colspan=" 2">
                            <asp:TextBox ID="txtViewXML" Style="width: 45vw; margin-left: 5%" runat="server" Height="50%" Enabled="false" TextMode="MultiLine" Rows="25"></asp:TextBox>
                        </td>
                    </tr>
                </table>
            </div>--%>


            <%--Table for Input Dropdowns--%>
            <table style="width: 600px;">
                <tr>
                    <%--Session Code--%>
                    <td>
                        <asp:Label ID="lblSessionCode" runat="server" Text="Session Code: " CssClass="lbl"></asp:Label>
                    </td>
                    <td>
                        <asp:DropDownList ID="ddlSessionCode" runat="server" AutoPostBack="True" CssClass="ddl" Width="150px"></asp:DropDownList>
                    </td>

                    <%--Product Type--%>
                    <td style="padding-left: 20px;">
                        <asp:Label ID="lblProductType" runat="server" Text="Product Type: " CssClass="lbl"></asp:Label>
                    </td>
                    <td>
                        <asp:DropDownList ID="ddlProductType" runat="server" AutoPostBack="true" CssClass="ddl" Width="100px"></asp:DropDownList>
                    </td>

                    <%--Direction--%>
                    <td style="padding-left: 20px;">
                        <asp:Label ID="lblDirection" runat="server" Text="Direction: " CssClass="lbl"></asp:Label>
                    </td>
                    <td>
                        <asp:DropDownList ID="ddlDirection" runat="server" AutoPostBack="True" CssClass="ddl" Width="150px"></asp:DropDownList>
                    </td>

                    <%--Message Type--%>
                    <td style="padding-left: 20px;">
                        <asp:Label ID="lblMessageType" runat="server" Text="Message Type: " CssClass="lbl"></asp:Label>
                    </td>
                    <td>
                        <asp:DropDownList ID="ddlMessageType" AutoPostBack="true" runat="server" CssClass="ddl" Width="150px"></asp:DropDownList>
                    </td>

                    <%--Sub Message Type--%>
                    <td style="padding-left: 20px;">
                        <asp:Label ID="lblSubMessageType" runat="server" Text="Event: " CssClass="lbl"></asp:Label>
                    </td>
                    <td>
                        <asp:DropDownList ID="ddlSubMessageType" AutoPostBack="true" runat="server" CssClass="ddl" Width="150px"></asp:DropDownList>
                    </td>


                    <%--Format Type--%>
                    <td style="padding-left: 20px;">
                        <asp:Label ID="lblXMLType" runat="server" Text="Format Type : " CssClass="lbl" Visible="false"></asp:Label>
                    </td>
                    <td>
                        <asp:DropDownList ID="ddlXML" AutoPostBack="true" runat="server" CssClass="ddl" Width="150px" Visible="false">
                            <asp:ListItem Value="HEADER" Text="Header" />
                            <asp:ListItem Value="MESSAGES" Text="Messages" Selected="true" />
                            <asp:ListItem Value="TRAILER" Text="Trailer" />
                        </asp:DropDownList>
                    </td>


                    <%-- Removed by Atharva M || 13 April 2022--%>
                    <%--<td style="padding-top: 20px;">
                        <div id="toggleSetup" style="margin-bottom: 12%; margin-left: 10%">
                            <asp:Button runat="server" ID="btnSetup" Text="" Visible="false" class="SetupToggle" />
                            <asp:Button runat="server" ID="btnView" Text="" Visible="false" class="ViewToggle " />
                        </div>
						<%--Added by Mahima G on 21 Oct 2021 - CFIXINT - 13--
                        </td>--%>

                    <%--Error Message--%>
                    <%--<td style="padding-left: 10px; width: auto;">
                        <asp:Label ID="lblError" runat="server" Style="margin-bottom: 20px !important; color: #0284e0;" />
                    </td>--%>

                    <%--Load Button--%>
                    <%--<td style="width: 100px; padding-left: 20px; visibility: hidden">
                        <asp:Button ID="btnLoad" Text="Load" runat="server" CssClass="btn" Width="100px" autopostback="true" />
                    </td>--%>
                </tr>

                <tr>
                    <td colspan="8" style="height: 15px"></td>
                </tr>
            </table>

            <div>
                <asp:Label ID="lblError" runat="server" Style="margin-bottom: 20px !important;" />
            </div>
            

            <div id="Main" runat="server">
                <table class="tblConfigFIX">
                    <tr>
                        <%--Mapping Treeview--%>
                        <td style="min-width: 20%; width: 300px">
                            <div id="divtreeview1" runat="server" style="height: auto; max-height: 65vh; overflow-y: overlay; float: left; display: inline; width: 100%; margin-top: 20px;">
                                <asp:TreeView ID="TreeView1" runat="server" AutoGenerateDataBindings="True">
                                    <ParentNodeStyle CssClass="TreeViewBody" />
                                    <RootNodeStyle CssClass="TreeViewBody" />
                                    <NodeStyle CssClass="TreeViewLeafNode" />
                                </asp:TreeView>
                            </div>
                        </td>

                        <%--Internal XML Treeview (BuySide)--%>
                        <td style="min-width: 0%; width: 20px">
                            <div class="divchildtreeview" id="divtreeview2" runat="server" visible="false" style="height: auto; max-height: 65vh; overflow-y: overlay; width: 300px">
                                <asp:TreeView ID="TreeView2" runat="server" AutoGenerateDataBindings="True" Style="height: auto; margin-left: 25px; margin-top: 20px;">
                                    <ParentNodeStyle CssClass="TreeViewBody" />
                                    <RootNodeStyle CssClass="TreeViewBody" />
                                    <NodeStyle CssClass="TreeViewLeafNode" />
                                </asp:TreeView>
                            </div>
                        </td>

                        <%--Mapping Grids, Expression and other Info--%>
                        <td style="min-width: 40%; width: 400px; margin-left: 30px">
                            <div class="divgrid" id="divGridView" runat="server">
                                <%--Info--%>
                                <table>
                                    <%--Tag Info--%>
                                    <tr>
                                        <td style="width: 250px;" colspan="10">
                                            <asp:Label ID="lblTagInfo" runat="server" Width="300px" Style="font-size: 20px; display: block" AutoPostBack="True" />
                                        </td>
                                    </tr>

                                    <%--Field and Attribute Toggle Button--%>
                                    <tr>
                                        <td style="padding-top: 20px;">
                                            <div id="toggleSwitch">
                                                <asp:Button runat="server" ID="btnSetField" Text="" Visible="false" class="fieldToggle" />
                                                <asp:Button runat="server" ID="btnSetAttribute" Text="" Visible="false" class="attributeToggle " />
                                            </div>
                                        </td>
                                    </tr>

                                    <%--Grid and Expression Radio Buttons--%>
                                    <tr>
                                        <td style="width: 100px;">
                                            <asp:RadioButton ID="GridRadio" Text="Grid" runat="server" Style="padding-top: 20px" Width="100px" Visible="false" Checked="false" AutoPostBack="True" />
                                        </td>
                                        <td style="width: 100px;">
                                            <asp:RadioButton ID="expressionRadio" Text="Expression" runat="server" Style="padding-top: 20px" Width="100px" Visible="false" Checked="false" AutoPostBack="True" />
                                        </td>
                                    </tr>
                                </table>

                                <table style="width: 100%; padding-top: 15px">
                                    <%--Expression--%>
                                    <tr>
                                        <td colspan="3">
                                            <div id="divText" visible="false" runat="server" colspan="4">
                                                <table>
                                                    <tr style="width: 100px;">
                                                        <%--Required YN--%>
                                                        <td>
                                                            <asp:Label ID="lblRequiredYN" runat="server" Width="75px" class="lbl" Text="Required YN : "></asp:Label>
                                                        </td>
                                                        <td>
                                                            <asp:DropDownList ID="ddlExpRequiredYN" AutoPostBack="true" runat="server" CssClass="ddl" Width="80px">
                                                                <asp:ListItem Text="Y" Value="Y" />
                                                                <asp:ListItem Text="N" Value="N" />
                                                            </asp:DropDownList>
                                                        </td>

                                                        <%--Save Button--%>
                                                        <td style="width: 100px; padding-left: 10px;">
                                                            <asp:Button ID="btnSave" Text="Save" runat="server" CssClass="btn" Width="100px" Enabled="True" />
                                                        </td>
                                                    </tr>
                                                </table>
                                                <textarea runat="server" autopostback="true" id="txtExpression" class="enableCPA" rows="15" style="width: 400px !important; display: block; margin-top: 10px"></textarea>
                                            </div>
                                        </td>
                                    </tr>

                                    <%--Grids--%>
                                    <tr>
                                        <td>

                                            <%--Buyside Grid--%>
                                            <asp:GridView ID="grdField" runat="server" AllowSorting="True" AutoGenerateColumns="False" BorderStyle="None" BorderWidth="0px" CellPadding="3" PagerStyle-Height="32px" Visible="false"
                                                AllowPaging="true" CssClass="Grid" ShowHeaderWhenEmpty="true" RowHeadersWidthSizeMode="DisableResizing;" SelectedRowStyle-Wrap="true" HeaderStyle-CssClass="GridHeaderTitle" padding-top="20px">
                                                <RowStyle CssClass="GridItem" />
                                                <HeaderStyle CssClass="GridHeader" />
                                                <FooterStyle CssClass="GridFooter" />
                                                <PagerStyle CssClass="GridPager" />

                                                <EmptyDataTemplate>
                                                    <asp:Label ID="lblqueuedatagrid" runat="server" Text="No data found."></asp:Label>
                                                </EmptyDataTemplate>

                                                <Columns>
                                                    <%--Actions--%>
                                                    <asp:TemplateField HeaderText="Actions" HeaderStyle-Wrap="True" Visible="true">
                                                        <ItemStyle HorizontalAlign="center" Width="100px" />
                                                        <HeaderStyle Width="100px" />
                                                        <EditItemTemplate>
                                                            <asp:LinkButton ID="btnUpdateNew" runat="server" CommandName="Update" Text="Update" HorizontalAlign="left" CssClass="display: inline-block;" />

                                                            <asp:LinkButton ID="btnCancelNew" runat="server" CommandName="Cancel" Text="Cancel" HorizontalAlign="right" CssClass="display: inline-block;" />
                                                        </EditItemTemplate>
                                                        <ItemTemplate>
                                                            <asp:LinkButton ID="btnEditNew" Width="100px" HorizontalAlign="center" runat="server" CommandName="Edit" Text="Edit" />
                                                        </ItemTemplate>
                                                    </asp:TemplateField>

                                                    <%--RequiredYN--%>
                                                    <asp:TemplateField HeaderText="Required Y/N">
                                                        <HeaderStyle CssClass="gridColSummary" Width="80px" />
                                                        <ItemStyle CssClass="gridColSummary" Width="80px" Wrap="true" HorizontalAlign="center" />
                                                        <ItemTemplate>
                                                            <asp:Label ID="lblRequiredYN" Width="80px" runat="server" Text='<%# Microsoft.Security.Application.Encoder.HtmlEncode(DataBinder.Eval(Container, "DataItem.Required_Y/N").ToString())%>' Style="padding: 5px;" />
                                                        </ItemTemplate>
                                                        <EditItemTemplate>
                                                            <asp:DropDownList ID="ddlRequiredYN" CssClass="ddl" runat="server" Style="padding: 5px;" Width="80px">
                                                                <asp:ListItem Text="Y" Value="Y" />
                                                                <asp:ListItem Text="N" Value="N" />
                                                            </asp:DropDownList>
                                                        </EditItemTemplate>
                                                    </asp:TemplateField>

                                                    <%--repeatYN--%>
                                                    <asp:TemplateField HeaderText="Repeat Y/N">
                                                        <HeaderStyle CssClass="gridColSummary" Width="80px" />
                                                        <ItemStyle CssClass="gridColSummary" Width="80px" Wrap="true" HorizontalAlign="center" />
                                                        <ItemTemplate>
                                                            <asp:Label ID="lblRepeatYN" Width="80px" runat="server" Text='<%# Microsoft.Security.Application.Encoder.HtmlEncode(DataBinder.Eval(Container, "DataItem.Repeat_Y/N").ToString())%>' Style="padding: 5px;" />
                                                        </ItemTemplate>
                                                        <EditItemTemplate>
                                                            <asp:DropDownList ID="ddlRepeatYN" CssClass="ddl" runat="server" Style="padding: 5px;" Width="80px" AutoPostBack="true"> <%--OnSelectedIndexChanged="grp_requiredYN_ddl">--%>
                                                                <asp:ListItem Text="Y" Value="Y" />
                                                                <asp:ListItem Text="N" Value="N" />
                                                            </asp:DropDownList>
                                                        </EditItemTemplate>
                                                    </asp:TemplateField>

                                                    <%--ViewType--%>
                                                    <asp:TemplateField HeaderText="View Type">
                                                        <HeaderStyle CssClass="gridColSummary" Width="120px" />
                                                        <ItemStyle CssClass="gridColSummary" Width="120px" Wrap="true" HorizontalAlign="center" />
                                                        <ItemTemplate>
                                                            <asp:Label ID="lblViewType" Width="120px" runat="server" Text='<%# Microsoft.Security.Application.Encoder.HtmlEncode(DataBinder.Eval(Container, "DataItem.ViewType").ToString())%>' Style="padding: 5px;" />
                                                        </ItemTemplate>
                                                        <EditItemTemplate>
                                                            <asp:DropDownList runat="server" ID="ddlViewType" AutoPostBack="True" Width="120px" CssClass="txt" Style="padding: 5px; width:auto;" OnSelectedIndexChanged="ddlViewTypeField_SelectedIndexChange">
                                                                <asp:ListItem Text="" Value="" />
                                                                <asp:ListItem Text="View" Value="View" />
                                                                <asp:ListItem Text="App Table" Value="AppTable" />
                                                            </asp:DropDownList>
                                                        </EditItemTemplate>
                                                    </asp:TemplateField>

                                                    <%--View--%>
                                                    <asp:TemplateField HeaderText="View">
                                                        <HeaderStyle CssClass="gridColSummary" Width="100px" />
                                                        <ItemStyle CssClass="gridColSummary" Width="100px" Wrap="true" HorizontalAlign="center" />
                                                        <ItemTemplate>
                                                            <asp:Label ID="lblAlias" Width="100px" runat="server" Text='<%# Microsoft.Security.Application.Encoder.HtmlEncode(DataBinder.Eval(Container, "DataItem.Alias").ToString())%>' Style="padding: 5px; width: auto;" />
                                                            <%--Added by Mahima G on 6th-Sept 2021 | CFIXINT-10 --%>
                                                        </ItemTemplate>
                                                        <EditItemTemplate>
                                                            <asp:DropDownList runat="server" ID="ddlAlias" AutoPostBack="True" Width="100px" CssClass="txt" Style="padding: 5px; min-width: 100px; width: auto" OnSelectedIndexChanged="ddlAlias_SelectedIndexChanged" />
                                                        </EditItemTemplate>
                                                    </asp:TemplateField>

                                                    <%--Column Name--%>
                                                    <asp:TemplateField HeaderText="Column Name">
                                                        <HeaderStyle CssClass="gridColSummary" Width="150px" />
                                                        <ItemStyle CssClass="gridColSummary" Width="150px" Wrap="true" HorizontalAlign="center"/>
                                                        <ItemTemplate>
                                                            <asp:Label ID="lblColumnName" Width="150px" runat="server" ondrop="drop(event)" ondragover="allowDrop(event)" Text='<%# Microsoft.Security.Application.Encoder.HtmlEncode(DataBinder.Eval(Container, "DataItem.Column_Name").ToString())%>' Style="padding: 5px; width: auto;" />
                                                        </ItemTemplate>
                                                        <%--<EditItemTemplate>
                                                <asp:DropDownList runat="server" ID="ddlColumnName" Width="150px" CssClass="txt" Style="padding: 5px;" />
                                            </EditItemTemplate>--%>
                                                        <EditItemTemplate>
                                                            <asp:TextBox ID="txtColumnName" Width="200px" runat="server" Style="padding: 5px; width: auto;" ondrop="drop(event)" ondragover="allowDrop(event)" />
                                                        </EditItemTemplate>
                                                    </asp:TemplateField>

                                                    <%--Constant--%>
                                                    <asp:TemplateField HeaderText="Constant" Visible="True">
                                                        <HeaderStyle CssClass="gridColSummary" Width="100px" />
                                                        <ItemStyle CssClass="gridColSummary" Width="100px" Wrap="true" HorizontalAlign="center" />
                                                        <ItemTemplate>
                                                            <asp:Label ID="lblDefaultValue" Width="100px" runat="server" Text='<%# Microsoft.Security.Application.Encoder.HtmlEncode(DataBinder.Eval(Container, "DataItem.Default_Value").ToString())%>' Style="padding: 5px; width: auto;" />
                                                        </ItemTemplate>
                                                        <EditItemTemplate>
                                                            <asp:TextBox ID="txtDefaultValue" Width="100px" runat="server" Style="padding: 5px; width: auto;" />
                                                        </EditItemTemplate>
                                                    </asp:TemplateField>
                                                </Columns>
                                            </asp:GridView>


                                            <%--Sellside grid--%>
                                            <asp:GridView ID="grdSellSide" runat="server" AllowSorting="True" AutoGenerateColumns="False" BorderStyle="None" BorderWidth="0px" CellPadding="3" PagerStyle-Height="32px" Visible="false"
                                                AllowPaging="true" CssClass="Grid" ShowHeaderWhenEmpty="true" RowHeadersWidthSizeMode="DisableResizing;" SelectedRowStyle-Wrap="true" HeaderStyle-CssClass="GridHeaderTitle" padding-top="20px">
                                                <RowStyle CssClass="GridItem" />
                                                <HeaderStyle CssClass="GridHeader" />
                                                <FooterStyle CssClass="GridFooter" />
                                                <PagerStyle CssClass="GridPager" />

                                                <EmptyDataTemplate>
                                                    <asp:Label ID="lblqueuedatagrid" runat="server" Text="No data found."></asp:Label>
                                                </EmptyDataTemplate>

                                                <Columns>
                                                    <%--Actions--%>
                                                    <asp:TemplateField HeaderText="Actions" HeaderStyle-Wrap="True" Visible="true">
                                                        <ItemStyle HorizontalAlign="center" Width="100px" />
                                                        <HeaderStyle Width="100px" />
                                                        <EditItemTemplate>
                                                            <asp:LinkButton ID="btnUpdateNew" runat="server" CommandName="Update" Text="Update" HorizontalAlign="left" CssClass="display: inline-block;" />

                                                            <asp:LinkButton ID="btnCancelNew" runat="server" CommandName="Cancel" Text="Cancel" HorizontalAlign="right" CssClass="display: inline-block;" />
                                                        </EditItemTemplate>
                                                        <ItemTemplate>
                                                            <asp:LinkButton ID="btnEditNew" Width="100px" HorizontalAlign="center" runat="server" CommandName="Edit" Text="Edit" />
                                                        </ItemTemplate>
                                                    </asp:TemplateField>

                                                    <%--Required Y/N--%>
                                                    <asp:TemplateField HeaderText="Required Y/N">
                                                        <HeaderStyle CssClass="gridColSummary" Width="80px" />
                                                        <ItemStyle CssClass="gridColSummary" Width="80px" Wrap="true" HorizontalAlign="center" />
                                                        <ItemTemplate>
                                                            <asp:Label ID="lblRequiredYN" Width="80px" runat="server" Text='<%# Microsoft.Security.Application.Encoder.HtmlEncode(DataBinder.Eval(Container, "DataItem.Required_Y/N").ToString())%>' Style="padding: 5px;" />
                                                        </ItemTemplate>
                                                        <EditItemTemplate>
                                                            <asp:DropDownList ID="ddlRequiredYN" CssClass="ddl" runat="server" Style="padding: 5px;" Width="80px">
                                                                <asp:ListItem Text="Y" Value="Y" />
                                                                <asp:ListItem Text="N" Value="N" />
                                                            </asp:DropDownList>
                                                        </EditItemTemplate>
                                                    </asp:TemplateField>

                                                    <%--Tag Type--%>
                                                    <asp:TemplateField HeaderText="Tag Type">
                                                        <HeaderStyle CssClass="gridColSummary" Width="120px" />
                                                        <ItemStyle CssClass="gridColSummary" Width="120px" Wrap="true" HorizontalAlign="center" />
                                                        <ItemTemplate>
                                                            <asp:Label ID="lblTagType" Width="120px" runat="server" Text='<%# Microsoft.Security.Application.Encoder.HtmlEncode(DataBinder.Eval(Container, "DataItem.TagType").ToString())%>' Style="padding: 5px;" />
                                                        </ItemTemplate>
                                                        <EditItemTemplate>
                                                            <asp:DropDownList runat="server" ID="ddlTagType" AutoPostBack="True" Width="120px" CssClass="txt" Style="padding: 5px;" OnSelectedIndexChanged="ddlTagType_SelectedIndexChanged">
                                                                <asp:ListItem Text="" Value="" />
                                                                <asp:ListItem Text="FIX" Value="FIX" />
                                                                <asp:ListItem Text="XML" Value="XML" />

                                                            </asp:DropDownList>
                                                        </EditItemTemplate>
                                                    </asp:TemplateField>


                                                    <%--Root Tag--%>
                                                    <asp:TemplateField HeaderText="Root Tag" Visible="False">
                                                        <HeaderStyle CssClass="gridColSummary" Width="150px" />
                                                        <ItemStyle CssClass="gridColSummary" Width="150px" Wrap="true" HorizontalAlign="center" />
                                                        <ItemTemplate>
                                                            <asp:Label ID="lblRoot" Width="150px" runat="server" ondrop="drop(event)" ondragover="allowDrop(event)" Text='<%# Microsoft.Security.Application.Encoder.HtmlEncode(DataBinder.Eval(Container, "DataItem.RootTag").ToString())%>' Style="padding: 5px; width: auto; min-width: 120px; min-height: 17px; height: auto;" />
                                                        </ItemTemplate>

                                                        <EditItemTemplate>
                                                            <%--Added by Atharva M || 11 march 2022--%>
                                                            <asp:Label runat="server" ID="Roottag" AutoPostBack="True" Width="120px" CssClass="txt" Style="padding: 5px; width: auto; min-width: 120px; min-height: 17px; height: auto;"></asp:Label>
                                                            <%--<asp:DropDownList runat="server" ID="ddlRoot" AutoPostBack="True" Width="120px" CssClass="txt" Style="padding: 5px;" OnSelectedIndexChanged="ddlRootTag_SelectedIndexChanged">
                                                </asp:DropDownList>--%>
                                                        </EditItemTemplate>
                                                    </asp:TemplateField>


                                                    <%--Tag Name--%>
                                                    <asp:TemplateField HeaderText="Tag Name" Visible="false"><%--CFIXINT-1 | Mahima G | 22 Sept 2021--%>
                                                        <HeaderStyle CssClass="gridColSummary" Width="150px" />
                                                        <ItemStyle CssClass="gridColSummary" Width="150px" Wrap="true" HorizontalAlign="center" />
                                                        <ItemTemplate>
                                                            <asp:Label ID="lblColumnName" Width="150px" runat="server" ondrop="drop(event)" ondragover="allowDrop(event)" Text='<%# Microsoft.Security.Application.Encoder.HtmlEncode(DataBinder.Eval(Container, "DataItem.TagName").ToString())%>' Style="padding: 5px;" />
                                                        </ItemTemplate>
                                                        <%--<EditItemTemplate>
                                            <asp:DropDownList runat="server" ID="ddlColumnName" Width="150px" CssClass="txt" Style="padding: 5px;" />
                                        </EditItemTemplate>--%>
                                                        <EditItemTemplate>
                                                            <%--Modified By Atharva M || 11 MArch 2022--%>
                                                            <asp:Label ID="XMLTagName" AutoPostBack="True" Width="120px" runat="server" CssClass="txt" Style="padding: 5px; width: auto; min-width: 120px; min-height: 17px; height: auto;"></asp:Label>
                                                            <asp:TextBox ID="FIXTagName" Width="200px" AutoPostBack="True" runat="server" Style="padding: 5px;" ondrop="drop(event)" ondragover="allowDrop(event)"/>
                                                            <%--CFIXINT-1 | Mahima G | 22 Sept 2021 --%>
                                                        </EditItemTemplate>
                                                    </asp:TemplateField>

                                                    <%--Modified By Atharva M || 14 MArch 2022--%>
                                                    <asp:TemplateField HeaderText="Value Type" Visible="True">
                                                        <HeaderStyle CssClass="gridColSummary" Width="80px" />
                                                        <ItemStyle CssClass="gridColSummary" Width="80px" Wrap="true" HorizontalAlign="center" />
                                                        <ItemTemplate>
                                                            <asp:Label ID="lblValueType" Width="80px" runat="server" Text='<%# Microsoft.Security.Application.Encoder.HtmlEncode(DataBinder.Eval(Container, "DataItem.XMLValueType").ToString())%>' Style="padding: 5px;" />
                                                        </ItemTemplate>
                                                        <EditItemTemplate>
                                                            <asp:DropDownList ID="ddlValueType" CssClass="ddl" runat="server" Style="padding: 5px;" Width="80px" AutoPostBack="true" OnSelectedIndexChanged="ddlValueType_SelectedIndexChanged">
                                                                <asp:ListItem Text="Field" Value="Field" />
                                                                <asp:ListItem Text="Attribute" Value="Attribute" />
                                                            </asp:DropDownList>
                                                        </EditItemTemplate>
                                                    </asp:TemplateField>

                                                    <asp:TemplateField HeaderText="Attribute" Visible="True">
                                                        <HeaderStyle CssClass="gridColSummary" Width="80px" />
                                                        <ItemStyle CssClass="gridColSummary" Width="80px" Wrap="true" HorizontalAlign="center" />
                                                        <ItemTemplate>
                                                            <asp:Label ID="lblAttribute" Width="80px" runat="server" Text='<%# Microsoft.Security.Application.Encoder.HtmlEncode(DataBinder.Eval(Container, "DataItem.Attribute").ToString())%>' Style="padding: 5px;" />
                                                        </ItemTemplate>
                                                        <EditItemTemplate>
                                                            <asp:DropDownList ID="ddlAttribute" CssClass="ddl" runat="server" Style="padding: 5px;" Width="80px" AutoPostBack="true">
                                                            </asp:DropDownList>
                                                        </EditItemTemplate>
                                                    </asp:TemplateField>
                                                    <%--Modified By Atharva M || 14 MArch 2022--%>

                                                    <%--Constant--%>
                                                    <%--Added by Mahima G on 3 Oct 2021--%>
                                                    <asp:TemplateField HeaderText="Constant" Visible="false"><%--CFIXINT-1 | Mahima G | 22 Sept 2021--%>
                                                        <HeaderStyle CssClass="gridColSummary" Width="150px" />
                                                        <ItemStyle CssClass="gridColSummary" Width="150px" Wrap="true" />
                                                        <ItemTemplate>
                                                            <asp:Label ID="lblConstant" Width="150px" runat="server" ondrop="drop(event)" ondragover="allowDrop(event)" Text='<%# Microsoft.Security.Application.Encoder.HtmlEncode(DataBinder.Eval(Container, "DataItem.Constant").ToString())%>' Style="padding: 5px;" />
                                                        </ItemTemplate>
                                                        <%--<EditItemTemplate>
                                            <asp:DropDownList runat="server" ID="ddlColumnName" Width="150px" CssClass="txt" Style="padding: 5px;" />
                                        </EditItemTemplate>--%>
                                                        <EditItemTemplate>
                                                            <asp:TextBox ID="txtConstant" Width="200px" AutoPostBack="True" runat="server" Style="padding: 5px;" ondrop="drop(event)" ondragover="allowDrop(event)" />
                                                            <%--CFIXINT-1 | Mahima G | 22 Sept 2021--%>
                                                        </EditItemTemplate>
                                                    </asp:TemplateField>
                                                    <%--END - Added by Mahima G on 3 Oct 2021--%>


                                                    <%--Repeat Y/N--%>
                                                    <%--start - Added by Mahima G on 26 Oct 2021 | CFIXINT-15--%>
                                                    <asp:TemplateField HeaderText="Repeat Y/N" Visible="false">
                                                        <HeaderStyle CssClass="gridColSummary" Width="80px" />
                                                        <ItemStyle CssClass="gridColSummary" Width="80px" Wrap="true" HorizontalAlign="center" />
                                                        <ItemTemplate>
                                                            <asp:Label ID="lblRepeatYN" Width="80px" runat="server" Text='<%# Microsoft.Security.Application.Encoder.HtmlEncode(DataBinder.Eval(Container, "DataItem.Repeat_Y/N").ToString())%>' Style="padding: 5px;" />
                                                        </ItemTemplate>
                                                        <EditItemTemplate>
                                                            <asp:DropDownList ID="ddlRepeatYN" CssClass="ddl" runat="server" Style="padding: 5px;" Width="80px" AutoPostBack="true">
                                                                <asp:ListItem Text="Y" Value="Y" />
                                                                <asp:ListItem Text="N" Value="N" />
                                                            </asp:DropDownList>
                                                        </EditItemTemplate>
                                                    </asp:TemplateField>
                                                    <%--end - Added by Mahima G on 26 Oct 2021 | CFIXINT-15--%>
                                                </Columns>
                                            </asp:GridView>
                                        </td>
                                    </tr>

                                </table>
                            </div>
                        </td>

                        <%--Datalist and SourceXML treeview--%>
                        <td style="min-width: 20%; width: 350px;">

                            <%--Column List--%>
                            <%--Buyside - Column Names from Function or AppTable--%>
                            <%--Sellside - FIX Tag Column List--%>
                            <div id="divDatalist" runat="server" visible="false" class="SlideToggleDocShow" style="display: inline; right: 0; overflow-y:hidden">
                                <table>
                                    <tr>
                                        <td>
                                            <asp:UpdatePanel ID="updatepnlMetadata" runat="server" UpdateMode="Conditional">
                                                <ContentTemplate>
                                                    <fieldset class="fieldSetBorder">
                                                        <legend class="fieldsetlegend">Column Names</legend>
                                                        <table id="tblFindUDFColumns" runat="server" style="padding-top: 10px!important">
                                                            <tr>
                                                                <td>
                                                                    <asp:TextBox ID="txtSearch" runat="server" Width="150px" onkeyup="return SearchColumn(this, event);" AutoPostBack="false"></asp:TextBox>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                                                    <asp:Button ID="btnFind" runat="server" CssClass="btn" Text="Find" Width="120px" />
                                                                </td>
                                                            </tr>
                                                            <tr>
                                                                <td class="auto-style1">
                                                                    <asp:LinkButton ID="lnkAll" runat="server" CssClass="BlueColur" Text="ALL" OnClick="FilterColumnData"></asp:LinkButton>&nbsp;
                                                                    <asp:LinkButton ID="lnkA" runat="server" CssClass="BlueColur" Text="A" OnClick="FilterColumnData"></asp:LinkButton>&nbsp;
                                                                    <asp:LinkButton ID="lnkB" runat="server" CssClass="BlueColur" Text="B" OnClick="FilterColumnData"></asp:LinkButton>&nbsp;
                                                                    <asp:LinkButton ID="lnkC" runat="server" CssClass="BlueColur" Text="C" OnClick="FilterColumnData"></asp:LinkButton>&nbsp;
                                                                    <asp:LinkButton ID="lnkD" runat="server" CssClass="BlueColur" Text="D" OnClick="FilterColumnData"></asp:LinkButton>&nbsp;
                                                                    <asp:LinkButton ID="lnkE" runat="server" CssClass="BlueColur" Text="E" OnClick="FilterColumnData"></asp:LinkButton>&nbsp;
                                                                    <asp:LinkButton ID="lnkF" runat="server" CssClass="BlueColur" Text="F" OnClick="FilterColumnData"></asp:LinkButton>&nbsp;
                                                                    <asp:LinkButton ID="lnkG" runat="server" CssClass="BlueColur" Text="G" OnClick="FilterColumnData"></asp:LinkButton>&nbsp;
                                                                    <asp:LinkButton ID="lnkH" runat="server" CssClass="BlueColur" Text="H" OnClick="FilterColumnData"></asp:LinkButton>&nbsp;
                                                                    <asp:LinkButton ID="lnkI" runat="server" CssClass="BlueColur" Text="I" OnClick="FilterColumnData"></asp:LinkButton>&nbsp;
                                                                    <asp:LinkButton ID="lnkJ" runat="server" CssClass="BlueColur" Text="J" OnClick="FilterColumnData"></asp:LinkButton>&nbsp;
                                                                    <asp:LinkButton ID="lnkK" runat="server" CssClass="BlueColur" Text="K" OnClick="FilterColumnData"></asp:LinkButton>&nbsp;
                                                                    <asp:LinkButton ID="lnkL" runat="server" CssClass="BlueColur" Text="L" OnClick="FilterColumnData"></asp:LinkButton>&nbsp;
                                                                    <asp:LinkButton ID="lnkM" runat="server" CssClass="BlueColur" Text="M" OnClick="FilterColumnData"></asp:LinkButton>&nbsp;
                                                                    <asp:LinkButton ID="lnkN" runat="server" CssClass="BlueColur" Text="N" OnClick="FilterColumnData"></asp:LinkButton>&nbsp;
                                                                    <asp:LinkButton ID="lnkO" runat="server" CssClass="BlueColur" Text="O" OnClick="FilterColumnData"></asp:LinkButton>&nbsp;
                                                                    <asp:LinkButton ID="lnkP" runat="server" CssClass="BlueColur" Text="P" OnClick="FilterColumnData"></asp:LinkButton>&nbsp;
                                                                    <asp:LinkButton ID="lnkQ" runat="server" CssClass="BlueColur" Text="Q" OnClick="FilterColumnData"></asp:LinkButton>&nbsp;
                                                                    <asp:LinkButton ID="lnkR" runat="server" CssClass="BlueColur" Text="R" OnClick="FilterColumnData"></asp:LinkButton>&nbsp;
                                                                    <asp:LinkButton ID="lnkS" runat="server" CssClass="BlueColur" Text="S" OnClick="FilterColumnData"></asp:LinkButton>&nbsp;
                                                                    <asp:LinkButton ID="lnkT" runat="server" CssClass="BlueColur" Text="T" OnClick="FilterColumnData"></asp:LinkButton>&nbsp;
                                                                    <asp:LinkButton ID="lnkU" runat="server" CssClass="BlueColur" Text="U" OnClick="FilterColumnData"></asp:LinkButton>&nbsp;
                                                                    <asp:LinkButton ID="lnkV" runat="server" CssClass="BlueColur" Text="V" OnClick="FilterColumnData"></asp:LinkButton>&nbsp;
                                                                    <asp:LinkButton ID="lnkW" runat="server" CssClass="BlueColur" Text="W" OnClick="FilterColumnData"></asp:LinkButton>&nbsp;
                                                                    <asp:LinkButton ID="lnkX" runat="server" Text="X" CssClass="BlueColur" OnClick="FilterColumnData"></asp:LinkButton>&nbsp;
                                                                    <asp:LinkButton ID="lnkY" runat="server" Text="Y" CssClass="BlueColur" OnClick="FilterColumnData"></asp:LinkButton>&nbsp;
                                                                    <asp:LinkButton ID="lnkZ" runat="server" Text="Z" CssClass="BlueColur" OnClick="FilterColumnData"></asp:LinkButton>&nbsp;
                                                                </td>
                                                            </tr>
                                                        </table>

                                                        <div style="overflow-y: scroll; height: 34em;">
                                                            <asp:DataList ID="dtColumn" runat="server">
                                                                <ItemTemplate>
                                                                    <table border="0">
                                                                        <tr>
                                                                            <td>
                                                                                <asp:Label runat="server" Text='<%#Eval("Column")%>' ID="ColumnList" class="taglist" CssClass="listitem" draggable="true" ondragstart="drag(event)" droppable=" true"></asp:Label>
                                                                            </td>
                                                                        </tr>
                                                                    </table>
                                                                </ItemTemplate>
                                                            </asp:DataList>
                                                        </div>
                                                    </fieldset>
                                                </ContentTemplate>
                                            </asp:UpdatePanel>
                                        </td>
                                    </tr>
                                </table>
                            </div>

                            <%--START|| Added by Dhanashree R || 8 March 2022--%>
                            <%--Sellside - Internal SourceXML Mapping--%>
                            <div id="divTreeViewList" runat="server" visible="false" class="SlideToggleDocShow" style="display: inline; right: 0; overflow-y: hidden;">
                                <table>
                                    <tr>
                                        <td style="min-width: 20%; width: 300px">
                                            <contenttemplate>
                                                <fieldset class="fieldSetBorder">
                                                    <legend class="fieldsetlegend">Internal XML</legend>
                                                    <div id="divchildtreeview3" runat="server" style="height: 42em; overflow-y: scroll; float: left; display: inline; width: 100%; margin-top: 20px;">
                                                        <asp:TreeView ID="TreeView3" runat="server" AutoGenerateDataBindings="True">
                                                            <ParentNodeStyle CssClass="TreeViewBody" />
                                                            <RootNodeStyle CssClass="TreeViewBody" />
                                                            <NodeStyle CssClass="TreeViewLeafNode" />
                                                        </asp:TreeView>
                                                    </div>
                                                </fieldset>
                                            </contenttemplate>
                                        </td>
                                    </tr>
                                </table>
                            </div>
                            <%--END|| Added by Dhanashree R || 8 March 2022--%>

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

        </ContentTemplate>
    </asp:UpdatePanel>
</asp:Content>
