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

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



<asp:content id="Content1" runat="server" contentplaceholderid="MainContent">
        <asp:UpdateProgress ID="UpdateProgress2" runat="server" AssociatedUpdatePanelID="UpdatePanel1"
        DisplayAfter="0">
        <ProgressTemplate>
            <div class="divLoading">
                <img alt="Loading" src="../App_Resources/loading.gif" /><span class="lbl">Loading...&nbsp;&nbsp;</span>
            </div>
        </ProgressTemplate>
    </asp:UpdateProgress>

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

            <style>
                #btnLoad:hover, #btnSave:hover {
                    cursor: pointer;
                }

                .lblSuccess {
                    color: green;
                }

                .divLoading {
                    position: absolute;
                    top: 48px;
                    left: 260px;
                }

                fieldset {
                    border-color: white;
                    border: solid 1px #dddddd;
                    box-sizing: border-box;
                    padding: 2px;
                    border-collapse: collapse;
                }
                /*.Grid .GridItem:first-child {
                    background-color:  #f9f9f9 !important;
                }*/
                .txttemp {
                    width: 443px !important;
                }
                .GridHeader {
                    background-color: #ededed;
                }


                #ctl00_MainContent_PopUPDiv {
                    top: 297px;
                    left: 927px;
                    position: absolute;
                    z-index: 10;
                    width: auto;
                    height: auto;
                    max-height: 500px;
                    overflow-y: scroll;
                    background-color: #FFFFFF;
                    border: solid 1px #DDDDDD;
                    border-bottom: solid 2px #DDDDDD;
                    border-right: solid 2px #DDDDDD;
                    padding: 5px;
                }

               
            </style>
            <script>
                function AllowAlphaNumericOnly(e) {

                    var keycode;
                    if (window.event)
                        keycode = window.event.keyCode;
                    else if (event)
                        keycode = event.keyCode;
                    else if (e)
                        keycode = e.which;
                    else return true;

                    if ((keycode > 47 && keycode <= 57) || (keycode > 64 && keycode < 91) || (keycode > 96 && keycode < 123)) {

                        return true;
                    }

                    else { return false; }

                }

                var dialogConfirmed = false;
                function ViewDialogDuplicate(obj, title, dialogText) {
                    
                    if ($("#pageName").html() != null) {
                    }

                    if (!dialogConfirmed) {
                        $('html').append(String.Format("<div id='dialog' title='{0}'><p style='float:left;'><span class='ui-icon ui-icon-alert' style='float:left; margin:0 5px 20px 0;'></span>{1}</p></div>", title, dialogText));
                        $('#dialog').dialog
                                ({
                                    height: 180,
                                    width: 350,
                                    modal: true,
                                    resizable: false,
                                    draggable: true,
                                    close: function (event, ui) { $('html').find('#dialog').remove(); },
                                    buttons:
                                    {
                                        'Yes': function () {
                                            $("[id$='btnConfirmation']")[0].click();
                                            $(this).dialog('close');
                                        },
                                        'No': function () {
                                            $(this).dialog('close');
                                            $('html').find("#dialog").remove();
                                            return false;
                                        }
                                    }
                                });
                    }

                    return dialogConfirmed;
                    $(".ui-widget-overlay").height($("body").height());

                }
                function checkAll(elem) {
                    var checkBoxes = $("#ctl00_MainContent_PopUPDiv").find($("[id$='chk']"));
                    if ($($("[id*='chkAll']")[0]).is(':checked')) {
                        for (i = 0; i < checkBoxes.length; i++) {
                            checkBoxes[i].checked = true
                        }
                    } else {
                        for (i = 0; i < checkBoxes.length; i++) {
                            checkBoxes[i].checked = false
                        }
                    }
                }



            </script>

            <table>
                <tr>
                    <td>
                        <asp:Label ID="lblSuccess" CssClass="lblError" runat="server" Style="margin-bottom: 20px !important" />
                        <asp:Label ID="lblError" CssClass="lblError" runat="server" Style="margin-bottom: 20px !important" />
                        
                        
                        <input type="hidden" id="hdnButtonClick" runat="server" />
                        <input type="hidden" id="hdnButtonClickCopyTo" runat="server" />
                    </td>
                    </td>
                </tr>


            </table>
          
              <table style="width: 100%;margin-top:5px;">
                <tr>
                    <td>
                        <%--<asp:Panel ID="pnlOne" runat="server">--%>
                            <table>

                                <tr>
                                    <td>
                                        <asp:Label ID="lblProduct" runat="server" Text="Product Name  " CssClass="lbl" />
                                    </td>
                                    <td>
                                        <asp:DropDownList ID="ddlProduct" runat="server" AutoPostBack="True" Style="padding: 5px;" Width="200px">
                                            <%--<asp:ListItem Text="test" Value="test"/>--%>
                                        </asp:DropDownList>
                                    </td>

                                  
                                    <td>
                                        <asp:Label ID="lblMsgType" runat="server" Text="Message Type  " CssClass="lbl" Style="padding-left: 17px;" />
                                    </td>
                                    <td>
                                        <asp:DropDownList ID="ddlMsgType" runat="server" AutoPostBack="True" Style="padding: 5px;" Width="201px">
                                             <%-- START ----Added By- Dhanashree R || 13 Oct 2021 || HSBCELINT-88--%>
                                            <asp:ListItem Text="Mandate" Value="Mandate" />
                                            <%-- END ----Added By- Dhanashree R || 13 Oct 2021 || HSBCELINT-88--%>
                                            <asp:ListItem Text="Order" Value="Order" />
                                            <asp:ListItem Text="RFQ" Value="RFQ" />
                                        </asp:DropDownList>
                                    </td>
          
                                    <td Style="padding-left: 15px;">
                                        <asp:Button ID="btnLoad" Text="Load" runat="server" CssClass="btn" Width="100px" Style="padding: 5px;" />
                                     </td>
                                     <td Style="padding-left: 15px;">
                                        <asp:Button ID="btnSave" Enabled="false" Text="Save" runat="server" CssClass="btn" Width="100px" Style="padding: 5px;"/>
                                     </td>
                                </tr>

                                <tr>
                                    <td>
                                        <asp:Label ID="lblProductVariation" runat="server" Text="Product Variation  " CssClass="lbl" />
                                    </td>
                                    <td>
                                        <asp:DropDownList ID="ddlProductVariation" runat="server" AutoPostBack="True" Style="padding: 5px;" Width="201px">
                                            <%--<asp:ListItem Text="test" Value="test"/>--%>
                                        </asp:DropDownList>
                                    </td>

                                
                                    <td>
                                        <asp:Label ID="lblMsgDirection" runat="server" Text="Message Direction  " CssClass="lbl" Style="padding-left: 17px;" />
                                    </td>
                                    <td>
                                        <asp:DropDownList ID="ddlMsgDirection" runat="server" AutoPostBack="True" Style="padding: 5px;" Width="201px">
                                            <asp:ListItem Text="Request" Value="Request" />
                                            <asp:ListItem Text="Response" Value="Response" />
                                            <asp:ListItem Text="Solve For" Value="SolveFor" /> <%--Added BY Samruddhi Wani || Asked by Rushikesh N|| on 07-Jun-2022 || Jira Id - BBVAORINT-697--%>
                                        </asp:DropDownList>
                                    </td>
                                    <td Style="padding-left: 15px;">
                                        <asp:Button ID="btnAdd" Enabled="false" Text="Add" runat="server" CssClass="btn" Width="100px" Style="padding: 5px;" />
                                    </td>

                                    <td Style="padding-left: 15px;">
                                    <asp:Button ID="btnDelete" Enabled="false" Text="Delete" runat="server" CssClass="btn" Width="100px" Style="padding: 5px;" />
                                                </td>

                                </tr>

                                <tr>
                                    <td>
                                        <asp:Label ID="lblPriceProvider" runat="server" Text="Counterparty  " CssClass="lbl" />
                                    </td>
                                    <td>
                                        <asp:DropDownList ID="ddlPriceProvider" runat="server" AutoPostBack="True" Style="padding: 5px;" Width="200px">
                                            <%--<asp:ListItem Text="test" Value="test"/>--%>
                                        </asp:DropDownList>
                                    </td>
									
                                    <td Style="padding-left: 17px;">
                                        <asp:Button ID="btnImport" Text="Import" runat="server" CssClass="btn" Width="100px" />
                                    </td>
                                    <td>
                                        <asp:FileUpload ID="fileuploadExcel" type="file" size="52" name="clientfile" runat="server" Width="201px" />
                                    </td>
                                   <td td Style="padding-left: 15px;">
                                        <asp:Button ID="btnExport" Text="Export" runat="server" CssClass="btn" Width="100px" />
                                    </td>


                                    <%--<td>
                                        <asp:Button ID="btnCreateXsl"  Text="Generate Xsl" runat="server" CssClass="btn" Width="100px" />
                                    </td>--%>
                                </tr>

                                <tr>
                                    <td colspan="5">
                                        <table>
                                            <tr>
                                             
                                            </tr>
                                        </table>
                                      
                                    </td>

                                    
                                    <%--<td>
                                        <asp:Button ID="btnCreateXsl"  Text="Generate Xsl" runat="server" CssClass="btn" Width="100px" />
                                    </td>--%>

                                </tr>
                            </table>
                            

                           <%-- <table>


                                <tr>
                                    <td>
                                        <asp:Button ID="btnLoad" Text="Load" runat="server" CssClass="btn" Width="100px" />
                                    </td>

                                    <td>
                                        <asp:Button ID="btnSave" Enabled="false" Text="Save" runat="server" CssClass="btn" Width="100px" />
                                    </td>
                                    <td>
                                        <asp:Button ID="btnAdd" Enabled="false" Text="Add" runat="server" CssClass="btn" Width="100px" />
                                    </td>

                                    <td>
                                        <asp:Button ID="btnDelete" Enabled="false" Text="Delete" runat="server" CssClass="btn" Width="100px" />
                                    </td>

                                    <%--<td>
                                        <asp:Button ID="btnCreateXsl"  Text="Generate Xsl" runat="server" CssClass="btn" Width="100px" />
                                    </td>--

                                </tr>
                            </table>--%>
                        <%--</asp:Panel>--%>
                    </td>
                </tr>
               
                <tr>
                    <td>
                        <table ID="CopyToCounterPartyTable" runat="server" visible="false" style="padding-top: 25px;padding-bottom: 25px;">
                            <tr>
                                <td>  
                                    <asp:Label ID="lblCopyTo" Text="Copy Template To" runat="server"> </asp:Label>
                                    <asp:CheckBox runat="server" ID="chkCopyTo" CssClass="chk" AutoPostBack="true" Style="margin-left: 8px;" />
                                    <%--For the CounterParty Selection AutoSuggestion Box--%>
                                </td>
                                    <td>

                                    <asp:TextBox runat="server" ID="txtCopyTo" CssClass="txt txttemp" ReadOnly="true" style="width: 730px !important"></asp:TextBox>
                                </td>
                                <td>
                                </td>
                                <td></td>

                        <td>
                             <asp:Panel ID="PopUPDiv" runat="server"  Style="" Visible="false" Placement="Center">

                                                        <table>
                                                            <tr>
                                                                <td>
                                                                  
                                                                    <asp:Label runat="server" Text="" CssClass="lbl PopUpUpperLeft  hideControl" ID="lblPopUP" ></asp:Label></td>
                                                                <td style="white-space: nowrap; text-align: right; width: 120px;">
                                                                    <asp:Button runat="server" CssClass="btn btnApply" Text="Copy Template" ID="btnApply"></asp:Button>
                                                                    &nbsp;
                                                    <asp:Button runat="server" CssClass="btn btnClose" Text="X" ID="btnClose"></asp:Button></td>

                                                            </tr>


                                                            <tr>
                                                                <td class="LowerTDPopUp" colspan="2" style="padding-top: 10px;">
                                                                    <asp:GridView runat="server" ID="dgPopUp" AutoGenerateColumns="false" AllowPaging="true" PageSize="28">
                                                                        <HeaderStyle CssClass="GridHeader" Font-Size="X-Small" BackColor="#ededed" Font-Bold="False"
                                                                            ForeColor="White" HorizontalAlign="Center" Wrap="false"/>
                                                                        <RowStyle CssClass="GridItem" Wrap="false" />
                                                                        <Columns>
                                                                            <asp:TemplateField HeaderText="">
                                                                                <HeaderStyle HorizontalAlign="Center" Width="20px" VerticalAlign="Middle"></HeaderStyle>
                                                                                <ItemStyle HorizontalAlign="Center" Width="20px" VerticalAlign="Middle" />
                                                                                <HeaderTemplate>
                                                                                    <asp:CheckBox ID="chkAll" runat="server" Checked="false"  onclick="checkAll();"/>
                                                                                </HeaderTemplate>
                                                                                <ItemTemplate>
                                                                                    <asp:CheckBox ID="chk" runat="server" Checked="false" />
                                                                                </ItemTemplate>
                                                                            </asp:TemplateField>
                                                                            <asp:TemplateField HeaderText="Price Provider">
                                                                                <HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle"></HeaderStyle>
                                                                                <ItemTemplate>
                                                                                    <asp:Label ID="lblPriceProvider" runat="server" Text='<%# Eval("Price_Provider")%>' Width="150px"></asp:Label>
                                                                                </ItemTemplate>
                                                                            </asp:TemplateField>

                                                                        </Columns>
                                                                    </asp:GridView>
                                                                </td>
                                                            </tr>
                                                        </table>
                                                    </asp:Panel>


                        </td>
                            </tr>
              
                            <tr id="payoffInfo" runat="server">

                                <td>
                                    <asp:Label ID="lblInfo" runat="server" Text="Payoff Information  " CssClass="lbl" />
                                </td>
                                <td>
                                    <textarea runat="server" id="txtAddInfo" class="enableCPA" rows="4" style="width: 730px !important">

                                    </textarea>

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

                <tr>
                    <td colspan="2">
                        
                            <table style="width: 866px !important;">   <%--style="width: 100%; "--%>
                                <tr>
                                    <td>
                                        <asp:Panel ID="pnlTwo" runat="server" Visible="false">
                                             <asp:GridView ID="grdXslData" runat="server" AllowPaging="True" AutoGenerateColumns="False" CssClass="Grid" EmptyDataText="No Records Found" 
                                            PageSize="999" ShowHeaderWhenEmpty="true" Width ="866px">
                                                <RowStyle CssClass="GridItem" />
                                                <HeaderStyle CssClass="GridHeader" />
                                                <FooterStyle CssClass="GridFooter" />
                                                <PagerStyle CssClass="GridPager" />
                                                <Columns>
                                                    <asp:TemplateField>
                                                        <ItemStyle HorizontalAlign="Center" Width ="3%" />
                                                        <HeaderStyle  Width ="3%" />

                                                        <ItemTemplate>
                                                            <asp:CheckBox ID="chkRow" runat="server" AutoPostBack="true"></asp:CheckBox>
                                                        </ItemTemplate>
                                                    </asp:TemplateField>

                                                    <asp:TemplateField HeaderStyle-Wrap="True" HeaderText="Actions" Visible="true">
                                                        <ItemStyle HorizontalAlign="center" Width="15%" />
                                                        <HeaderStyle Width="15%" />
                                                        <EditItemTemplate>
                                                      
                                                            <asp:LinkButton ID="btnUpdateNew" runat="server" CommandName="Update" Text="Update"  HorizontalAlign="left" CssClass="display: inline-block;" />
                                                            &nbsp;&nbsp;
                                                            <asp:LinkButton ID="btnCancelNew" runat="server" CommandName="Cancel" Text="Cancel" HorizontalAlign="Right" CssClass="display: inline-block;" />
                                                        </EditItemTemplate>
                                                        <ItemTemplate>
                                                            <asp:LinkButton ID="btnEditNew" HorizontalAlign="center" runat="server" CommandName="Edit" Text="Edit" />
                                                        </ItemTemplate>
                                                    </asp:TemplateField>

                                                     <asp:TemplateField HeaderText="Sr. No.">
                                                        <HeaderStyle CssClass="gridColSummary" Width ="7%"   />
                                                        <ItemStyle CssClass="gridColSummary" wrap="true"  Width ="7%" />
                                                        <ItemTemplate>
                                                            <asp:Label ID="lblRowNumber" runat="server" Text="<%# Container.DataItemIndex + 1 %>"/>
                                                        </ItemTemplate>
                                                    </asp:TemplateField>

                                                    <asp:TemplateField HeaderText="ID" Visible="false" >
                                                        <HeaderStyle CssClass="gridColSummary"/>
                                                        <ItemStyle CssClass="gridColSummary" wrap="true" />
                                                        <ItemTemplate>
                                                            <asp:Label ID="lblXSLId" CssClass="lbl" runat="server" Text='<%# Microsoft.Security.Application.Encoder.HtmlEncode(DataBinder.Eval(Container, "DataItem.id").ToString)%>'  />

                                                        </ItemTemplate>
                                                        <EditItemTemplate>
                                                            <asp:TextBox ID="txtXSLId" CssClass="txt" runat="server" Text='<%# Microsoft.Security.Application.Encoder.HtmlEncode(DataBinder.Eval(Container, "DataItem.id").ToString)%>' />

                                                        </EditItemTemplate>
                                                   
                                                    </asp:TemplateField>

                                                
                                                    <asp:TemplateField HeaderText="Email Header">
                                                        <HeaderStyle CssClass="gridColSummary" Width ="30%" />
                                                        <ItemStyle CssClass="gridColSummary" Width ="30%" wrap="true"/>
                                                        <ItemTemplate>
                                                            <asp:Label ID="lblEmailHeader" CssClass="lbl" runat="server"  Text='<%# Microsoft.Security.Application.Encoder.HtmlEncode(DataBinder.Eval(Container, "DataItem.Email_Header").ToString)%>' />

                                                        </ItemTemplate>
                                                        <EditItemTemplate>
                                                             <asp:textbox ID="txtEmailHeader" CssClass="txt"  runat="server"  Width ="100%"  Text='<%# Microsoft.Security.Application.Encoder.HtmlEncode(DataBinder.Eval(Container, "DataItem.Email_Header").ToString)%>' />
                                                        </EditItemTemplate>
                                                    </asp:TemplateField>

                                                    <asp:TemplateField HeaderText="UCP Alias" >
                                                        <HeaderStyle CssClass="gridColSummary" Width ="25%" />
                                                        <ItemStyle CssClass="gridColSummary" Width ="25%" wrap="true"/>
                                                        <ItemTemplate>
                                                            <asp:Label ID="lblUCPAlias" CssClass="lbl" runat="server"  Text='<%# Microsoft.Security.Application.Encoder.HtmlEncode(DataBinder.Eval(Container, "DataItem.Template_Field_Display_Name").ToString)%>'  Width="200px"/>

                                                        </ItemTemplate>
                                                        <EditItemTEmplate>
                                                           <asp:DropDownList ID="ddlUCPAlias" runat="server"  Width ="100%"/>
                                                        </EditItemTEmplate> 
                                                    </asp:TemplateField>
                                                
                                                     <asp:TemplateField HeaderText="Extended" >
                                                        <HeaderStyle CssClass="gridColSummary" Width ="20%" />
                                                        <ItemStyle CssClass="gridColSummary" Width ="20%" wrap="true"/>
                                                        <ItemTemplate>
                                                            <asp:Label ID="lblExtended" CssClass="lbl" runat="server" Text='<%# Microsoft.Security.Application.Encoder.HtmlEncode(DataBinder.Eval(Container, "DataItem.Extended_Name").ToString)%>'  Width="200px"/>

                                                        </ItemTemplate>
                                                        <EditItemTEmplate>
                                                           <asp:DropDownList ID="ddlExtended" runat="server" Width ="100%"/>
                                                        </EditItemTEmplate> 
                                                    </asp:TemplateField> 


                                                     <asp:TemplateField HeaderText="Seqeunce No." Visible ="False">
                                                        <HeaderStyle CssClass="gridColSummary" />
                                                        <ItemStyle CssClass="gridColSummary" wrap="true"/>
                                                        <ItemTemplate>
                                                                  <asp:Label ID="lblSeqNo" CssClass="lbl" runat="server" Text='<%# Microsoft.Security.Application.Encoder.HtmlEncode(DataBinder.Eval(Container, "DataItem.Sequence_Number").ToString)%>'  />

                                                        </ItemTemplate>
                                                         <EditItemTemplate>
                                                               <asp:DropDownList ID="ddlSeqNo" runat="server"    />
                                                         </EditItemTemplate>
                                                    </asp:TemplateField>

                                                    <asp:TemplateField HeaderText="Display Y/N" Visible="false">
                                                        <HeaderStyle CssClass="gridColSummary"/>
                                                        <ItemStyle HorizontalAlign="Center" CssClass="gridColSummary" wrap="true"/>
                                                        <ItemTemplate>
                                                              <asp:Label ID="lblDisplayYN" CssClass="lbl" runat="server"  Text='<%# Microsoft.Security.Application.Encoder.HtmlEncode(DataBinder.Eval(Container, "DataItem.Display_YN").ToString)%>'  />


                                                        </ItemTemplate>
                                                        <EditItemTemplate>
                                                            <asp:DropDownList  ID="ddlDisplayYN" CssClass="ddl"  runat="server" >
                                                                <asp:ListItem Text="Y" Value="Y"/>
                                                                <asp:ListItem Text="N" Value ="N"/>
                                                            </asp:DropDownList>
                                                        </EditItemTemplate>
                                                    </asp:TemplateField>
                                             
                                                </Columns>
                                             </asp:GridView>
                                         </asp:Panel>      
                                    </td>
                                </tr>
                            </table>
                       

                </tr>
                

            </table>
            
            <asp:HiddenField ID="hidden_FilePath" runat="server" />
            
             <input type="hidden" id="hdnDelete" runat="server" />
            <asp:Button ID="btnConfirmation" runat="server" Width="0" Style="width: 0px; height: 0px; font-size: 0; border: none; display:none;" />
           
        </ContentTemplate>
          <%--  <Triggers>
        <asp:PostBackTrigger  ControlID="btnCreateXsl" />
        <asp:PostBackTrigger  ControlID="btnSave" />
        

    </Triggers>--%>
         <Triggers>
            <asp:PostBackTrigger ControlID="btnExport" />
            <asp:PostBackTrigger ControlID="btnImport" />           
        </Triggers>
    </asp:UpdatePanel>
</asp:content>
