109 lines
4.2 KiB
C#
109 lines
4.2 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Web;
|
|
using System.Web.UI;
|
|
using System.Web.UI.WebControls;
|
|
using SteamWare;
|
|
using GMW_data;
|
|
|
|
namespace GMW_Term.WebUserControls
|
|
{
|
|
public partial class mod_processPackList : System.Web.UI.UserControl
|
|
{
|
|
/// <summary>
|
|
/// wrapper traduzione termini
|
|
/// </summary>
|
|
/// <param name="lemma"></param>
|
|
/// <returns></returns>
|
|
public string traduci(string lemma)
|
|
{
|
|
return user_std.UtSn.Traduci(lemma);
|
|
}
|
|
protected void Page_Load(object sender, EventArgs e)
|
|
{
|
|
// eseguo solo se ha un utente...
|
|
if (!string.IsNullOrEmpty(user_std.UtSn.utente))
|
|
{
|
|
updatePackListStatus();
|
|
}
|
|
}
|
|
/// <summary>
|
|
/// aggiorna lo stato della packing list corrente
|
|
/// </summary>
|
|
private void updatePackListStatus()
|
|
{
|
|
// recupero barcode e controllo sia valido
|
|
string barcode = memLayer.ML.StringSessionObj("UDC_sel");
|
|
bool barcodeOk = MagClass.magazzino.checkUDC(barcode);
|
|
bool udcConsumabile = MagClass.magazzino.IdxPosizioneUdc(barcode) > 0;
|
|
bool udcPrelevabile = (MagClass.magazzino.taRigheListePrelievo.getPrelevateByUdc(barcode).Rows.Count == 0);
|
|
// se ho un UDC
|
|
if (barcode != "")
|
|
{
|
|
if (udcConsumabile || !memLayer.ML.CRB("checkUdcConsLdp"))
|
|
{
|
|
if (udcPrelevabile)
|
|
{
|
|
if (barcodeOk)
|
|
{
|
|
// controllo se barcode è ok x LDP corrente...
|
|
if (MagClass.magazzino.verificaDatiUdc(MagClass.magazzino.codListaAttivaUtente, barcode))
|
|
{
|
|
MagClass.magazzino.confermaUdcPrelevatoPerLista(MagClass.magazzino.codListaAttivaUtente, barcode);
|
|
lblErrore.Visible = false;
|
|
}
|
|
else
|
|
{
|
|
// salvo errore
|
|
lblErrore.Visible = true;
|
|
lblErrore.Text = traduci("BarcodeNonValidoLDP");
|
|
}
|
|
resetMemoriaBarcode();
|
|
}
|
|
}
|
|
else
|
|
{
|
|
// indico barcode già caricato
|
|
lblErrore.Visible = true;
|
|
lblErrore.Text = string.Format("{0}: {1}", barcode, traduci("udcGiaPrelevato"));
|
|
resetMemoriaBarcode();
|
|
}
|
|
}
|
|
else
|
|
{
|
|
// indico UDC consumato
|
|
lblErrore.Visible = true;
|
|
lblErrore.Text = string.Format("{0}: {1}", barcode, traduci("udcGiaConsumato"));
|
|
resetMemoriaBarcode();
|
|
}
|
|
}
|
|
//update visualizzazione
|
|
lblListaAttiva.Text = traduci("ListaPrel");
|
|
hlListaAttiva.Text = traduci("noListActive");
|
|
lblDest.Text = "";
|
|
lblProd.Text = "";
|
|
lblPezzi.Text = "";
|
|
try
|
|
{
|
|
// leggo una riga...
|
|
DS_magazzino.ElencoListePrelievoRow riga = MagClass.magazzino.taElencoListePrelievo.getByCodLista(MagClass.magazzino.codListaAttivaUtente)[0];
|
|
lblDest.Text = riga.Destinatario;
|
|
lblProd.Text = riga.Particolare;
|
|
lblPezzi.Text = string.Format("<b>{0:###}</b>/{1:###} pz", riga.Prelevato, riga.QtaTot);
|
|
hlListaAttiva.Text = MagClass.magazzino.codListaAttivaUtente;
|
|
}
|
|
catch
|
|
{ }
|
|
}
|
|
|
|
private static void resetMemoriaBarcode()
|
|
{
|
|
// svuoto barcode selezionato ed eventuale UDC
|
|
//memLayer.ML.emptySessionVal("UDC_sel");
|
|
GMW_data.TermClass.Ter.resetScanBarcode(true, false, false);
|
|
memLayer.ML.emptySessionVal("Barcode_sel");
|
|
memLayer.ML.emptySessionVal("scannedValue");
|
|
}
|
|
}
|
|
} |