601b3937f9
timerCss timerStatus timerUnload
134 lines
3.7 KiB
C#
134 lines
3.7 KiB
C#
using AppData;
|
|
using NKC_SDK;
|
|
using SteamWare;
|
|
using System;
|
|
using System.IO;
|
|
using System.Web.UI;
|
|
|
|
namespace NKC_WF.WebUserControls
|
|
{
|
|
public partial class cmp_MU_svgViewer : BaseUserControl
|
|
{
|
|
/// <summary>
|
|
/// BatchId corrente...
|
|
/// </summary>
|
|
public int BatchId
|
|
{
|
|
set
|
|
{
|
|
if (hfBatchId.Value != value.ToString())
|
|
{
|
|
hfBatchId.Value = value.ToString();
|
|
}
|
|
}
|
|
get
|
|
{
|
|
int answ = 0;
|
|
int.TryParse(hfBatchId.Value, out answ);
|
|
return answ;
|
|
}
|
|
}
|
|
/// <summary>
|
|
/// Foglio corrente...
|
|
/// </summary>
|
|
public int SheetId
|
|
{
|
|
set
|
|
{
|
|
if (hfSheetId.Value != value.ToString())
|
|
{
|
|
hfSheetId.Value = value.ToString();
|
|
doUpdate();
|
|
}
|
|
}
|
|
get
|
|
{
|
|
int answ = 0;
|
|
int.TryParse(hfSheetId.Value, out answ);
|
|
return answ;
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// Timer rilettura css in ms...
|
|
/// </summary>
|
|
public int TimerCss
|
|
{
|
|
set
|
|
{
|
|
if (hfTimerCss.Value != value.ToString())
|
|
{
|
|
hfTimerCss.Value = value.ToString();
|
|
}
|
|
}
|
|
get
|
|
{
|
|
int answ = 0;
|
|
int.TryParse(hfTimerCss.Value, out answ);
|
|
return answ;
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// Percorso file calcolato
|
|
/// </summary>
|
|
public string filename
|
|
{
|
|
get
|
|
{
|
|
return hfFilename.Value;
|
|
}
|
|
set
|
|
{
|
|
hfFilename.Value = value;
|
|
}
|
|
}
|
|
public void doUpdate()
|
|
{
|
|
// recupero ID del foglio corrente
|
|
string answ = "";
|
|
string baseOrig = memLayer.ML.CRS("nestBasePath").ToLower();
|
|
string baseCurr = memLayer.ML.CRS("servBasePath").ToLower();
|
|
try
|
|
{
|
|
var tabSheets = DLMan.taSHL.getBySheetId(SheetId, "");
|
|
if (tabSheets.Count > 0)
|
|
{
|
|
filename = tabSheets[0].DrawFilePath.ToLower().Replace(baseOrig, baseCurr);
|
|
if (memLayer.ML.CRB("userVirtDir"))
|
|
{
|
|
filename = Server.MapPath(filename);
|
|
}
|
|
answ = File.ReadAllText(filename);
|
|
}
|
|
}
|
|
catch
|
|
{ }
|
|
if (string.IsNullOrEmpty(answ))
|
|
{
|
|
// loggo...
|
|
Log.Instance.Info($"SVG not found | filename: {filename} | baseOrig: {baseOrig} | baseCurr: {baseCurr} | used default SVG");
|
|
// leggo SVG DI DEFAULT che indica NON PRESENTE...
|
|
filename = Server.MapPath("~/Images/NoData.svg");
|
|
answ = File.ReadAllText(filename);
|
|
}
|
|
// update componente svg!
|
|
svgTable.InnerHtml = answ;
|
|
}
|
|
protected void Page_Load(object sender, EventArgs e)
|
|
{
|
|
if (!Page.IsPostBack)
|
|
{
|
|
// scrivo valore revisione batch!
|
|
hfCurrBunkRev.Value = ComLib.getSheetRevByBunk(BatchId).ToString();
|
|
fixTimer();
|
|
}
|
|
}
|
|
|
|
private void fixTimer()
|
|
{
|
|
int timerCss = memLayer.ML.CRI("timerCss");
|
|
TimerCss = timerCss > 0 ? timerCss : 500;
|
|
}
|
|
}
|
|
} |