71 lines
1.7 KiB
C#
71 lines
1.7 KiB
C#
using MP_MON.Models;
|
|
using SteamWare;
|
|
using System.Web.Configuration;
|
|
using System.Web.Mvc;
|
|
|
|
namespace MP_MON.Controllers
|
|
{
|
|
public class MachineController : Controller
|
|
{
|
|
private MapoMonEntities db = new MapoMonEntities();
|
|
/// <summary>
|
|
/// Restituisce una view per SINGOLA macchina
|
|
/// </summary>
|
|
/// <param name="id"></param>
|
|
/// <returns></returns>
|
|
public ActionResult Index(string id)
|
|
{
|
|
// ricarico ogni minuto COMUNQUE tutto...
|
|
string pageRefreshSec = "60";
|
|
// refresh std ogni sec
|
|
int pageRefreshMs = 1000;
|
|
ViewBag.cssSemBase = "sem";
|
|
try
|
|
{
|
|
pageRefreshSec = memLayer.ML.CRS("pageRefreshSec");
|
|
}
|
|
catch
|
|
{ }
|
|
if (pageRefreshSec == "")
|
|
{
|
|
pageRefreshSec = "60";
|
|
}
|
|
|
|
ViewBag.pageRefreshMs = pageRefreshMs;
|
|
Response.AddHeader("Refresh", pageRefreshSec);
|
|
return View();
|
|
}
|
|
/// <summary>
|
|
/// Restituisce una view per SINGOLA macchina
|
|
/// </summary>
|
|
/// <param name="id"></param>
|
|
/// <returns></returns>
|
|
public ActionResult Status(string id)
|
|
{
|
|
// ricarico ogni minuto COMUNQUE tutto...
|
|
string pageRefreshSec = "60";
|
|
// refresh std ogni sec
|
|
int pageRefreshMs = 1000;
|
|
ViewBag.cssSemBase = "sem";
|
|
ViewBag.IdxMacchina = id;
|
|
try
|
|
{
|
|
pageRefreshSec = memLayer.ML.CRS("pageRefreshSec");
|
|
}
|
|
catch
|
|
{ }
|
|
if (pageRefreshSec == "")
|
|
{
|
|
pageRefreshSec = "60";
|
|
}
|
|
|
|
ViewBag.pageRefreshMs = pageRefreshMs;
|
|
Response.AddHeader("Refresh", pageRefreshSec);
|
|
return View();
|
|
}
|
|
public ActionResult GetClock()
|
|
{
|
|
return PartialView("_mmClock");
|
|
}
|
|
}
|
|
} |