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

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

<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="Server">
    <asp:ScriptManagerProxy ID="ScriptManagerProxy11" runat="server">
    </asp:ScriptManagerProxy>
    <script src="../FinIQJS/SortFilter_Grid.js"></script>
 <script src="../FinIQJS/FreezeGrid.js"></script>
    <link href="../FinIQJS/FreezeGrid.css" rel="stylesheet" type="text/css"/>
    <style type="text/css">
        .btn {
            width: 70px;
        }

        .ddl {
            width: 100px;
        }

        .constantWidth {
            width: 2px;
        }


       .lblerror, .lblError, .LBLERROR {
    
            color:red 
        }

        .lblInfo {
    color: green !important;
        }
    </style>
    <asp:UpdatePanel ID="UpdatePanel2" runat="server">
        <ContentTemplate>

            <table style="padding-bottom: 10px; margin: 5px; width: auto;">
                <tr>
                    <td colspan="4">
                        <asp:Label ID="lblSuccess" CssClass="lblSuccess" runat="server" Text=""></asp:Label>
								<asp:Label ID="lblInfo" CssClass="lblInfo" runat="server" Text=""></asp:Label>
                                    <asp:Label ID="lblError" CssClass="lbl lblerror" runat="server" Text=""></asp:Label>
                    </td>
                </tr>
                
                <tr>
                    <td>
                        <asp:Label ID="Label2" runat="server" Text="Workflow Type"></asp:Label>&nbsp;
                    </td>
                    <td>
                        <asp:DropDownList ID="cboWFType" runat="server" CssClass="ddl ddlCommon" Width=" 240px" AutoPostBack="true" AppendDataBoundItems="true" TabIndex="1">
                        </asp:DropDownList>
                    </td>
                    <td class="constantWidth">
                    <td>
                        <asp:Button ID="BtnLoad" runat="server" CssClass="btn btnCommon" Text="Load" />
                    </td>
					
					<td>
                        <asp:Button ID="BtnAdd" runat="server" Text="Add" CssClass="btn " /></td>
                   <%-- <td class="constantWidth"></td>--%>
                    <td>
                        <asp:Button ID="BtnSave" runat="server" CssClass="btn " Text="Save" />
                    </td>
                   <%-- <td class="constantWidth"></td>--%>

                    <td>
                        <asp:Button ID="BtnDelete" runat="server" CssClass="btn " OnClientClick="return confirm('Do you want to perform this Action ?');" Text="Delete" />
                    </td>
                    <%--<td class="constantWidth"></td>--%>

                    <td>
                        <asp:Button ID="BtnCancel" runat="server" CssClass="btn " Text="Cancel" />
                    </td>
                    <td>
					<%--Added by Nikhil M for Rows per page 999 on 11 Dec 2019--%>
                    <td>
                         <%--UBPINT-6 changed by Prateek M--%>
                         <asp:Label ID="lblRowsPerPage" runat="server" Text="Row(s) per page :" Style="margin-left:10px;"/>
                         <asp:TextBox ID="txtRowsPerPage" runat="server" Text="999" Width="40px" Style="text-align:center;" AutoPostBack="true" MaxLength="3" onkeydown="EnterKeyEvent(event)" onkeypress="return isNumberKey(event)"  />
                    </td>   
					
                    <td>&nbsp;</td>

                </tr>
            </table>
            
        </ContentTemplate>
    </asp:UpdatePanel>

    <table>
        <tr>
            <td>
                <asp:UpdatePanel ID="UpdatePanel1" runat="server">
                    <ContentTemplate>
                        <asp:GridView ID="dgvQueueBkAction" runat="server" AllowSorting="True" AutoGenerateColumns="False" 
                            BorderStyle="Solid" BorderWidth="1px" CellPadding="3" CssClass="Grid Gridview" AllowPaging="true" PageSize="999" ShowHeaderWhenEmpty="true"  HeaderStyle-CssClass="GridHeaderTitle">
                            <SelectedRowStyle CssClass="GridItemSelect" />
                            <RowStyle CssClass="GridItem" />
                            <HeaderStyle CssClass="GridHeader" />
                            <FooterStyle CssClass="GridFooter" />
                            <EmptyDataTemplate>
                                <asp:Label ID="lblqueuedatagrid" runat="server" Text="No data found."></asp:Label>
                            </EmptyDataTemplate>

                            <Columns>

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

                                 <asp:CommandField ButtonType="Link" ShowEditButton="true" EditText="Edit" UpdateText="Update" ControlStyle-Width="40">
                                    <HeaderStyle Width="40" />
                                    <ItemStyle Wrap="false" Width="40" HorizontalAlign="center" VerticalAlign="middle" />
                                </asp:CommandField>


                                <asp:TemplateField HeaderStyle-Wrap="false" HeaderText="Serial No" Visible="true" >
                                     <ItemStyle Width="80px" />
                                    <HeaderStyle Width="80px" />
                                    <ItemTemplate>
                                        <asp:Label ID="lblSer" runat="server" Text='<%#Container.DataItemIndex + 1%>' />
                                    </ItemTemplate>
                                    <EditItemTemplate>
                                        <asp:Label ID="lblSer1" runat="server" Text='<%#Container.DataItemIndex + 1%>' />
                                    </EditItemTemplate>
                                </asp:TemplateField>

                                <asp:TemplateField HeaderStyle-Wrap="false" HeaderText="Id" Visible="true">
                                    <ItemStyle Width="80px" HorizontalAlign="Right"/>
                                    <HeaderStyle Width="80px" />
                                    <ItemTemplate >
                                        <asp:Label ID="lblID" runat="server" Text='<%# Microsoft.Security.Application.Encoder.HtmlEncode(DataBinder.Eval(Container, "DataItem.QBA_ID").ToString)%>' />
                                    </ItemTemplate>
                                    <EditItemTemplate>
                                        <asp:Label ID="lblID1" runat="server" Text='<%# Microsoft.Security.Application.Encoder.HtmlEncode(DataBinder.Eval(Container, "DataItem.QBA_ID").ToString)%>' />
                                    </EditItemTemplate>
                                </asp:TemplateField>

                                <asp:TemplateField HeaderText="Queue" ControlStyle-Width="200">
                                    <HeaderStyle Width="100" />
                                    <ItemStyle Wrap="true" Width="100" HorizontalAlign="left" />
                                    <ItemTemplate>
                                        <asp:Label ID="lblQueue" runat="server" Text='<%# Microsoft.Security.Application.Encoder.HtmlEncode(DataBinder.Eval(Container, "DataItem.QBA_Queue_Name").ToString)%>'>
                                        </asp:Label>
                                    </ItemTemplate>
                                    <EditItemTemplate>
                                        <asp:DropDownList ID="ddlQueue" runat="server" AutoPostBack="False" CssClass="ddl">
                                        </asp:DropDownList>
                                    </EditItemTemplate>
                                </asp:TemplateField>

                                <asp:TemplateField HeaderText="Button" ControlStyle-Width="200">
                                    <HeaderStyle Width="100" />
                                    <ItemStyle Wrap="true" Width="100" HorizontalAlign="left" />
                                    <ItemTemplate>
                                        <asp:Label ID="lblButton" runat="server" Text='<%# Microsoft.Security.Application.Encoder.HtmlEncode(DataBinder.Eval(Container, "DataItem.QBA_Button_Name").ToString)%>'>
                                        </asp:Label>
                                    </ItemTemplate>
                                    <EditItemTemplate>
                                        <asp:DropDownList ID="ddlButton" runat="server" AutoPostBack="False" CssClass="ddl">
                                        </asp:DropDownList>
                                    </EditItemTemplate>
                                </asp:TemplateField>

                                <asp:TemplateField HeaderStyle-Wrap="false" HeaderText="Priority" Visible="true" >
                                     <ItemStyle Width="80px" HorizontalAlign="Right"/>
                                    <HeaderStyle Width="80px" />
                                    <ItemTemplate>
                                        <asp:Label ID="lblPriority" runat="server"  Text='<%# Microsoft.Security.Application.Encoder.HtmlEncode(DataBinder.Eval(Container, "DataItem.QBA_Execution_Priority").ToString)%>' />
                                    </ItemTemplate>
                                    <EditItemTemplate>
                                        <asp:TextBox ID="txtPriority" runat="server" Text='<%# Microsoft.Security.Application.Encoder.HtmlEncode(DataBinder.Eval(Container, "DataItem.QBA_Execution_Priority").ToString)%>' />
                                    </EditItemTemplate>
                                </asp:TemplateField>

                                <asp:TemplateField HeaderStyle-Wrap="false" HeaderText="Constraint" Visible="true">
                                     <ItemStyle Width="200px" />
                                    <HeaderStyle Width="200px" />
                                    <ItemTemplate>
                                        <asp:Label ID="lblConstraint" runat="server" Text='<%# Microsoft.Security.Application.Encoder.HtmlEncode(DataBinder.Eval(Container, "DataItem.QBA_Execution_constraint").ToString)%>' />
                                    </ItemTemplate>
                                    <EditItemTemplate>
                                        <asp:TextBox ID="txtConstraint" runat="server" Text='<%# Microsoft.Security.Application.Encoder.HtmlEncode(DataBinder.Eval(Container, "DataItem.QBA_Execution_constraint").ToString)%>' />
                                    </EditItemTemplate>
                                </asp:TemplateField>
                            </Columns>

                        </asp:GridView>

                    </ContentTemplate>
                </asp:UpdatePanel>

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

    <script type="text/javascript">

        //Start| 26-JUN-2020 | Added by Rajeshree K for grid filters        
        $(document).ready(function () {
            SetSorting_Filter1();
        });
        //End| 26-JUN-2020 | Added by Rajeshree K for grid filters

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

        function EnterKeyEvent(evt) {
            var code = (evt.which) ? evt.which : evt.keyCode;

            if (code == 13) {
                __doPostBack('<%=txtRowsPerPage.ClientID%>', 'TextChanged');

            }
        }
        </script>
</asp:Content>
