<%@ Page Language="C#" EnableEventValidation="false" AutoEventWireup="false" MasterPageFile="~/SiteMaster.Master"
    MaintainScrollPositionOnPostback="true" Theme="Main_Theme" CodeBehind="AssessmentGridsPage.aspx.cs"
    Inherits="MKInsight.Online.RRAM2.AssessmentGrid.AssessmentGridsPage" %>

<%@ Register Src="../UIControls/Header.ascx" TagName="Header" TagPrefix="uc1" %>
<%@ Register Src="../UIControls/MessageBox.ascx" TagName="MessageBox" TagPrefix="uc2" %>
<%@ Register Assembly="UIWebControls" Namespace="UIWebControls" TagPrefix="cc4" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
<%@ Register Src="../UIControls/GridControls/GridMethodology.ascx" TagName="GridMethodology"
    TagPrefix="uc4" %>
<%@ Register Src="../UIControls/GridControls/GridDetails.ascx" TagName="GridDetails"
    TagPrefix="uc5" %>
<%@ Register Src="../UIControls/GridControls/ImpactLikelihoodLabels.ascx" TagName="ImpactLikelihoodLabels"
    TagPrefix="uc6" %>
<%@ Register Src="../UIControls/PopupPanel.ascx" TagName="PopupPanel" TagPrefix="uc5" %>
<%@ Register Src="../UIControls/GridControls/TotalImpactGridControl.ascx" TagName="TotalImpactGridControl"
    TagPrefix="uc7" %>
<%@ Register Src="../UIControls/FileAttachments/FileAttachmentsControl.ascx" TagName="FileAttachmentsControl"
    TagPrefix="uc3" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">

    <script type="text/javascript">
        function setdata(value) {
            PageMethods.SetData(value);
		}
    </script>

    <link rel="stylesheet" type="text/css" href="../scripts/grid/matrix.css" />
    <script type="text/ecmascript" src="../scripts/grid/matrix.js"></script>

    <script type="text/javascript" src="../scripts/jquery/jquery_min.js"></script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="c_M" runat="server">
    <uc1:Header ID="usc_Header" runat="server" />

    <uc2:MessageBox ID="usc_M" runat="server" />
    <div style="height: 3px;"></div>

    <asp:MultiView ID="Mv" runat="server">
        <asp:View ID="vM" runat="server">
            <table id="tb_RiskUniverse" runat="server" style="width: 100%">
                <tr>
                    <td class="left" colspan="2" style="border-top-width: 1px; border-top-color: black; height: 42px; background-color: whitesmoke; vertical-align: top;">

                        <asp:Panel ID="tbM" runat="server" CssClass="w-bar">
                            <asp:LinkButton runat="server" ID="tbl_New" CssClass="w-button" Style="background: url(../images/add32.png); ">
                                <asp:Label ID="tbl_NewLabel" runat="server"></asp:Label>
                            </asp:LinkButton>

                            <asp:LinkButton runat="server" ID="tbl_NewSubGrid" CssClass="w-button" Style="background: url(../images/add32.png); ">
                                <asp:Label ID="tbl_NewSubGridLabel" runat="server"></asp:Label>
                            </asp:LinkButton>

                        </asp:Panel>


                    </td>
                </tr>
                <tr>
                    <td class="left" style="width: 290px; vertical-align: top;">
                        <asp:Panel ID="pt" runat="server" BorderColor="Silver" BorderStyle="Solid" BorderWidth="1px"
                            Height="450px" ScrollBars="Both" Width="300px">
                            <cc4:MKGridView ID="dg_CS" runat="server" AllowPaging="True" AllowSorting="True"
                                AutoGenerateColumns="False" BorderStyle="None" CellPadding="3" DataKeyNames="ID"
                                OnRowDataBound="OnRowDataBound" Width="95%">
                                <AlternatingRowStyle CssClass="alternatingrowstyle" />
                                <FooterStyle BackColor="White" ForeColor="#000066" />
                                <HeaderStyle CssClass="headerstyle" Font-Bold="True" HorizontalAlign="Left" Wrap="False" />
                                <PagerStyle HorizontalAlign="Left" />
                                <Columns>
                                    <asp:CommandField HeaderText="Select" ShowSelectButton="True" />
                                    <asp:BoundField DataField="ID" HeaderText="ID" />
                                    <asp:BoundField DataField="Name" HeaderText="Name" SortExpression="Name" />
                                    <asp:CheckBoxField DataField="IsActive" HeaderText="Archived" SortExpression="IsActive" />
                                    <asp:CheckBoxField DataField="UseDefault" HeaderText="Default" SortExpression="UseDefault" />
                                    <asp:CheckBoxField DataField="Embedded" HeaderText="EmbeddedAssessmentGrid" SortExpression="Embedded" />
                                </Columns>
                                <PagerTemplate>
                                    <asp:Label ID="lbl_ShowRows" runat="server" Text="Show rows:" /><asp:DropDownList ID="ddlPageSize" runat="server" AutoPostBack="true" OnSelectedIndexChanged="OnSelectedIndexChanged">
                                        <asp:ListItem Value="5" />
                                        <asp:ListItem Value="10" />
                                        <asp:ListItem Value="15" />
                                        <asp:ListItem Value="20" />
                                    </asp:DropDownList>&nbsp;&nbsp;<asp:Label ID="lbl_page" runat="server" Text="Page" /><asp:TextBox ID="txtGoToPage" runat="server" AutoPostBack="true" CssClass="gotopage" OnTextChanged="GoToPageOnTextChanged" /><asp:Label ID="lbl_Of" runat="server" Text="of" /><asp:Label ID="lblTotalNumberOfPages" runat="server" />&nbsp;&nbsp;<asp:Button ID="btn_p" runat="server" CommandArgument="Prev" CommandName="Page" CssClass="previous" SkinID="_" ToolTip="Previous Page" /><asp:Button ID="btn_n" runat="server" CommandArgument="Next" CommandName="Page" CssClass="next" SkinID="_" ToolTip="Next Page" />
                                </PagerTemplate>
                                <SelectedRowStyle BackColor="#D6E8FF" />
                            </cc4:MKGridView>
                        </asp:Panel>
                    </td>
                    <td class="left" style="vertical-align: top;">
                        <asp:Panel ID="pv" runat="server" Visible="false">
                            <asp:Wizard ID="wu" runat="server" ActiveStepIndex="0" BackColor="White" BorderColor="#CCCCCC"
                                BorderStyle="Solid" BorderWidth="1px" DisplaySideBar="False" EnableTheming="True"
                                Width="100%">
                                <StepStyle BorderWidth="0px" />
                                <StartNavigationTemplate>

                                    <div class="wizardFooter">
                                        <asp:Button ID="UCancelButton" runat="server" OnClick="OnUpdateCancelWizard" Text="Cancel" />
                                        <asp:Button ID="UDeleteButton" runat="server" Text="Delete" OnClick="OnDeleteGrid" />
                                        <asp:Button ID="UStartNextButton" runat="server" Text="Next &gt;" CommandName="MoveNext" />
                                    </div>
                                </StartNavigationTemplate>
                                <NavigationStyle HorizontalAlign="Right" />
                                <WizardSteps>
                                    <asp:WizardStep ID="s_uD" runat="server" Title="Details">
                                        <uc5:GridDetails ID="usc_Update" runat="server" />
                                    </asp:WizardStep>
                                    <asp:WizardStep ID="s_uM" runat="server" Title="Methodology">
                                        <uc4:GridMethodology ID="usc_UpdateM" runat="server" />
                                    </asp:WizardStep>
                                    <asp:WizardStep ID="s_uL" runat="server" Title="Labels">
                                        <uc6:ImpactLikelihoodLabels ID="usc_updateL" runat="server" />
                                    </asp:WizardStep>
                                    <asp:WizardStep ID="s_IL" runat="server" Title="GridImpactLabels">
                                        <div style="height: 15px">
                                        </div>
                                        <asp:Label ID="lbl_ImpactHelper" runat="server" Font-Bold="true"></asp:Label>
                                        <asp:Panel ID="pnl_GIL" runat="server" ScrollBars="Both" Width="600px">
                                        </asp:Panel>
                                        <div style="height: 15px">
                                        </div>
                                        <asp:Label ID="lbl_LikelihoodHelper" runat="server" Font-Bold="true"></asp:Label>
                                        <asp:Panel ID="pnl_GLL" runat="server" ScrollBars="Both" Width="600px">
                                        </asp:Panel>
                                        <br />
                                        <div>
                                            <asp:Label ID="lbl_view" runat="server">
                                            </asp:Label>
                                            <asp:LinkButton ID="lnk_ViewImage" runat="server"></asp:LinkButton>
                                            <asp:LinkButton ID="lnk_DeleteImage" runat="server"></asp:LinkButton>
                                        </div>
                                        <br />
                                        <div>
                                            <asp:Label ID="lbl_ImpactLikelihoodImage" runat="server"></asp:Label>
                                        </div>
                                        <br />
                                        <div>
                                            <uc3:FileAttachmentsControl ID="usc_FA" runat="server" />
                                        </div>

                                        <asp:Panel ID="pnl_N" runat="server" Visible="false">
                                            <div>
                                                <asp:Label ID="lbl_NewImage" runat="server">
                                                </asp:Label>
                                                <asp:LinkButton ID="lnk_ViewNewImage" runat="server"></asp:LinkButton>

                                            </div>
                                        </asp:Panel>
                                    </asp:WizardStep>
                                    <asp:WizardStep ID="s_uG" runat="server" Title="Grid">
                                        <asp:Literal ID="lit_UStyles" runat="server" />
                                        <asp:Literal ID="lit_UScript" runat="server" />
                                        <asp:Panel ID="pnl_ULevels" runat="server">
                                        </asp:Panel>
                                        <div>
                                            <asp:Panel ID="pnl_Lock" runat="server">
                                                <div style="margin: 2px;">
                                                    <asp:Image ID="img_Locked" runat="server" ImageUrl="../images/lock32.png" />
                                                </div>
                                                <div>
                                                    <asp:Label ID="lbl_Locked" runat="server" Font-Bold="True" ForeColor="Blue"></asp:Label>
                                                </div>

                                            </asp:Panel>
                                        </div>
                                        <table style="width: 100%">
                                            <tr style="text-align: left">
                                                <td style="text-align: left">
                                                    <asp:Table ID="tb_uM" runat="server" CellPadding="0" CellSpacing="0" CssClass="matrix_rw">
                                                    </asp:Table>
                                                </td>
                                                <td style="text-align: left; vertical-align: top;">
                                                    <asp:Table ID="tb_uPallet" runat="server" CssClass="pallet">
                                                    </asp:Table>
                                                </td>
                                            </tr>
                                            <tr style="text-align: left">
                                                <td style="text-align: left;">
                                                    <div>
                                                        <asp:Button ID="btn_LoadCurrentGrid" runat="server" CausesValidation="False" OnClientClick="JavaScript:  InitTable(); disableLoadButton(); return false;"
                                                            Text="Load Grid" />
                                                        <asp:Button ID="btn_UpdatecheckGrid" runat="server" CausesValidation="False" OnClientClick="JavaScript: return PopulateForm();"
                                                            Text="Check Grid" />
                                                    </div>
                                                </td>
                                                <td style="text-align: left; vertical-align: top;">&nbsp;
                                                </td>
                                            </tr>
                                        </table>
                                        <div>
                                            <uc7:TotalImpactGridControl ID="u_UTGI" runat="server" />
                                        </div>
                                    </asp:WizardStep>
                                </WizardSteps>
                                <SideBarButtonStyle ForeColor="#000066" />
                                <NavigationButtonStyle BackColor="#FFFBFF" BorderColor="#CCCCCC" BorderStyle="Solid"
                                    BorderWidth="1px" ForeColor="#284775" />
                                <SideBarStyle BackColor="#F0F0F0" BorderWidth="1px" HorizontalAlign="Left" VerticalAlign="Middle"
                                    Width="100px" Wrap="True" />
                                <FinishNavigationTemplate>

                                    <div class="wizardFooter">
                                        <asp:Button ID="UFinishPreviousButton" runat="server" CausesValidation="False" CommandName="MovePrevious"
                                            Text="&lt; Previous" />
                                        <asp:Button ID="UFinishGrid" runat="server" CommandName="MoveComplete" Enabled="False"
                                            Text="Finish " />
                                    </div>
                                </FinishNavigationTemplate>
                                <HeaderStyle BackColor="#5D7B9D" BorderStyle="Solid" Font-Bold="True" ForeColor="White"
                                    HorizontalAlign="Left" />
                                <HeaderTemplate>
                                    <asp:Label ID="lbl_UTitle" runat="server" Font-Bold="True" Text="Title"></asp:Label>
                                </HeaderTemplate>
                                <StepNavigationTemplate>

                                    <div class="wizardFooter">
                                        <asp:Button ID="UStepPreviousButton" runat="server" CausesValidation="False" CommandName="MovePrevious"
                                            Text="&lt; Previous" />
                                        <asp:Button ID="UStepNextButton" runat="server" CommandName="MoveNext" Text="Next &gt;" />
                                    </div>
                                </StepNavigationTemplate>
                            </asp:Wizard>
                        </asp:Panel>
                    </td>
                </tr>
            </table>
        </asp:View>
        <asp:View ID="v_Add" runat="server">
            <div>
                <asp:Literal ID="lit_Styles" runat="server" />
                <asp:Literal ID="lit_Script" runat="server" />
                <asp:Panel ID="pnl_Levels" runat="server">
                </asp:Panel>
                <asp:Wizard ID="w" runat="server" ActiveStepIndex="0" BorderColor="#CCCCCC" BorderWidth="1px"
                    EnableTheming="True" Width="860px" BackColor="White" BorderStyle="Solid"
                    DisplaySideBar="False">
                    <StepStyle BorderWidth="0px" />
                    <StartNavigationTemplate>

                        <div class="wizardFooter">
                            <asp:Button ID="CancelButton" runat="server" Text="Cancel" OnClick="OnCancelWizard" />
                            <asp:Button ID="StartNextButton" runat="server" Text="Next &gt;" CommandName="MoveNext" />
                        </div>
                    </StartNavigationTemplate>
                    <NavigationStyle HorizontalAlign="Right" />
                    <WizardSteps>
                        <asp:WizardStep ID="s_D" runat="server" Title="Details">
                            <uc5:GridDetails ID="usc_Add" runat="server" />
                        </asp:WizardStep>
                        <asp:WizardStep runat="server" Title="Methodology" ID="s_M">
                            <uc4:GridMethodology ID="usc_AddM" runat="server" />
                        </asp:WizardStep>
                        <asp:WizardStep ID="s_L" runat="server" Title="Labels">
                            <uc6:ImpactLikelihoodLabels ID="usc_AddL" runat="server" />
                        </asp:WizardStep>
                        <asp:WizardStep ID="s_G" runat="server" Title="Grid">
                            <asp:Panel ID="pn_G" runat="server">
                                <table style="width: 100%">
                                    <tr style="text-align: left">
                                        <td style="text-align: left">
                                            <asp:Table ID="tb_M" runat="server" CellPadding="0" CellSpacing="0" CssClass="matrix_rw">
                                            </asp:Table>
                                        </td>
                                        <td style="text-align: left; vertical-align: top;">
                                            <asp:Table ID="tb_Pallet" runat="server" CssClass="pallet">
                                            </asp:Table>
                                        </td>
                                    </tr>
                                </table>
                                <div style="height: 30px;">
                                    <asp:Button ID="btn_CheckGrid" runat="server" OnClientClick="JavaScript: PopulateForm(); return false;"
                                        Text="Check Grid" CausesValidation="False" />
                                </div>
                            </asp:Panel>
                            <div>
                                <uc7:TotalImpactGridControl ID="u_TGI" runat="server" />
                            </div>
                        </asp:WizardStep>
                    </WizardSteps>
                    <SideBarButtonStyle ForeColor="#000066" />
                    <NavigationButtonStyle BackColor="#FFFBFF" BorderColor="#CCCCCC" BorderStyle="Solid"
                        BorderWidth="1px" ForeColor="#284775" />
                    <SideBarStyle VerticalAlign="Middle" Wrap="True" BackColor="#F0F0F0" BorderWidth="1px"
                        Width="100px" HorizontalAlign="Left" />
                    <FinishNavigationTemplate>

                        <div class="wizardFooter">
                            <asp:Button ID="FinishPreviousButton" runat="server" CausesValidation="False" CommandName="MovePrevious"
                                Text="&lt; Previous" />
                            <asp:Button ID="FinishGrid" runat="server" CommandName="MoveComplete" Text="Finish "
                                Enabled="False" />
                        </div>
                    </FinishNavigationTemplate>
                    <HeaderStyle BackColor="#5D7B9D" BorderStyle="Solid" Font-Bold="True" ForeColor="White"
                        HorizontalAlign="Left" />
                    <HeaderTemplate>
                        <asp:Label ID="lbl_Title" runat="server" Font-Bold="True" Text="Title"></asp:Label>
                    </HeaderTemplate>
                    <StepNavigationTemplate>

                        <div class="wizardFooter">
                            <asp:Button ID="StepPreviousButton" runat="server" CausesValidation="False" CommandName="MovePrevious"
                                Text="&lt; Previous" />
                            <asp:Button ID="StepNextButton" runat="server" CommandName="MoveNext" Text="Next &gt;" />
                        </div>
                    </StepNavigationTemplate>
                </asp:Wizard>
            </div>
        </asp:View>
    </asp:MultiView>
    <asp:Button ID="btn_pHandler" runat="server" Text="Button" Style="display: none;" />
    <asp:Panel ID="p" runat="server" CssClass="frame" Style="display: none;">
        <div class="overlay">
            <div style="float: right; margin-top: -28px; margin-right: -10px;">
                <asp:ImageButton ID="ImageButton1" ImageUrl="~/images/jq/close.png" runat="server" />
            </div>
            <div class="floatright">
                <asp:Button ID="btn_TopOK" runat="server" OnClick="OnOK" />
            </div>
            <uc5:PopupPanel ID="usc_PP" runat="server" />
            <div class="divpok">
                <asp:Button ID="btn_POK" runat="server" />
            </div>
        </div>
    </asp:Panel>
    <cc1:ModalPopupExtender ID="mdp" runat="server" TargetControlID="btn_pHandler" PopupControlID="P"
        BackgroundCssClass="modalBackground">
    </cc1:ModalPopupExtender>

</asp:Content>
