diff --git a/.vs/MP-MON/v14/.suo b/.vs/MP-MON/v14/.suo index ce74978f..b20fc585 100644 Binary files a/.vs/MP-MON/v14/.suo and b/.vs/MP-MON/v14/.suo differ diff --git a/MP-MON/Controllers/HomeController.cs b/MP-MON/Controllers/HomeController.cs index cf8e9f4d..2d017df1 100644 --- a/MP-MON/Controllers/HomeController.cs +++ b/MP-MON/Controllers/HomeController.cs @@ -1,6 +1,7 @@ using MP_MON.Models; using System; using System.Collections.Generic; +using System.IO; using System.Linq; using System.Web; using System.Web.Configuration; @@ -70,11 +71,20 @@ namespace MP_MON.Controllers var MappaStato = db.stp_MSE_getOffline(keepAliveMin); List risultato = MappaStato.ToList(); int numKO = risultato.Count; - // invio email SE ne ho trovate > 0... !!!FARE!!! if (numKO > 0) { // scrivo esito esito = string.Format("Trovate {0} schede offline", numKO); + // invio email... + string from = WebConfigurationManager.AppSettings["_fromEmail"]; + string to = WebConfigurationManager.AppSettings["_checkIobEmail"]; + string subject = "MapoIOB - scheda offline."; + string body = string.Format("Attenzione!{0}{1}{0}", Environment.NewLine, esito); + foreach (MappaStatoExpl item in risultato) + { + body += string.Format("{2}{0} | Art: {1}", item.CodMacchina, item.CodArticolo, Environment.NewLine); + } + SteamWare.gestEmail.geAuth.mandaEmail(from, to, subject, body); } else { @@ -86,5 +96,6 @@ namespace MP_MON.Controllers } + } } \ No newline at end of file diff --git a/MP-MON/Home20161116.txt b/MP-MON/Home20161116.txt new file mode 100644 index 00000000..df683a58 --- /dev/null +++ b/MP-MON/Home20161116.txt @@ -0,0 +1,303 @@ +21:35:57 6671 [STARTUP] - [Modulo gestEmail]: avviato con parametro smtp localhost +21:35:57 6720 [STARTUP] - [Modulo gestEmail]: avviato con parametro smtp localhost +21:35:59 7407 [EXCEPTION] - Errore durante l'invio della posta. + full error message + System.Net.Mail.SmtpException: Errore durante l'invio della posta. ---> System.Net.WebException: Impossibile effettuare la connessione al server remoto. ---> System.Net.Sockets.SocketException: Impossibile stabilire la connessione. Rifiuto persistente del computer di destinazione 127.0.0.1:25 + in System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress) + in System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure, Socket s4, Socket s6, Socket& socket, IPAddress& address, ConnectSocketState state, IAsyncResult asyncResult, Exception& exception) + --- Fine della traccia dello stack dell'eccezione interna --- + in System.Net.ServicePoint.GetConnection(PooledStream PooledStream, Object owner, Boolean async, IPAddress& address, Socket& abortSocket, Socket& abortSocket6) + in System.Net.PooledStream.Activate(Object owningObject, Boolean async, GeneralAsyncDelegate asyncCallback) + in System.Net.PooledStream.Activate(Object owningObject, GeneralAsyncDelegate asyncCallback) + in System.Net.ConnectionPool.GetConnection(Object owningObject, GeneralAsyncDelegate asyncCallback, Int32 creationTimeout) + in System.Net.Mail.SmtpConnection.GetConnection(ServicePoint servicePoint) + in System.Net.Mail.SmtpTransport.GetConnection(ServicePoint servicePoint) + in System.Net.Mail.SmtpClient.GetConnection() + in System.Net.Mail.SmtpClient.Send(MailMessage message) + --- Fine della traccia dello stack dell'eccezione interna --- + in System.Net.Mail.SmtpClient.Send(MailMessage message) + in SteamWare.gestEmail.mandaEmailNoLog(String _mailFrom, String _mailTo, String _oggetto, String _corpo) +21:35:59 7437 [INFO] - Email inviata: oggetto: MapoIOB - scheda offline., corpo: + +Attenzione! +Trovate 18 schede offline +
+

+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
MacchinaArticoloStatoTC
SMER.09-fermo generico00:00
PUL.035010710lavorazione07:31
SMER.045009047lavorazione07:01
PUL.025010225lavorazione07:00
SMER.035009595lavorazione10:49
SMER.085009595lavorazione09:07
SMER.075009580lavorazione07:34
SMER.025003049lavorazione06:55
SMER.015009030lavorazione08:04
EXABB5010290lavorazione10:03
PUL.045010660lavorazione14:43
SMER.105009556lavorazione14:03
PUL.015010260lavorazione06:45
SMER.065007041lavorazione02:00
TAV.025010720manuale02:01
TAV.015010181lavorazione01:43
SBAV.055007580lavorazione03:13
SMER.115009053lavorazione08:45
+
+ +21:44:30 0054 [STARTUP] - [Modulo gestEmail]: avviato con parametro smtp smtp.gmail.com +21:44:30 0094 [STARTUP] - [Modulo gestEmail]: avviato con parametro smtp smtp.gmail.com +21:44:31 6462 [INFO] - Email inviata: oggetto: MapoIOB - scheda offline., corpo: + +Attenzione! +Trovate 18 schede offline +
+

+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
MacchinaArticoloStatoTC
SMER.09-fermo generico00:00
PUL.035010710lavorazione07:31
SMER.045009047lavorazione07:01
PUL.025010225lavorazione07:00
SMER.035009595lavorazione10:49
SMER.085009595lavorazione09:07
SMER.075009580lavorazione07:34
SMER.025003049lavorazione06:55
SMER.015009030lavorazione08:04
EXABB5010290lavorazione10:03
PUL.045010660lavorazione14:43
SMER.105009556lavorazione14:03
PUL.015010260lavorazione06:45
SMER.065007041lavorazione02:00
TAV.025010720manuale02:01
TAV.015010181lavorazione01:43
SBAV.055007580lavorazione03:13
SMER.115009053lavorazione08:45
+
+ +21:49:26 2027 [STARTUP] - [Modulo gestEmail]: avviato con parametro smtp smtp.gmail.com +21:49:26 2076 [STARTUP] - [Modulo gestEmail]: avviato con parametro smtp smtp.gmail.com +21:49:27 3772 [INFO] - Email inviata: oggetto: MapoIOB - scheda offline., corpo: + +Attenzione! +Trovate 18 schede offlineMacchina: SMER.09, Articolo: - +Macchina: PUL.03, Articolo: 5010710 +Macchina: SMER.04, Articolo: 5009047 +Macchina: PUL.02, Articolo: 5010225 +Macchina: SMER.03, Articolo: 5009595 +Macchina: SMER.08, Articolo: 5009595 +Macchina: SMER.07, Articolo: 5009580 +Macchina: SMER.02, Articolo: 5003049 +Macchina: SMER.01, Articolo: 5009030 +Macchina: EXABB, Articolo: 5010290 +Macchina: PUL.04, Articolo: 5010660 +Macchina: SMER.10, Articolo: 5009556 +Macchina: PUL.01, Articolo: 5010260 +Macchina: SMER.06, Articolo: 5007041 +Macchina: TAV.02, Articolo: 5010720 +Macchina: TAV.01, Articolo: 5010181 +Macchina: SBAV.05, Articolo: 5007580 +Macchina: SMER.11, Articolo: 5009053 + diff --git a/MP-MON/MP-MON.csproj b/MP-MON/MP-MON.csproj index 35da5a99..c30c5c5d 100644 --- a/MP-MON/MP-MON.csproj +++ b/MP-MON/MP-MON.csproj @@ -315,7 +315,9 @@ - + + Designer + Web.config @@ -332,7 +334,7 @@ - + Web.config Designer diff --git a/MP-MON/Views/Home/_checkIOB.cshtml b/MP-MON/Views/Home/_checkIOB.cshtml new file mode 100644 index 00000000..58425636 --- /dev/null +++ b/MP-MON/Views/Home/_checkIOB.cshtml @@ -0,0 +1,31 @@ +@model IEnumerable + +
+

@ViewBag.EsitoVerifica

+
+ +
+ + + + + + + + + + @foreach (var item in Model) + { + // calcolo durata... + TimeSpan TC = TimeSpan.FromMinutes((double)item.TCAssegnato); + // converto a stringa! + string TCAssegnato = TC.ToString(@"mm\:ss"); + + + + + + + } +
MacchinaArticoloStatoTC
@Html.DisplayFor(modelItem => item.CodMacchina)@Html.DisplayFor(modelItem => item.CodArticolo)@Html.DisplayFor(modelItem => item.DescrizioneStato)@TCAssegnato
+
diff --git a/MP-MON/Views/Shared/_checkIOB.cshtml b/MP-MON/Views/Shared/_checkIOB.cshtml deleted file mode 100644 index 8539b852..00000000 --- a/MP-MON/Views/Shared/_checkIOB.cshtml +++ /dev/null @@ -1,4 +0,0 @@ - -
-

@ViewBag.EsitoVerifica

-
diff --git a/MP-MON/Web.config b/MP-MON/Web.config index 258cf9c7..d6346cde 100644 --- a/MP-MON/Web.config +++ b/MP-MON/Web.config @@ -20,8 +20,11 @@ - - + + + + +