using AppData; using NKC_SDK; using SteamWare; using System; namespace NKC_WF.WebUserControls { public partial class cmp_MU_carts : BaseUserControl { /// /// Batch corrente... /// public int BatchId { set { hfBatchID.Value = value.ToString(); doUpdate(); } get { int answ = 0; int.TryParse(hfBatchID.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; } } /// /// Dimensione QRCode /// public int qrSize { get { int answ = 32; int.TryParse(hfQrSize.Value, out answ); return answ; } set { hfQrSize.Value = value.ToString(); doUpdate(); } } /// /// Indica se mostrare o meno button PRINT /// public bool ShowPrint { set { hfShowPrint.Value = value.ToString(); } get { bool answ = false; bool.TryParse(hfShowPrint.Value, out answ); return answ; } } /// /// CartId selezionato /// public int selCartId { get { int answ = 0; int.TryParse(grView.SelectedValue.ToString(), out answ); return answ; } } /// /// Queue selezionata /// public string currQueue { get { return hfPrintQueue.Value; } set { hfPrintQueue.Value = value; } } protected void Page_Load(object sender, EventArgs e) { if(!Page.IsPostBack) { currQueue= DLMan.getPrinter("PC-MACHINE-UNLOAD"); } } public void doUpdate() { grView.DataBind(); } /// /// Alla selezione mando in stampa il singolo record /// /// /// protected void grView_SelectedIndexChanged(object sender, EventArgs e) { // invio SINGOLO record in stampa DLMan.stampaDoc(selCartId.ToString(), currQueue, tipoDocumento.docCart, Request.UserHostName); // reset doReset(); } /// /// comando reset /// /// /// protected void lbtPrintAll_Click(object sender, EventArgs e) { // chiamo stored x stampare OGNI cart del BATCH var tabCarts = DLMan.taCR.getByBatch(BatchId); try { if (tabCarts != null && tabCarts.Count > 0) { foreach (var item in tabCarts) { // invio SINGOLO record in stampa DLMan.stampaDoc(item.CartID.ToString(), currQueue, tipoDocumento.docCart, Request.UserHostName); } } } catch { } // reset doReset(); } private void doReset() { // resetto grView.SelectedIndex = -1; grView.DataBind(); } } }