94 lines
2.1 KiB
C#
94 lines
2.1 KiB
C#
using GPW.CORE.Smart.Data;
|
|
using Microsoft.AspNetCore.Components;
|
|
using System;
|
|
|
|
namespace GPW.CORE.Smart.Components.Compo
|
|
{
|
|
public partial class NavBottom
|
|
{
|
|
#region Protected Fields
|
|
|
|
protected string hideButtonCSS = "visible";
|
|
protected string hideMenuCSS = "hidden";
|
|
protected bool isVisible = false;
|
|
protected Version? version = typeof(Program).Assembly.GetName().Version;
|
|
|
|
#endregion Protected Fields
|
|
|
|
#region Protected Properties
|
|
|
|
protected string baseUrl
|
|
{
|
|
get => configuration.GetValue<string>("OptConf:BaseUrl") ?? "~/";
|
|
}
|
|
|
|
[Inject]
|
|
protected IConfiguration configuration { get; set; } = null!;
|
|
|
|
protected bool isActive { get; set; } = false;
|
|
|
|
[Inject]
|
|
protected MessageService MService { get; set; } = null!;
|
|
|
|
[Inject]
|
|
protected NavigationManager NavManager { get; set; } = null!;
|
|
|
|
#endregion Protected Properties
|
|
|
|
#region Protected Methods
|
|
|
|
protected void goTo(string target)
|
|
{
|
|
NavManager.NavigateTo($"{baseUrl}/{target}", true);
|
|
}
|
|
|
|
protected void goToAbout()
|
|
{
|
|
goTo("About");
|
|
}
|
|
|
|
protected void goToAdmin()
|
|
{
|
|
goTo("Admin");
|
|
}
|
|
|
|
protected void goToIndex()
|
|
{
|
|
goTo("Index");
|
|
}
|
|
|
|
protected void goToMPF()
|
|
{
|
|
goTo("DayOff");
|
|
}
|
|
|
|
protected void hideMenu()
|
|
{
|
|
isVisible = false;
|
|
hideMenuCSS = "hidden; height: 0%;";
|
|
hideButtonCSS = "visible";
|
|
}
|
|
|
|
protected void showMenu()
|
|
{
|
|
if (MService.IdxDipendente > 0)
|
|
{
|
|
isVisible = true;
|
|
hideMenuCSS = "visible; height: 22%; display:block;";
|
|
hideButtonCSS = "hidden";
|
|
}
|
|
}
|
|
|
|
protected void slideIn()
|
|
{
|
|
isActive = false;
|
|
}
|
|
|
|
protected void slideOut()
|
|
{
|
|
isActive = true;
|
|
}
|
|
|
|
#endregion Protected Methods
|
|
}
|
|
} |