From 60be254e4a5bf99426e6b6e2b0dc2d14f4cc6697 Mon Sep 17 00:00:00 2001
From: Samuele Locatelli
Date: Fri, 3 Mar 2023 17:12:31 +0100
Subject: [PATCH] Fix gestione siti INT/EXT x landing page
---
HOME/Controllers/HomeController.cs | 79 +++++++---
HOME/Views/Home/Index.cshtml | 41 +++--
HOME/Web.config | 233 +++++++++++++++--------------
3 files changed, 194 insertions(+), 159 deletions(-)
diff --git a/HOME/Controllers/HomeController.cs b/HOME/Controllers/HomeController.cs
index 491e714..dac1ea7 100644
--- a/HOME/Controllers/HomeController.cs
+++ b/HOME/Controllers/HomeController.cs
@@ -9,8 +9,30 @@ namespace HOME.Controllers
{
public class HomeController : Controller
{
+ #region Public Fields
+
public Logger lg = LogManager.GetCurrentClassLogger();
+ #endregion Public Fields
+
+ #region Public Methods
+
+ public ActionResult About()
+ {
+ ViewBag.Title = "GPW";
+ ViewBag.Message = "Gestione Presenze Web - powered by Steamware";
+
+ return View();
+ }
+
+ public ActionResult Contact()
+ {
+ ViewBag.Title = "GPW";
+ ViewBag.Message = "I nostri recapiti di contatto";
+
+ return View();
+ }
+
public ActionResult Index()
{
ViewBag.Title = "GPW";
@@ -32,42 +54,53 @@ namespace HOME.Controllers
// esegue stored procedure come function, recuperando chiave desiderata...
var keyVal = ctx.stp_AKV_getByKey("Environment").ToList();
// imposto URL dei vari siti
- ViewBag.UrlAdmin = ctx.stp_AKV_getByKey("UrlAdmin").ToList()[0].valString + "/";
- ViewBag.UrlBCode = ctx.stp_AKV_getByKey("UrlBCode").ToList()[0].valString + "/";
- ViewBag.UrlSmart = ctx.stp_AKV_getByKey("UrlSmart").ToList()[0].valString + "/";
- ViewBag.UrlWrkLg = ctx.stp_AKV_getByKey("UrlWrkLg").ToList()[0].valString + "/";
- ViewBag.UrlWrkLgCore = ctx.stp_AKV_getByKey("UrlWrkLgCore").ToList()[0].valString + "/";
+ string UrlInt = getAKV("UrlInt");
+ string UrlExt = getAKV("UrlExt");
+ ViewBag.UrlAdmin = $"https://{UrlInt}/GPW/{getAKV("UrlAdmin")}/";
+ ViewBag.UrlBCode = $"https://{UrlInt}/GPW/{getAKV("UrlBCode")}/";
+ ViewBag.UrlSmart = $"https://{UrlExt}/GPW/{getAKV("UrlSmart")}/";
+ ViewBag.UrlSmartCore = $"https://{UrlExt}/GPW/{getAKV("UrlSmartCore")}/";
+ ViewBag.UrlWrkLg = $"https://{UrlInt}/GPW/{getAKV("UrlWrkLg")}/";
+ ViewBag.UrlWrkLgCore = $"https://{UrlInt}/GPW/{getAKV("UrlWrkLgCore")}/";
if (logLevel > 5) lg.Info("DB: UrlAdmin = " + ViewBag.UrlAdmin);
}
catch (Exception exc)
{
lg.Error(string.Format("Errore in decodifica valori da conf DB:{0}{1}", Environment.NewLine, exc));
- // in questo caso leggo da web.config
- ViewBag.UrlAdmin = WebConfigurationManager.AppSettings["UrlAdmin"] + "/"; //"../ADMIN";
- ViewBag.UrlBCode = WebConfigurationManager.AppSettings["UrlBCode"] + "/"; //"../BCODE";
- ViewBag.UrlSmart = WebConfigurationManager.AppSettings["UrlSmart"] + "/"; //"../SMART";
- ViewBag.UrlWrkLg = WebConfigurationManager.AppSettings["UrlWrkLg"] + "/"; //"../WRKLG";
- ViewBag.UrlWrkLgCore = WebConfigurationManager.AppSettings["UrlWrkLgCore"] + "/"; //"../CORE.WRKLOG";
if (logLevel > 5) lg.Info("Web.config: UrlAdmin = " + ViewBag.UrlAdmin);
}
}
return View();
}
- public ActionResult About()
- {
- ViewBag.Title = "GPW";
- ViewBag.Message = "Gestione Presenze Web - powered by Steamware";
+ #endregion Public Methods
- return View();
+ #region Protected Methods
+
+ ///
+ /// Recupero chiave da DB o da config
+ ///
+ ///
+ ///
+ protected string getAKV(string chiave)
+ {
+ string answ = "";
+ using (var ctx = new GPWEntities())
+ {
+ try
+ {
+ // recupero chiave da DB
+ answ = ctx.stp_AKV_getByKey(chiave).ToList()[0].valString;
+ }
+ catch
+ {
+ ///altrimenti da config
+ answ = WebConfigurationManager.AppSettings[chiave]; //"office.egalware.com";
+ }
+ }
+ return answ;
}
- public ActionResult Contact()
- {
- ViewBag.Title = "GPW";
- ViewBag.Message = "I nostri recapiti di contatto";
-
- return View();
- }
+ #endregion Protected Methods
}
}
\ No newline at end of file
diff --git a/HOME/Views/Home/Index.cshtml b/HOME/Views/Home/Index.cshtml
index 42db749..391df3f 100644
--- a/HOME/Views/Home/Index.cshtml
+++ b/HOME/Views/Home/Index.cshtml
@@ -38,8 +38,8 @@
-
-
- Utente »
-
-
-
- Area gestione worklog personale (legacy):
-
- - Visualizzazione timbrature
- - Inserimento mancate timbrature
- - Inserimento ore a commessa
+ - Richieste timbrature
- Verifica ore dichiarate / timbrature
- Rilievo temperatura
- - Verifica Check Accesso
+ - Inserimento mancate timbrature
+ - [NEW] Richieste Permessi, Ferie
+ - [NEW] Vista calendario
+ - [NEW] Versione Blazor
+
+
+ SMART »
+
@@ -73,17 +67,22 @@
- Area gestione worklog personale (nuova):
+ Area gestione worklog personale:
- - Agenda settimanale
- - Verifica progetti (budget/real)
- - Inserimento ore a commessa
- Visualizzazione timbrature
- Inserimento mancate timbrature
+ - Inserimento ore a commessa
- Verifica ore dichiarate / timbrature
- Rilievo temperatura
- Verifica Check Accesso
+ - [NEW] Agenda settimanale
+ - [NEW] Verifica progetti (budget/real)
+ - [NEW] Versione Blazor
+
+
+ Utente »
+
\ No newline at end of file
diff --git a/HOME/Web.config b/HOME/Web.config
index 69afeb9..bfb8003 100644
--- a/HOME/Web.config
+++ b/HOME/Web.config
@@ -1,40 +1,43 @@
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
\ No newline at end of file