using SteamWare; using System; namespace NKC_WF.WebUserControls { public partial class cmp_MU_Items : System.Web.UI.UserControl { /// /// Sheet corrente... /// public int SheetID { set { hfSheetID.Value = value.ToString(); doUpdate(); } get { int answ = 0; int.TryParse(hfSheetID.Value, out answ); return answ; } } /// /// Indica se mostrare o meno QRCode /// public bool ShowQr { set { hfShowQr.Value = value.ToString(); } get { bool answ = false; bool.TryParse(hfShowQr.Value, out answ); return answ; } } /// /// restituisce URL immagine QRCode /// /// /// public string getImgUrl(object currId) { string baseUrl = $"{memLayer.ML.CRS("matrixUrl")}/HOME/QR_site/JSON?val="; string payload = "{'baseUrl':'{0}','parameters':['" + currId.ToString() + "']}"; string answ = $"{baseUrl}{payload}"; return answ; } protected void Page_Load(object sender, EventArgs e) { } public void doUpdate() { grView.DataBind(); } /// /// Dimensione QRCode /// public int qrSize { get { int answ = 32; int.TryParse(hfQrSize.Value, out answ); return answ; } set { hfQrSize.Value = value.ToString(); doUpdate(); } } /// /// Calcola css da statusID /// /// /// public string cssByStatus(object _statusID) { string answ = "text-secondary"; int statusID = 0; int.TryParse(_statusID.ToString(), out statusID); switch (statusID) { case 1: answ = "text-dark"; break; case 2: answ = "text-warning"; break; case 3: answ = "text-success"; break; case 4: answ = "text-info"; break; default: answ = "text-danger"; break; } return answ; } } }