using Microsoft.AspNetCore.Components;
using Microsoft.JSInterop;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using wispro.sp.entity;

namespace wispro.sp.web.Components
{
    public partial class RightMenuTreeNode
    {
        bool menuVisiable = false;

        [Parameter]
        public Department Department { get; set; }

        [Parameter]
        public EventCallback<Department> OnCreate { get; set; }

        [Parameter]
        public EventCallback<Department> OnEdit { get; set; }

        [Parameter]
        public EventCallback<Department> OnDelete { get; set; }

        private void _OnCreate(Department dept)
        {
            if (OnCreate.HasDelegate)
            {
                OnCreate.InvokeAsync(dept);
            }
            
        }

        private void _OnEdit(Department dept)
        {
            if (OnEdit.HasDelegate)
            {
                OnEdit.InvokeAsync(dept);
            }

        }

        private void _OnDelete(Department dept)
        {
            if (OnDelete.HasDelegate)
            {
                OnDelete.InvokeAsync(dept);
            }

        }

        
        private  void ShowMenu(bool isShowmenu)
        {
            menuVisiable = isShowmenu;
        }

        bool _isOverMenu = false;
        private void isOverMenu(bool isOver)
        {
            _isOverMenu = isOver;
        }
    }
}
