Ejemplo n.º 1
0
        //-------------------------------------------------------------------------------------- CSS & HTML --
        public new static string GetCssTree()
        {
            string rtn = "";

            rtn += Panel_GroupUI_ConnectionItem.GetCssTree();
            rtn += Panel_GroupUI_PermissionItem.GetCssTree();
            rtn += GetCssRoot();
            return(rtn);
        }
Ejemplo n.º 2
0
        //----------------------------------------------------------------------------------------------------
        public void ConnectionItem_Click(Panel_GroupUI_ConnectionItem connectionItem)
        {
            for (int i = 0; i < this.ConnectionItems.Length; i++)
            {
                this.ConnectionItems[i].RemoveClass__Item_On();
            }

            Permission connectionRoot = null;

            for (int i = 0; i < this.Model.Permissions.Length; i++)
            {
                if (this.Model.Permissions[i].ConnectionId == connectionItem.Model.ConnectionId)
                {
                    connectionRoot = this.Model.Permissions[i];
                }
            }

            var holder_PermissionItems = jF(".Holder_PermissionItems").html("");

            this.PermissionItems = new Panel_GroupUI_PermissionItem[0];
            if (connectionRoot != null)
            {
                int i = 0;
                this.PermissionItems[i]       = new Panel_GroupUI_PermissionItem();
                this.PermissionItems[i].Model = connectionRoot;
                i++;
                if (connectionRoot.SubPermissions != null)
                {
                    for (int j = 0; j < connectionRoot.SubPermissions.Length; j++)
                    {
                        this.PermissionItems[i]       = new Panel_GroupUI_PermissionItem();
                        this.PermissionItems[i].Model = connectionRoot.SubPermissions[j];
                        i++;
                        if (connectionRoot.SubPermissions[j].SubPermissions != null)
                        {
                            for (int k = 0; k < connectionRoot.SubPermissions[j].SubPermissions.Length; k++)
                            {
                                this.PermissionItems[i]       = new Panel_GroupUI_PermissionItem();
                                this.PermissionItems[i].Model = connectionRoot.SubPermissions[j].SubPermissions[k];
                                i++;
                            }
                        }
                    }
                }
            }
            for (int i = 0; i < this.PermissionItems.Length; i++)
            {
                this.PermissionItems[i].ViewModel = this.ViewModel;
                this.PermissionItems[i].Instantiate();
                holder_PermissionItems.append(this.PermissionItems[i].jRoot);
            }
            holder_PermissionItems.scrollTop(0);
        }