Files
NKC/NKC_WF/site/DBG_QRCode_Unload.aspx.cs
T
Samuele E. Locatelli 5dbb91e7c4 Update test download
2020-01-30 12:50:41 +01:00

124 lines
2.8 KiB
C#

using AppData;
using SteamWare;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace NKC_WF.site
{
public partial class DBG_QRCode_Unload : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
doUpdate();
}
}
/// <summary>
/// BatchId corrente...
/// </summary>
public int BatchId
{
set
{
hfBatchID.Value = value.ToString();
}
get
{
int answ = 0;
int.TryParse(hfBatchID.Value, out answ);
return answ;
}
}/// <summary>
/// SheetId corrente...
/// </summary>
public int SheetId
{
set
{
hfSheetID.Value = value.ToString();
}
get
{
int answ = 0;
int.TryParse(hfSheetID.Value, out answ);
return answ;
}
}
/// <summary>
/// restituisce URL immagine QRCode
/// </summary>
/// <returns></returns>
public string getLoginUrl()
{
string baseUrl = "https://qrcode.steamware.net/HOME/QR_site/JSON?val=";
string payload = "{'baseUrl':'{0}','parameters':['" + memLayer.ML.CRS("BaseUrl") + "']}";
string answ = $"{baseUrl}{payload}";
return answ;
}
protected int qrSize
{
get
{
int answ = 32;
int.TryParse(ddlQrSize.SelectedValue, out answ);
return answ;
}
}
/// <summary>
/// Aggiorna componente principale e child components
/// </summary>
private void doUpdate()
{
imgQrLogin.ImageUrl = getLoginUrl();
updateSize();
setCurrData();
// aggiorno child
cmp_MU_bins.ShowQr = true;
cmp_MU_bins.BatchId = BatchId;
cmp_MU_carts.ShowQr = true;
cmp_MU_carts.BatchId = BatchId;
cmp_MU_Items.ShowQr = true;
cmp_MU_Items.SheetID = SheetId;
}
/// <summary>
/// Imposta dati correnti (Bunk / Sheet)
/// </summary>
private void setCurrData()
{
// recupero bunk corrente...
DS_App.StackListRow currBunk = ComLib.getCurrBunk();
if (currBunk != null)
{
BatchId = currBunk.BatchID;
DS_App.SheetListRow currSheet = ComLib.getCurrSheet(BatchId);
if (currSheet != null)
{
SheetId = currSheet.SheetID;
}
}
}
protected void ddlQrSize_SelectedIndexChanged(object sender, EventArgs e)
{
updateSize();
}
private void updateSize()
{
imgQrLogin.Height = qrSize * 2;
cmp_MU_bins.qrSize = qrSize;
cmp_MU_carts.qrSize = qrSize;
cmp_MU_Items.qrSize = qrSize;
}
protected void timerRefresh_Tick(object sender, EventArgs e)
{
doUpdate();
}
}
}