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

<asp:Content ID="Content3" ContentPlaceHolderID="MainContent" runat="server">
    <link type="text/css" rel="stylesheet" href="../App_Themes/Style1.css" />
    <script src="../FinIQJS/SortFilter_Grid.js" type="text/javascript"></script>
    <script src="../FinIQJS/FreezeGrid.js"></script>
    <link href="../FinIQJS/FreezeGrid.css" rel="stylesheet" type="text/css"/>


    <script type="text/javascript">

        Sys.WebForms.PageRequestManager.getInstance().add_pageLoaded(function (evt, args) {
            try {
                SetSorting_Filter1();

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

                    $('.lblError1:not(:empty)').empty();
                });
            } catch (e) {
                throw (e);
            }
        });

        function Search() {
            try {
                if ((event.which == 13) || (event.keyCode == 13) || (event.keyCode == 9) || (event.which == 9)) {
                    if ($('#ctl00_MainContent_txtRowsPerPage').val() == "" || $('#ctl00_MainContent_txtRowsPerPage').val() == "0")
                        $('#ctl00_MainContent_txtRowsPerPage').val('999')
                    document.getElementById('ctl00_MainContent_btnLoad').click();
                    return false;
                }
                else {
                    return true
                };
            } catch (e) {
                throw (e);
            }
        }

        function checkAll(objRef) {
            var GridView = objRef.parentNode.parentNode.parentNode;

            var inputList = GridView.getElementsByTagName("input");

            for (var i = 0; i < inputList.length; i++) {

                if (inputList[i].type == "checkbox" && objRef != inputList[i]) {

                    if (objRef.checked) {
                        inputList[i].checked = true;
                        $('#ctl00_MainContent_blnChkAll').val('true');
                        document.getElementById('ctl00_MainContent_btnChkUnchkAll').click();
                    }
                    else {
                        inputList[i].checked = false;
                        $('#ctl00_MainContent_blnChkAll').val('false');
                        document.getElementById('ctl00_MainContent_btnChkUnchkAll').click();
                    }
                }
            }
        }

    </script>
    <asp:UpdatePanel runat="server" ID="updPanel" UpdateMode="Conditional">
        <ContentTemplate>
            <asp:HiddenField ID="blnChkAll" runat="server" />
            <asp:Button runat="server" Style="display: none" ID="btnChkUnchkAll" />
            <table>
                <tr>
                    <td>
                        <asp:UpdateProgress ID="UpdateProgress1" runat="server" AssociatedUpdatePanelID="updPanel"
                            DisplayAfter="0">
                            <ProgressTemplate>
                                <div class="divLoading1">
                                    <img alt="Loading" src="../App_Resources/loading.gif" /><span class="lbl">Loading...&nbsp;&nbsp;
                                    </span>
                                </div>
                            </ProgressTemplate>
                        </asp:UpdateProgress>
                    </td>
                </tr>
                <tr>
                    <td>
                        <asp:Label runat="server" ID="lblError" CssClass="lblError lblError1"></asp:Label>
                    </td>
                </tr>
            </table>
            <table>
                <tr>
                    <td>
                        <asp:Button runat="server" ID="btnLoad" Text="Load" CssClass="btn width80" />
                    </td>
                    <td class="Width90">
                        <asp:Button runat="server" ID="btnExport" Text="Export" CssClass="btn width80" AutoPostBack="true" />
                    </td>
                    <td class="width90 paddingTopTen paddingLeftFive">
                        <asp:Label runat="server" Text="Rows per page"></asp:Label>
                    </td>
                    <td class="paddingTopTen">
                        <asp:TextBox runat="server" ID="txtRowsPerPage" OnKeyPress="AllowOnlyNumeric();" onkeydown="Search();" CssClass="Width35 alignRight" AutoPostBack="true"></asp:TextBox>
                    </td>
                </tr>
            </table>
           <table class="paddingTopTen">
                <tr>
                    <td>
                        <asp:GridView runat="server" ID="gvData" CssClass="Grid" AutoGenerateColumns="false" AllowPaging="true" AllowSorting="true" ShowHeaderWhenEmpty="true" EmptyDataText="No Records Found">
                            <HeaderStyle CssClass="GridHeader" />
                            <RowStyle CssClass="GridItem" />
                            <FooterStyle CssClass="GridFooter" />
                            <PagerStyle CssClass="GridPager" />
                            <SelectedRowStyle CssClass="GridItemSelect" />
                            <AlternatingRowStyle CssClass="GridItem" />
                            <Columns>

                                <asp:TemplateField ControlStyle-CssClass="widthTwenty" HeaderStyle-CssClass="widthTwenty" ItemStyle-CssClass="widthTwenty">
                                    <HeaderTemplate>
                                        <asp:CheckBox ID="chkAll" runat="server" Visible="false" OnClick="checkAll(this);" AutoPostBack="false" />
                                    </HeaderTemplate>
                                    <ItemTemplate>
                                        <asp:CheckBox ID="chkRecord" runat="server" AutoPostBack="false" />
                                    </ItemTemplate>
                                </asp:TemplateField>

                                <asp:TemplateField HeaderText="WTM_ID" ControlStyle-CssClass="widthFifty" HeaderStyle-CssClass="widthFifty" ItemStyle-CssClass="widthFifty" ItemStyle-HorizontalAlign="Center" Visible="false">
                                    <ItemTemplate>
                                        <asp:Label runat="server" ID="lblWTMID" Text='<%# Microsoft.Security.Application.Encoder.HtmlEncode(DataBinder.Eval(Container, "DataItem.WTM_ID").ToString)%>'></asp:Label>
                                    </ItemTemplate>
                                </asp:TemplateField>

                                <asp:TemplateField HeaderText="Code" ControlStyle-CssClass="widthFifty" HeaderStyle-CssClass="widthFifty" ItemStyle-CssClass="widthFifty" ItemStyle-HorizontalAlign="Left">
                                    <ItemTemplate>
                                        <asp:Label runat="server" ID="lblWTMCode" Text='<%# Microsoft.Security.Application.Encoder.HtmlEncode(DataBinder.Eval(Container, "DataItem.WTM_Code").ToString)%>'></asp:Label>
                                    </ItemTemplate>
                                </asp:TemplateField>

                                <asp:TemplateField HeaderText="Workflow Name" ControlStyle-CssClass="widthOneNinetyFive" HeaderStyle-CssClass="widthOneNinetyFive" ItemStyle-CssClass="widthOneNinetyFive" ItemStyle-HorizontalAlign="Left" ItemStyle-Wrap="true">
                                    <ItemTemplate>
                                        <asp:Label runat="server" ID="lblWorkflowTitle" Text='<%# Microsoft.Security.Application.Encoder.HtmlEncode(DataBinder.Eval(Container, "DataItem.WTM_Title").ToString)%>'></asp:Label>
                                    </ItemTemplate>
                                </asp:TemplateField>

                                <asp:TemplateField HeaderText="Created At" ControlStyle-CssClass="widthOneFifty" HeaderStyle-CssClass="widthOneFifty" ItemStyle-CssClass="widthOneFifty" ItemStyle-HorizontalAlign="Center">
                                    <ItemTemplate>
                                        <asp:Label runat="server" ID="lblWTMCreatedAt" Text='<%# Microsoft.Security.Application.Encoder.HtmlEncode(DataBinder.Eval(Container, "DataItem.WTM_Created_At").ToString)%>'></asp:Label>
                                    </ItemTemplate>
                                </asp:TemplateField>

                                <asp:TemplateField HeaderText="Created By" ControlStyle-CssClass="widthSixtySeven" HeaderStyle-CssClass="widthSixtySeven" ItemStyle-CssClass="widthSixtySeven" ItemStyle-HorizontalAlign="Left">
                                    <ItemTemplate>
                                        <asp:Label runat="server" ID="lblWTMCreatedBy" Text='<%# Microsoft.Security.Application.Encoder.HtmlEncode(DataBinder.Eval(Container, "DataItem.WTM_Created_By").ToString)%>'></asp:Label>
                                    </ItemTemplate>
                                </asp:TemplateField>
                              
                            </Columns>
                        </asp:GridView>
                    </td>
                </tr>
            </table>

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

</asp:Content>   
