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

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>



<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="Server">
    <asp:ScriptManagerProxy ID="ScriptManagerProxy11" runat="server">
    </asp:ScriptManagerProxy>
    <style type="text/css">
        .btn, .btnCommon, .btn:hover {
            width: 70px;
            text-align: center !important;
        }

        .ddl {
            width: auto;
        }

        .constantWidth {
            width: 6px;
        }

        .lblError {
            text-decoration-color: red;
        }

        .auto-style2 {
            width: 332px;
            height: 26px;
        }

        .auto-style5 {
            width: 332px;
        }
    </style>


    <script type="text/javascript">

        function isNumberKey(evt) {
            var = (evt.which) ? evt.which : evt.keyCode;
            if (charCode > 31 && (charCode < 48 || charCode > 57))
                return false;
            return true;
        }

    </script>

    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
        <ContentTemplate>
            <div id="Div1" runat="server">
                <table style="padding-bottom: 10px; margin: 5px;">
                <tr>
                    <td class="lblBlotterPaddingRight">
                         <asp:Label ID="lblSchemeName" runat="server"    CssClass="lbl" Text="Scheme Name"></asp:Label>
                    </td>
                    <td class="ctlBlotterPaddingRight">
                        <asp:DropDownList ID="ddlSchemeName" runat="server" CssClass="ddl" AppendDataBoundItems="true" Width="250px"  AutoPostBack="True" >
                        </asp:DropDownList>
                    </td>


                    <td class="lblblotterpaddingright">
                        <asp:Label ID="lblScheduleCode" CssClass="lbl" runat="server" Text="Schedule Code"></asp:Label>
                    </td>
                    <td class="ctlBlotterPaddingRight" colspan="3">
                        <asp:DropDownList ID="ddlScheduleCode" CssClass="ddl" AppendDataBoundItems="true" Width="277px" runat="server" AutoPostBack="true"></asp:DropDownList>
                    </td>
                    <td>
                        <asp:Label ID="lblIncludeDeactivated" CssClass="lbl" runat="server" Text="Include Deactivated"></asp:Label>
                    </td>
                    <td class="lblblotterpaddingright"> 
                        <asp:CheckBox ID="deactivatedChkBox" runat="server" AutoPostBack="true"></asp:CheckBox>
                    </td>
                    <td class="tdlblRecordCnt">
                        <asp:Label runat="server" ID="lblRecordCnt" Text="Total Record(s) :" CssClass="lbl"></asp:Label>
                    </td>

                    <td>
                        <asp:Label runat="server" ID="lblTotalRecords" Text="" CssClass="lbl" Width ="200px"> </asp:Label>
                    </td>



                </tr>
                    <tr>
                        <td style="height: 10px; font-family: Verdana; font-size: 12px;"></td>
                    </tr>
                    <tr>
                        <td class="lblblotterpaddingright">
                            <asp:Label ID="lblTemplateName" CssClass="lbl" runat="server" Text="Template Name"></asp:Label>
                    </td>
                    <td class="ctlBlotterPaddingRight">
                        <asp:DropDownList ID="ddlTemplateName" CssClass="ddl" AppendDataBoundItems="true" width="250px" runat="server" AutoPostBack="true"></asp:DropDownList>
                    </td>
                    <%--<td class="lblblotterpaddingright">
                        <asp:Label ID="lblProductId" CssClass="lbl" runat="server" Text="Product ID"></asp:Label>
                    </td>
                    <td class="ctlBlotterPaddingRight">
                        <asp:TextBox ID="txtProductId" horizontalalign="right" CssClass="txt"  width="250px" runat="server" AutoPostBack="true"></asp:TextBox>
                    </td>--%>

                    <td class="ctlBlotterPaddingRight">
                        <asp:Button ID="btnLoad" Enabled="False" runat="server" autopostback="true" Text="Load" CssClass="btn" />
                    </td>
                    <td class="ctlBlotterPaddingRight">
                        <asp:Button ID="btnAdd" Enabled="False" runat="server" autopostback="true" CssClass="btn" Text="Add" />
                    </td>
                    <td class="ctlBlotterPaddingRight">
                        <asp:Button ID="btnSave" Enabled="False" runat="server" CssClass="btn" Text="Save" />
                    </td>

                    <td class="ctlBlotterPaddingRight">
                        <asp:Button ID="btnDelete" Enabled="False" runat="server" CssClass="btn" Text="Delete" OnClientClick="return confirm('Are you sure to delete this record(s) ?');" />
                    </td>
                    <td colspan ="2">
                        <asp:Label ID="lblDisplay" runat="server" CssClass="lblError labelMargin btnSpacing"></asp:Label>
                    </td>
               </tr>
            </table>
            </div>
            <div id="Div2" runat="server">
                <table>
                <tr>
                    <td colspan="8">
                        <div>
                            <asp:GridView ID="grdTemplateScheduleSubcodes" Style =" margin-left : 6px" runat="server" AllowSorting="True" AutoGenerateColumns="False"
                                BorderStyle="Solid" BorderWidth="1px" CellPadding="3" CssClass="Grid Gridview" AllowPaging="true" ShowHeaderWhenEmpty="true" PageSize = "10" >
                                <SelectedRowStyle CssClass="GridItemSelect" />
                                <RowStyle CssClass="GridItem" />
                                <HeaderStyle CssClass="GridHeader" />
                                <FooterStyle CssClass="GridFooter" />
                                <PagerStyle CssClass="GridPager" />
                                <EmptyDataTemplate>
                                    <asp:Label ID="lblTemplateScheduleSubcodes" runat="server" Text="No data found..."></asp:Label>
                                </EmptyDataTemplate>


                                <Columns>
                                    <asp:TemplateField>
                                        <ItemStyle Width="30px" />
                                        <HeaderStyle Width="30px" />
                                        <ItemTemplate>
                                            <asp:CheckBox ID="CheckBox" runat="server" AutoPostBack="false"></asp:CheckBox>
                                        </ItemTemplate>
                                    </asp:TemplateField>

                                    <asp:TemplateField HeaderStyle-Wrap="True" Visible="true">
                                        <ItemStyle HorizontalAlign="center"/>
                                        <HeaderStyle />
                                        <EditItemTemplate>
                                            <asp:LinkButton ID="btnUpdateNew" runat="server" CommandName="Update"  Text="Update" HorizontalAlign="left" CssClass="display: inline-block;" />
                                            &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 HeaderStyle-Wrap="True" HeaderText="ID" Visible="false">
                                        <ItemStyle Width="30px" HorizontalAlign="right" />
                                        <HeaderStyle Width="30px" />
                                        <ItemTemplate>
                                            <asp:Label ID="lblTSSID" runat="server" Text='<%# Microsoft.Security.Application.Encoder.HtmlEncode(If(DataBinder.Eval(Container, "DataItem.TSS_ID") Is DBNull.Value, "", DataBinder.Eval(Container, "DataItem.TSS_ID"))).ToString%>' />
                                        </ItemTemplate>
                                    </asp:TemplateField>

                                    <asp:TemplateField HeaderStyle-Wrap="True" HeaderText="Parent Code" Visible="true">
                                        <ItemStyle Width="180px" HorizontalAlign="left" />
                                        <HeaderStyle Width="180px" />
                                        <ItemTemplate>
                                            <asp:Label ID="lblParentCode" runat="server" Text='<%# Microsoft.Security.Application.Encoder.HtmlEncode(DataBinder.Eval(Container, "DataItem.TSS_ParentCode").ToString)%>'/>
                                        </ItemTemplate>
                                        <EditItemTemplate>
                                           <asp:DropDownList ID="ddlParentCode" runat="server" Width="180px" HorizontalAlign="left" />
                                        </EditItemTemplate>
                                    </asp:TemplateField>

                                    <asp:TemplateField HeaderStyle-Wrap="True" HeaderText= "Subcode Type" Visible="true">
                                        <ItemStyle Width="180px" HorizontalAlign="left" />
                                        <HeaderStyle Width="180px" />
                                        <ItemTemplate>
                                            <asp:Label ID="lblSubcodeType" runat="server" Text='<%# Microsoft.Security.Application.Encoder.HtmlEncode(DataBinder.Eval(Container, "DataItem.TSS_Subcode_Type").ToString)%>'/>
                                        </ItemTemplate>
                                        <EditItemTemplate>
                                           <asp:DropDownList ID="ddlSubcodeType" runat="server" AutoPostBack = "true"  OnSelectedIndexChanged ="subcodeTypeIndexChange" Width="180px" HorizontalAlign="left">
                                            <asp:ListItem Value="Offset Schedule">Offset Schedule</asp:ListItem>
                                            <asp:ListItem Value="Alias Mapping">Alias Mapping</asp:ListItem>
                                            <asp:ListItem Value="Mutation">Mutation</asp:ListItem>
                                            <asp:ListItem Value="Index Mapping">Index Mapping</asp:ListItem>
                                           </asp:DropDownList>                         
                                        </EditItemTemplate>
                                    </asp:TemplateField>
                                   <%-- <asp:TemplateField HeaderStyle-Wrap="True" HeaderText="Parent Code" Visible="false">
                                        <ItemStyle Width="50px" HorizontalAlign="left" />
                                        <HeaderStyle Width="50px" />
                                        <ItemTemplate>
                                            <asp:Label ID="lblParentCode" runat="server" Text='<%# Microsoft.Security.Application.Encoder.HtmlEncode(DataBinder.Eval(Container, "DataItem.TSS_ParentCode").ToString)%>' />
                                        </ItemTemplate>
                                        <EditItemTemplate>
                                            <asp:TextBox ID="txtParentCode" runat="server" onkeypress="return isNumberKey(event)" HorizontalAlign="Right" Width="30px" Text='<%# Microsoft.Security.Application.Encoder.HtmlEncode(DataBinder.Eval(Container, "DataItem.TSS_ParentCode").ToString)%>' />
                                        </EditItemTemplate>
                                    </asp:TemplateField>--%>



                                    <%--------------------------------------------------------------------------------%>
                                    <asp:TemplateField HeaderStyle-Wrap="True" HeaderText="Schedule SubCode">
                                        <HeaderStyle Width="160px" />
                                        <ItemStyle Wrap="false" Width="160px" HorizontalAlign="left" />

                                        <ItemTemplate>
                                            <asp:Label ID="lblSubCode" runat="server" Text='<%# Microsoft.Security.Application.Encoder.HtmlEncode(DataBinder.Eval(Container, "DataItem.TSS_SubCode").ToString)%>'>
                                            </asp:Label>
                                        </ItemTemplate>
                                        <EditItemTemplate>
                                            <asp:TextBox ID="txtSubCode" runat="server" onkeypress="return isNumberKey(event)" HorizontalAlign="Right" Text='<%# Microsoft.Security.Application.Encoder.HtmlEncode(DataBinder.Eval(Container, "DataItem.TSS_SubCode").ToString)%>' />
                                        </EditItemTemplate>

                                        <%--   <EditItemTemplate>
                                    <asp:DropDownList ID="ddlWorkflow" runat="server" Width="279px" AutoPostBack="False">
                                    </asp:DropDownList>
                                </EditItemTemplate>--%>
                                    </asp:TemplateField>
                                    <%--------------------------------------------------------------------------------%>


                                    <asp:TemplateField HeaderStyle-Wrap="False" HeaderText="Fixing Offset">
                                        <HeaderStyle wrap ="false"  Width="65px"/>
                                        <ItemStyle HorizontalAlign="Right" width ="65px"/>
                                        <ItemTemplate>
                                            <asp:Label ID="lblFixingOffset" runat="server" Text='<%# Microsoft.Security.Application.Encoder.HtmlEncode(DataBinder.Eval(Container, "DataItem.TSS_Fixing_Offset").ToString)%>'>
                                            </asp:Label>
                                        </ItemTemplate>
                                        <EditItemTemplate>
                                            <asp:TextBox ID="txtFixingOffset" runat="server" Enabled ="false" OnKeyPress="return AllowNumericOnly(this);" AutoPostBack="False" Width="65px">
                                            </asp:TextBox>
                                        </EditItemTemplate>
                                    </asp:TemplateField>

                                    <asp:TemplateField HeaderStyle-Wrap="False" HeaderText="Settlement Offset">
                                        <HeaderStyle wrap ="true" Width="65px" />
                                        <ItemStyle HorizontalAlign="Right" Width="65px"/>
                                        <ItemTemplate>
                                            <asp:Label ID="lblSettlementOffset" runat="server"  Text='<%# Microsoft.Security.Application.Encoder.HtmlEncode(DataBinder.Eval(Container, "DataItem.TSS_Settlement_Offset").ToString)%>'>
                                            </asp:Label>
                                        </ItemTemplate>
                                        <EditItemTemplate> 
                                            <asp:TextBox ID="txtSettlementOffset" runat="server" Enabled ="false" OnKeyPress="return AllowNumericOnly(this);" AutoPostBack="False" Width="65px" >
                                            </asp:TextBox>
                                        </EditItemTemplate>
                                    </asp:TemplateField>
                                    

                                    <asp:TemplateField HeaderStyle-Wrap="True" HeaderText="Save Date Schedule (Y/N)" Visible="true">
                                        <ItemStyle Width="65px" HorizontalAlign="Center" Wrap ="true" />
                                        <HeaderStyle Width="65px" />
                                        <ItemTemplate>
                                            <asp:Label ID="lblSaveDateSchedule" runat="server" Text='<%# Microsoft.Security.Application.Encoder.HtmlEncode(If(DataBinder.Eval(Container, "DataItem.TSS_SaveDateScheduleYN") Is DBNull.Value, "", DataBinder.Eval(Container, "DataItem.TSS_SaveDateScheduleYN"))).ToString%>' />
                                        </ItemTemplate>
                                        <EditItemTemplate>
                                            <asp:DropDownList ID="ddlSaveDateScheduleYN" runat="server" AutoPostBack="False" Width="65px">
                                                <asp:ListItem Value="Y">Y</asp:ListItem>
                                                <asp:ListItem Value="N">N</asp:ListItem>
                                            </asp:DropDownList>
                                        </EditItemTemplate>
                                    </asp:TemplateField>

                                    <asp:TemplateField HeaderStyle-Wrap="True" HeaderText="Active (Y/N)" Visible="true">
                                        <ItemStyle Width="65px" HorizontalAlign="Center" Wrap="true" />
                                        <HeaderStyle Width="65px" />
                                        <ItemTemplate>
                                            <asp:Label ID="lblActive" runat="server" Text='<%# Microsoft.Security.Application.Encoder.HtmlEncode(If(DataBinder.Eval(Container, "DataItem.TSS_Active_YN") Is DBNull.Value, "", DataBinder.Eval(Container, "DataItem.TSS_Active_YN"))).ToString%>' />
                                        </ItemTemplate>
                                        <EditItemTemplate>
                                            <asp:DropDownList ID="ddlActive" runat="server" AutoPostBack="False" Width="65px">
                                                <asp:ListItem Value="Y">Y</asp:ListItem>
                                                <asp:ListItem Value="N">N</asp:ListItem>
                                            </asp:DropDownList>
                                        </EditItemTemplate>
                                    </asp:TemplateField>

                                    <asp:TemplateField HeaderStyle-Wrap="True" HeaderText="Created At" Visible="true">
                                        <ItemStyle wrap ="false" HorizontalAlign="Right"/>
                                        <HeaderStyle Width="115px" />
                                        <ItemTemplate>
                                            <asp:Label ID="lblCreatedAt" runat="server" Text='<%# Microsoft.Security.Application.Encoder.HtmlEncode(DataBinder.Eval(Container, "DataItem.TSS_Created_At").ToString)%>' />
                                        </ItemTemplate>
                                        <%--<EditItemTemplate>
                                            <asp:TextBox ID="txtCreatedAt" runat="server" onkeypress="return isNumberKey(event)" HorizontalAlign="Right" Width="115px" Text='<%# Microsoft.Security.Application.Encoder.HtmlEncode(DataBinder.Eval(Container, "DataItem.WEM_Display_Priority").ToString)%>' />
                                        </EditItemTemplate>--%>
                                    </asp:TemplateField>

                                    <asp:TemplateField HeaderStyle-Wrap="True" HeaderText="Created By" Visible="true">
                                        <ItemStyle Width="115px" HorizontalAlign="Left" />
                                        <HeaderStyle Width="115px" />
                                        <ItemTemplate>
                                            <asp:Label ID="lblCreatedBy" runat="server" Text='<%# Microsoft.Security.Application.Encoder.HtmlEncode(DataBinder.Eval(Container, "DataItem.TSS_Created_By").ToString)%>' />
                                        </ItemTemplate>

                                    </asp:TemplateField>

                                    <asp:TemplateField HeaderStyle-Wrap="True" HeaderText="UDF Field Name" Visible="true">
                                        <ItemStyle Width="115px" HorizontalAlign="Left" />
                                        <HeaderStyle Width="115px" />
                                        <ItemTemplate>
                                            <asp:Label ID="lblUDFFieldName" runat="server" Text='<%# Microsoft.Security.Application.Encoder.HtmlEncode(If(DataBinder.Eval(Container, "DataItem.TSS_UDF_Fieldname") Is DBNull.Value, "", DataBinder.Eval(Container, "DataItem.TSS_UDF_Fieldname"))).ToString%>' />
                                        </ItemTemplate>
                                        <EditItemTemplate>
                                            <asp:DropDownList ID="ddlUDFFieldName" runat="server" Enabled ="false" HorizontalAlign="left" />
                                        </EditItemTemplate>
                                    </asp:TemplateField>

                                   <%-- Start || Added By Samruddhi Wani || On 26-May-2022 || As Asked By Rushikesh N || JIRA ID - BBVAORINT-590--%>
                                    <asp:TemplateField HeaderStyle-Wrap="True" HeaderText="Mutation Factor" Visible="true">
                                        <ItemStyle Width="115px" HorizontalAlign="Left" />
                                        <HeaderStyle Width="115px" />
                                        <ItemTemplate>
                                            <asp:Label ID="lblMutationFactor" runat="server" Text='<%# Microsoft.Security.Application.Encoder.HtmlEncode(If(DataBinder.Eval(Container, "DataItem.TSS_MutationFactor") Is DBNull.Value, "", DataBinder.Eval(Container, "DataItem.TSS_MutationFactor"))).ToString%>' />
                                        </ItemTemplate>
                                        <EditItemTemplate>
                                            <asp:DropDownList ID="ddlMutationFactor" runat="server" Enabled ="false" HorizontalAlign="left" />
                                        </EditItemTemplate>
                                    </asp:TemplateField>
                                    <%--End || Added By Samruddhi Wani || On 26-May-2022 || As Asked By Rushikesh N || JIRA ID - BBVAORINT-590--%>
                                    <asp:TemplateField HeaderStyle-Wrap="True" HeaderText="Updated At" Visible="true">
                                        <ItemStyle Wrap="false" HorizontalAlign="Right" />
                                        <HeaderStyle Width="115px" />
                                        <ItemTemplate>
                                            <asp:Label ID="lblUpdatedAt" runat="server" Text='<%# Microsoft.Security.Application.Encoder.HtmlEncode(DataBinder.Eval(Container, "DataItem.TSS_Updated_At").ToString)%>' />
                                        </ItemTemplate>
                                        <%--<EditItemTemplate>
                                            <asp:TextBox ID="txtCreatedAt" runat="server" onkeypress="return isNumberKey(event)" HorizontalAlign="Right" Width="115px" Text='<%# Microsoft.Security.Application.Encoder.HtmlEncode(DataBinder.Eval(Container, "DataItem.WEM_Display_Priority").ToString)%>' />
                                        </EditItemTemplate>--%>
                                    </asp:TemplateField>

                                    <asp:TemplateField HeaderStyle-Wrap="True" HeaderText="Updated By" Visible="true">
                                        <ItemStyle Width="115px" HorizontalAlign="Left" />
                                        <HeaderStyle Width="115px" />
                                        <ItemTemplate>
                                            <asp:Label ID="lblUpdatedBy" runat="server" Text='<%# Microsoft.Security.Application.Encoder.HtmlEncode(DataBinder.Eval(Container, "DataItem.TSS_Updated_By").ToString)%>' />
                                        </ItemTemplate>
                                    </asp:TemplateField>

                                    <asp:TemplateField HeaderStyle-Wrap="True" HeaderText="Frequency" Visible="false">
                                        <ItemStyle Width="115px" HorizontalAlign="Left" />
                                        <HeaderStyle Width="115px" />
                                        <ItemTemplate>
                                            <asp:Label ID="lblFrequency" runat="server" Text='<%# Microsoft.Security.Application.Encoder.HtmlEncode(DataBinder.Eval(Container, "DataItem.TSM_Frequency").ToString)%>' />
                                        </ItemTemplate>
                                    </asp:TemplateField>


                                </Columns>
                                <PagerStyle CssClass="GridPager"></PagerStyle>
                            </asp:GridView>
                        </div>
                    </td>
                </tr>
                    <tr>
                        <td>
                            <input id="hdnButtonClick" runat="server" type="hidden"></input>
                        </td>
                    </tr>
            </table>
            </div>
            
        </ContentTemplate>
    </asp:UpdatePanel>
</asp:Content>
