Files
MoonPro.net/MP-IO/enabled.aspx.cs
T
2016-11-11 18:13:50 +01:00

69 lines
2.0 KiB
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using SteamWare;
using MapoDb;
namespace MP_IO
{
public partial class enabled : System.Web.UI.Page
{
/// <summary>
/// caricamento pagina
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void Page_Load(object sender, EventArgs e)
{
// legge i get x processare la seriale
int idxMacchina = 0;
bool enabled = false;
string answ = "";
try
{
idxMacchina = Convert.ToInt32(Request.QueryString["idxMacchina"]);
}
catch
{
idxMacchina = 0;
}
if (idxMacchina != 0)
{
try
{
enabled = MapoDb.MapoDb.obj.insEnabled(idxMacchina);
if (enabled)
{
answ = "OK";
}
else
{
answ = "NO";
}
}
catch (Exception exc)
{
if (memLayer.ML.confReadInt("_logLevel") > 5)
{
string errore = string.Format("Errore: {0}{1}", Environment.NewLine, exc);
logger.lg.scriviLog(errore, tipoLog.EXCEPTION);
answ = errore;
}
}
}
else
{
string errore = "Errore: parametri macchina vuoti";
logger.lg.scriviLog(errore, tipoLog.ERROR);
answ = errore;
}
// ripulisco pagina restituita e tolgo html (solo codice ok/NO)
Response.Clear();
Response.Write(answ);
Context.Response.End();
}
}
}