50 lines
1.3 KiB
C#
50 lines
1.3 KiB
C#
using MP.Data.DatabaseModels;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace MP.Data.Services
|
|
{
|
|
public class SharedMemService
|
|
{
|
|
|
|
/// <summary>
|
|
/// Dizionario macchine (shared)
|
|
/// </summary>
|
|
public Dictionary<string, string> DictMacchine { get; set; } = new Dictionary<string, string>();
|
|
|
|
/// <summary>
|
|
/// Dizionario Menu
|
|
/// </summary>
|
|
public Dictionary<string, List<LinkMenu>> DictMenu { get; set; } = new Dictionary<string, List<LinkMenu>>();
|
|
|
|
/// <summary>
|
|
/// Reset cache memory
|
|
/// </summary>
|
|
public void ResetCache()
|
|
{
|
|
DictMacchine = new Dictionary<string, string>();
|
|
DictMenu = new Dictionary<string, List<LinkMenu>>();
|
|
}
|
|
|
|
/// <summary>
|
|
/// Restituisce il livello pagina dato URL
|
|
/// - se contiene ?IdxMacc --> T2D (detail)
|
|
/// - altrimenti --> T2H
|
|
/// </summary>
|
|
/// <param name="pageUrl"></param>
|
|
/// <returns></returns>
|
|
public string PageLevel(string pageUrl)
|
|
{
|
|
string answ = "T2H";
|
|
if (pageUrl.Contains("?IdxMacc="))
|
|
{
|
|
answ = "T2D";
|
|
}
|
|
return answ;
|
|
}
|
|
}
|
|
}
|