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

<%@ Register Src="../FinIQ_User_Controls/DateControl.ascx" TagName="DateControl" TagPrefix="uc1" %>

<asp:Content ID="Content" ContentPlaceHolderID="MainContent" runat="server">
    <asp:ScriptManagerProxy ID="ScriptManagerProxy" runat="server"></asp:ScriptManagerProxy>

    <style type="text/css">
        .marginUp {
            margin-top: 20px;
        }

        .cssEdit {
            line-height: 0px;
        }

        .invisible {
            display: none;
        }

        .Visible {
            display: block;
        }

        .btnClose {
            width: 30px;
        }


        .GridContainerTD {
            width: 379px;
            height: 255px;
            overflow-y: auto !important;
        }

        .tdBtn {
            width: 90px;
        }


        .tdlblRecordCnt {
            width: 100px;
        }

        .wrapcol {
            word-wrap: break-word;
        }

        .lblsuccess_TSM {
            color: #008000;
            font-size: 11px !important;
            padding: 5px 0px 5px 0px;
        }

        .lblerror_TSM {
            color: #FF4E4E !important;
            font: normal 11px Verdana !important;
            padding: 5px 0px 5px 0px;
            z-index: 99999;
            /*position: absolute;
      top: 110px;
    left: 32px;*/
        }

        /*Start Added on 08-Mar-2021 for UBP*/
        .btn_padding {
            padding-right: 10px !important;
            padding-top: 5px !important;
        }
        /*End Added on 08-Mar-2021 for UBP*/
    </style>
    <script>
        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 () {
                                $("#ctl00_MainContent_btnConfirmation").click();
                                $(this).dialog('close');
                            },
                            'No': function () {
                                $(this).dialog('close');
                                $('html').find("#dialog").remove();
                                return false;
                            }
                        }
                    });
            }

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

        }

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

            return true;
        }

        function isEnterKey(evt) {

            var charCode = (evt.which) ? evt.which : evt.keyCode;
            if ($("[id*='hdnButtonClick']")[0].value == "I" || $("[id*='hdnButtonClick']")[0].value == "U") {

                return false;
            }
            if (charCode == 13) {
                if (parseInt($("[id*='txtRowsPerPage']")[0].value) == 0) {
                    $($(".lblError")[0]).text("Please select valid rows per page value")
                }
                document.getElementById("<%=hdn_RowsPerPagebtn.ClientID%>").click();
            }
            return true;


            //Start Added on 08-Mar-2021 for UBP
            document.onkeyup = function (e) {
                if (e.ctrlKey && e.key == "r") {
                    document.getElementById('<%= btnLoad.ClientID %>').click();
            } else if (e.ctrlKey && e.shiftKey && e.key == "E") {
                    document.getElementById('<%= btnExport.ClientID %>').click();
                }
            }
            //End Added on 08-Mar-2021 for UBP
        }
    </script>
    <link href="../App_Themes/Style1.css" rel="stylesheet" type="text/css" />
    <asp:UpdatePanel ID="updpnl_new" runat="server" UpdateMode="Always" EnableViewState="true">

        <ContentTemplate>
            <table>
                <tr>
                    <td class="btn_padding" colspan="10">
                        <asp:Label ID="lblDisplay" Text=""  runat="server" style="color: red !important; display: grid !important" />
                        <asp:Label ID="lblSuccess" Text="" runat="server"  STYLE="display: grid !important"/>
                        <asp:Label ID="lblInfo" Text=""  runat="server" style="color:blue !important; display: grid !important"  />
                    </td>
                </tr>
                <tr>

                    <td class="btn_padding">
                        <asp:Label ID="lblSchemeName" runat="server" CssClass="lbl" Text="Scheme Name"></asp:Label>
                    </td>
                    <td class="btn_padding">
                        <asp:DropDownList ID="ddlSchemeName" runat="server" CssClass="ddl" AppendDataBoundItems="true" Width="200px" AutoPostBack="True">
                        </asp:DropDownList>
                    </td>

                    <td class="btn_padding">
                        <asp:Button ID="btnLoad" Text="Load" ToolTip="Load (ctrl + r)" runat="server" CssClass="btn" Width="100px" AutoPostBack="true" />
                    </td>

                    <td class="btn_padding">
                        <asp:Button ID="btnDelete" Text="Delete" runat="server" CssClass="btn" Width="100px" AutoPostBack="true" />
                    </td>
                    <td class="btn_padding">
                         <asp:Button ID="btnExport" style="margin-right: 50px !important;" CssClass="Export2Excel" Text="" ToolTip="Export Excel (ctrl + shift + e)"  runat="server"  />
                    </td>                 
                    <td class="btn_padding">
                        <asp:HiddenField ID="hdnDeleteRowIndex" runat="server" />
                        <asp:Button ID="btnConfirmation" runat="server" Width="0" Style="width: 0px; height: 0px; font-size: 0; border: none; display: none;" />

                    </td>
                    <td class="btn_padding">
                        <asp:HiddenField ID="hdnButtonClick" runat="server" />
                    </td>

                </tr>
                <tr>
                    <td style="height: 10PX"></td>
                </tr>

                <tr>
                    <td class="btn_padding">
                        <asp:Label ID="lblTemplateName" runat="server" CssClass="lbl" Text="Template Name"></asp:Label>
                    </td>
                    <td class="btn_padding">
                        <asp:DropDownList ID="ddlTemplateName" runat="server" CssClass="ddl" AppendDataBoundItems="true" Width="200px" AutoPostBack="True">
                        </asp:DropDownList>
                    </td>
                    <td class="btn_padding">
                        <asp:Button ID="btnAdd" Text="Add" runat="server" CssClass="btn" Width="100px" AutoPostBack="true" />
                    </td>

                    <td class="btn_padding">
                        <asp:Button ID="btnSave" Text="Save" runat="server" OnClick="btnSave_Click" CssClass="btn" Width="100px" AutoPostBack="true" />
                    </td>
                    <td class="btn_padding tdlblRecordCnt" style="padding-left: 20px !important">
                        <asp:Label runat="server" ID="lblRecordCnt" Text="Total Record(s) :" CssClass="lbl"></asp:Label>
                    </td>

                    <td class="btn_padding">
                        <asp:Label runat="server" ID="lblTotRecords" Text="" CssClass="lbl"> </asp:Label>
                    </td>
                    <td class="btn_padding">
                        <input type="hidden" id="Hidden1" runat="server" />
                        <asp:Button ID="hdn_RowsPerPagebtn" Text="" Style="display: none;" runat="server" />
                    </td>
                     <td class="btn_padding" style="padding-left: 20px">
                        <asp:Label ID="lblRowsPerPage" runat="server" Text="Record(s) per page: " Csscalss="lbl" Autopostback="true" />

                    </td>
                    <td class="btn_padding">
                        <asp:TextBox ID="txtRowsPerPage" AutoPostBack="true" runat="server" CssClass="txt" MaxLength="2" Width="40px" Style="text-align: center !important" onkeydown="return isEnterKey(event);" OnKeyPress="return AllowNumericOnly(this);" oncopy="return false" onpaste="return false" oncut="return false" />
                    </td>
                </tr>
            </table>
            <table>

                <tr>
                    <td colspan="8">
                        <div class="marginUp">
                            <asp:GridView ID="grdTSM" runat="server" AutoGenerateColumns="false" AutoPostBack="true"
                                CssClass="Grid" ShowHeaderWhenEmpty="true" AllowSorting="True" BorderStyle="None"
                                BorderWidth="0px" PageSize="20" AllowPaging="True">
                                <HeaderStyle CssClass="GridHeader" HorizontalAlign="Center" />

                                <PagerSettings Mode="NumericFirstLast"
                                    FirstPageText="First"
                                    LastPageText="Last"
                                    Position="Bottom" />
                                <PagerStyle CssClass="GridPager" />
                                <FooterStyle CssClass="GridFooter" />
                                <EditRowStyle CssClass="GridItemSelect" />
                                <RowStyle CssClass="GridItem" />

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

                                <Columns>

                                    <asp:TemplateField ControlStyle-Width="20px" Visible="true">
                                        <HeaderStyle Width="20px" />
                                        <ItemTemplate>
                                            <asp:CheckBox ID="chkSelect" AutoPostBack="true" runat="server"></asp:CheckBox>
                                        </ItemTemplate>
                                    </asp:TemplateField>

                                    <%--<asp:CommandField HeaderText ="Actions" ButtonType="Link" ShowEditButton="true" EditText="Edit" HeaderStyle-Width="20px" HeaderStyle-HorizontalAlign="Center" 
                                        ItemStyle-Width="20px" ItemStyle-HorizontalAlign ="center" UpdateText="Update"/>--%>

                                    <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>

                                    <asp:TemplateField HeaderText="TSM ID" ControlStyle-Width="60px" Visible="false">
                                        <HeaderStyle Wrap="true" Width="70px" />
                                        <ItemStyle HorizontalAlign="Left" VerticalAlign="Middle" Wrap="true" Width="70px" CssClass="wrapcol" />
                                        <ItemTemplate>
                                            <asp:Label ID="lblTSMId" runat="server" CssClass="lbl" Text='<%# Microsoft.Security.Application.Encoder.HtmlEncode(DataBinder.Eval(Container, "DataItem.TSM_Id").ToString)%>'>
                                            </asp:Label>
                                        </ItemTemplate>
                                        <EditItemTemplate>
                                            <asp:TextBox ID="txtTSMId" runat="server" Enabled="false" AutoPostBack="true" CssClass="txt" Text='<%# Microsoft.Security.Application.Encoder.HtmlEncode(DataBinder.Eval(Container, "DataItem.TSM_Id").ToString)%>'></asp:TextBox>
                                        </EditItemTemplate>
                                    </asp:TemplateField>

                                    <asp:TemplateField HeaderText="Template Name" ControlStyle-Width="180px" Visible="True">
                                        <HeaderStyle Wrap="true" Width="180px" />
                                        <ItemStyle HorizontalAlign="Left" VerticalAlign="Middle" Wrap="true" Width="180px" CssClass="wrapcol" />
                                        <ItemTemplate>
                                            <asp:Label ID="lblTemplateName" runat="server" CssClass="lbl" Text='<%# Microsoft.Security.Application.Encoder.HtmlEncode(DataBinder.Eval(Container, "DataItem.TSM_Template_Name").ToString)%>'>
                                            </asp:Label>
                                        </ItemTemplate>
                                        <EditItemTemplate>
                                            <asp:TextBox ID="txtTemplateName" Width="180px" runat="server" Enabled="false" AutoPostBack="true" CssClass="txt" Text='<%# Microsoft.Security.Application.Encoder.HtmlEncode(DataBinder.Eval(Container, "DataItem.TSM_Template_Name").ToString)%>'></asp:TextBox>
                                        </EditItemTemplate>
                                    </asp:TemplateField>

                                    <asp:TemplateField HeaderText="Schedule Code" ControlStyle-Width="170px">
                                        <HeaderStyle Wrap="true" Width="170px" />
                                        <ItemStyle HorizontalAlign="Left" VerticalAlign="Middle" Wrap="true" Width="170px" CssClass="wrapcol" />
                                        <ItemTemplate>
                                            <asp:Label ID="lblScheduleCode" runat="server" CssClass="lbl" Wrap="true" Text='<%# Microsoft.Security.Application.Encoder.HtmlEncode(DataBinder.Eval(Container, "DataItem.TSM_ScheduleCode").ToString)%>'>
                                            </asp:Label>
                                        </ItemTemplate>

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

                                    <asp:TemplateField HeaderText="Frequency" ControlStyle-Width="120px">
                                        <HeaderStyle Wrap="true" Width="120px" />
                                        <ItemStyle HorizontalAlign="Left" VerticalAlign="Middle" Wrap="true" Width="120px" CssClass="wrapcol" />
                                        <ItemTemplate>
                                            <asp:Label ID="lblFrequency" runat="server" Text='<%# Microsoft.Security.Application.Encoder.HtmlEncode(DataBinder.Eval(Container, "DataItem.TSM_Frequency").ToString)%>'>
                                            </asp:Label>
                                        </ItemTemplate>

                                        <EditItemTemplate>
                                            <asp:DropDownList ID="ddlFrequencyCode" runat="server" CssClass="ddl" OnSelectedIndexChanged="frequencyIndexChanged" Width="120px" AutoPostBack="True">
                                                <asp:ListItem Value="AtMaturity">AtMaturity</asp:ListItem>
                                                <asp:ListItem Value="Schedule">Schedule</asp:ListItem>
                                                <asp:ListItem Value="Trade">Trade</asp:ListItem>
                                            </asp:DropDownList>
                                        </EditItemTemplate>
                                    </asp:TemplateField>

                                    <asp:TemplateField HeaderText="Frequency Source" ControlStyle-Width="180px">
                                        <HeaderStyle Wrap="true" Width="180px" />
                                        <ItemStyle HorizontalAlign="Left" VerticalAlign="Middle" Wrap="true" Width="180px" CssClass="wrapcol" />
                                        <ItemTemplate>
                                            <asp:Label ID="lblFrequencyScource" runat="server" Text='<%# Microsoft.Security.Application.Encoder.HtmlEncode(DataBinder.Eval(Container, "DataItem.TSM_Frequency_Source").ToString)%>'>
                                            </asp:Label>
                                        </ItemTemplate>

                                        <EditItemTemplate>
                                            <asp:DropDownList ID="ddlFrequencySource" runat="server" AutoPostBack="true" Width="180px" ></asp:DropDownList>
                                        </EditItemTemplate>
                                    </asp:TemplateField>


                                    <asp:TemplateField HeaderText="Entity ID" ControlStyle-Width="70px" Visible="false">
                                        <HeaderStyle Wrap="true" Width="70px" />
                                        <ItemStyle HorizontalAlign="Left" VerticalAlign="Middle" Wrap="true" Width="70px" CssClass="wrapcol" />
                                        <ItemTemplate>
                                            <asp:Label ID="lblEntityId" runat="server" Text='<%# Microsoft.Security.Application.Encoder.HtmlEncode(DataBinder.Eval(Container, "DataItem.TSM_Entity_Id").ToString)%>'>
                                            </asp:Label>
                                        </ItemTemplate>

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



                                    <asp:TemplateField HeaderText="Fixing Date Mapping" ControlStyle-Width="215px">
                                        <HeaderStyle Wrap="true" Width="120px" />
                                        <ItemStyle HorizontalAlign="Left" VerticalAlign="Middle" Wrap="true" Width="215px" CssClass="wrapcol" />
                                        <ItemTemplate>
                                            <asp:Label ID="lblFixingDateMapping" runat="server" Text='<%# Microsoft.Security.Application.Encoder.HtmlEncode(DataBinder.Eval(Container, "DataItem.TSM_FixingDate_Mapping").ToString)%>'>
                                            </asp:Label>
                                        </ItemTemplate>

                                        <EditItemTemplate>
                                            <asp:DropDownList ID="ddlFixingDateMapping" Width="215px" runat="server" AutoPostBack="true"></asp:DropDownList>
                                        </EditItemTemplate>
                                    </asp:TemplateField>

                                    <asp:TemplateField HeaderText="Settlement Date Mapping" ControlStyle-Width="215px">
                                        <HeaderStyle Wrap="true" Width="120px" />
                                        <ItemStyle HorizontalAlign="Left" VerticalAlign="Middle" Width="215px" Wrap="true" CssClass="wrapcol" />
                                        <ItemTemplate>
                                            <asp:Label ID="lblSettlementDateMapping" runat="server" Text='<%# Microsoft.Security.Application.Encoder.HtmlEncode(DataBinder.Eval(Container, "DataItem.TSM_SettlementDate_Mapping").ToString)%>'>
                                            </asp:Label>
                                        </ItemTemplate>

                                        <EditItemTemplate>
                                            <asp:DropDownList ID="ddlSettlementDateMapping" Width="215px" runat="server" AutoPostBack="true"></asp:DropDownList>
                                        </EditItemTemplate>
                                    </asp:TemplateField>



                                    <asp:TemplateField HeaderText="User Facing Event" ControlStyle-Width="50px">
                                        <HeaderStyle Wrap="true" Width="50px" />
                                        <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" CssClass="wrapcol" Width="50px" />
                                        <ItemTemplate>
                                            <asp:Label ID="lblUserFacingEvent" runat="server" Text='<%# Microsoft.Security.Application.Encoder.HtmlEncode(DataBinder.Eval(Container, "DataItem.TSM_User_Facing_event").ToString)%>'>
                                            </asp:Label>
                                        </ItemTemplate>

                                        <EditItemTemplate>
                                            <asp:DropDownList ID="ddlUserFacingEvent" Width="50px" runat="server">
                                                <asp:ListItem Value="Y">Y</asp:ListItem>
                                                <asp:ListItem Value="N">N</asp:ListItem>

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

                                    <asp:TemplateField HeaderText="Transaction Code" ControlStyle-Width="110px" Visible="false">
                                        <HeaderStyle Wrap="true" Width="110px" />
                                        <ItemStyle HorizontalAlign="Left" VerticalAlign="Middle" Wrap="true" Width="110px" CssClass="wrapcol" />
                                        <ItemTemplate>
                                            <asp:Label ID="lblTransactionCode" runat="server" Text='<%# Microsoft.Security.Application.Encoder.HtmlEncode(DataBinder.Eval(Container, "DataItem.TSM_Transaction_Code").ToString)%>'>
                                            </asp:Label>
                                        </ItemTemplate>

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

                                    <asp:TemplateField HeaderText="Settlement Currency" Visible="false">
                                        <HeaderStyle Wrap="false" />
                                        <ItemStyle HorizontalAlign="Left" VerticalAlign="Middle" Wrap="false" CssClass="wrapcol" />
                                        <ItemTemplate>
                                            <asp:Label ID="lblSettlementCurrency" runat="server" Text='<%# Microsoft.Security.Application.Encoder.HtmlEncode(DataBinder.Eval(Container, "DataItem.TSM_SettlementCurrency").ToString)%>'>
                                            </asp:Label>
                                        </ItemTemplate>

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

                                    <asp:TemplateField HeaderText="Intermediate Currency" Visible="false">
                                        <HeaderStyle Wrap="false" />
                                        <ItemStyle HorizontalAlign="Left" VerticalAlign="Middle" Wrap="true" CssClass="wrapcol" />
                                        <ItemTemplate>
                                            <asp:Label ID="lblIntermediateCurrency" runat="server" Text='<%# Microsoft.Security.Application.Encoder.HtmlEncode(DataBinder.Eval(Container, "DataItem.TSM_IntermediateCurrency").ToString)%>'>
                                            </asp:Label>
                                        </ItemTemplate>

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

                                    <asp:TemplateField HeaderText="Reset Lag" ControlStyle-Width="70px" Visible="false">
                                        <HeaderStyle Wrap="true" Width="70px" />
                                        <ItemStyle HorizontalAlign="Left" VerticalAlign="Middle" Wrap="true" Width="70px" CssClass="wrapcol" />
                                        <ItemTemplate>
                                            <asp:Label ID="lblResetLag" runat="server" Text='<%# Microsoft.Security.Application.Encoder.HtmlEncode(DataBinder.Eval(Container, "DataItem.TSM_ResetLag").ToString)%>'>
                                            </asp:Label>
                                        </ItemTemplate>

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

                                    <asp:TemplateField HeaderText="Schedule Config" ControlStyle-Width="110px" Visible="false">
                                        <HeaderStyle Wrap="true" Width="110px" />
                                        <ItemStyle HorizontalAlign="Left" VerticalAlign="Middle" Wrap="true" Width="110px" CssClass="wrapcol" />
                                        <ItemTemplate>
                                            <asp:Label ID="lblScheduleConfig" runat="server" Text='<%# Microsoft.Security.Application.Encoder.HtmlEncode(DataBinder.Eval(Container, "DataItem.TSM_ScheduleConfig").ToString)%>'>
                                            </asp:Label>
                                        </ItemTemplate>

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

                                    <asp:TemplateField HeaderText="Day Basis" ControlStyle-Width="80px" Visible="false">
                                        <HeaderStyle Wrap="true" Width="80px" />
                                        <ItemStyle HorizontalAlign="Left" VerticalAlign="Middle" Wrap="true" Width="80px" CssClass="wrapcol" />
                                        <ItemTemplate>
                                            <asp:Label ID="lblDayBasis" runat="server" Text='<%# Microsoft.Security.Application.Encoder.HtmlEncode(DataBinder.Eval(Container, "DataItem.TSM_DayBasis").ToString)%>'>
                                            </asp:Label>
                                        </ItemTemplate>

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

                                    <asp:TemplateField HeaderText="Created At" ControlStyle-Width="150px" Visible="false">
                                        <HeaderStyle Wrap="true" Width="150px" />
                                        <ItemStyle HorizontalAlign="Left" VerticalAlign="Middle" Wrap="true" Width="150px" CssClass="wrapcol" />
                                        <ItemTemplate>
                                            <asp:Label ID="lblCreatedAt" runat="server" Text='<%# Microsoft.Security.Application.Encoder.HtmlEncode(DataBinder.Eval(Container, "DataItem.TSM_Created_At").ToString)%>'>   
                                            </asp:Label>
                                        </ItemTemplate>
                                    </asp:TemplateField>

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

                                    </asp:TemplateField>
                                    <asp:TemplateField HeaderText="Updated At" ControlStyle-Width="170px" Visible="true">
                                        <HeaderStyle Wrap="true" Width="170px" />
                                        <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" Wrap="true" Width="170px" CssClass="wrapcol" />
                                        <ItemTemplate>
                                            <asp:Label ID="lblUpdatedAt" runat="server" Text='<%# Microsoft.Security.Application.Encoder.HtmlEncode(DataBinder.Eval(Container, "DataItem.TSM_Updated_At").ToString)%>'>
                                            </asp:Label>
                                        </ItemTemplate>
                                    </asp:TemplateField>

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

                                    <asp:TemplateField HeaderText="Misc1" ControlStyle-Width="70px" Visible="false">
                                        <HeaderStyle Wrap="true" Width="70px" />
                                        <ItemStyle HorizontalAlign="Left" VerticalAlign="Middle" Wrap="true" Width="70px" CssClass="wrapcol" />
                                        <ItemTemplate>
                                            <asp:Label ID="lblMisc1" runat="server" Text='<%# Microsoft.Security.Application.Encoder.HtmlEncode(DataBinder.Eval(Container, "DataItem.TSM_Misc1").ToString)%>'>
                                            </asp:Label>
                                        </ItemTemplate>

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

                                    <asp:TemplateField HeaderText="Misc2" ControlStyle-Width="70px" Visible="false">
                                        <HeaderStyle Wrap="true" Width="70px" />
                                        <ItemStyle HorizontalAlign="Left" VerticalAlign="Middle" Wrap="true" Width="70px" CssClass="wrapcol" />
                                        <ItemTemplate>
                                            <asp:Label ID="lblMisc2" runat="server" Text='<%# Microsoft.Security.Application.Encoder.HtmlEncode(DataBinder.Eval(Container, "DataItem.TSM_Misc2").ToString)%>'>
                                            </asp:Label>
                                        </ItemTemplate>

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

                                    <asp:TemplateField HeaderText="Misc3" ControlStyle-Width="70px" Visible="false">
                                        <HeaderStyle Wrap="true" Width="70px" />
                                        <ItemStyle HorizontalAlign="Left" VerticalAlign="Middle" Wrap="true" Width="70px" CssClass="wrapcol" />
                                        <ItemTemplate>
                                            <asp:Label ID="lblMisc3" runat="server" Text='<%# Microsoft.Security.Application.Encoder.HtmlEncode(DataBinder.Eval(Container, "DataItem.TSM_Misc3").ToString)%>'>
                                            </asp:Label>
                                        </ItemTemplate>

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

                                    <asp:TemplateField HeaderText="Active (Y/N)" ControlStyle-Width="50px">
                                        <HeaderStyle Wrap="true" Width="50px" />
                                        <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" CssClass="wrapcol" />
                                        <ItemTemplate>
                                            <asp:Label ID="lblActive" runat="server" Text='<%# Microsoft.Security.Application.Encoder.HtmlEncode(DataBinder.Eval(Container, "DataItem.TSM_Active_YN").ToString)%>'>
                                            </asp:Label>
                                        </ItemTemplate>

                                        <EditItemTemplate>
                                            <asp:DropDownList ID="ddlActive" runat="server" Width="50px">
                                                <asp:ListItem Value="Y">Y</asp:ListItem>
                                                <asp:ListItem Value="N">N</asp:ListItem>

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

                                </Columns>
                            </asp:GridView>
                        </div>
                    </td>
                </tr>
                <%--</div>--%>
            </table>

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

</asp:Content>
