aggiunto try-catch x index MP-LAND

This commit is contained in:
Samuele E. Locatelli
2017-01-05 18:37:52 +01:00
parent 05366df1fb
commit 3b877be611
4 changed files with 14 additions and 15 deletions
Binary file not shown.
BIN
View File
Binary file not shown.
+14 -9
View File
@@ -17,15 +17,20 @@ namespace MP.Controllers
ViewBag.Environment = WebConfigurationManager.AppSettings["Environment"];
using (var ctx = new MoonProEntities())
{
// esegue stored procedure come function, recuperando chiave desiderata...
var keyVal = ctx.stp_AKV_getByKey("Environment").ToList<AnagKeyValue>();
ViewBag.Environment = keyVal[0].valString;
// imposto URL dei vari siti
ViewBag.UrlMpSite = ctx.stp_AKV_getByKey("UrlMpSite").ToList<AnagKeyValue>()[0].valString;
ViewBag.UrlMpAdmin = ctx.stp_AKV_getByKey("UrlMpAdmin").ToList<AnagKeyValue>()[0].valString;
ViewBag.UrlMpIO = ctx.stp_AKV_getByKey("UrlMpIO").ToList<AnagKeyValue>()[0].valString;
ViewBag.UrlMpMON = ctx.stp_AKV_getByKey("UrlMpMON").ToList<AnagKeyValue>()[0].valString;
ViewBag.UrlMpTAB = ctx.stp_AKV_getByKey("UrlMpTAB").ToList<AnagKeyValue>()[0].valString;
try
{
// esegue stored procedure come function, recuperando chiave desiderata...
var keyVal = ctx.stp_AKV_getByKey("Environment").ToList<AnagKeyValue>();
ViewBag.Environment = keyVal[0].valString;
// imposto URL dei vari siti
ViewBag.UrlMpSite = ctx.stp_AKV_getByKey("UrlMpSite").ToList<AnagKeyValue>()[0].valString;
ViewBag.UrlMpAdmin = ctx.stp_AKV_getByKey("UrlMpAdmin").ToList<AnagKeyValue>()[0].valString;
ViewBag.UrlMpIO = ctx.stp_AKV_getByKey("UrlMpIO").ToList<AnagKeyValue>()[0].valString;
ViewBag.UrlMpMON = ctx.stp_AKV_getByKey("UrlMpMON").ToList<AnagKeyValue>()[0].valString;
ViewBag.UrlMpTAB = ctx.stp_AKV_getByKey("UrlMpTAB").ToList<AnagKeyValue>()[0].valString;
}
catch
{ }
}
return View();
}
-6
View File
@@ -71,16 +71,10 @@
<add key="authSenzaDominio" value="true" />
<add key="TcMaxFactor" value="2" />
<add key="chkIdxOdlEndProd" value="false" />
<!--<add key="MoonProConnectionString" value="Data Source=SQL-STEAM\SQL2012;Initial Catalog=MoonPro;Persist Security Info=True;User ID=sa;Password=keyhammer" />
<add key="PermessiConnectionString" value="Data Source=SQL-STEAM\SQL2012;Initial Catalog=MoonPro;Persist Security Info=True;User ID=sa;Password=keyhammer" />
<add key="UtenteCdcConnectionString" value="Data Source=SQL-STEAM\SQL2012;Initial Catalog=Donati_Anagrafica;Persist Security Info=True;User ID=sa;Password=keyhammer" />
<add key="VocabolarioConnectionString" value="Data Source=SQL-STEAM\SQL2012;Initial Catalog=MoonPro_Vocabolario;Persist Security Info=True;User ID=sa;Password=keyhammer" />-->
<add key="AutoCleanUpInterval" value="10" />
<add key="ChartImageHandler" value="storage=file;timeout=20;dir=c:\TempImageFiles\;" />
</appSettings>
<connectionStrings>
<!--<add name="MoonProConnectionString" connectionString="Data Source=SQL-STEAM\SQL2012;Initial Catalog=MoonPro;Persist Security Info=True;User ID=sa;Password=keyhammer" providerName="System.Data.SqlClient" />
<add name="MapoDb.Properties.Settings.MoonProConnectionString" connectionString="Data Source=SQL-STEAM\SQL2012;Initial Catalog=MoonPro;Persist Security Info=True;User ID=sa;Password=keyhammer" providerName="System.Data.SqlClient" />-->
<add name="MPModel" connectionString="data source=SQL-STEAM\SQL2012;initial catalog=MoonPro;persist security info=True;user id=sa;password=keyhammer;MultipleActiveResultSets=True;App=EntityFramework" providerName="System.Data.SqlClient" />
<add name="MoonProEntities" connectionString="metadata=res://*/Models.MPModel.csdl|res://*/Models.MPModel.ssdl|res://*/Models.MPModel.msl;provider=System.Data.SqlClient;provider connection string=&quot;data source=SQL-STEAM\SQL2012;initial catalog=MoonPro;persist security info=True;user id=sa;password=keyhammer;multipleactiveresultsets=True;application name=EntityFramework&quot;" providerName="System.Data.EntityClient" />
</connectionStrings>