Files
NKC/NKC_WF/site/DBG_QRCode_Unload.aspx.cs
T
2020-01-27 19:58:06 +01:00

103 lines
2.3 KiB
C#

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>
/// Batch corrente...
/// </summary>
public int BatchId
{
set
{
hfBatchID.Value = value.ToString();
}
get
{
int answ = 0;
int.TryParse(hfBatchID.Value, out answ);
return answ;
}
}/// <summary>
/// Sheet 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();
//!!!FIXME!!! fare calcolo del VERO batch corrente...
BatchId = 242; // fixed x test!
SheetID = 770;
// 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;
}
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;
}
}
}