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

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <script src="../FinIQJS/FinIQCommon.js"></script>

    <asp:ScriptManagerProxy ID="ScriptManagerProxy1" runat="server"></asp:ScriptManagerProxy>

    <style type="text/css">
        .txt {
        }

        .buttons {
        }

        .ddl {
        }

        .auto-style30 {
            width: 136px;
        }

        .wordbreak {
            word-wrap: break-word !important;
        }

        .auto-style34 {
            width: 154px;
        }

        .auto-style36 {
            width: 152px;
        }

        .auto-style38 {
            width: 340px;
        }

        .auto-style39 {
            width: 115px;
        }

        .auto-style40 {
            width: 165px;
        }

        .auto-style43 {
            width: 95px;
        }

        .auto-style45 {
            width: 100px;
        }

        .auto-style46 {
            width: 96px;
        }

        .cellcolorchange {
            box-shadow: 1px 1px 8px 1px #8f8f8f;
        }

        .selectedCell {
            background-color: lightblue;
        }

        .unselectedCell {
            background-color: white;
        }

        /*  #GridWokflowAccess tr.rowHover:hover
         {
             background-color: Yellow;

         }*/
    </style>



    <script type="text/javascript" lang="javascript">
       

        $(document).ready(function () {


            $('#ctl00_MainContent_GridWokflowAccess td').hover(function () {
                $(this).addClass('cellcolorchange');
            }, function () { $(this).removeClass('cellcolorchange'); });




            $("#ctl00_MainContent_GridWokflowAccess td").click(function () {
                debugger
                if (this != undefined && this != null) {
                    var currentCellIndex = this.cellIndex;
                    var currentRowIndex = $(this).parent()[0].rowIndex;

                    var loginname = $(this).parents("#ctl00_MainContent_GridWokflowAccess")[0].rows[0].cells[currentCellIndex].innerText;
                    var Workflowname = $(this).parents("#ctl00_MainContent_GridWokflowAccess")[0].rows[currentRowIndex].cells[0].innerText;
                    var cellvalue = $(this).parents("#ctl00_MainContent_GridWokflowAccess")[0].rows[currentRowIndex].cells[currentCellIndex].innerText;
                    var Workflowcode = $(this).parents("#ctl00_MainContent_GridWokflowAccess")[0].rows[currentRowIndex].cells[1].innerText;
                    var ButtonQueuename = $(this).parents("#ctl00_MainContent_GridWokflowAccess")[0].rows[currentRowIndex].cells[2].innerText;



                    //alert('Row: ' + currentRowIndex + ', Column: ' + currentCellIndex);


                    document.getElementById('<%=hfcolumnname.ClientID %>').value = loginname;
                     document.getElementById('<%=hfcolumnvalue.ClientID %>').value = Workflowname;
                     document.getElementById('<%=hfvalue.ClientID %>').value = cellvalue;
                    document.getElementById('<%=hfworkflowcode.ClientID %>').value = Workflowcode;
                    document.getElementById('<%=hfbuttonqueue.ClientID %>').value = ButtonQueuename;



                     $("#ctl00_MainContent_btnLoad").click();



                 }

             });
         })

        var parameter = Sys.WebForms.PageRequestManager.getInstance();

        parameter.add_endRequest(function () {


            $('#ctl00_MainContent_GridWokflowAccess td').hover(function () {
                $(this).addClass('cellcolorchange');
            }, function () { $(this).removeClass('cellcolorchange'); });





            $("#ctl00_MainContent_GridWokflowAccess td").click(function () {
                if (this != undefined && this != null) {
                    var currentCellIndex = this.cellIndex;
                    var currentRowIndex = $(this).parent()[0].rowIndex;

                    var loginname = $(this).parents("#ctl00_MainContent_GridWokflowAccess")[0].rows[0].cells[currentCellIndex].innerText;
                    var Workflowname = $(this).parents("#ctl00_MainContent_GridWokflowAccess")[0].rows[currentRowIndex].cells[0].innerText;
                    var cellvalue = $(this).parents("#ctl00_MainContent_GridWokflowAccess")[0].rows[currentRowIndex].cells[currentCellIndex].innerText;
                    var Workflowcode = $(this).parents("#ctl00_MainContent_GridWokflowAccess")[0].rows[currentRowIndex].cells[1].innerText;
                    var ButtonQueuename = $(this).parents("#ctl00_MainContent_GridWokflowAccess")[0].rows[currentRowIndex].cells[2].innerText;



                    // alert('Row: ' + currentRowIndex + ', Column: ' + currentCellIndex);


                    document.getElementById('<%=hfcolumnname.ClientID %>').value = loginname;
                     document.getElementById('<%=hfcolumnvalue.ClientID %>').value = Workflowname;
                     document.getElementById('<%=hfvalue.ClientID %>').value = cellvalue;
                     document.getElementById('<%=hfworkflowcode.ClientID %>').value = Workflowcode;
                    document.getElementById('<%=hfbuttonqueue.ClientID %>').value = ButtonQueuename;


                     $("#ctl00_MainContent_btnLoad").click();



                 }

             });
         });



    </script>

    <asp:UpdatePanel ID="UpdatePanelCP" runat="server">
        <ContentTemplate>

            <table>
                <tr>
                    <td class="auto-style1">
                        <asp:UpdateProgress ID="UpdateProgress1" 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>
                    </td>

                </tr>
                <tr>
                    <td>
                        <asp:Label runat="server" ID="lblError" CssClass="lblError1"></asp:Label>
                    </td>
                    <td>
                        <asp:Button ID="btnLoad" runat="server" CssClass="btn" Text="Load"  Style="visibility: hidden" />
                    </td>
                </tr>
                <tr>
                    <td>
                        <asp:Label ID="lblmatrixname" runat="server"  Text="Matrix Name" CssClass="lbl" Width="90px"></asp:Label>
                    </td>

                    <td >
                        <asp:DropDownList ID="cmbaccessmatrix" runat="server" AppendDataBoundItems="true" AutoPostBack="True" CssClass="ddl" Visible="True" Width="220px" >
                        </asp:DropDownList>
                    </td>
                    <td>
                        <asp:Label ID="lnlgroup" runat="server"  Text="User Group" CssClass="lbl" Width="80px" Style="margin-left: 25px;"></asp:Label>
                    </td>
                    <td>
                         <asp:DropDownList ID="ddlusrgrp" runat="server" AppendDataBoundItems="true" AutoPostBack="True" CssClass="ddl" Visible="True" Width="220px">
                        </asp:DropDownList>

                    </td>


                    <td>
                        <asp:Label ID="lblbutton" runat="server"  Text="Button" CssClass="lbl" Width="50px" Style="margin-left: 25px;"></asp:Label>
                    </td>
                    <td>
                         <asp:DropDownList ID="ddlbutton" runat="server" AppendDataBoundItems="true" AutoPostBack="True" CssClass="ddl" Visible="True" Width="220px">
                        </asp:DropDownList>

                    </td>



                </tr>
                <tr style="padding-top: 0.3%;">
                    <td>
                        <asp:Label ID="lblworkflow" runat="server" Text="Workflow" CssClass="lbl" Width="90px"></asp:Label>
                    </td>
                    <td>
                         <asp:DropDownList ID="ddlworkflow" runat="server" AppendDataBoundItems="true" AutoPostBack="True" CssClass="ddl" Visible="True" Width="220px" >
                        </asp:DropDownList>

                    </td>

                    <td>
                        <asp:Label ID="lblqueue" runat="server" Width="80px" Text="Queue" CssClass="lbl" Style="margin-left: 25px;"></asp:Label>
                    </td>
                    <td>
                         <asp:DropDownList ID="ddlqueue" runat="server" AppendDataBoundItems="true" AutoPostBack="True" CssClass="ddl" Visible="True" Width="220px">
                        </asp:DropDownList>

                    </td>


                </tr>
            </table>

            <table>
                <tr>
                    <td>


                        <asp:GridView ID="GridWokflowAccess" runat="server" AllowPaging="True" AllowSorting="True" Visible="true"
                            AutoGenerateColumns="True" BorderStyle="None" BorderWidth="0px" CellPadding="3" PagerStyle-Height="32px"
                            CssClass="Grid" PageSize="30" ShowHeaderWhenEmpty="true">
                            <SelectedRowStyle CssClass="GridItemSelect" HorizontalAlign="Center" />
                            <RowStyle Wrap="false" CssClass="GridItem" HorizontalAlign="Center" />
                            <HeaderStyle CssClass="GridHeader" wrap="true"/>
                            <FooterStyle CssClass="GridFooter" />
                            <PagerStyle CssClass="GridPager" />

                            <PagerSettings Mode="NumericFirstLast"
                                FirstPageText="First"
                                LastPageText="Last"
                                Position="Bottom" />








                        </asp:GridView>
                    </td>

                    <td style="display: none">
                        <asp:HiddenField ID="hfcolumnname" runat="server" />
                        <asp:HiddenField ID="hfcolumnvalue" runat="server" />
                        <asp:HiddenField ID="hfrowindex" runat="server" />
                        <asp:HiddenField ID="hfcolumnindex" runat="server" />
                        <asp:HiddenField ID="hfvalue" runat="server" />
                        <asp:HiddenField ID="hfworkflowcode" runat="server" />
                         <asp:HiddenField ID="hfbuttonqueue" runat="server" />
                    </td>

                </tr>
            </table>


        </ContentTemplate>
    </asp:UpdatePanel>










</asp:Content>
