<%@ Page Title="" Language="C#" MasterPageFile="~/SiteMasterBase.Master" AutoEventWireup="true"
    CodeBehind="WPInterface.aspx.cs" MaintainScrollPositionOnPostback="true" Inherits="MKInsight.Online.APPS.WorkProgrammes.WPInterface" %>

<%@ Register Src="../UIControls/MessageBox.ascx" TagName="MessageBox" TagPrefix="uc1" %>
<%@ Register Src="../UIControls/WPInfoBar.ascx" TagName="WPInfoBar" TagPrefix="uc2" %>
<%@ Register Src="../UIControls/WP/WPPropertiesControl.ascx" TagName="WPPropertiesControl"
    TagPrefix="uc4" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
<%@ Register Src="../UIControls/WP/PBPDetails.ascx" TagName="PBPDetails" TagPrefix="uc5" %>
<%@ Register Src="../UIControls/ProgressControl.ascx" TagName="ProgressControl" TagPrefix="uc6" %>

<%@ Register Src="../UIControls/PopupMessageBox.ascx" TagName="PopupMessageBox" TagPrefix="uc3" %>

<asp:Content ID="Content1" ContentPlaceHolderID="cph_Head" runat="server">


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

    <script type="text/javascript" src="../scripts/jquery/jquery_min.js"></script>
    <script type="text/javascript" src="../scripts/jquery/jquery.box-min.js"></script>
    <link rel="stylesheet" type="text/css" href="../scripts/jquery/jqbox.css" />

    <style type="text/css">
        .RiskTable {
            width: 99.4%;
            border: 1px solid #ACA899;
            margin-left: 4px;
        }
    </style>

    <script type="text/javascript">


        function ChangeAttachmentCount() {

            PageMethods.ReturnTestIDAndCount(OnChangeAttachmentCountComplete, OnChangeAttachmentCountError);
        }

        function OnChangeAttachmentCountError(error, userContext, methodName) {

        }

        function OnChangeAttachmentCountComplete(result, userContext, methodName) {

            var split = result.split('|');
            var countValue = split[1];
            if (countValue == "") countValue = "0";

            if (split[0] != "") {
                document.getElementById(split[0]).innerHTML = "(" + countValue + ")";
            }

        }

    </script>

</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="cph_Body" runat="server">



    <asp:Panel ID="c_Toolbar" runat="server" CssClass="toolbar">

        <asp:LinkButton runat="server" ID="tbl_Save" Style="background: url(../images/save32.png); background-position-y: 2px; background-repeat: no-repeat;" OnClick="OnSave_ToolbarClick">
            <asp:Label ID="tbl_SaveLabel" runat="server"></asp:Label>
        </asp:LinkButton>

        <asp:LinkButton runat="server" ID="tbl_SaveClose" Style="background: url(../images/saveclose32.png); background-position-y: 2px; background-repeat: no-repeat;" OnClick="OnSaveClose_ToolbarClick">
            <asp:Label ID="tbl_SaveCloseLabel" runat="server"></asp:Label>
        </asp:LinkButton>

        <img alt="" src="~/images/sp.png" runat="server" id="img1" />

        <asp:LinkButton runat="server" ID="tbl_Submit" Style="background: url(../images/submit32.png); background-position-y: 2px; background-repeat: no-repeat;" OnClick="OnSubmit_ToolbarClick">
            <asp:Label ID="tbl_SubmitLabel" runat="server"></asp:Label>
        </asp:LinkButton>

        <img alt="" src="~/images/sp.png" runat="server" id="img2" />
        <asp:LinkButton runat="server" ID="tbl_Properties" Style="background: url(../images/property32.png); background-position-y: 2px; background-repeat: no-repeat;" OnClick="Onlbl_Properties_ToolbarClick">
            <asp:Label ID="lbl_Properties" runat="server"></asp:Label>
        </asp:LinkButton>


    </asp:Panel>

    <div style="height: 25px;">
    </div>

    <asp:UpdatePanel ID="pPB" runat="server">
        <ContentTemplate>
            <div class="divright">
                <uc6:ProgressControl ID="usc_PB" runat="server" Visible="false" />
            </div>

        </ContentTemplate>
    </asp:UpdatePanel>

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


            <div style="padding-top:25px;">            
                <uc1:MessageBox ID="usc_M" runat="server" />
            </div>
        </ContentTemplate>
    </asp:UpdatePanel>

    <div style="height: 2px;">
    </div>
    <asp:MultiView ID="mv" runat="server">

        <asp:View ID="v_close" runat="server">
            <asp:Label ID="lbl_Close" runat="server"></asp:Label>
        </asp:View>

        <asp:View ID="v_WP" runat="server">
            <div>
                <div style="height: 25px;">
                </div>
                <uc2:WPInfoBar ID="WP_Info" runat="server" />
                <div style="height: 2px;">
                </div>
            </div>
            <uc3:PopupMessageBox ID="u_Popup" runat="server" />
            <div runat="server" id="tb_Risks">
                <table id="tbWPobj" class="Item">
                    <tr>
                        <td class="wheader2" colspan="3">
                            <asp:Label ID="lbl_WPObj" runat="server"></asp:Label>
                        </td>
                    </tr>
                    <tr>
                        <td rowspan="2" style="vertical-align: top; width: 80%;">
                            <asp:TextBox ID="txt_WPObj" runat="server" Height="50px" TextMode="MultiLine" Width="90%"></asp:TextBox>
                        </td>
                        <td>
                            <asp:Label ID="lbl_TotalScore" Font-Bold="true" Font-Size="Medium" runat="server"></asp:Label>
                        </td>
                        <td>
                            <asp:UpdatePanel ID="wp_pnlS" runat="server">
                                <ContentTemplate>
                                    <asp:Label ID="lbl_ScoreValue" runat="server" Font-Size="Medium" Font-Bold="true"></asp:Label>
                                </ContentTemplate>
                            </asp:UpdatePanel>
                        </td>
                    </tr>
                    <tr>
                        <td>&nbsp;
                        </td>
                        <td>&nbsp;
                        </td>
                    </tr>
                </table>
                <div style="height: 2px;">
                </div>
            </div>
            <asp:UpdatePanel ID="up_pur" runat="server">
                <ContentTemplate>
                    <asp:Panel ID="tb_PU" runat="server">
                        <table id="PU" class="RiskTable">
                            <tr>
                                <td class="wheader2" colspan="2">
                                    <asp:Label ID="lbl_PU" runat="server"></asp:Label>
                                </td>
                            </tr>
                            <tr>
                                <td style="text-align: left">
                                    <asp:Label ID="lbl_PUValue" runat="server"></asp:Label>

                                </td>
                                <td style="text-align: right">
                                    <div style="float: right;">
                                        <asp:ImageButton ID="btn_PUNext" runat="server" ImageUrl="../images/next32.png"
                                            OnClick="OnNextProcess" />
                                    </div>

                                    <div style="float: right;">
                                        <asp:ImageButton ID="btn_PUPer" runat="server" ImageUrl="../images/back32.png"
                                            OnClick="OnPreviousProcess" />



                                    </div>

                                </td>
                            </tr>
                        </table>
                        <div style="height: 2px;">
                        </div>
                    </asp:Panel>
                </ContentTemplate>
            </asp:UpdatePanel>
            <div style="height: 2px;">
            </div>
            <asp:UpdatePanel ID="up_rs" runat="server">
                <ContentTemplate>
                    <div>
                        <asp:Panel ID="pTF" runat="server">
                        </asp:Panel>
                        <table id="risks" class="RiskTable">
                            <tr>
                                <td class="wheader2" colspan="4">
                                    <asp:Label ID="lbl_Risks" runat="server"></asp:Label>
                                </td>
                            </tr>
                            <tr>
                                <td class="wheader3" colspan="4">
                                    <asp:Panel runat="server" ID="tb_Objectives">
                                        <table id="riskActions">
                                            <tr>
                                                <td>
                                                    <asp:ImageButton ID="btn_RNew" runat="server" ImageUrl="../images/AuditWork/add16.png" />
                                                </td>
                                                <td>
                                                    <asp:ImageButton ID="btn_REdit" runat="server" ImageUrl="../images/AuditWork/detail16.png" />
                                                </td>
                                                <td>
                                                    <asp:ImageButton ID="btn_RDelete" runat="server" ImageUrl="../images/AuditWork/delete16.png" />
                                                </td>
                                            </tr>
                                        </table>
                                    </asp:Panel>
                                </td>
                            </tr>
                            <tr>
                                <td rowspan="2" style="width: 5%; vertical-align: top;">
                                    <div>
                                        <asp:ImageButton ID="btn_RDone" runat="server" OnClick="OnRiskDone" />
                                    </div>
                                    <div style="height: 15px;">
                                    </div>
                                    <div>
                                        <asp:ImageButton ID="btn_D" runat="server" ImageUrl="~/images/detail16.png" OnClick="OnRiskDetails" />
                                    </div>
                                    <div style="height: 15px;">
                                    </div>
                                    <div>
                                        <asp:ImageButton ID="btn_RiskRev" runat="server" OnClick="OnRiskReviewDetails" />
                                    </div>
                                    <div>
                                        <asp:ImageButton ID="btn_RRec" runat="server" OnClick="OnRiskRecommendation" Visible="False" />
                                    </div>
                                </td>
                                <td rowspan="2" style="width: 80%; text-align: left">
                                    <asp:Label ID="lbl_RiskName" runat="server"></asp:Label>
                                </td>
                                <td style="text-align: right">
                                    <asp:Image ID="img_RN" runat="server" ImageUrl="~/images/AuditWork/AddedWPItem.png" />
                                </td>
                                <td rowspan="2">
                                    <div style="float: right;">
                                        <asp:ImageButton ID="btn_RNext" runat="server" ImageUrl="../images/next32.png"
                                            OnClick="OnNextRisk" />
                                    </div>
                                    <div style="float: right;">
                                        <asp:ImageButton ID="btn_RPer" runat="server" ImageUrl="../images/back32.png"
                                            OnClick="OnPreviousRisk" />
                                    </div>
                                </td>
                            </tr>
                            <tr>
                                <td>&nbsp;
                                </td>
                            </tr>
                        </table>
                    </div>
                </ContentTemplate>
            </asp:UpdatePanel>
            <div>
                <table id="CF">
                    <tr>
                        <td style="vertical-align: top;">

                            <script type="text/javascript">
                                var xPos, yPos;
                                var prm = Sys.WebForms.PageRequestManager.getInstance();
                                prm.add_beginRequest(BeginRequestHandler);
                                prm.add_endRequest(EndRequestHandler);

                                function BeginRequestHandler(sender, args) {
                                    xPos = $get('ctl00_cph_Body_pnl_C').scrollLeft;
                                    yPos = $get('ctl00_cph_Body_pnl_C').scrollTop;
                                }
                                function EndRequestHandler(sender, args) {
                                    $get('ctl00_cph_Body_pnl_C').scrollLeft = xPos;
                                    $get('ctl00_cph_Body_pnl_C').scrollTop = yPos;
                                }

                            </script>

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

                                    <table class="Item">
                                        <tr>
                                            <td class="wheader2">
                                                <asp:Label ID="lbl_Controls" runat="server"></asp:Label>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td class="wheader3">
                                                <asp:Panel runat="server" ID="tb_CompTests">
                                                    <table id="controlsActions">
                                                        <tr>
                                                            <td>
                                                                <asp:ImageButton ID="btn_CNew" runat="server" ImageUrl="../images/AuditWork/add16.png" />
                                                            </td>
                                                            <td>
                                                                <asp:ImageButton ID="btn_CEdit" runat="server" ImageUrl="../images/AuditWork/delete16.png" />
                                                            </td>
                                                            <td>
                                                                <asp:ImageButton ID="btn_CDelete" runat="server" ImageUrl="../images/AuditWork/delete16.png" />
                                                            </td>
                                                        </tr>
                                                    </table>
                                                </asp:Panel>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td>
                                                <asp:Panel ID="pnl_C" runat="server" Width="270px"
                                                    ScrollBars="Vertical">
                                                </asp:Panel>
                                            </td>
                                        </tr>
                                    </table>

                                </ContentTemplate>
                            </asp:UpdatePanel>
                        </td>
                        <td style="width: 100%; vertical-align: top;">
                            <asp:UpdatePanel ID="up_T" runat="server">
                                <ContentTemplate>
                                    <table class="Item">
                                        <tr>
                                            <td class="wheader2">
                                                <asp:Label ID="lbl_Tests" runat="server"></asp:Label>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td class="wheader3">
                                                <asp:Panel runat="server" ID="tb_Findings">
                                                    <table id="testActions">
                                                        <tr>
                                                            <td>
                                                                <asp:ImageButton ID="btn_TNew" runat="server" ImageUrl="../images/AuditWork/add16.png" />
                                                            </td>
                                                            <td>
                                                                <asp:ImageButton ID="btn_TEdit" runat="server" ImageUrl="../images/AuditWork/detail16.png" />
                                                            </td>
                                                            <td>
                                                                <asp:ImageButton ID="btn_TDelete" runat="server" ImageUrl="../images/AuditWork/delete16.png" />
                                                            </td>
                                                        </tr>
                                                    </table>
                                                </asp:Panel>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td>
                                                <asp:Panel ID="pnl_T" runat="server" Width="100%"
                                                    ScrollBars="Vertical">
                                                </asp:Panel>
                                            </td>
                                        </tr>
                                    </table>
                                </ContentTemplate>
                            </asp:UpdatePanel>
                        </td>
                    </tr>
                </table>
            </div>
        </asp:View>
        <asp:View ID="wpPv" runat="server">
            <uc4:WPPropertiesControl ID="usc_WPP" runat="server" />
            <div class="footer">
                <asp:Button ID="btn_WPPOK" runat="server" Text="ok" Width="70px" OnClick="OnWPPropertiesOK" />
                <asp:Button ID="btn_WPPCancel" runat="server" Text="cancel" Width="70px" OnClick="OnWPPropertiesCancel" />
            </div>
        </asp:View>
        <asp:View ID="wp_finished" runat="server">
            <h3>
                <asp:Label ID="lbl_finished" runat="server" ForeColor="Blue"></asp:Label></h3>
        </asp:View>
    </asp:MultiView>
    <asp:Button ID="btn_PBPHandler" runat="server" Text="Button" Style="display: none;" />
    <asp:Panel ID="PnlPBP" runat="server" Style="display: none; width: 80%">
        <div class="overlay">
            <asp:Panel ID="pnlPBPHeader" runat="server" CssClass="header">
                <asp:Label ID="lbl_PBP" runat="server" CssClass="msg" Text="Comments" />
            </asp:Panel>
            <asp:Panel ID="pnlPBPB" runat="server" CssClass="body">
                <div>
                    <uc5:PBPDetails ID="usc_PBP" runat="server" />
                </div>
            </asp:Panel>
            <div class="footer">
                <asp:Button ID="btn_PBPOk" runat="server" Text="ok" Width="70px" OnClick="OnPBPOK" />
                <asp:Button ID="btn_PBPCancel" runat="server" Text="cancel" Width="70px" OnClick="OnPBPCancel" />
            </div>
        </div>
        <div class="underlay">
        </div>
    </asp:Panel>
    <cc1:ModalPopupExtender ID="PBP" runat="server" TargetControlID="btn_PBPHandler"
        PopupControlID="PnlPBP" BackgroundCssClass="modalBackground">
    </cc1:ModalPopupExtender>
    <cc1:DragPanelExtender ID="PBPdpE" runat="server" DragHandleID="pnlPBPHeader" TargetControlID="PnlPBP" />
</asp:Content>
