semplificati metodi visualizzazione SVG

This commit is contained in:
Samuele E. Locatelli
2020-01-26 11:11:14 +01:00
parent 16cb7f97f8
commit 3caba4ab6c
4 changed files with 13 additions and 70 deletions
@@ -22,6 +22,5 @@
</script>
<svg width="1200" height="600" xmlns='http://www.w3.org/2000/svg' runat="server" id="svgTable">
</svg>
<asp:HiddenField ID="hfBatchID" runat="server" />
<asp:HiddenField ID="hfSheetId" runat="server" Value="0" />
<asp:HiddenField ID="hfFilename" runat="server" Value="" />
@@ -12,24 +12,6 @@ namespace NKC_WF.WebUserControls
{
public partial class cmp_MU_svgViewer : System.Web.UI.UserControl
{
/// <summary>
/// Batch corrente...
/// </summary>
public int BatchId
{
set
{
hfBatchID.Value = value.ToString();
calcSheet();
doUpdate();
}
get
{
int answ = 0;
int.TryParse(hfBatchID.Value, out answ);
return answ;
}
}
/// <summary>
/// Foglio corrente...
/// </summary>
@@ -61,53 +43,12 @@ namespace NKC_WF.WebUserControls
hfFilename.Value = value;
}
}
protected void calcSheet()
{
// base path
string baseOrig = memLayer.ML.CRS("drawBaseBath").ToLower();
string baseCurr = memLayer.ML.CRS("srvDrawBaseBath").ToLower();
//SOLO SE ho batch != 0...
if (BatchId > 0)
{
// FORSE 5/5?!?
var sheetList = DataLayer.man.taSHL.getByMLStatus(BatchId, 3, 5);
if (sheetList.Count > 0)
{
SheetId = sheetList[0].SheetID;
#if false
filename = sheetList[0].DrawFilePath.ToLower().Replace(baseOrig, baseCurr);
// NON DOVREBEB SERVIRE MAP se è già share di rete... anche se è su MEDESIMA macchina
//filename = Server.MapPath(filename);
#endif
}
}
#if false
else if (SheetId > 0)
{
filename = DataLayer.man.taSHL.getByItemID(SheetId)[0].DrawFilePath.ToLower().Replace(baseOrig, baseCurr);
}
#endif
}
public void doUpdate()
{
// recupero ID del foglio corrente
string answ = "";
try
{
#if false
// FORSE 5/5?!?
var sheetList = DataLayer.man.taSHL.getByMLStatus(BatchId, 3, 5);
if (sheetList.Count > 0)
{
SheetId = sheetList[0].SheetID;
// lo leggo da file
string baseOrig = memLayer.ML.CRS("drawBaseBath").ToLower();
string baseCurr = memLayer.ML.CRS("srvDrawBaseBath").ToLower();
filename = sheetList[0].DrawFilePath.ToLower().Replace(baseOrig, baseCurr);
// NON DOVREBEB SERVIRE MAP se è già share di rete... anche se è su MEDESIMA macchina
//filename = Server.MapPath(filename);
}
#endif
string baseOrig = memLayer.ML.CRS("drawBaseBath").ToLower();
string baseCurr = memLayer.ML.CRS("srvDrawBaseBath").ToLower();
var tabSheets = DataLayer.man.taSHL.getBySheetId(SheetId);
@@ -23,15 +23,6 @@ namespace NKC_WF.WebUserControls
/// </remarks>
protected global::System.Web.UI.HtmlControls.HtmlGenericControl svgTable;
/// <summary>
/// Controllo hfBatchID.
/// </summary>
/// <remarks>
/// Campo generato automaticamente.
/// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
/// </remarks>
protected global::System.Web.UI.WebControls.HiddenField hfBatchID;
/// <summary>
/// Controllo hfSheetId.
/// </summary>
+13 -1
View File
@@ -38,9 +38,21 @@ namespace NKC_WF
BatchId = 242; // fixed x test!
// aggiorno child
cmp_MU_stats.BatchId = BatchId;
cmp_MU_svgViewer.BatchId = BatchId;
cmp_MU_bins.BatchId = BatchId;
cmp_MU_carts.BatchId = BatchId;
// calcolo sheet x SVG viewer...
int SheetId = 0;
//SOLO SE ho batch != 0...
if (BatchId > 0)
{
// FORSE 5/5?!?
var sheetList = DataLayer.man.taSHL.getByMLStatus(BatchId, 3, 5);
if (sheetList.Count > 0)
{
SheetId = sheetList[0].SheetID;
}
}
cmp_MU_svgViewer.SheetId = SheetId;
}
}
}