using AppData; using SteamWare; using System; using System.Web.UI; namespace NKC_WF.site { public partial class DBG_QRCode_Unload : BasePage { string machine ="WRK001"; protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { doUpdate(); } } /// /// BatchId corrente... /// public int BatchId { set { hfBatchID.Value = value.ToString(); } get { int answ = 0; int.TryParse(hfBatchID.Value, out answ); return answ; } } /// /// SheetId corrente... /// public int SheetId { set { hfSheetID.Value = value.ToString(); } get { int answ = 0; int.TryParse(hfSheetID.Value, out answ); return answ; } } /// /// restituisce URL immagine QRCode /// /// public string getLoginUrl() { string baseUrl = $"{memLayer.ML.CRS("matrixUrl")}/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; } } /// /// Aggiorna componente principale e child components /// 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; } /// /// Imposta dati correnti (Bunk / Sheet) /// 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, machine); 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(); } } }