From 793ca31719f3fe1a5cec88d698cfbe0c34e3056c Mon Sep 17 00:00:00 2001 From: Marco Audiffredi Date: Mon, 20 May 2024 14:55:39 +0200 Subject: [PATCH] Gestione Timesheet filtro link su area riservata --- Controllers/HomeController.cs | 5 +++++ Controllers/LoginController.cs | 1 + Models/LoginOut.cs | 2 ++ Views/Shared/_LayoutAreaRiservata.cshtml | 11 ++++++++++- 4 files changed, 18 insertions(+), 1 deletion(-) diff --git a/Controllers/HomeController.cs b/Controllers/HomeController.cs index f70ee1f..f7167f9 100644 --- a/Controllers/HomeController.cs +++ b/Controllers/HomeController.cs @@ -11,6 +11,7 @@ namespace VirtualTask.Controllers private readonly ILogger _logger; string token = string.Empty; string admin = string.Empty; + string time_sheet = string.Empty; public HomeController(ILogger logger) { _logger = logger; @@ -21,7 +22,11 @@ namespace VirtualTask.Controllers SessionHelper helper = new SessionHelper(this); token = helper.GetStringValue("tok"); admin = helper.GetStringValue("admin"); + time_sheet = helper.GetStringValue("time_sheet"); + ViewBag.Admin = admin; + ViewBag.TimeSheet = time_sheet; + if (string.IsNullOrEmpty(token)) { return RedirectToAction("Login2", "Login"); diff --git a/Controllers/LoginController.cs b/Controllers/LoginController.cs index 5db62b2..c7b3067 100644 --- a/Controllers/LoginController.cs +++ b/Controllers/LoginController.cs @@ -59,6 +59,7 @@ namespace VirtualTask.Controllers helper.SetStringValue("tenant2", loginOut.Tenant); helper.SetStringValue("tecnico", model.Username); helper.SetStringValue("admin", loginOut.Tcsuper != null ? loginOut.Tcsuper : "N"); + helper.SetStringValue("time_sheet", loginOut.Config!=null && loginOut.Config.time_sheet != null && loginOut.Config.time_sheet ==true? "S" : "N"); return RedirectToAction("Index", "Home"); } diff --git a/Models/LoginOut.cs b/Models/LoginOut.cs index 05f56b2..03606b0 100644 --- a/Models/LoginOut.cs +++ b/Models/LoginOut.cs @@ -198,6 +198,8 @@ namespace VirtualTask.Models /// tenant public string? Tenant { get; set; } + + } } diff --git a/Views/Shared/_LayoutAreaRiservata.cshtml b/Views/Shared/_LayoutAreaRiservata.cshtml index 7c0745e..580fa83 100644 --- a/Views/Shared/_LayoutAreaRiservata.cshtml +++ b/Views/Shared/_LayoutAreaRiservata.cshtml @@ -3,6 +3,7 @@ string locationTr = string.Empty; string locationPg = string.Empty; string locationRm = string.Empty; + string timesheet = ViewBag.TimeSheet; locationTr = @"https://www.google.com/maps/dir/Polo+Informatico,+Via+Curio+Fornaci,+Terni,+TR//@42.5682046,12.5716686,13z/data=!4m8!4m7!1m5!1m1!1s0x132ee4b0d0b5464b:0xfe6f167f10da0915!2m2!1d12.612868!2d42.5681488!1m0?hl=it&entry=ttu"; locationPg = @"https://www.google.com/maps/dir/Polo+Informatico,+Via+Adalberto+Migliorati,+Perugia,+PG//@43.0707354,12.3267502,16.25z/data=!4m8!4m7!1m5!1m1!1s0x132ea0273e872527:0x38a8a69c342cf3e4!2m2!1d12.3318154!2d43.0721535!1m0?entry=ttu"; locationRm = @"https://www.google.com/maps/dir/Via+del+Serafico,+90,+00142+Roma+RM//@41.8309813,12.4753342,14z/data=!4m8!4m7!1m5!1m1!1s0x13258a552865707b:0x7db7d14e57c069f7!2m2!1d12.4866518!2d41.829886!1m0?hl=it&entry=ttu"; @@ -177,7 +178,15 @@ Purchase:
  • Dati Azienda
  • Commesse
  • Esporta buoni
  • -
  • Timbrature
  • + + + @{ + if (!string.IsNullOrEmpty(timesheet) && timesheet.Equals("S")) + { +
  • Timbrature
  • + } + } +
  • Logout
  • @{