Fix gestione siti INT/EXT x landing page

This commit is contained in:
Samuele Locatelli
2023-03-03 17:12:31 +01:00
parent 7852fec949
commit 60be254e4a
3 changed files with 194 additions and 159 deletions
+56 -23
View File
@@ -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<AnagKeyValue>();
// imposto URL dei vari siti
ViewBag.UrlAdmin = ctx.stp_AKV_getByKey("UrlAdmin").ToList<AnagKeyValue>()[0].valString + "/";
ViewBag.UrlBCode = ctx.stp_AKV_getByKey("UrlBCode").ToList<AnagKeyValue>()[0].valString + "/";
ViewBag.UrlSmart = ctx.stp_AKV_getByKey("UrlSmart").ToList<AnagKeyValue>()[0].valString + "/";
ViewBag.UrlWrkLg = ctx.stp_AKV_getByKey("UrlWrkLg").ToList<AnagKeyValue>()[0].valString + "/";
ViewBag.UrlWrkLgCore = ctx.stp_AKV_getByKey("UrlWrkLgCore").ToList<AnagKeyValue>()[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
/// <summary>
/// Recupero chiave da DB o da config
/// </summary>
/// <param name="chiave"></param>
/// <returns></returns>
protected string getAKV(string chiave)
{
string answ = "";
using (var ctx = new GPWEntities())
{
try
{
// recupero chiave da DB
answ = ctx.stp_AKV_getByKey(chiave).ToList<AnagKeyValue>()[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
}
}
+20 -21
View File
@@ -38,8 +38,8 @@
</p>
</div>
<div class="col">
<a href="@ViewBag.UrlSmart" class="btn btn-warning btn-lg fullWidth" target="_blank">
<b><i class="fas fa-mobile-alt"></i> SMART &raquo;</b>
<a href="@ViewBag.UrlSmartCore" class="btn btn-primary btn-lg fullWidth" target="_blank">
<b><i class="fas fa-mobile-alt"></i> SMART &raquo;</b> <sup>new</sup>
</a>
<hr />
<p>
@@ -47,25 +47,19 @@
<ul>
<li>Timbrature remote</li>
<li>Inserimento registro attività</li>
</ul>
</p>
</div>
<div class="col">
<a href="@ViewBag.UrlWrkLg" class="btn btn-info btn-lg fullWidth" target="_blank">
<b><i class="far fa-user"></i> Utente &raquo;</b>
</a>
<hr />
<p>
Area gestione worklog personale (legacy):
<ul>
<li>Visualizzazione timbrature</li>
<li>Inserimento mancate timbrature</li>
<li>Inserimento ore a commessa</li>
<li>Richieste timbrature</li>
<li>Verifica ore dichiarate / timbrature</li>
<li>Rilievo temperatura</li>
<li>Verifica Check Accesso</li>
<li>Inserimento mancate timbrature</li>
<li>[NEW] Richieste Permessi, Ferie</li>
<li>[NEW] Vista calendario</li>
<li>[NEW] Versione Blazor</li>
</ul>
</p>
<hr />
<a href="@ViewBag.UrlSmart" class="btn btn-warning btn-lg fullWidth" target="_blank">
<b><i class="fas fa-mobile-alt"></i> SMART &raquo;</b>
</a>
</div>
<div class="col">
<a href="@ViewBag.UrlWrkLgCore" class="btn btn-primary btn-lg fullWidth" target="_blank">
@@ -73,17 +67,22 @@
</a>
<hr />
<p>
Area gestione worklog personale (nuova):
Area gestione worklog personale:
<ul>
<li>Agenda settimanale</li>
<li>Verifica progetti (budget/real)</li>
<li>Inserimento ore a commessa</li>
<li>Visualizzazione timbrature</li>
<li>Inserimento mancate timbrature</li>
<li>Inserimento ore a commessa</li>
<li>Verifica ore dichiarate / timbrature</li>
<li>Rilievo temperatura</li>
<li>Verifica Check Accesso</li>
<li>[NEW] Agenda settimanale</li>
<li>[NEW] Verifica progetti (budget/real)</li>
<li>[NEW] Versione Blazor</li>
</ul>
</p>
<hr />
<a href="@ViewBag.UrlWrkLg" class="btn btn-warning btn-lg fullWidth" target="_blank">
<b><i class="fas fa-briefcase"></i> Utente &raquo;</b>
</a>
</div>
</div>
+118 -115
View File
@@ -1,40 +1,43 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0"?>
<!--
For more information on how to configure your ASP.NET application, please visit
https://go.microsoft.com/fwlink/?LinkId=301880
-->
<configuration>
<configSections>
<!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
<sectionGroup name="elmah">
<section name="security" requirePermission="false" type="Elmah.SecuritySectionHandler, Elmah" />
<section name="errorLog" requirePermission="false" type="Elmah.ErrorLogSectionHandler, Elmah" />
<section name="errorMail" requirePermission="false" type="Elmah.ErrorMailSectionHandler, Elmah" />
<section name="errorFilter" requirePermission="false" type="Elmah.ErrorFilterSectionHandler, Elmah" />
</sectionGroup>
<!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
<!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
</configSections>
<appSettings>
<!--modalità operativa e refresh-->
<add key="Environment" value="SteamWare" />
<add key="UrlAdmin" value="/ADMIN" />
<add key="UrlBCode" value="../BCODE" />
<add key="UrlSmart" value="../SMART" />
<add key="UrlWrkLg" value="../WRKLG" />
<add key="UrlWrkLgCore" value="../CORE.WRKLOG" />
<!--gestione logs-->
<add key="_logDir" value="~/logs/" />
<add key="_logLevel" value="7" />
<add key="_logMaxMb" value="30" />
<!-- conf base MVC -->
<add key="webpages:Version" value="3.0.0.0" />
<add key="webpages:Enabled" value="false" />
<add key="ClientValidationEnabled" value="true" />
<add key="UnobtrusiveJavaScriptEnabled" value="true" />
</appSettings>
<!--
<configSections>
<!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
<sectionGroup name="elmah">
<section name="security" requirePermission="false" type="Elmah.SecuritySectionHandler, Elmah"/>
<section name="errorLog" requirePermission="false" type="Elmah.ErrorLogSectionHandler, Elmah"/>
<section name="errorMail" requirePermission="false" type="Elmah.ErrorMailSectionHandler, Elmah"/>
<section name="errorFilter" requirePermission="false" type="Elmah.ErrorFilterSectionHandler, Elmah"/>
</sectionGroup>
<!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
<!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false"/>
</configSections>
<appSettings>
<!--modalità operativa e refresh-->
<add key="Environment" value="SteamWare"/>
<add key="UrlAdmin" value="/ADMIN"/>
<add key="UrlBCode" value="../BCODE"/>
<add key="UrlSmart" value="../SMART"/>
<add key="UrlSmartCore" value="../CORE.SMART"/>
<add key="UrlWrkLg" value="../WRKLG"/>
<add key="UrlWrkLgCore" value="../CORE.WRKLOG"/>
<add key="UrlInt" value="office.egalware.com"/>
<add key="UrlExt" value="seriate.egalware.com"/>
<!--gestione logs-->
<add key="_logDir" value="~/logs/"/>
<add key="_logLevel" value="7"/>
<add key="_logMaxMb" value="30"/>
<!-- conf base MVC -->
<add key="webpages:Version" value="3.0.0.0"/>
<add key="webpages:Enabled" value="false"/>
<add key="ClientValidationEnabled" value="true"/>
<add key="UnobtrusiveJavaScriptEnabled" value="true"/>
</appSettings>
<!--
Per una descrizione delle modifiche al file web.config, vedere il sito Web all'indirizzo http://go.microsoft.com/fwlink/?LinkId=235367.
Gli attributi seguenti possono essere impostati sul tag <httpRuntime>.
@@ -42,92 +45,92 @@
<httpRuntime targetFramework="4.6.2" />
</system.Web>
-->
<system.web>
<compilation targetFramework="4.6.2" debug="true"/>
<httpRuntime targetFramework="4.6.2"/>
<httpModules>
<add name="ErrorLog" type="Elmah.ErrorLogModule, Elmah"/>
<add name="ErrorMail" type="Elmah.ErrorMailModule, Elmah"/>
<add name="ErrorFilter" type="Elmah.ErrorFilterModule, Elmah"/>
</httpModules>
</system.web>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" culture="neutral" publicKeyToken="30ad4fe6b2a6aeed"/>
<bindingRedirect oldVersion="0.0.0.0-13.0.0.0" newVersion="13.0.0.0"/>
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Web.Optimization" publicKeyToken="31bf3856ad364e35"/>
<bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="1.1.0.0"/>
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="WebGrease" publicKeyToken="31bf3856ad364e35"/>
<bindingRedirect oldVersion="0.0.0.0-1.6.5135.21930" newVersion="1.6.5135.21930"/>
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.AI.Agent.Intercept" publicKeyToken="31bf3856ad364e35" culture="neutral"/>
<bindingRedirect oldVersion="0.0.0.0-2.0.7.0" newVersion="2.0.7.0"/>
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Antlr3.Runtime" publicKeyToken="eb42632606e9261f" culture="neutral"/>
<bindingRedirect oldVersion="0.0.0.0-3.5.0.2" newVersion="3.5.0.2"/>
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Web.Helpers" publicKeyToken="31bf3856ad364e35"/>
<bindingRedirect oldVersion="1.0.0.0-3.0.0.0" newVersion="3.0.0.0"/>
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Web.WebPages" publicKeyToken="31bf3856ad364e35"/>
<bindingRedirect oldVersion="1.0.0.0-3.0.0.0" newVersion="3.0.0.0"/>
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35"/>
<bindingRedirect oldVersion="1.0.0.0-5.2.9.0" newVersion="5.2.9.0"/>
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.Web.Infrastructure" publicKeyToken="31bf3856ad364e35" culture="neutral"/>
<bindingRedirect oldVersion="0.0.0.0-2.0.0.0" newVersion="2.0.0.0"/>
</dependentAssembly>
</assemblyBinding>
</runtime>
<system.webServer>
<validation validateIntegratedModeConfiguration="false"/>
<modules>
<add name="ErrorLog" type="Elmah.ErrorLogModule, Elmah" preCondition="managedHandler"/>
<add name="ErrorMail" type="Elmah.ErrorMailModule, Elmah" preCondition="managedHandler"/>
<add name="ErrorFilter" type="Elmah.ErrorFilterModule, Elmah" preCondition="managedHandler"/>
</modules>
</system.webServer>
<connectionStrings>
<add name="GPWEntities" connectionString="metadata=res://*/Models.GPWModel.csdl|res://*/Models.GPWModel.ssdl|res://*/Models.GPWModel.msl;provider=System.Data.SqlClient;provider connection string=&quot;data source=W2019-SQL-STEAM;initial catalog=GPW;persist security info=True;user id=sa;password=keyhammer16;MultipleActiveResultSets=True;App=EntityFramework&quot;" providerName="System.Data.EntityClient"/>
<add name="ErrorLog" connectionString="Data Source=SQL2016DEV;Initial Catalog=Elmah;Persist Security Info=True;User ID=sa;Password=keyhammer16;" providerName="System.Data.SqlClient"/>
</connectionStrings>
<entityFramework>
<defaultConnectionFactory type="System.Data.Entity.Infrastructure.LocalDbConnectionFactory, EntityFramework">
<parameters>
<parameter value="mssqllocaldb"/>
</parameters>
</defaultConnectionFactory>
<providers>
<provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer"/>
</providers>
</entityFramework>
<elmah>
<errorLog type="Elmah.SqlErrorLog, Elmah" connectionStringName="ErrorLog"/>
<security allowRemoteAccess="false"/>
</elmah>
<location path="elmah.axd" inheritInChildApplications="false">
<system.web>
<compilation targetFramework="4.6.2" />
<httpRuntime targetFramework="4.6.2" />
<httpModules>
<add name="ErrorLog" type="Elmah.ErrorLogModule, Elmah" />
<add name="ErrorMail" type="Elmah.ErrorMailModule, Elmah" />
<add name="ErrorFilter" type="Elmah.ErrorFilterModule, Elmah" />
</httpModules>
<httpHandlers>
<add verb="POST,GET,HEAD" path="elmah.axd" type="Elmah.ErrorLogPageFactory, Elmah"/>
</httpHandlers>
</system.web>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" culture="neutral" publicKeyToken="30ad4fe6b2a6aeed" />
<bindingRedirect oldVersion="0.0.0.0-13.0.0.0" newVersion="13.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Web.Optimization" publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="1.1.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="WebGrease" publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="0.0.0.0-1.6.5135.21930" newVersion="1.6.5135.21930" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.AI.Agent.Intercept" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-2.0.7.0" newVersion="2.0.7.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Antlr3.Runtime" publicKeyToken="eb42632606e9261f" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-3.5.0.2" newVersion="3.5.0.2" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Web.Helpers" publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="1.0.0.0-3.0.0.0" newVersion="3.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Web.WebPages" publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="1.0.0.0-3.0.0.0" newVersion="3.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="1.0.0.0-5.2.9.0" newVersion="5.2.9.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.Web.Infrastructure" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-2.0.0.0" newVersion="2.0.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
<system.webServer>
<validation validateIntegratedModeConfiguration="false" />
<modules>
<add name="ErrorLog" type="Elmah.ErrorLogModule, Elmah" preCondition="managedHandler" />
<add name="ErrorMail" type="Elmah.ErrorMailModule, Elmah" preCondition="managedHandler" />
<add name="ErrorFilter" type="Elmah.ErrorFilterModule, Elmah" preCondition="managedHandler" />
</modules>
<handlers>
<add name="ELMAH" verb="POST,GET,HEAD" path="elmah.axd" type="Elmah.ErrorLogPageFactory, Elmah" preCondition="integratedMode"/>
</handlers>
</system.webServer>
<connectionStrings>
<add name="GPWEntities" connectionString="metadata=res://*/Models.GPWModel.csdl|res://*/Models.GPWModel.ssdl|res://*/Models.GPWModel.msl;provider=System.Data.SqlClient;provider connection string=&quot;data source=W2019-SQL-STEAM;initial catalog=GPW;persist security info=True;user id=sa;password=keyhammer16;MultipleActiveResultSets=True;App=EntityFramework&quot;" providerName="System.Data.EntityClient" />
<add name="ErrorLog" connectionString="Data Source=SQL2016DEV;Initial Catalog=Elmah;Persist Security Info=True;User ID=sa;Password=keyhammer16;" providerName="System.Data.SqlClient" />
</connectionStrings>
<entityFramework>
<defaultConnectionFactory type="System.Data.Entity.Infrastructure.LocalDbConnectionFactory, EntityFramework">
<parameters>
<parameter value="mssqllocaldb" />
</parameters>
</defaultConnectionFactory>
<providers>
<provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />
</providers>
</entityFramework>
<elmah>
<errorLog type="Elmah.SqlErrorLog, Elmah" connectionStringName="ErrorLog" />
<security allowRemoteAccess="false" />
</elmah>
<location path="elmah.axd" inheritInChildApplications="false">
<system.web>
<httpHandlers>
<add verb="POST,GET,HEAD" path="elmah.axd" type="Elmah.ErrorLogPageFactory, Elmah" />
</httpHandlers>
</system.web>
<system.webServer>
<handlers>
<add name="ELMAH" verb="POST,GET,HEAD" path="elmah.axd" type="Elmah.ErrorLogPageFactory, Elmah" preCondition="integratedMode" />
</handlers>
</system.webServer>
</location>
</location>
</configuration>
<!--ProjectGuid: 7D89DF90-4A60-45D5-9710-3EF25C58DA31-->