<%@ Page Title="" Language="C#" MasterPageFile="~/SiteMaster.Master" AutoEventWireup="true" CodeBehind="ProcessUniversePage.aspx.cs" Inherits="MKInsight.Online.RRAM2.ConfigurationPages.ProcessUniversePage" %>

<%@ Register Src="../UIControls/Header.ascx" TagName="Header" TagPrefix="uc4" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
<%@ Register Src="../UIControls/PopupPanel.ascx" TagName="PopupPanel" TagPrefix="uc15" %>
<%@ Register Src="../UIControls/MessageBox.ascx" TagName="MessageBox" TagPrefix="uc5" %>
<%@ Register Assembly="MKinsight.Online.UIServices" Namespace="Geekees.Common.Controls" TagPrefix="ct" %>
<%@ Register Src="../UIControls/Interface/TextBoxEx.ascx" TagName="TextBoxEx" TagPrefix="uc1" %>
<%@ Register Src="../UIControls/Interface/MultilineTextBoxEx.ascx" TagName="MultilineTextBoxEx" TagPrefix="uc2" %>
<%@ Register Src="../UIControls/Metabase/MetabaseViewer.ascx" TagName="MetabaseViewer" TagPrefix="uc3" %>
<%@ Register Src="~/UIControls/PopupsHandler.ascx" TagPrefix="uc1" TagName="PopupsHandler" %>

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

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

    <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" />

    <script type="text/javascript">

        function nodeSelectHandler(elem) {
            document.getElementById('<%:txtSelectedNode.ClientID%>').value = elem.parentNode.getAttribute("treeNodeValue");
            document.getElementById('<%:btnSelectionPBTrigger.ClientID%>').click();
        }

        function dndCompleteHandler(elem, newParent) {

            try {

                PageMethods.MoveProcess(elem.getAttribute("treeNodeValue"), newParent.getAttribute("treeNodeValue"), OnSucceeded, OnFailed);
                return true;

            }
            catch (err) {
                return false;
            }
        }

        function OnSucceeded(result, userContext, methodName) { }
        function OnFailed(error, userContext, methodName) { }

    </script>

    <style type="text/css">
        .IE8Fix {
            z-index: 100;
        }

        .handle {
            background: Black;
            width: 20px;
            height: 20px;
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="c_M" runat="server">
    <asp:UpdatePanel ID="up_E" runat="server" UpdateMode="Conditional">
        <ContentTemplate>
            <uc4:Header ID="usc_Header" runat="server" />

            <uc6:PopupMessageBox ID="u_p" runat="server" />

            <uc5:MessageBox ID="usc_M" runat="server" />

            <uc1:PopupsHandler ID="ph_DefaultType" runat="server" />

            <asp:Panel ID="tbP" runat="server" CssClass="w-bar">

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

                </asp:LinkButton>
                
            </asp:Panel>


            <div style="display: none;">
                <asp:Button ID="btnSelectionPBTrigger" runat="server" OnClick="OnSelectNode" />
                <asp:TextBox ID="txtSelectedNode" runat="server"></asp:TextBox>
                <asp:TextBox ID="txtMessage" runat="server"></asp:TextBox>
            </div>
            <table style="width: 100%">
                <tr style="vertical-align: top;">
                    <td style="width: 410px;">
                        <div style="vertical-align: top;">
                            <asp:Panel ID="pt" runat="server" ScrollBars="Both" CssClass="c3boxleft">
                                <ct:ASTreeView ID="astvMyTree" runat="server" BasePath="~/scripts/ASTJavascript/astreeview/"
                                    DataTableRootNodeValue="0"
                                    EnableRoot="false"
                                    EnableNodeSelection="true"
                                    EnableCheckbox="false"
                                    EnableDragDrop="false"
                                    EnableTreeLines="false"
                                    EnableNodeIcon="true"
                                    EnableCustomizedNodeIcon="false"
                                    EnableContextMenu="false"
                                    EnableDebugMode="false"
                                    EnableAjaxOnEditDelete="true"
                                    AddNodeProvider="~/ConfigurationPages/ProcessUniversePage.aspx"
                                    LoadNodesProvider="~/ConfigurationPages/ProcessUniversePage.aspx"
                                    AdditionalLoadNodesRequestParameters="{'t1':'ajaxLoad'}"
                                    OnNodeSelectedScript="nodeSelectHandler(elem);"
                                    EnableParentNodeExpand="true"
                                    EnableHorizontalLock="true"
                                    EnableContainerDragDrop="true"
                                    OnNodeDragAndDropCompleteScript="dndCompleteHandler( elem, newParent );"
                                    EnableOnNodeDragAndDropCompleteScriptReturn="true"
                                    Width="410" />
                            </asp:Panel>
                        </div>
                    </td>
                    <td>
                        <div>
                            <asp:Panel ID="pv" runat="server" Visible="False" CssClass="c3boxv">
                                <table>

                                    <tr>
                                        <td style="padding-left: 3px;">
                                            <uc1:TextBoxEx ID="u_Name" runat="server" />
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            <uc2:MultilineTextBoxEx ID="u_Desc" runat="server" />
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            <uc1:PopupsHandler runat="server" ID="ph_Type" />
                                        </td>
                                    </tr>
                                   
                                    <tr>
                                        <td>
                                            
                                            <div class="paddingleft9"> <asp:Button  ID="btn_meta" runat="server" OnClick="OnLoadMetaData" /></div>
                                            

                                            <asp:Panel ID="p_meta" runat="server">
                                                <uc3:MetabaseViewer ID="mb" runat="server" />
                                            </asp:Panel>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            <hr class="ee" />
                                        </td>
                                    </tr>
                                    <tr>
                                        <td class="left" colspan="2" style="vertical-align: top;">

                                            <asp:Button ID="btn_Update" runat="server" Font-Bold="true" Text="Update" OnClick="OnActionButtonsClick" />
                                            <asp:Button ID="btn_Add" runat="server" Font-Bold="true" Text="Add" OnClick="OnActionButtonsClick" />
                                            <asp:Button ID="lnkCancel" runat="server" OnClick="OnActionButtonsClick" />
                                            <span class="tab"></span>
                                            <asp:Button ID="btn_Delete" runat="server" Text="Delete" ForeColor="Red" OnClick="OnActionButtonsClick" />
                                        </td>
                                    </tr>
                                </table>
                            </asp:Panel>
                        </div>
                    </td>
                </tr>
            </table>
            <div>
                <hr class="ee" />
                <img alt="" src="../images/handdrag16.png" />
                <asp:Label ID="lbl_DrapDropMessage" runat="server" Font-Italic="true" Font-Size="Smaller"
                    ForeColor="Gray"></asp:Label>
            </div>

          
            <asp:Button ID="btn_pHandler" runat="server" Text="Button" Style="display: none;" />

            <cc1:ModalPopupExtender ID="mdp" runat="server" TargetControlID="btn_pHandler" PopupControlID="Pxc"
                BackgroundCssClass="modalBackground">
            </cc1:ModalPopupExtender>
            <cc1:DragPanelExtender ID="dpE" runat="server" DragHandleID="pnlHeader" TargetControlID="pxc" />
            <asp:Button ID="Button1" runat="server" Style="display: none;" />
            <asp:Panel ID="Pxc" runat="server" CssClass="frame" Style="display: none;">
                <div class="overlay">
                    <div style="float: right;">
                        <asp:Button ID="btn_TopOK" runat="server" OnClick="OnOK" />
                    </div>
                    <uc15:PopupPanel ID="usc_PP" runat="server" />
                    <asp:Panel ID="p_t" runat="server" Height="400px" ScrollBars="Both">
                        <asp:TreeView ID="PoupTree" runat="server" ExpandDepth="1"
                            PathSeparator="|" ShowCheckBoxes="All" EnableClientScript="False" PopulateNodesFromClient="False">
                        </asp:TreeView>
                    </asp:Panel>

                    <div class="divpok">
                        <asp:Button ID="btn_POK" runat="server" OnClick="OnOK" />
                    </div>


                </div>

            </asp:Panel>

        </ContentTemplate>
        <Triggers>
            <asp:PostBackTrigger ControlID="astvMyTree" />
        </Triggers>


    </asp:UpdatePanel>




</asp:Content>
