diff --git a/Jenkinsfile b/Jenkinsfile index e25a4a71..39342e90 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -12,7 +12,7 @@ pipeline { steps { /* calcolo numero versione... diverso x branch MASTER/DEVELOP */ script { - withEnv(['NEXT_BUILD_NUMBER=1345']) { + withEnv(['NEXT_BUILD_NUMBER=1346']) { // env.versionNumber = VersionNumber(versionNumberString : '6.12.${BUILD_DATE_FORMATTED, "yyMM"}.${BUILDS_ALL_TIME}', projectStartDate : '2006-01-01', skipFailedBuilds: true) env.versionNumber = VersionNumber(versionNumberString : '6.12.${BUILD_DATE_FORMATTED, "yyMM"}.${BUILDS_ALL_TIME}', projectStartDate : '2006-01-01', skipFailedBuilds: true, overrideBuildsAllTime: '${NEXT_BUILD_NUMBER}') env.APP_NAME = 'MAPO' diff --git a/MP-IO/MP-IO.csproj.user b/MP-IO/MP-IO.csproj.user index e85dec40..391097c4 100644 --- a/MP-IO/MP-IO.csproj.user +++ b/MP-IO/MP-IO.csproj.user @@ -10,7 +10,7 @@ - Debug|Any CPU + Release|Any CPU MvcControllerEmptyScaffolder root/Common/MVC/Controller 600 diff --git a/MP-LAND/Controllers/HomeController.cs b/MP-LAND/Controllers/HomeController.cs index 8175cbdf..9e2f6e79 100644 --- a/MP-LAND/Controllers/HomeController.cs +++ b/MP-LAND/Controllers/HomeController.cs @@ -13,381 +13,397 @@ using ZXing.QrCode; namespace MP.Controllers { - public class HomeController : Controller - { - public ActionResult Index() + public class HomeController : Controller { - ViewBag.Title = "MAPO"; - // x sicurezza leggo da web.config - ViewBag.Environment = WebConfigurationManager.AppSettings["Environment"]; - using (var ctx = new MoonProEntities()) - { - try - { - // esegue stored procedure come function, recuperando chiave desiderata... - ViewBag.Environment = ctx.stp_AKV_getByKey("Environment").ToList()[0].valString; - // imposto URL dei vari siti - ViewBag.UrlMpSite = ctx.stp_AKV_getByKey("UrlMpSite").ToList()[0].valString; - ViewBag.UrlMpAdmin = ctx.stp_AKV_getByKey("UrlMpAdmin").ToList()[0].valString; - ViewBag.UrlMpIO = ctx.stp_AKV_getByKey("UrlMpIO").ToList()[0].valString; - ViewBag.UrlMpMON = ctx.stp_AKV_getByKey("UrlMpMON").ToList()[0].valString; - ViewBag.UrlMpTAB = ctx.stp_AKV_getByKey("UrlMpTAB").ToList()[0].valString; - ViewBag.UrlMpCTrack = ctx.stp_AKV_getByKey("UrlMpCTrack").ToList()[0].valString; - // importo verifica abilitazione CTrack - !!!FARE!!! vero check key auth! - ViewBag.CTrack_Enb = (ctx.stp_AKV_getByKey("CTRACK").ToList()[0].valString != ""); - } - catch (Exception exc) - { - logger.lg.scriviLog(string.Format("Eccezione in composizione HOME page LAND:{0}{1}", Environment.NewLine, exc), tipoLog.EXCEPTION); - // Default: NO CTrack - ViewBag.CTrack_Enb = false; - } - } - return View(); - } - /// - /// info steamware - /// - /// - public ActionResult About() - { - ViewBag.Title = "MES | SCADA | IOT"; - ViewBag.Message = "Soluzione integrata per la gestione della produzione"; + #region Protected Methods - return View(); - } - /// - /// contatti - /// - /// - public ActionResult Contact() - { - ViewBag.Title = "MAPO"; - ViewBag.Message = "Per contattarci"; - return View(); - } - /// - /// System INFO - /// - /// - public ActionResult System() - { - ViewBag.Title = "MAPO System Info"; - ViewBag.Message = "HW & SW details"; - return View(); - } - /// - /// Gestione download aggiornamenti - /// - /// - /// - public ActionResult Packages(string results) - { - ViewBag.Title = "Steamware's MAPO Suite"; - ViewBag.Message = "Ultime release applicazioni"; - UpdateInfoEventArgs updArgs = new UpdateInfoEventArgs(); - // Recupero info ADM... - updArgs = UpdateMan.obj.getUpdateInfo(updateUrl("ADM")); - if (updArgs.IsUpdateAvailable) - { - ViewBag.VersMpAdmin = updArgs.CurrentVersion; - } - else - { - ViewBag.VersMpAdmin = "ND"; - ViewBag.AdmDisabled = "disabled"; - } - // Recupero info IO... - updArgs = UpdateMan.obj.getUpdateInfo(updateUrl("IO")); - if (updArgs.IsUpdateAvailable) - { - ViewBag.VersMpIO = updArgs.CurrentVersion; - } - else - { - ViewBag.VersMpIO = "ND"; - ViewBag.IODisabled = "disabled"; - } - // Recupero info LAND... - updArgs = UpdateMan.obj.getUpdateInfo(updateUrl("LAND")); - if (updArgs.IsUpdateAvailable) - { - ViewBag.VersMpLand = updArgs.CurrentVersion; - } - else - { - ViewBag.VersMpLand = "ND"; - ViewBag.LandDisabled = "disabled"; - } - // Recupero info MON... - updArgs = UpdateMan.obj.getUpdateInfo(updateUrl("MON")); - if (updArgs.IsUpdateAvailable) - { - ViewBag.VersMpMon = updArgs.CurrentVersion; - } - else - { - ViewBag.VersMpMon = "ND"; - ViewBag.MonDisabled = "disabled"; - } - // Recupero info SITE... - updArgs = UpdateMan.obj.getUpdateInfo(updateUrl("SITE")); - if (updArgs.IsUpdateAvailable) - { - ViewBag.VersMpSite = updArgs.CurrentVersion; - } - else - { - ViewBag.VersMpSite = "ND"; - ViewBag.SiteDisabled = "disabled"; - } - // Recupero info TAB... - updArgs = UpdateMan.obj.getUpdateInfo(updateUrl("TAB")); - if (updArgs.IsUpdateAvailable) - { - ViewBag.VersMpTab = updArgs.CurrentVersion; - } - else - { - ViewBag.VersMpTab = "ND"; - ViewBag.TabDisabled = "disabled"; - } - // Recupero info CTRACK... - updArgs = UpdateMan.obj.getUpdateInfo(updateUrl("CTRACK")); - if (updArgs.IsUpdateAvailable) - { - ViewBag.VersMpCTrack = updArgs.CurrentVersion; - } - else - { - ViewBag.VersMpCTrack = "ND"; - ViewBag.TabDisabled = "disabled"; - } - // salvo risultati... - ViewBag.Results = results; - // fix visibilità CTrack - using (var ctx = new MoonProEntities()) - { - try + /// + /// Path locale dove scaricare gli installer + /// + protected string localDownloadPath(string package) { - // importo verifica abilitazione CTrack - !!!FARE!!! vero check key auth! - ViewBag.CTrack_Enb = (ctx.stp_AKV_getByKey("CTRACK").ToList()[0].valString != ""); + return string.Format(@"{0}{1}\{2}", memLayer.ML.CRS("downloadPath"), package, memLayer.ML.CRS("appVers")); } - catch + + /// + /// URLK stringa di UPDATE... + /// + protected string updateUrl(string package) { - ViewBag.CTrack_Enb = false; + return string.Format("http://seriate.steamware.net:8083/SWS/MAPO/{0}/{1}/manifest.xml", package, memLayer.ML.CRS("appVers")); } - } - // VIEW! - return View(); - } - /// - /// Gestione configurazioni applicativi (DB) - /// - /// - /// - public ActionResult ConfigMan(string sorgente) - { - ViewBag.Title = "Steamware's MAPO Suite - Configurations"; - // cerco file se disponibile... - string filePath = Path.Combine(Server.MapPath("~/FileUpload"), "web.config"); - bool fileExist = (fileMover.obj.fileExist(Server.MapPath("~/FileUpload"), "web.config")); - if (fileExist) - { - ViewBag.Message = "File web.config presente"; - // leggo il file di conf caricato... - System.Configuration.Configuration rootWebConfig = WebConfigurationManager.OpenWebConfiguration("~/FileUpload/web.config"); + #endregion Protected Methods - if (sorgente != "" && sorgente != null) + #region Public Methods + + /// + /// info steamware + /// + /// + public ActionResult About() { - // resetto tab import - memLayer.ML.taConfigTmp.reset(sorgente); - // carico dati! - var settings = rootWebConfig.AppSettings.Settings; - foreach (var item in settings.AllKeys) - { - memLayer.ML.taConfigTmp.insertQuery(sorgente, item, settings[item].Value, string.Format("{0}|{1}", sorgente, item)); - } - // salvo in viewbag gli elenchi 0/1/2 (tutte, nuove, modificate) + ViewBag.Title = "MES | SCADA | IOT"; + ViewBag.Message = "Soluzione integrata per la gestione della produzione"; - using (var ctx = new MoonProEntities()) - { - try + return View(); + } + + /// + /// Gestione configurazioni applicativi (DB) + /// + /// + /// + public ActionResult ConfigMan(string sorgente) + { + ViewBag.Title = "Steamware's MAPO Suite - Configurations"; + + // cerco file se disponibile... + string filePath = Path.Combine(Server.MapPath("~/FileUpload"), "web.config"); + bool fileExist = (fileMover.obj.fileExist(Server.MapPath("~/FileUpload"), "web.config")); + if (fileExist) { - // esegue stored procedure come function, recuperando chiave desiderata... - var elConfig = ctx.ConfigTmp.ToList(); - ViewBag.elConfig = elConfig; + ViewBag.Message = "File web.config presente"; + // leggo il file di conf caricato... + System.Configuration.Configuration rootWebConfig = WebConfigurationManager.OpenWebConfiguration("~/FileUpload/web.config"); + + if (sorgente != "" && sorgente != null) + { + // resetto tab import + memLayer.ML.taConfigTmp.reset(sorgente); + // carico dati! + var settings = rootWebConfig.AppSettings.Settings; + foreach (var item in settings.AllKeys) + { + memLayer.ML.taConfigTmp.insertQuery(sorgente, item, settings[item].Value, string.Format("{0}|{1}", sorgente, item)); + } + // salvo in viewbag gli elenchi 0/1/2 (tutte, nuove, modificate) + + using (var ctx = new MoonProEntities()) + { + try + { + // esegue stored procedure come function, recuperando chiave desiderata... + var elConfig = ctx.ConfigTmp.ToList(); + ViewBag.elConfig = elConfig; + } + catch + { } + } + + ViewBag.keyList = "CARICATO!"; + } } - catch - { } - } - - ViewBag.keyList = "CARICATO!"; - } - } - else - { - ViewBag.Message = "Attenzione: nessun file presente!"; - } - // VIEW! - return View((object)ViewBag.elConfig); - } - - [HttpPost] - public ActionResult UploadFile(HttpPostedFileBase file, string sorgente) - { - if (file != null && file.ContentLength > 0 && sorgente != "") - { - try - { - // forzo nome SEMPRE a web.config - //string path = Path.Combine(Server.MapPath("~/FileUpload"), Path.GetFileName(file.FileName).ToLower()); - string path = Path.Combine(Server.MapPath("~/FileUpload"), "web.config"); - file.SaveAs(path); - ViewBag.Message = "File Caricato!"; - // ora processo import del sorgente selezionato... - - - - - - } - catch (Exception ex) - { - ViewBag.Message = "ERROR:" + ex.Message.ToString(); - } - } - else - { - ViewBag.Message = "Non è stato selezionato alcun file."; - } - return RedirectToAction("ConfigMan", "Home", new { sorgente }); - } - - - // GET: Home/Download/Caller (ALL|ADM|IO|LAND|MON|SITE|TAB|CTRACK) - public ActionResult Download(string caller) - { - string resultsMsg = ""; - // in base al caller scarico il file installazione richiesto... - if (caller == null) - { - caller = "ALL"; - } - // ora verifico COSA devo scaricare... - if (updateUrl(caller) != "") - { - // se è ALL scarico tuttoi... - if (caller == "ALL") - { - Stopwatch stopWatch = new Stopwatch(); - stopWatch.Start(); - int done = 0; - // scarico TUTTI... - done += UpdateMan.obj.downloadLatest(updateUrl("ADM"), localDownloadPath("ADM"), "ADM"); - done += UpdateMan.obj.downloadLatest(updateUrl("IO"), localDownloadPath("IO"), "IO"); - done += UpdateMan.obj.downloadLatest(updateUrl("LAND"), localDownloadPath("LAND"), "LAND"); - done += UpdateMan.obj.downloadLatest(updateUrl("MON"), localDownloadPath("MON"), "MON"); - done += UpdateMan.obj.downloadLatest(updateUrl("SITE"), localDownloadPath("SITE"), "SITE"); - done += UpdateMan.obj.downloadLatest(updateUrl("TAB"), localDownloadPath("TAB"), "TAB"); - done += UpdateMan.obj.downloadLatest(updateUrl("CTRACK"), localDownloadPath("CTRACK"), "CTRACK"); - stopWatch.Stop(); - // calcolo elapsed time come TimeSpan value. - TimeSpan ts = stopWatch.Elapsed; - resultsMsg = string.Format("OK: {0} Package downloaded, {1:0.000} sec", done, ts.TotalSeconds); - } - else - { - // scarico singolo target... - UpdateMan.obj.downloadLatest(updateUrl(caller), localDownloadPath(caller), caller); - resultsMsg = string.Format("OK: {0} DOWNLOADED | {1} --> {2}", caller, updateUrl(caller), localDownloadPath(caller)); - } - } - // ...chiamo action - return RedirectToAction("Packages", "Home", new { results = resultsMsg }); - } - - /// - /// Gestione QRCode utenti TAB - /// - /// - public ActionResult UserListQR(string id, string From, string Lenght) - { - int lenght = 0; - int from = 0; - int.TryParse(Lenght, out lenght); - int.TryParse(From, out from); - ViewBag.Title = "QR link"; - ViewBag.Message = WebConfigurationManager.AppSettings["Cliente"]; - ViewBag.BaseUrl = WebConfigurationManager.AppSettings["baseAuthUrl"]; - ViewBag.Environment = WebConfigurationManager.AppSettings["Environment"]; - using (var ctx = new MoonProEntities()) - { - try - { - // esegue stored procedure come function, recuperando chiave desiderata... - var elOperatori = ctx.AnagraficaOperatori.ToList(); - if (from + lenght > 0) - { - // seleziono sottoelenco SE ammissibile... - int numRec = elOperatori.Count; - lenght = lenght == 0 ? numRec : lenght; - from = from > numRec ? 0 : from; - if (from < numRec) + else { - lenght = from + lenght < numRec ? lenght : numRec - from; - elOperatori = elOperatori.GetRange(from, lenght); + ViewBag.Message = "Attenzione: nessun file presente!"; } - } - ViewBag.elOperatori = elOperatori; + // VIEW! + return View((object)ViewBag.elConfig); } - catch - { } - } - return View((object)ViewBag.elOperatori); - } - /// - /// Restituisce un QR code dato valore - /// - /// - /// - public ActionResult QR(string valore) - { - QrCodeEncodingOptions options = new QrCodeEncodingOptions - { - DisableECI = true, - CharacterSet = "UTF-8", - Width = 600, - Height = 600, - Margin = 0 - }; - var writer = new BarcodeWriter(); - writer.Format = BarcodeFormat.QR_CODE; - writer.Options = options; - // scrivo bitmap - var pixelData = writer.Write(valore); - // Return Image - MemoryStream ms = new MemoryStream(); - pixelData.Save(ms, ImageFormat.Png); - ms.Position = 0; - return new FileStreamResult(ms, "image/png"); - } + /// + /// contatti + /// + /// + public ActionResult Contact() + { + ViewBag.Title = "MAPO"; + ViewBag.Message = "Per contattarci"; + return View(); + } - /// - /// Path locale dove scaricare gli installer - /// - protected string localDownloadPath(string package) - { - return string.Format(@"{0}{1}\{2}", memLayer.ML.CRS("downloadPath"), package, memLayer.ML.CRS("appVers")); + // GET: Home/Download/Caller (ALL|ADM|IO|LAND|MON|SITE|TAB|CTRACK) + public ActionResult Download(string caller) + { + string resultsMsg = ""; + // in base al caller scarico il file installazione richiesto... + if (caller == null) + { + caller = "ALL"; + } + // ora verifico COSA devo scaricare... + if (updateUrl(caller) != "") + { + // se è ALL scarico tuttoi... + if (caller == "ALL") + { + Stopwatch stopWatch = new Stopwatch(); + stopWatch.Start(); + int done = 0; + // scarico TUTTI... + done += UpdateMan.obj.downloadLatest(updateUrl("ADM"), localDownloadPath("ADM"), "ADM"); + done += UpdateMan.obj.downloadLatest(updateUrl("IO"), localDownloadPath("IO"), "IO"); + done += UpdateMan.obj.downloadLatest(updateUrl("LAND"), localDownloadPath("LAND"), "LAND"); + done += UpdateMan.obj.downloadLatest(updateUrl("MON"), localDownloadPath("MON"), "MON"); + done += UpdateMan.obj.downloadLatest(updateUrl("SITE"), localDownloadPath("SITE"), "SITE"); + done += UpdateMan.obj.downloadLatest(updateUrl("TAB"), localDownloadPath("TAB"), "TAB"); + done += UpdateMan.obj.downloadLatest(updateUrl("CTRACK"), localDownloadPath("CTRACK"), "CTRACK"); + stopWatch.Stop(); + // calcolo elapsed time come TimeSpan value. + TimeSpan ts = stopWatch.Elapsed; + resultsMsg = string.Format("OK: {0} Package downloaded, {1:0.000} sec", done, ts.TotalSeconds); + } + else + { + // scarico singolo target... + UpdateMan.obj.downloadLatest(updateUrl(caller), localDownloadPath(caller), caller); + resultsMsg = string.Format("OK: {0} DOWNLOADED | {1} --> {2}", caller, updateUrl(caller), localDownloadPath(caller)); + } + } + // ...chiamo action + return RedirectToAction("Packages", "Home", new { results = resultsMsg }); + } + + public ActionResult Index() + { + ViewBag.Title = "MAPO"; + // x sicurezza leggo da web.config + ViewBag.Environment = WebConfigurationManager.AppSettings["Environment"]; + using (var ctx = new MoonProEntities()) + { + try + { + // esegue stored procedure come function, recuperando chiave desiderata... + ViewBag.Environment = ctx.stp_AKV_getByKey("Environment").ToList()[0].valString; + // imposto URL dei vari siti + ViewBag.UrlMpSite = ctx.stp_AKV_getByKey("UrlMpSite").ToList()[0].valString; + ViewBag.UrlMpAdmin = ctx.stp_AKV_getByKey("UrlMpAdmin").ToList()[0].valString; + ViewBag.UrlMpIO = ctx.stp_AKV_getByKey("UrlMpIO").ToList()[0].valString; + ViewBag.UrlMpMON = ctx.stp_AKV_getByKey("UrlMpMON").ToList()[0].valString; + ViewBag.UrlMpTAB = ctx.stp_AKV_getByKey("UrlMpTAB").ToList()[0].valString; + ViewBag.UrlMpCTrack = ctx.stp_AKV_getByKey("UrlMpCTrack").ToList()[0].valString; + // importo verifica abilitazione CTrack - !!!FARE!!! vero check key auth! + ViewBag.CTrack_Enb = (ctx.stp_AKV_getByKey("CTRACK").ToList()[0].valString != ""); + } + catch (Exception exc) + { + logger.lg.scriviLog(string.Format("Eccezione in composizione HOME page LAND:{0}{1}", Environment.NewLine, exc), tipoLog.EXCEPTION); + // Default: NO CTrack + ViewBag.CTrack_Enb = false; + } + } + return View(); + } + + /// + /// Gestione download aggiornamenti + /// + /// + /// + public ActionResult Packages(string results) + { + ViewBag.Title = "Steamware's MAPO Suite"; + ViewBag.Message = "Ultime release applicazioni"; + UpdateInfoEventArgs updArgs = new UpdateInfoEventArgs(); + // Recupero info ADM... + updArgs = UpdateMan.obj.getUpdateInfo(updateUrl("ADM")); + if (updArgs.IsUpdateAvailable) + { + ViewBag.VersMpAdmin = updArgs.CurrentVersion; + } + else + { + ViewBag.VersMpAdmin = "ND"; + ViewBag.AdmDisabled = "disabled"; + } + // Recupero info IO... + updArgs = UpdateMan.obj.getUpdateInfo(updateUrl("IO")); + if (updArgs.IsUpdateAvailable) + { + ViewBag.VersMpIO = updArgs.CurrentVersion; + } + else + { + ViewBag.VersMpIO = "ND"; + ViewBag.IODisabled = "disabled"; + } + // Recupero info LAND... + updArgs = UpdateMan.obj.getUpdateInfo(updateUrl("LAND")); + if (updArgs.IsUpdateAvailable) + { + ViewBag.VersMpLand = updArgs.CurrentVersion; + } + else + { + ViewBag.VersMpLand = "ND"; + ViewBag.LandDisabled = "disabled"; + } + // Recupero info MON... + updArgs = UpdateMan.obj.getUpdateInfo(updateUrl("MON")); + if (updArgs.IsUpdateAvailable) + { + ViewBag.VersMpMon = updArgs.CurrentVersion; + } + else + { + ViewBag.VersMpMon = "ND"; + ViewBag.MonDisabled = "disabled"; + } + // Recupero info SITE... + updArgs = UpdateMan.obj.getUpdateInfo(updateUrl("SITE")); + if (updArgs.IsUpdateAvailable) + { + ViewBag.VersMpSite = updArgs.CurrentVersion; + } + else + { + ViewBag.VersMpSite = "ND"; + ViewBag.SiteDisabled = "disabled"; + } + // Recupero info TAB... + updArgs = UpdateMan.obj.getUpdateInfo(updateUrl("TAB")); + if (updArgs.IsUpdateAvailable) + { + ViewBag.VersMpTab = updArgs.CurrentVersion; + } + else + { + ViewBag.VersMpTab = "ND"; + ViewBag.TabDisabled = "disabled"; + } + // Recupero info CTRACK... + updArgs = UpdateMan.obj.getUpdateInfo(updateUrl("CTRACK")); + if (updArgs.IsUpdateAvailable) + { + ViewBag.VersMpCTrack = updArgs.CurrentVersion; + } + else + { + ViewBag.VersMpCTrack = "ND"; + ViewBag.TabDisabled = "disabled"; + } + // salvo risultati... + ViewBag.Results = results; + // fix visibilità CTrack + using (var ctx = new MoonProEntities()) + { + try + { + // importo verifica abilitazione CTrack - !!!FARE!!! vero check key auth! + ViewBag.CTrack_Enb = (ctx.stp_AKV_getByKey("CTRACK").ToList()[0].valString != ""); + } + catch + { + ViewBag.CTrack_Enb = false; + } + } + // VIEW! + return View(); + } + + /// + /// Restituisce un QR code dato valore + /// + /// + /// + public ActionResult QR(string valore) + { + QrCodeEncodingOptions options = new QrCodeEncodingOptions + { + DisableECI = true, + CharacterSet = "UTF-8", + Width = 600, + Height = 600, + Margin = 0 + }; + var writer = new BarcodeWriter(); + writer.Format = BarcodeFormat.QR_CODE; + writer.Options = options; + // scrivo bitmap + var pixelData = writer.Write(valore); + + // Return Image + MemoryStream ms = new MemoryStream(); + pixelData.Save(ms, ImageFormat.Png); + ms.Position = 0; + return new FileStreamResult(ms, "image/png"); + } + + /// + /// System INFO + /// + /// + public ActionResult SystemInfo() + { + ViewBag.Title = "MAPO System Info"; + ViewBag.Message = "HW & SW details"; + + // imposto i vari dati da mostrare a video senza indicare come bypassare... + string connStr = memLayer.ML.confReadString("DbConfConnectionString"); + var currHwSwInfo = HwSwInfo.man(System.Reflection.Assembly.GetExecutingAssembly()); + ViewBag.DbNameExample = connStr.Substring(0, connStr.IndexOf(";Persist Security")); + ViewBag.CodModulo = memLayer.ML.confReadString("CodModulo"); + ViewBag.HwSwInfo = currHwSwInfo; + return View(); + } + + [HttpPost] + public ActionResult UploadFile(HttpPostedFileBase file, string sorgente) + { + if (file != null && file.ContentLength > 0 && sorgente != "") + { + try + { + // forzo nome SEMPRE a web.config + //string path = Path.Combine(Server.MapPath("~/FileUpload"), Path.GetFileName(file.FileName).ToLower()); + string path = Path.Combine(Server.MapPath("~/FileUpload"), "web.config"); + file.SaveAs(path); + ViewBag.Message = "File Caricato!"; + // ora processo import del sorgente selezionato... + } + catch (Exception ex) + { + ViewBag.Message = "ERROR:" + ex.Message.ToString(); + } + } + else + { + ViewBag.Message = "Non è stato selezionato alcun file."; + } + return RedirectToAction("ConfigMan", "Home", new { sorgente }); + } + + /// + /// Gestione QRCode utenti TAB + /// + /// + public ActionResult UserListQR(string id, string From, string Lenght) + { + int lenght = 0; + int from = 0; + int.TryParse(Lenght, out lenght); + int.TryParse(From, out from); + ViewBag.Title = "QR link"; + ViewBag.Message = WebConfigurationManager.AppSettings["Cliente"]; + ViewBag.BaseUrl = WebConfigurationManager.AppSettings["baseAuthUrl"]; + ViewBag.Environment = WebConfigurationManager.AppSettings["Environment"]; + using (var ctx = new MoonProEntities()) + { + try + { + // esegue stored procedure come function, recuperando chiave desiderata... + var elOperatori = ctx.AnagraficaOperatori.ToList(); + if (from + lenght > 0) + { + // seleziono sottoelenco SE ammissibile... + int numRec = elOperatori.Count; + lenght = lenght == 0 ? numRec : lenght; + from = from > numRec ? 0 : from; + if (from < numRec) + { + lenght = from + lenght < numRec ? lenght : numRec - from; + elOperatori = elOperatori.GetRange(from, lenght); + } + } + ViewBag.elOperatori = elOperatori; + } + catch + { } + } + return View((object)ViewBag.elOperatori); + } + + #endregion Public Methods } - /// - /// URLK stringa di UPDATE... - /// - protected string updateUrl(string package) - { - return string.Format("http://seriate.steamware.net:8083/SWS/MAPO/{0}/{1}/manifest.xml", package, memLayer.ML.CRS("appVers")); - } - } } \ No newline at end of file diff --git a/MP-LAND/MP-LAND.csproj b/MP-LAND/MP-LAND.csproj index 0d1cba0b..518f2f1c 100644 --- a/MP-LAND/MP-LAND.csproj +++ b/MP-LAND/MP-LAND.csproj @@ -496,7 +496,7 @@ - + diff --git a/MP-LAND/Views/Home/System.cshtml b/MP-LAND/Views/Home/System.cshtml deleted file mode 100644 index e548db53..00000000 --- a/MP-LAND/Views/Home/System.cshtml +++ /dev/null @@ -1,174 +0,0 @@ -
-
-
-
-
-

@ViewBag.Title

-
-
-

@ViewBag.Message

-
-
-
-
-
-
- -
-
-
-
-
-
-
-
Module
-
-

@SteamWare.memLayer.ML.confReadString("CodModulo")

-
-
-
-
.net framework
-
-

@SteamWare.HwSwInfo.man(System.Reflection.Assembly.GetExecutingAssembly()).runtimeImg

-
-
-
-
Main Assembly
-
-

@SteamWare.HwSwInfo.man(System.Reflection.Assembly.GetExecutingAssembly()).mainAssembly

-
-
-
-
-
-
-
-
- -
-
-
-
-
-
-
-
Server Stats
-
-

-

@SteamWare.HwSwInfo.man(System.Reflection.Assembly.GetExecutingAssembly()).ServerStats
-

-
-
-
-
IIS Stats
-
-

-

@SteamWare.HwSwInfo.man(System.Reflection.Assembly.GetExecutingAssembly()).IISStats
-

-
-
-
-
-
-
-
-
- -
-
-
-
-
-
-
-
Redis Servers Data
-
-

-

@SteamWare.HwSwInfo.man(System.Reflection.Assembly.GetExecutingAssembly()).redisServersData
-

-
-
-
-
-
-
-
-
- -
-
-
-
-
-
-
-
Browser size data
-
-

-

@SteamWare.HwSwInfo.man(System.Reflection.Assembly.GetExecutingAssembly()).paretoBrowserSize
-

-
-
-
-
-
-
-
-
- -
-
-
-
-
-
-
-
Elenco librerie
- @SteamWare.HwSwInfo.man(System.Reflection.Assembly.GetExecutingAssembly()).numLibraries -
-

-

@SteamWare.HwSwInfo.man(System.Reflection.Assembly.GetExecutingAssembly()).librariesVers
-

-
-
-
-
-
- @*
-
-
- -
-
-
-
-

-

-

-
-
-
*@ -
-
-
-
-
-
-
-
- - - - diff --git a/MP-LAND/Views/Home/SystemInfo.cshtml b/MP-LAND/Views/Home/SystemInfo.cshtml new file mode 100644 index 00000000..80af5840 --- /dev/null +++ b/MP-LAND/Views/Home/SystemInfo.cshtml @@ -0,0 +1,160 @@ +
+
+
+
+
+

@ViewBag.Title

+
+
+

@ViewBag.Message

+
+
+
+
+
+
+ +
+
+
+
+
+
+
+
Module
+
+

@ViewBag.CodModulo

+
+
+
+
Main DB Conf
+
+

@ViewBag.DbNameExample

+
+
+
+
.net framework
+
+

@ViewBag.HwSwInfo.runtimeImg

+
+
+
+
Main Assembly
+
+

@ViewBag.HwSwInfo.mainAssembly

+
+
+
+
+
+
+
+
+ +
+
+
+
+
+
+
+
Server Stats
+
+

+

@ViewBag.HwSwInfo.ServerStats
+

+
+
+
+
IIS Stats
+
+

+

@ViewBag.HwSwInfo.IISStats
+

+
+
+
+
+
+
+
+
+ +
+
+
+
+
+
+
+
Redis Servers Data
+
+

+

@ViewBag.HwSwInfo.redisServersData
+

+
+
+
+
+
+
+
+
+ +
+
+
+
+
+
+
+
Browser size data
+
+

+

@ViewBag.HwSwInfo.paretoBrowserSize
+

+
+
+
+
+
+
+
+
+ +
+
+
+
+
+
+
+
Elenco librerie
+ @ViewBag.HwSwInfo.numLibraries +
+

+

@ViewBag.HwSwInfo.librariesVers
+

+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file diff --git a/MP-LAND/Views/Shared/_Layout.cshtml b/MP-LAND/Views/Shared/_Layout.cshtml index 8cac6d33..966d1417 100644 --- a/MP-LAND/Views/Shared/_Layout.cshtml +++ b/MP-LAND/Views/Shared/_Layout.cshtml @@ -1,58 +1,58 @@  - - - @ViewBag.Title - MP LAND - @Styles.Render("~/Content/css") - @Scripts.Render("~/bundles/modernizr") + + + @ViewBag.Title - MP LAND + @Styles.Render("~/Content/css") + @Scripts.Render("~/bundles/modernizr") -