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

<%@ Register Src="../UIControls/MessageBox.ascx" TagName="MessageBox" TagPrefix="uc1" %>
<%@ Register Src="../UIControls/Metabase/MetabaseViewer.ascx" TagName="MetabaseViewer" TagPrefix="uc2" %>
<%@ Register Assembly="UIWebControls" Namespace="UIWebControls" TagPrefix="cc4" %>

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

<%@ Register Src="../UIControls/UserComments/UserCommentsControl.ascx" TagName="UserCommentsControl" TagPrefix="uc4" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>

<asp:Content ID="Content1" ContentPlaceHolderID="cph_Head" runat="server">
    <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" />
    <script type="text/javascript" src="../scripts/ASTJavascript/astreeview/astreeview_packed.js"></script>
    <link rel="stylesheet" type="text/css" href="../scripts/ASTJavascript/astreeview/astreeview.css" />
    <link rel="stylesheet" type="text/css" href="../scripts/ASTJavascript/asdropdowntreeview/dropdowntreeview.css" />

    <style>
         div.toolbar 
       {         
           margin-left:1px;         
       }
    </style>  
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="cph_Body" runat="server">
    <asp:UpdatePanel ID="upn" runat="server">
        <ContentTemplate>
            <asp:Panel ID="pnl_TB" runat="server" CssClass="Toolbar">
                <div style="display: none">
                    <iframe src="../SetDTPage.aspx" id="i_sdt" runat="server"></iframe>
                    <asp:Button ID="btn_Refresh" runat="server" OnClick="btn_Refresh_Click" />
                </div>

                <table style="width: 100%;">
                    <tr>
                      
                        <td class="smalllogo">
                            <asp:Image ID="img_SmallLogo" runat="server" AlternateText="" ImageUrl="~/images/logo_small.png" />
                        </td>
                    </tr>
                </table>
            </asp:Panel>

            <div style="height: 2px;"></div>
            <uc1:MessageBox ID="u_m" runat="server" />

            <table style="width: 100%">
                <tr>
                    <td style="vertical-align: top;width:30%">
                        <div>
                            <asp:Label ID="lbl_G" runat="server"></asp:Label>
                            <asp:DropDownList ID="drp_G" runat="server" AutoPostBack="True" OnSelectedIndexChanged="OnGroupChanged">
                            </asp:DropDownList>
                            
                                <asp:CheckBox ID="mki_Archived" runat="server" AutoPostBack="True" OnCheckedChanged="OnShowArchived" />
                            
                            <br />
                            <br />
                        </div>

                        <asp:Panel ID="pn_Details" runat="server">

                            <asp:ListView ID="lv" runat="server" OnItemCommand="OnRowCommandSelect" OnItemDataBound="OnItemBound" OnLayoutCreated="OnListViewCreated" OnSelectedIndexChanging="OnSelectedIndexChanging">
                                <LayoutTemplate>
                                    <div id="grid" class="win2k3-grid" style="width: 100%">
                                        <table cellspacing="0" class="datatable" cellpadding="5" rules="all">
                                            <tr class="header">
                                                <th>
                                                    <asp:Label ID="lbl_Select" runat="server" Text="Select"></asp:Label>
                                                </th>
                                                <th>
                                                    <asp:Label ID="lbl_Name" runat="server" Text="Key_Name" Width="130" Font-Bold="true"></asp:Label>
                                                </th>
                                                <th>
                                                    <asp:Label ID="lbl_Status" runat="server" Text="Key_Status" Font-Bold="true"></asp:Label>
                                                </th>
                                                <th>
                                                    <asp:Label ID="lbl_InvDate" runat="server" Width="90" Text="Key_InvitationDate" Font-Bold="true"></asp:Label>
                                                </th>
                                                <th>
                                                    <asp:Label ID="lbl_ReplyDate" Width="120" runat="server" Text="Key_PlannedReplyDate" Font-Bold="true"></asp:Label>
                                                </th>
                                            </tr>
                                            <asp:PlaceHolder runat="server" ID="itemPlaceholder"></asp:PlaceHolder>
                                        </table>
                                    </div>
                                </LayoutTemplate>
                                <ItemTemplate>
                                    <%#AddGroupingRowIfNeeded()%>

                                    <tr>
                                        <td>
                                            <asp:LinkButton ID="l_s" runat="server" CommandArgument='<%#DataBinder.Eval(Container.DataItem,"ID")%>' CommandName="Select" Text="Select"></asp:LinkButton>
                                        </td>

                                        <td>
                                            <%#Eval("Name")%>
                                        </td>
                                        <td>
                                            <%#Eval("Status")%>
                                        </td>
                                        <td>
                                            <%#Eval("InvitationDate")%>
                                        </td>
                                        <td>
                                            <%#Eval("PlannedReplyDate")%>
                                        </td>
                                    </tr>

                                </ItemTemplate>
                                <SelectedItemTemplate>
                                    <%#AddGroupingRowIfNeeded()%>
                                    <tr style="background-color: #DDECFF;">

                                        <td>
                                            <asp:LinkButton ID="l_s" runat="server" CommandArgument='<%#DataBinder.Eval(Container.DataItem,"ID")%>' CommandName="Select" Text="Select"></asp:LinkButton>
                                        </td>

                                        <td>
                                            <%#Eval("Name")%>
                                        </td>
                                        <td>
                                            <%#Eval("Status")%>
                                        </td>
                                        <td>
                                            <%#Eval("InvitationDate")%>
                                        </td>
                                        <td>
                                            <%#Eval("PlannedReplyDate")%>
                                        </td>
                                    </tr>
                                </SelectedItemTemplate>
                            </asp:ListView>

                            <table>
                                <tr>
                                    <td></td>
                                </tr>
                                <tr>
                                    <td style="padding-left: 0px;">
                                        <asp:Label ID="lbl_NoResults" runat="server" Visible="false" Font-Italic="true" ForeColor="Gray"></asp:Label>
                                    </td>
                                </tr>

                            </table>

                        </asp:Panel>
                    </td>
                    <td style="vertical-align: top;">
                        <asp:Panel ID="c_bar" runat="server" CssClass="toolbar" Style="margin-top: -28px; margin-left: 0px;" Visible="false">

                            <asp:LinkButton runat="server" ID="tbl_Detail" Style="background: url(../images/design32.png); background-position-y: 2px; background-repeat: no-repeat;" OnClick="OnDetail_ToolbarClick">
                                <asp:Label ID="tbl_DetailLable" runat="server"></asp:Label>
                            </asp:LinkButton>

                            <asp:LinkButton runat="server" ID="tbl_Comment" Style="background: url(../images/note32.png); background-position-y: 2px; background-repeat: no-repeat;" OnClick="OnComment_ToolbarClick">
                                <asp:Label ID="tbl_CommentLabel" runat="server"></asp:Label>
                            </asp:LinkButton>

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

                            <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_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>
                            
                        </asp:Panel>

                        <asp:MultiView ID="mv" runat="server">
                            <asp:View ID="v_main" runat="server">
                                <div style="height:10px;"></div>
                                <asp:Panel ID="pn_Meta" runat="server" >
                                    <uc2:MetabaseViewer ID="u_mb" runat="server" />
                                </asp:Panel>
                            </asp:View>

                            <asp:View ID="v_comment" runat="server">
                                <div style="margin-top: 13px; margin-left: 0px;">
                                    <uc4:UserCommentsControl ID="u_Comments" runat="server" Visible="false" />
                                </div>
                                
                            </asp:View>
                        </asp:MultiView>
                    </td>
                </tr>
            </table>


            <uc3:PopupMessageBox ID="u_pm" runat="server" />

            <asp:Button ID="btn_partial_refresh" runat="server" Style="display: none;" />
        </ContentTemplate>
    </asp:UpdatePanel>

    <script>

        try {
            $(document).ready(function () {

                var xPos1, yPos1, timer1;

                var prm = Sys.WebForms.PageRequestManager.getInstance();
                prm.add_beginRequest(BeginRequestHandler);
                prm.add_endRequest(EndRequestHandler);

                function BeginRequestHandler(sender, args) {

                    try {
                        yPos1 = $(window).scrollTop();
                    } catch (err) { }
                }

                function EndRequestHandler(sender, args) {
                    try {
                        $(window).scrollTop(yPos1);
                        timer1 = window.setTimeout(function () { $(window).scrollTop(yPos1); }, 100);

                        $(window).scrollTop(yPos1);
                    }
                    catch (err) { }
                }

            });
        }
        catch (err) { }

    </script>
</asp:Content>
