fix logo cliente + fix gest MON + macc
This commit is contained in:
+127
-101
@@ -9,112 +9,138 @@ using System.Web.Mvc;
|
||||
|
||||
namespace MP_MON.Controllers
|
||||
{
|
||||
public class MSEController : Controller
|
||||
{
|
||||
DataLayer DataLayerObj = new DataLayer();
|
||||
private MapoMonEntities db = new MapoMonEntities();
|
||||
public class MSEController : Controller
|
||||
{
|
||||
#region Private Fields
|
||||
|
||||
// GET: StatusMap
|
||||
public ActionResult StatusMap(string baseCss)
|
||||
{
|
||||
memLayer.ML.setSessionVal("IdxMacchina", "***ALL***");
|
||||
return SingleStatus(baseCss, "***ALL***");
|
||||
}
|
||||
private DataLayer DataLayerObj = new DataLayer();
|
||||
private MapoMonEntities db = new MapoMonEntities();
|
||||
|
||||
/// <summary>
|
||||
/// Output MSE in formato string/json
|
||||
/// </summary>
|
||||
public string getData(string id)
|
||||
{
|
||||
int dataRefresh = 2000;
|
||||
string answ = "";
|
||||
answ = DataLayerObj.currMSE;
|
||||
if (!string.IsNullOrEmpty(answ))
|
||||
{
|
||||
List<MappaStatoExpl> dati = getDbSaveRedis(dataRefresh);
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
// GET: StatusMap
|
||||
public ActionResult SingleStatus(string baseCss, string IdxMacchina)
|
||||
{
|
||||
int dataRefresh = 2000;
|
||||
// salvo idxMacc in sessione se c'è...
|
||||
if (!string.IsNullOrEmpty(IdxMacchina))
|
||||
{
|
||||
memLayer.ML.setSessionVal("IdxMacchina", IdxMacchina);
|
||||
}
|
||||
else
|
||||
{
|
||||
IdxMacchina = memLayer.ML.StringSessionObj("IdxMacchina");
|
||||
}
|
||||
try
|
||||
{
|
||||
dataRefresh = Convert.ToInt32(System.Web.Configuration.WebConfigurationManager.AppSettings["dataRefreshMs"]);
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
List<MappaStatoExpl> dati = new List<MappaStatoExpl>();
|
||||
string currMse = DataLayerObj.currMSE;
|
||||
if (!string.IsNullOrEmpty(currMse))
|
||||
{
|
||||
try
|
||||
#endregion Private Fields
|
||||
|
||||
#region Private Methods
|
||||
|
||||
/// <summary>
|
||||
/// Restituisce dati da DB (e li salva su REDIS...)
|
||||
/// </summary>
|
||||
/// <param name="dataRefresh">Parametro x procedura ricalcolo MSE</param>
|
||||
private List<MappaStatoExpl> getDbSaveRedis(int dataRefresh)
|
||||
{
|
||||
dati = JsonConvert.DeserializeObject<List<MappaStatoExpl>>(currMse);
|
||||
List<MappaStatoExpl> dati = new List<MappaStatoExpl>();
|
||||
// se non c'è rileggo...
|
||||
logger.lg.scriviLog("Recuperata MSE da DB");
|
||||
dati = db.stp_MSE_getData(dataRefresh).ToList();
|
||||
// serializzo
|
||||
DataLayerObj.currMSE = JsonConvert.SerializeObject(dati);
|
||||
return dati;
|
||||
}
|
||||
catch (Exception exc)
|
||||
|
||||
#endregion Private Methods
|
||||
|
||||
#region Protected Methods
|
||||
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
dati = getDbSaveRedis(dataRefresh);
|
||||
logger.lg.scriviLog(string.Format("Recuperata MSE da DB{0}{1}", Environment.NewLine, exc));
|
||||
if (disposing)
|
||||
{
|
||||
db.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
dati = getDbSaveRedis(dataRefresh);
|
||||
}
|
||||
// filtro dati SOLO PER la macchina che mi interessa... SE C'E'...
|
||||
string reqView = "_StatusMap";
|
||||
if (IdxMacchina != "***ALL***")
|
||||
{
|
||||
dati = dati.Where(e => e.IdxMacchina == IdxMacchina).ToList();
|
||||
reqView = "_StatusMapSingle";
|
||||
}
|
||||
ViewBag.baseCss = baseCss;
|
||||
ViewBag.IdxMacchina = IdxMacchina;
|
||||
// aggiungo il controllo del NUM MAX col x singola riga
|
||||
int maxCol = 6;
|
||||
try
|
||||
{
|
||||
maxCol = memLayer.ML.cdvi("MON_maxCol");
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
ViewBag.maxCol = maxCol;
|
||||
return PartialView(reqView, dati);
|
||||
}
|
||||
/// <summary>
|
||||
/// Restituisce dati da DB (e li salva su REDIS...)
|
||||
/// </summary>
|
||||
/// <param name="dataRefresh">Parametro x procedura ricalcolo MSE</param>
|
||||
private List<MappaStatoExpl> getDbSaveRedis(int dataRefresh)
|
||||
{
|
||||
List<MappaStatoExpl> dati = new List<MappaStatoExpl>();
|
||||
// se non c'è rileggo...
|
||||
logger.lg.scriviLog("Recuperata MSE da DB");
|
||||
dati = db.stp_MSE_getData(dataRefresh).ToList();
|
||||
// serializzo
|
||||
DataLayerObj.currMSE = JsonConvert.SerializeObject(dati);
|
||||
return dati;
|
||||
}
|
||||
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing)
|
||||
{
|
||||
db.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
#endregion Protected Methods
|
||||
|
||||
}
|
||||
}
|
||||
#region Public Methods
|
||||
|
||||
/// <summary>
|
||||
/// Output MSE in formato string/json
|
||||
/// </summary>
|
||||
public string getData(string id)
|
||||
{
|
||||
int dataRefresh = 2000;
|
||||
string answ = "";
|
||||
answ = DataLayerObj.currMSE;
|
||||
if (!string.IsNullOrEmpty(answ))
|
||||
{
|
||||
List<MappaStatoExpl> dati = getDbSaveRedis(dataRefresh);
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
|
||||
// GET: StatusMap
|
||||
public ActionResult SingleStatus(string baseCss, string IdxMacchina)
|
||||
{
|
||||
int dataRefresh = 2000;
|
||||
// salvo idxMacc in sessione se c'è...
|
||||
if (!string.IsNullOrEmpty(IdxMacchina))
|
||||
{
|
||||
memLayer.ML.setSessionVal("IdxMacchina", IdxMacchina);
|
||||
}
|
||||
else
|
||||
{
|
||||
IdxMacchina = memLayer.ML.StringSessionObj("IdxMacchina");
|
||||
}
|
||||
try
|
||||
{
|
||||
dataRefresh = Convert.ToInt32(System.Web.Configuration.WebConfigurationManager.AppSettings["dataRefreshMs"]);
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
List<MappaStatoExpl> dati = new List<MappaStatoExpl>();
|
||||
string currMse = DataLayerObj.currMSE;
|
||||
if (!string.IsNullOrEmpty(currMse))
|
||||
{
|
||||
try
|
||||
{
|
||||
dati = JsonConvert.DeserializeObject<List<MappaStatoExpl>>(currMse);
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
dati = getDbSaveRedis(dataRefresh);
|
||||
logger.lg.scriviLog(string.Format("Recuperata MSE da DB{0}{1}", Environment.NewLine, exc));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
dati = getDbSaveRedis(dataRefresh);
|
||||
}
|
||||
// filtro dati SOLO PER la macchina che mi interessa... SE C'E'...
|
||||
string reqView = "_StatusMap";
|
||||
if (IdxMacchina != "***ALL***")
|
||||
{
|
||||
// se ho elenco macchine idxMacc|idxMacc
|
||||
if (IdxMacchina.IndexOf("|") > 0)
|
||||
{
|
||||
dati = dati.Where(e => IdxMacchina.IndexOf(e.IdxMacchina) >= 0).ToList();
|
||||
reqView = "_StatusMapSingle";
|
||||
}
|
||||
else
|
||||
{
|
||||
dati = dati.Where(e => e.IdxMacchina == IdxMacchina).ToList();
|
||||
reqView = "_StatusMapSingle";
|
||||
}
|
||||
}
|
||||
ViewBag.baseCss = baseCss;
|
||||
ViewBag.IdxMacchina = IdxMacchina;
|
||||
// aggiungo il controllo del NUM MAX col x singola riga
|
||||
int maxCol = 6;
|
||||
try
|
||||
{
|
||||
maxCol = memLayer.ML.cdvi("MON_maxCol");
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
ViewBag.maxCol = maxCol;
|
||||
return PartialView(reqView, dati);
|
||||
}
|
||||
|
||||
// GET: StatusMap
|
||||
public ActionResult StatusMap(string baseCss)
|
||||
{
|
||||
memLayer.ML.setSessionVal("IdxMacchina", "***ALL***");
|
||||
return SingleStatus(baseCss, "***ALL***");
|
||||
}
|
||||
|
||||
#endregion Public Methods
|
||||
}
|
||||
}
|
||||
@@ -389,6 +389,7 @@
|
||||
<LastGenOutput>MapoModel.Designer.cs</LastGenOutput>
|
||||
</EntityDeploy>
|
||||
<Content Include="images\LogoMapo.png" />
|
||||
<Content Include="images\logoSteamware.png" />
|
||||
<Content Include="Models\MapoModel.edmx.diagram">
|
||||
<DependentUpon>MapoModel.edmx</DependentUpon>
|
||||
</Content>
|
||||
@@ -532,7 +533,7 @@
|
||||
<Content Include="Scripts\umd\popper.js" />
|
||||
<Content Include="Scripts\umd\popper.min.js" />
|
||||
<Content Include="Scripts\_references.js" />
|
||||
<Content Include="images\logoSteamware.png" />
|
||||
<Content Include="images\logoCliente.png" />
|
||||
<Content Include="Web.config">
|
||||
<SubType>Designer</SubType>
|
||||
</Content>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
@model IEnumerable<MP_MON.Models.MappaStatoExpl>
|
||||
|
||||
<div class="row statusMap mx-2 mt-3 mb-1">
|
||||
<div class="row statusMap mx-1 my-1">
|
||||
|
||||
@{
|
||||
// salvo variabili num blocchi x riga
|
||||
@@ -123,7 +123,7 @@
|
||||
// controllo se ho resto zero --> uso NUOVA riga...
|
||||
if ((numBlock % maxCol) == maxCol - 1)
|
||||
{
|
||||
@Html.Raw("</div><div class=\"row statusMap mx-2 my-1\">");
|
||||
@Html.Raw("</div><div class=\"row statusMap mx-1 my-1\">");
|
||||
}
|
||||
// incremento contatore
|
||||
numBlock++;
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
<body>
|
||||
<nav class="navbar fixed-top navbar-expand-sm px-2 py-0 m-0 mb-1 mb-xl-5">
|
||||
<a href="@Url.Action("", "Home")" class="navbar-brand m-0 pr-4" style="vertical-align: bottom; text-align: left; font-size: 1em;">
|
||||
<img class="logoImg" src="~/images/logoMapo.png" style="margin-top: -10px;" />
|
||||
<img class="logoImg img-fluid" src="~/images/logoMapo.png" />
|
||||
</a>
|
||||
<button class="navbar-toggler navbar-dark" type="button" data-toggle="collapse" data-target="#navbarTogglerDemo01" aria-controls="navbarTogglerDemo01" aria-expanded="false" aria-label="Toggle navigation">
|
||||
<span class="navbar-toggler-icon"></span>
|
||||
@@ -21,14 +21,16 @@
|
||||
<li class="nav-item active">
|
||||
<span class="mainHead"><b><span style="color: #DEDEDE;">MP MON</span>itor</b></span>
|
||||
</li>
|
||||
<li>
|
||||
</li>
|
||||
</ul>
|
||||
<div class="px-2">
|
||||
<div id="divClock text-right">
|
||||
@{Html.RenderPartial("_mmClock");}
|
||||
</div>
|
||||
<div class="fontSmall text-right">
|
||||
@Request.UserHostAddress | v: @typeof(MP_MON.MvcApplication).Assembly.GetName().Version
|
||||
</div>
|
||||
</div>
|
||||
<div class="px-2">
|
||||
<img class="logoImg img-fluid" src="~/images/logoCliente.png" />
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
|
||||
@@ -15,7 +15,12 @@
|
||||
</script>
|
||||
|
||||
<div class="d-flex justify-content-start pl-3 text-left">
|
||||
<span style="color: #DEDEDE;">MP MON</span>itor
|
||||
<div class="px-2 align-bottom">
|
||||
<span style="color: #DEDEDE;">MP MON</span>itor
|
||||
</div>
|
||||
<div class="px-2 small ml-3 align-bottom">
|
||||
<sub>v: @typeof(MP_MON.MvcApplication).Assembly.GetName().Version | addr: @Request.UserHostAddress</sub>
|
||||
</div>
|
||||
</div>
|
||||
<div class="d-flex justify-content-center text-center">
|
||||
<sub><span id="windowSize"></span></sub>
|
||||
|
||||
@@ -1,2 +1 @@
|
||||
|
||||
@DateTime.Now.ToLongDateString(), @DateTime.Now.ToShortTimeString()
|
||||
@DateTime.Now.ToLongDateString(), @DateTime.Now.ToShortTimeString()
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 22 KiB |
Reference in New Issue
Block a user