diff --git a/.vs/GPW.sqlite b/.vs/GPW.sqlite index b8ee9b7..dd42750 100644 Binary files a/.vs/GPW.sqlite and b/.vs/GPW.sqlite differ diff --git a/HOME/Controllers/HomeController.cs b/HOME/Controllers/HomeController.cs index 2200e79..6de576c 100644 --- a/HOME/Controllers/HomeController.cs +++ b/HOME/Controllers/HomeController.cs @@ -22,32 +22,31 @@ namespace HOME.Controllers } catch { } + ViewBag.Environment = WebConfigurationManager.AppSettings["Environment"]; + if (logLevel > 5) lg.Info("Environment = " + ViewBag.Environment); using (var ctx = new GPWEntities()) { - if (logLevel > 5) lg.Info("Entities OK"); + if (logLevel > 5) lg.Info(string.Format("Inizio connessione DB con Entity Framework, connString:{0}{1}", Environment.NewLine, ctx.Database.Connection.ConnectionString)); try { // esegue stored procedure come function, recuperando chiave desiderata... var keyVal = ctx.stp_AKV_getByKey("Environment").ToList(); - ViewBag.Environment = keyVal[0].valString; // 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; - if (logLevel > 5) lg.Info("DB: Environment = " + ViewBag.Environment); if (logLevel > 5) lg.Info("DB: UrlAdmin = " + ViewBag.UrlAdmin); } - catch + 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.Environment = WebConfigurationManager.AppSettings["Environment"]; ViewBag.UrlAdmin = WebConfigurationManager.AppSettings["UrlAdmin"]; //"../ADMIN"; ViewBag.UrlBCode = WebConfigurationManager.AppSettings["UrlBCode"]; //"../BCODE"; ViewBag.UrlSmart = WebConfigurationManager.AppSettings["UrlSmart"]; //"../SMART"; ViewBag.UrlWrkLg = WebConfigurationManager.AppSettings["UrlWrkLg"]; //"../WRKLG"; - if (logLevel > 5) lg.Info("web.config: Environment = " + ViewBag.Environment); - if (logLevel > 5) lg.Info("web.config: UrlAdmin = " + ViewBag.UrlAdmin); + if (logLevel > 5) lg.Info("Web.config: UrlAdmin = " + ViewBag.UrlAdmin); } } return View(); diff --git a/HOME/Web.config b/HOME/Web.config index 600e9e6..ab2dca0 100644 --- a/HOME/Web.config +++ b/HOME/Web.config @@ -106,10 +106,6 @@ - @@ -117,15 +113,6 @@ -