Fix classi gestione Datamatrix.mgr x evitare singleton che si pianta...
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -11,6 +11,10 @@ namespace GMW.WebUserControls
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public partial class mod_PostFin_DT : GMW_data.UserControlBCodeMan
|
public partial class mod_PostFin_DT : GMW_data.UserControlBCodeMan
|
||||||
{
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Oggetto locale gestione classe datamatrix...
|
||||||
|
/// </summary>
|
||||||
|
protected DataMatrix DataMatrix_mgr = new DataMatrix();
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Imposta variabili specifiche classe
|
/// Imposta variabili specifiche classe
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -219,7 +223,7 @@ namespace GMW.WebUserControls
|
|||||||
bool answ = false;
|
bool answ = false;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
answ = DataMatrix.mgr.taDtx2UDC.getByAL(AL).Rows.Count > 0;
|
answ = DataMatrix_mgr.taDtx2UDC.getByAL(AL).Rows.Count > 0;
|
||||||
}
|
}
|
||||||
catch
|
catch
|
||||||
{ }
|
{ }
|
||||||
@@ -341,7 +345,7 @@ namespace GMW.WebUserControls
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
// verifico UDC in ingresso NON abbia DTX associati
|
// verifico UDC in ingresso NON abbia DTX associati
|
||||||
int numDtx = DataMatrix.mgr.taDtx2UDC.getByUDC(barcodeIn).Count;
|
int numDtx = DataMatrix_mgr.taDtx2UDC.getByUDC(barcodeIn).Count;
|
||||||
if (numDtx > 0 && cartUDC.CodStato == statoUDC_pre)
|
if (numDtx > 0 && cartUDC.CodStato == statoUDC_pre)
|
||||||
{
|
{
|
||||||
Postazione.warningText = traduci("ERR-UDC-DTX-002");
|
Postazione.warningText = traduci("ERR-UDC-DTX-002");
|
||||||
@@ -508,7 +512,7 @@ namespace GMW.WebUserControls
|
|||||||
bool isOk = false;
|
bool isOk = false;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
isOk = DataMatrix.mgr.taVerifica.GetData(barcodeIn)[0].StatoDtx == "OK";
|
isOk = DataMatrix_mgr.taVerifica.GetData(barcodeIn)[0].StatoDtx == "OK";
|
||||||
}
|
}
|
||||||
catch
|
catch
|
||||||
{ }
|
{ }
|
||||||
@@ -530,7 +534,7 @@ namespace GMW.WebUserControls
|
|||||||
bool dtxInDestAL = false;
|
bool dtxInDestAL = false;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
dtxFree = DataMatrix.mgr.taDtx2UDC.getByDtx(barcodeIn).Count == 0;
|
dtxFree = DataMatrix_mgr.taDtx2UDC.getByDtx(barcodeIn).Count == 0;
|
||||||
}
|
}
|
||||||
catch(Exception exc)
|
catch(Exception exc)
|
||||||
{
|
{
|
||||||
@@ -539,7 +543,7 @@ namespace GMW.WebUserControls
|
|||||||
}
|
}
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
dtxInDestAL = DataMatrix.mgr.taDtx2UDC.getByDtxAl(destAL, barcodeIn).Rows.Count == 1;
|
dtxInDestAL = DataMatrix_mgr.taDtx2UDC.getByDtxAl(destAL, barcodeIn).Rows.Count == 1;
|
||||||
}
|
}
|
||||||
catch (Exception exc)
|
catch (Exception exc)
|
||||||
{
|
{
|
||||||
@@ -562,7 +566,7 @@ namespace GMW.WebUserControls
|
|||||||
string partDtx = "";
|
string partDtx = "";
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
partDtx = DataMatrix.mgr.taDtxAcq.getByKey(barcodeIn)[0].Particolare;
|
partDtx = DataMatrix_mgr.taDtxAcq.getByKey(barcodeIn)[0].Particolare;
|
||||||
}
|
}
|
||||||
catch (Exception exc)
|
catch (Exception exc)
|
||||||
{
|
{
|
||||||
@@ -680,7 +684,7 @@ namespace GMW.WebUserControls
|
|||||||
if (chkDtxMode.Checked)
|
if (chkDtxMode.Checked)
|
||||||
{
|
{
|
||||||
// verifico che sia nell'AL DEST x poter rimuovere...
|
// verifico che sia nell'AL DEST x poter rimuovere...
|
||||||
if (DataMatrix.mgr.taDtx2UDC.getByDtxAl(destAL, barcodeIn).Rows.Count != 1)
|
if (DataMatrix_mgr.taDtx2UDC.getByDtxAl(destAL, barcodeIn).Rows.Count != 1)
|
||||||
{
|
{
|
||||||
Postazione.warningText = traduci("ERR-DTX-018");
|
Postazione.warningText = traduci("ERR-DTX-018");
|
||||||
Postazione.CssClass = cssAtt;
|
Postazione.CssClass = cssAtt;
|
||||||
@@ -688,7 +692,7 @@ namespace GMW.WebUserControls
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
// elimino associazione DTX e UDC dest...
|
// elimino associazione DTX e UDC dest...
|
||||||
DataMatrix.mgr.taDtx2UDC.deleteQuery(udcDest, barcodeIn, MagClass.magazzino.CodSoggCurrUser, IdxPosizioneOut, Postazione.currIdxCella);
|
DataMatrix_mgr.taDtx2UDC.deleteQuery(udcDest, barcodeIn, MagClass.magazzino.CodSoggCurrUser, IdxPosizioneOut, Postazione.currIdxCella);
|
||||||
fatto = true;
|
fatto = true;
|
||||||
Postazione.messaggiText += " " + traduci("DtxRem");
|
Postazione.messaggiText += " " + traduci("DtxRem");
|
||||||
Postazione.warningText = "";
|
Postazione.warningText = "";
|
||||||
@@ -706,7 +710,7 @@ namespace GMW.WebUserControls
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
// verifico che NON sia nell'AL DEST x poter aggiungere...
|
// verifico che NON sia nell'AL DEST x poter aggiungere...
|
||||||
if (DataMatrix.mgr.taDtx2UDC.getByDtxAl(destAL, barcodeIn).Rows.Count == 1)
|
if (DataMatrix_mgr.taDtx2UDC.getByDtxAl(destAL, barcodeIn).Rows.Count == 1)
|
||||||
{
|
{
|
||||||
Postazione.warningText = traduci("ERR-DTX-006");
|
Postazione.warningText = traduci("ERR-DTX-006");
|
||||||
Postazione.CssClass = cssAtt;
|
Postazione.CssClass = cssAtt;
|
||||||
@@ -714,7 +718,7 @@ namespace GMW.WebUserControls
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
// se lo trovo chiamo procedura di spostamento Dtx tra UDC sorgente --> dest (con eventuale creazione dest)
|
// se lo trovo chiamo procedura di spostamento Dtx tra UDC sorgente --> dest (con eventuale creazione dest)
|
||||||
DataMatrix.mgr.taDtx2UDC.UpdateUDC(udcDest, barcodeIn, statoUDC, DateTime.Now, MagClass.magazzino.CodSoggCurrUser, false, false);
|
DataMatrix_mgr.taDtx2UDC.UpdateUDC(udcDest, barcodeIn, statoUDC, DateTime.Now, MagClass.magazzino.CodSoggCurrUser, false, false);
|
||||||
// fix messaggi
|
// fix messaggi
|
||||||
Postazione.messaggiText += " " + traduci("ConfermatoDtx");
|
Postazione.messaggiText += " " + traduci("ConfermatoDtx");
|
||||||
Postazione.warningText = "";
|
Postazione.warningText = "";
|
||||||
@@ -883,7 +887,7 @@ namespace GMW.WebUserControls
|
|||||||
bool answ = false;
|
bool answ = false;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
answ = DataMatrix.mgr.taDtx2UDC.getByAL(AL).Rows.Count == 0;
|
answ = DataMatrix_mgr.taDtx2UDC.getByAL(AL).Rows.Count == 0;
|
||||||
}
|
}
|
||||||
catch { }
|
catch { }
|
||||||
return answ;
|
return answ;
|
||||||
|
|||||||
+1144
-1140
File diff suppressed because it is too large
Load Diff
@@ -9,6 +9,10 @@ namespace GMW.WebUserControls
|
|||||||
{
|
{
|
||||||
public partial class mod_PostRX_DT : System.Web.UI.UserControl
|
public partial class mod_PostRX_DT : System.Web.UI.UserControl
|
||||||
{
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Oggetto locale gestione classe datamatrix...
|
||||||
|
/// </summary>
|
||||||
|
protected DataMatrix DataMatrix_mgr = new DataMatrix();
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// flusso associato (hard coded) a RX
|
/// flusso associato (hard coded) a RX
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -23,10 +27,6 @@ namespace GMW.WebUserControls
|
|||||||
protected string codEventoUdc = "UDC_RX_DT";
|
protected string codEventoUdc = "UDC_RX_DT";
|
||||||
public event EventHandler eh_reqUpdate;
|
public event EventHandler eh_reqUpdate;
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Oggetto locale gestione classe datamatrix...
|
|
||||||
/// </summary>
|
|
||||||
protected DataMatrix DataMatrix_mgr = new DataMatrix();
|
|
||||||
/// <summary>
|
|
||||||
/// stringa UID univoca
|
/// stringa UID univoca
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string uid
|
public string uid
|
||||||
|
|||||||
@@ -5,356 +5,360 @@ using System.Web.UI;
|
|||||||
|
|
||||||
namespace GMW.WebUserControls
|
namespace GMW.WebUserControls
|
||||||
{
|
{
|
||||||
public partial class mod_PostTT_Pre_DT : System.Web.UI.UserControl
|
public partial class mod_PostTT_Pre_DT : System.Web.UI.UserControl
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Oggetto locale gestione classe datamatrix...
|
||||||
|
/// </summary>
|
||||||
|
protected DataMatrix DataMatrix_mgr = new DataMatrix();
|
||||||
|
/// <summary>
|
||||||
|
/// evento richiesta update
|
||||||
|
/// </summary>
|
||||||
|
public event EventHandler eh_reqUpdate;
|
||||||
|
/// <summary>
|
||||||
|
/// flusso associato (hard coded) a RX
|
||||||
|
/// </summary>
|
||||||
|
protected string flusso = "RX";
|
||||||
|
/// <summary>
|
||||||
|
/// stato associato (hard coded) a Controllato RX
|
||||||
|
/// </summary>
|
||||||
|
protected string statoUDC = "ContrRx";
|
||||||
|
/// <summary>
|
||||||
|
/// codice evento dell'UDC che si crea
|
||||||
|
/// </summary>
|
||||||
|
protected string codEventoUdc = "UDC_RX_TT_DT";
|
||||||
|
/// <summary>
|
||||||
|
/// Tipo AL accettabile (RX = R)
|
||||||
|
/// </summary>
|
||||||
|
protected string codTipoAL = "R";
|
||||||
|
/// <summary>
|
||||||
|
/// stringa UID univoca
|
||||||
|
/// </summary>
|
||||||
|
public string uid
|
||||||
{
|
{
|
||||||
/// <summary>
|
get
|
||||||
/// evento richiesta update
|
{
|
||||||
/// </summary>
|
return this.UniqueID.Replace("$", "_").Replace("-", "_");
|
||||||
public event EventHandler eh_reqUpdate;
|
}
|
||||||
/// <summary>
|
|
||||||
/// flusso associato (hard coded) a RX
|
|
||||||
/// </summary>
|
|
||||||
protected string flusso = "RX";
|
|
||||||
/// <summary>
|
|
||||||
/// stato associato (hard coded) a Controllato RX
|
|
||||||
/// </summary>
|
|
||||||
protected string statoUDC = "ContrRx";
|
|
||||||
/// <summary>
|
|
||||||
/// codice evento dell'UDC che si crea
|
|
||||||
/// </summary>
|
|
||||||
protected string codEventoUdc = "UDC_RX_TT_DT";
|
|
||||||
/// <summary>
|
|
||||||
/// Tipo AL accettabile (RX = R)
|
|
||||||
/// </summary>
|
|
||||||
protected string codTipoAL = "R";
|
|
||||||
/// <summary>
|
|
||||||
/// stringa UID univoca
|
|
||||||
/// </summary>
|
|
||||||
public string uid
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return this.UniqueID.Replace("$", "_").Replace("-", "_");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
/// <summary>
|
|
||||||
/// Codice AL target
|
|
||||||
/// </summary>
|
|
||||||
protected string destAL
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return lblAL.Text.Trim();
|
|
||||||
}
|
|
||||||
set
|
|
||||||
{
|
|
||||||
lblAL.Text = value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
/// <summary>
|
|
||||||
/// Codice UDC sorgente
|
|
||||||
/// </summary>
|
|
||||||
protected string sourceUDC
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return lblUdc.Text.Trim();
|
|
||||||
}
|
|
||||||
set
|
|
||||||
{
|
|
||||||
lblUdc.Text = value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
/// <summary>
|
|
||||||
/// Codice AL sorgente
|
|
||||||
/// </summary>
|
|
||||||
protected string sourceAL
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return lblAlFrom.Text.Trim();
|
|
||||||
}
|
|
||||||
set
|
|
||||||
{
|
|
||||||
lblAlFrom.Text = value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
/// <summary>
|
|
||||||
/// caricamento pagina
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="sender"></param>
|
|
||||||
/// <param name="e"></param>
|
|
||||||
protected void Page_Load(object sender, EventArgs e)
|
|
||||||
{
|
|
||||||
if (!Page.IsPostBack)
|
|
||||||
{
|
|
||||||
sourceAL = "";
|
|
||||||
sourceUDC = "";
|
|
||||||
destAL = "";
|
|
||||||
Postazione.messaggiText = "";
|
|
||||||
Postazione.warningText = "";
|
|
||||||
}
|
|
||||||
checkBarcode();
|
|
||||||
}
|
|
||||||
/// <summary>
|
|
||||||
/// resetta AL destinazione ed AL/UDC sorgente
|
|
||||||
/// </summary>
|
|
||||||
public void resetSourceDestAL()
|
|
||||||
{
|
|
||||||
sourceAL = "";
|
|
||||||
sourceUDC = "";
|
|
||||||
destAL = "";
|
|
||||||
}
|
|
||||||
/// <summary>
|
|
||||||
/// wrapper traduzione
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="lemma"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
public string traduci(object lemma)
|
|
||||||
{
|
|
||||||
return user_std.UtSn.Traduci(lemma.ToString());
|
|
||||||
}
|
|
||||||
/// <summary>
|
|
||||||
/// valore barcode
|
|
||||||
/// </summary>
|
|
||||||
public string barcodeIn
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return txtBarcode.Text.Trim();
|
|
||||||
}
|
|
||||||
set
|
|
||||||
{
|
|
||||||
txtBarcode.Text = value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
/// <summary>
|
|
||||||
/// controlla se ci sia un barcode
|
|
||||||
/// </summary>
|
|
||||||
private void checkBarcode()
|
|
||||||
{
|
|
||||||
if (barcodeIn != "")
|
|
||||||
{
|
|
||||||
Postazione.messaggiText = string.Format("{0}: {1}", traduci("BCodeIns"), barcodeIn);
|
|
||||||
switch (MagClass.tipoBCode_L5(barcodeIn))
|
|
||||||
{
|
|
||||||
case tipoCodiceBarcode.AL:
|
|
||||||
// verifico codice AL sia coerente: ACCETTO SOLO ALR...
|
|
||||||
if (checkAL(barcodeIn))
|
|
||||||
{
|
|
||||||
// verifico se è accettabile (DTX)
|
|
||||||
if (DataMatrix.mgr.taDtx2UDC.getByAL(barcodeIn).Rows.Count > 0)
|
|
||||||
{
|
|
||||||
// imposto AL corrente...
|
|
||||||
destAL = barcodeIn;
|
|
||||||
Postazione.CssClass = "stileAttesa";
|
|
||||||
Postazione.warningText = "";
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
Postazione.warningText = traduci("ErrAL_NoDtx");
|
|
||||||
Postazione.CssClass = "stileComandoKo";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case tipoCodiceBarcode.UDC:
|
|
||||||
// verifico se è accettabile (DTX)
|
|
||||||
if (DataMatrix.mgr.taDtx2UDC.getByUDC(barcodeIn).Rows.Count > 0)
|
|
||||||
{
|
|
||||||
// imposto UDC corrente...
|
|
||||||
sourceUDC = barcodeIn;
|
|
||||||
string newAL = MagClass.magazzino.taAL2UDC.getByUDC(barcodeIn)[0].AL;
|
|
||||||
// verifico codice AL sia coerente: ACCETTO SOLO ALR...
|
|
||||||
if (checkAL(newAL))
|
|
||||||
{
|
|
||||||
// imposto AL sorgente
|
|
||||||
sourceAL = newAL;
|
|
||||||
//sourceAL = MagClass.magazzino.taAL2UDC.getByUDC(barcodeIn)[0].AL;
|
|
||||||
Postazione.CssClass = "stileAttesa";
|
|
||||||
Postazione.warningText = "";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
Postazione.warningText = traduci("ErrUDC_NoDtx");
|
|
||||||
Postazione.CssClass = "stileComandoKo";
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case tipoCodiceBarcode.Comando:
|
|
||||||
// se è reset cancello tutto!
|
|
||||||
if (barcodeIn == memLayer.ML.cdv("cmdReset"))
|
|
||||||
{
|
|
||||||
sourceUDC = "";
|
|
||||||
destAL = "";
|
|
||||||
Postazione.messaggiText = "";
|
|
||||||
Postazione.warningText = "";
|
|
||||||
doUpdate();
|
|
||||||
}
|
|
||||||
Postazione.CssClass = "stileAttesa";
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
Postazione.messaggiText = "";
|
|
||||||
Postazione.warningText = traduci("ERR-UNK-001");
|
|
||||||
Postazione.CssClass = "stileComandoND";
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
barcodeIn = "";
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
Postazione.messaggiText = traduci("AttesaBCode");
|
|
||||||
Postazione.CssClass = "stileAttesa";
|
|
||||||
|
|
||||||
}
|
|
||||||
doUpdate();
|
|
||||||
}
|
|
||||||
/// <summary>
|
|
||||||
/// Verifica l'AL se sia ok x procedere:
|
|
||||||
/// - Tipo "R"
|
|
||||||
/// - Attivo
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="AL">The al.</param>
|
|
||||||
/// <returns></returns>
|
|
||||||
protected bool checkAL(string AL)
|
|
||||||
{
|
|
||||||
bool answ = false;
|
|
||||||
// verifico codice AL sia coerente: ACCETTO SOLO ALR...
|
|
||||||
if (AL.StartsWith("AL" + codTipoAL))
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
answ = MagClass.magazzino.taEA.getByAL_TipoAttivo(AL, codTipoAL).Rows.Count > 0;
|
|
||||||
}
|
|
||||||
catch
|
|
||||||
{ }
|
|
||||||
if (!answ)
|
|
||||||
{
|
|
||||||
Postazione.warningText = traduci("ErroreAlNonRxAttivo");
|
|
||||||
Postazione.CssClass = "stileComandoKo";
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
Postazione.warningText = "";
|
|
||||||
Postazione.CssClass = "stileComandoOk";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
Postazione.warningText = traduci("ErrAL_TipoErrato");
|
|
||||||
Postazione.CssClass = "stileComandoKo";
|
|
||||||
}
|
|
||||||
return answ;
|
|
||||||
}
|
|
||||||
/// <summary>
|
|
||||||
/// aggiorna componenti + focus a barcode
|
|
||||||
/// </summary>
|
|
||||||
public void doUpdate()
|
|
||||||
{
|
|
||||||
grViewDest.DataBind();
|
|
||||||
grViewSource.DataBind();
|
|
||||||
updateBtns();
|
|
||||||
// raise dell'evento
|
|
||||||
if (eh_reqUpdate != null)
|
|
||||||
{
|
|
||||||
eh_reqUpdate(this, new EventArgs());
|
|
||||||
}
|
|
||||||
txtBarcode.Focus();
|
|
||||||
}
|
|
||||||
/// <summary>
|
|
||||||
/// fix visibilità btnMove
|
|
||||||
/// </summary>
|
|
||||||
private void updateBtns()
|
|
||||||
{
|
|
||||||
bool btnVis = false;
|
|
||||||
// se ho source e dest mostro travasa...
|
|
||||||
if (destAL != "" && sourceAL != "")
|
|
||||||
{
|
|
||||||
DS_magazzino.V_statoCelleCapienzaAssegnatiRow riga;
|
|
||||||
int capienza = 6; // hard coded...
|
|
||||||
try
|
|
||||||
{
|
|
||||||
riga = MagClass.magazzino.taStatoCelle.getByIdxCella(Postazione.currIdxCella)[0];
|
|
||||||
capienza = riga.Capienza;
|
|
||||||
}
|
|
||||||
catch
|
|
||||||
{
|
|
||||||
capienza = 6; // hard coded...
|
|
||||||
}
|
|
||||||
// se ho somma UDC < (capienza) tra AL sorgente e destinazione
|
|
||||||
if (MagClass.magazzino.taAnagPart.getDistinctByAlSourceDest(sourceAL, destAL).Rows.Count < capienza)
|
|
||||||
{
|
|
||||||
btnVis = true;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
Postazione.warningText = traduci("ErrAlPieno");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
divTravasa.Visible = btnVis;
|
|
||||||
divStampa.Visible = btnVis;
|
|
||||||
}
|
|
||||||
/// <summary>
|
|
||||||
/// sposto la qta richiesta, eventualmente creando nuovo UDC
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="sender"></param>
|
|
||||||
/// <param name="e"></param>
|
|
||||||
protected void lbtMove_Click(object sender, EventArgs e)
|
|
||||||
{
|
|
||||||
MagClass.magazzino.travasoAL(sourceAL, destAL, Postazione.IP);
|
|
||||||
Postazione.warningText = "";
|
|
||||||
Postazione.messaggiText = string.Format("{0} AL {1} --> AL {2}", traduci("Spostato"), sourceAL, destAL);
|
|
||||||
doUpdate();
|
|
||||||
}
|
|
||||||
/// <summary>
|
|
||||||
/// richiesta (ri)stampa UDC
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="sender"></param>
|
|
||||||
/// <param name="e"></param>
|
|
||||||
public void ristampa()
|
|
||||||
{
|
|
||||||
MagClass.magazzino.stampaAL(udcReq, Postazione.printer, Request.UserHostName);
|
|
||||||
// registro ri-stampa UDC
|
|
||||||
MagClass.magazzino.taSAO.insertQuery(DateTime.Now, MagClass.magazzino.CodSoggCurrUser, Postazione.name, Postazione.IP, udcReq, "", "stampaAL", "Ri-Stampato AL Rx DT in post PRE TT");
|
|
||||||
Postazione.CssClass = "stileAttesa";
|
|
||||||
}
|
|
||||||
/// <summary>
|
|
||||||
/// udc da stampare
|
|
||||||
/// </summary>
|
|
||||||
protected string udcReq
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return memLayer.ML.StringSessionObj("udcSelSAO");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
/// <summary>
|
|
||||||
/// (ri)stampa AL
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="sender"></param>
|
|
||||||
/// <param name="e"></param>
|
|
||||||
protected void lbtStampaAL_Click(object sender, EventArgs e)
|
|
||||||
{
|
|
||||||
// verifico postazione sia valida...
|
|
||||||
if (Postazione.name != "" && Postazione.IP != "" && Postazione.currCodCella != "")
|
|
||||||
{
|
|
||||||
// lancio stampa
|
|
||||||
MagClass.magazzino.stampaAL(destAL, Postazione.printer, Request.UserHostName);
|
|
||||||
Postazione.CssClass = "stileAttesa";
|
|
||||||
Postazione.warningText = "";
|
|
||||||
Postazione.messaggiText = traduci("cartAlStampato");
|
|
||||||
sourceUDC = "";
|
|
||||||
sourceAL = "";
|
|
||||||
destAL = "";
|
|
||||||
doUpdate();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
// ricarico che mi manca postazione!
|
|
||||||
Postazione.CssClass = "stileAttesa";
|
|
||||||
Postazione.warningText = traduci("ERR-POS-001");
|
|
||||||
Postazione.messaggiText = "";
|
|
||||||
Response.Redirect(user_std.pagCorrente);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// Codice AL target
|
||||||
|
/// </summary>
|
||||||
|
protected string destAL
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return lblAL.Text.Trim();
|
||||||
|
}
|
||||||
|
set
|
||||||
|
{
|
||||||
|
lblAL.Text = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// Codice UDC sorgente
|
||||||
|
/// </summary>
|
||||||
|
protected string sourceUDC
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return lblUdc.Text.Trim();
|
||||||
|
}
|
||||||
|
set
|
||||||
|
{
|
||||||
|
lblUdc.Text = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// Codice AL sorgente
|
||||||
|
/// </summary>
|
||||||
|
protected string sourceAL
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return lblAlFrom.Text.Trim();
|
||||||
|
}
|
||||||
|
set
|
||||||
|
{
|
||||||
|
lblAlFrom.Text = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// caricamento pagina
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="sender"></param>
|
||||||
|
/// <param name="e"></param>
|
||||||
|
protected void Page_Load(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
if (!Page.IsPostBack)
|
||||||
|
{
|
||||||
|
sourceAL = "";
|
||||||
|
sourceUDC = "";
|
||||||
|
destAL = "";
|
||||||
|
Postazione.messaggiText = "";
|
||||||
|
Postazione.warningText = "";
|
||||||
|
}
|
||||||
|
checkBarcode();
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// resetta AL destinazione ed AL/UDC sorgente
|
||||||
|
/// </summary>
|
||||||
|
public void resetSourceDestAL()
|
||||||
|
{
|
||||||
|
sourceAL = "";
|
||||||
|
sourceUDC = "";
|
||||||
|
destAL = "";
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// wrapper traduzione
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="lemma"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public string traduci(object lemma)
|
||||||
|
{
|
||||||
|
return user_std.UtSn.Traduci(lemma.ToString());
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// valore barcode
|
||||||
|
/// </summary>
|
||||||
|
public string barcodeIn
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return txtBarcode.Text.Trim();
|
||||||
|
}
|
||||||
|
set
|
||||||
|
{
|
||||||
|
txtBarcode.Text = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// controlla se ci sia un barcode
|
||||||
|
/// </summary>
|
||||||
|
private void checkBarcode()
|
||||||
|
{
|
||||||
|
if (barcodeIn != "")
|
||||||
|
{
|
||||||
|
Postazione.messaggiText = string.Format("{0}: {1}", traduci("BCodeIns"), barcodeIn);
|
||||||
|
switch (MagClass.tipoBCode_L5(barcodeIn))
|
||||||
|
{
|
||||||
|
case tipoCodiceBarcode.AL:
|
||||||
|
// verifico codice AL sia coerente: ACCETTO SOLO ALR...
|
||||||
|
if (checkAL(barcodeIn))
|
||||||
|
{
|
||||||
|
// verifico se è accettabile (DTX)
|
||||||
|
if (DataMatrix_mgr.taDtx2UDC.getByAL(barcodeIn).Rows.Count > 0)
|
||||||
|
{
|
||||||
|
// imposto AL corrente...
|
||||||
|
destAL = barcodeIn;
|
||||||
|
Postazione.CssClass = "stileAttesa";
|
||||||
|
Postazione.warningText = "";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Postazione.warningText = traduci("ErrAL_NoDtx");
|
||||||
|
Postazione.CssClass = "stileComandoKo";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case tipoCodiceBarcode.UDC:
|
||||||
|
// verifico se è accettabile (DTX)
|
||||||
|
if (DataMatrix_mgr.taDtx2UDC.getByUDC(barcodeIn).Rows.Count > 0)
|
||||||
|
{
|
||||||
|
// imposto UDC corrente...
|
||||||
|
sourceUDC = barcodeIn;
|
||||||
|
string newAL = MagClass.magazzino.taAL2UDC.getByUDC(barcodeIn)[0].AL;
|
||||||
|
// verifico codice AL sia coerente: ACCETTO SOLO ALR...
|
||||||
|
if (checkAL(newAL))
|
||||||
|
{
|
||||||
|
// imposto AL sorgente
|
||||||
|
sourceAL = newAL;
|
||||||
|
//sourceAL = MagClass.magazzino.taAL2UDC.getByUDC(barcodeIn)[0].AL;
|
||||||
|
Postazione.CssClass = "stileAttesa";
|
||||||
|
Postazione.warningText = "";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Postazione.warningText = traduci("ErrUDC_NoDtx");
|
||||||
|
Postazione.CssClass = "stileComandoKo";
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case tipoCodiceBarcode.Comando:
|
||||||
|
// se è reset cancello tutto!
|
||||||
|
if (barcodeIn == memLayer.ML.cdv("cmdReset"))
|
||||||
|
{
|
||||||
|
sourceUDC = "";
|
||||||
|
destAL = "";
|
||||||
|
Postazione.messaggiText = "";
|
||||||
|
Postazione.warningText = "";
|
||||||
|
doUpdate();
|
||||||
|
}
|
||||||
|
Postazione.CssClass = "stileAttesa";
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
Postazione.messaggiText = "";
|
||||||
|
Postazione.warningText = traduci("ERR-UNK-001");
|
||||||
|
Postazione.CssClass = "stileComandoND";
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
barcodeIn = "";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Postazione.messaggiText = traduci("AttesaBCode");
|
||||||
|
Postazione.CssClass = "stileAttesa";
|
||||||
|
|
||||||
|
}
|
||||||
|
doUpdate();
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// Verifica l'AL se sia ok x procedere:
|
||||||
|
/// - Tipo "R"
|
||||||
|
/// - Attivo
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="AL">The al.</param>
|
||||||
|
/// <returns></returns>
|
||||||
|
protected bool checkAL(string AL)
|
||||||
|
{
|
||||||
|
bool answ = false;
|
||||||
|
// verifico codice AL sia coerente: ACCETTO SOLO ALR...
|
||||||
|
if (AL.StartsWith("AL" + codTipoAL))
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
answ = MagClass.magazzino.taEA.getByAL_TipoAttivo(AL, codTipoAL).Rows.Count > 0;
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{ }
|
||||||
|
if (!answ)
|
||||||
|
{
|
||||||
|
Postazione.warningText = traduci("ErroreAlNonRxAttivo");
|
||||||
|
Postazione.CssClass = "stileComandoKo";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Postazione.warningText = "";
|
||||||
|
Postazione.CssClass = "stileComandoOk";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Postazione.warningText = traduci("ErrAL_TipoErrato");
|
||||||
|
Postazione.CssClass = "stileComandoKo";
|
||||||
|
}
|
||||||
|
return answ;
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// aggiorna componenti + focus a barcode
|
||||||
|
/// </summary>
|
||||||
|
public void doUpdate()
|
||||||
|
{
|
||||||
|
grViewDest.DataBind();
|
||||||
|
grViewSource.DataBind();
|
||||||
|
updateBtns();
|
||||||
|
// raise dell'evento
|
||||||
|
if (eh_reqUpdate != null)
|
||||||
|
{
|
||||||
|
eh_reqUpdate(this, new EventArgs());
|
||||||
|
}
|
||||||
|
txtBarcode.Focus();
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// fix visibilità btnMove
|
||||||
|
/// </summary>
|
||||||
|
private void updateBtns()
|
||||||
|
{
|
||||||
|
bool btnVis = false;
|
||||||
|
// se ho source e dest mostro travasa...
|
||||||
|
if (destAL != "" && sourceAL != "")
|
||||||
|
{
|
||||||
|
DS_magazzino.V_statoCelleCapienzaAssegnatiRow riga;
|
||||||
|
int capienza = 6; // hard coded...
|
||||||
|
try
|
||||||
|
{
|
||||||
|
riga = MagClass.magazzino.taStatoCelle.getByIdxCella(Postazione.currIdxCella)[0];
|
||||||
|
capienza = riga.Capienza;
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{
|
||||||
|
capienza = 6; // hard coded...
|
||||||
|
}
|
||||||
|
// se ho somma UDC < (capienza) tra AL sorgente e destinazione
|
||||||
|
if (MagClass.magazzino.taAnagPart.getDistinctByAlSourceDest(sourceAL, destAL).Rows.Count < capienza)
|
||||||
|
{
|
||||||
|
btnVis = true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Postazione.warningText = traduci("ErrAlPieno");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
divTravasa.Visible = btnVis;
|
||||||
|
divStampa.Visible = btnVis;
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// sposto la qta richiesta, eventualmente creando nuovo UDC
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="sender"></param>
|
||||||
|
/// <param name="e"></param>
|
||||||
|
protected void lbtMove_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
MagClass.magazzino.travasoAL(sourceAL, destAL, Postazione.IP);
|
||||||
|
Postazione.warningText = "";
|
||||||
|
Postazione.messaggiText = string.Format("{0} AL {1} --> AL {2}", traduci("Spostato"), sourceAL, destAL);
|
||||||
|
doUpdate();
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// richiesta (ri)stampa UDC
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="sender"></param>
|
||||||
|
/// <param name="e"></param>
|
||||||
|
public void ristampa()
|
||||||
|
{
|
||||||
|
MagClass.magazzino.stampaAL(udcReq, Postazione.printer, Request.UserHostName);
|
||||||
|
// registro ri-stampa UDC
|
||||||
|
MagClass.magazzino.taSAO.insertQuery(DateTime.Now, MagClass.magazzino.CodSoggCurrUser, Postazione.name, Postazione.IP, udcReq, "", "stampaAL", "Ri-Stampato AL Rx DT in post PRE TT");
|
||||||
|
Postazione.CssClass = "stileAttesa";
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// udc da stampare
|
||||||
|
/// </summary>
|
||||||
|
protected string udcReq
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return memLayer.ML.StringSessionObj("udcSelSAO");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// (ri)stampa AL
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="sender"></param>
|
||||||
|
/// <param name="e"></param>
|
||||||
|
protected void lbtStampaAL_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
// verifico postazione sia valida...
|
||||||
|
if (Postazione.name != "" && Postazione.IP != "" && Postazione.currCodCella != "")
|
||||||
|
{
|
||||||
|
// lancio stampa
|
||||||
|
MagClass.magazzino.stampaAL(destAL, Postazione.printer, Request.UserHostName);
|
||||||
|
Postazione.CssClass = "stileAttesa";
|
||||||
|
Postazione.warningText = "";
|
||||||
|
Postazione.messaggiText = traduci("cartAlStampato");
|
||||||
|
sourceUDC = "";
|
||||||
|
sourceAL = "";
|
||||||
|
destAL = "";
|
||||||
|
doUpdate();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// ricarico che mi manca postazione!
|
||||||
|
Postazione.CssClass = "stileAttesa";
|
||||||
|
Postazione.warningText = traduci("ERR-POS-001");
|
||||||
|
Postazione.messaggiText = "";
|
||||||
|
Response.Redirect(user_std.pagCorrente);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -5,421 +5,425 @@ using System.Web.UI;
|
|||||||
|
|
||||||
namespace GMW.WebUserControls
|
namespace GMW.WebUserControls
|
||||||
{
|
{
|
||||||
public partial class mod_PostTT_Pre_NT : System.Web.UI.UserControl
|
public partial class mod_PostTT_Pre_NT : System.Web.UI.UserControl
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Oggetto locale gestione classe datamatrix...
|
||||||
|
/// </summary>
|
||||||
|
protected DataMatrix DataMatrix_mgr = new DataMatrix();
|
||||||
|
/// <summary>
|
||||||
|
/// evento richiesta update
|
||||||
|
/// </summary>
|
||||||
|
public event EventHandler eh_reqUpdate;
|
||||||
|
/// <summary>
|
||||||
|
/// flusso associato (hard coded) a RX
|
||||||
|
/// </summary>
|
||||||
|
protected string flusso = "RX";
|
||||||
|
/// <summary>
|
||||||
|
/// stato associato (hard coded) a Controllato RX
|
||||||
|
/// </summary>
|
||||||
|
protected string statoUDC = "ContrRx";
|
||||||
|
/// <summary>
|
||||||
|
/// codice evento dell'UDC che si crea
|
||||||
|
/// </summary>
|
||||||
|
protected string codEventoUdc = "UDC_RX_TT";
|
||||||
|
/// <summary>
|
||||||
|
/// Tipo AL accettabile (RX = R)
|
||||||
|
/// </summary>
|
||||||
|
protected string codTipoAL = "R";
|
||||||
|
/// <summary>
|
||||||
|
/// stringa UID univoca
|
||||||
|
/// </summary>
|
||||||
|
public string uid
|
||||||
{
|
{
|
||||||
/// <summary>
|
get
|
||||||
/// evento richiesta update
|
{
|
||||||
/// </summary>
|
return this.UniqueID.Replace("$", "_").Replace("-", "_");
|
||||||
public event EventHandler eh_reqUpdate;
|
}
|
||||||
/// <summary>
|
|
||||||
/// flusso associato (hard coded) a RX
|
|
||||||
/// </summary>
|
|
||||||
protected string flusso = "RX";
|
|
||||||
/// <summary>
|
|
||||||
/// stato associato (hard coded) a Controllato RX
|
|
||||||
/// </summary>
|
|
||||||
protected string statoUDC = "ContrRx";
|
|
||||||
/// <summary>
|
|
||||||
/// codice evento dell'UDC che si crea
|
|
||||||
/// </summary>
|
|
||||||
protected string codEventoUdc = "UDC_RX_TT";
|
|
||||||
/// <summary>
|
|
||||||
/// Tipo AL accettabile (RX = R)
|
|
||||||
/// </summary>
|
|
||||||
protected string codTipoAL = "R";
|
|
||||||
/// <summary>
|
|
||||||
/// stringa UID univoca
|
|
||||||
/// </summary>
|
|
||||||
public string uid
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return this.UniqueID.Replace("$", "_").Replace("-", "_");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
/// <summary>
|
|
||||||
/// Codice AL target
|
|
||||||
/// </summary>
|
|
||||||
protected string destAL
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return lblAL.Text.Trim();
|
|
||||||
}
|
|
||||||
set
|
|
||||||
{
|
|
||||||
lblAL.Text = value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
/// <summary>
|
|
||||||
/// Codice UDC sorgente
|
|
||||||
/// </summary>
|
|
||||||
protected string sourceUDC
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return lblUdc.Text.Trim();
|
|
||||||
}
|
|
||||||
set
|
|
||||||
{
|
|
||||||
lblUdc.Text = value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
/// <summary>
|
|
||||||
/// indica il codice articolo correntemente selezionato
|
|
||||||
/// </summary>
|
|
||||||
protected string currParticolare
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return memLayer.ML.StringSessionObj(string.Format("currParticolare_{0}", uid));
|
|
||||||
}
|
|
||||||
set
|
|
||||||
{
|
|
||||||
memLayer.ML.setSessionVal(string.Format("currParticolare_{0}", uid), value, memLayer.ML.confReadBool("keepParticolareSel"));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
/// <summary>
|
|
||||||
/// qta pezzi x UDC
|
|
||||||
/// </summary>
|
|
||||||
public int qta
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
int qta = 0;
|
|
||||||
try
|
|
||||||
{
|
|
||||||
qta = Convert.ToInt32(txtQta.Text.Trim());
|
|
||||||
}
|
|
||||||
catch
|
|
||||||
{ }
|
|
||||||
return qta;
|
|
||||||
}
|
|
||||||
set
|
|
||||||
{
|
|
||||||
txtQta.Text = value.ToString();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
/// <summary>
|
|
||||||
/// caricamento pagina
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="sender"></param>
|
|
||||||
/// <param name="e"></param>
|
|
||||||
protected void Page_Load(object sender, EventArgs e)
|
|
||||||
{
|
|
||||||
if (!Page.IsPostBack)
|
|
||||||
{
|
|
||||||
Postazione.messaggiText = "";
|
|
||||||
Postazione.warningText = "";
|
|
||||||
currParticolare = "";
|
|
||||||
}
|
|
||||||
checkBarcode();
|
|
||||||
}
|
|
||||||
/// <summary>
|
|
||||||
/// wrapper traduzione
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="lemma"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
public string traduci(object lemma)
|
|
||||||
{
|
|
||||||
return user_std.UtSn.Traduci(lemma.ToString());
|
|
||||||
}
|
|
||||||
/// <summary>
|
|
||||||
/// valore barcode
|
|
||||||
/// </summary>
|
|
||||||
public string barcodeIn
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return txtBarcode.Text.Trim();
|
|
||||||
}
|
|
||||||
set
|
|
||||||
{
|
|
||||||
txtBarcode.Text = value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
/// <summary>
|
|
||||||
/// controlla se ci sia un barcode
|
|
||||||
/// </summary>
|
|
||||||
private void checkBarcode()
|
|
||||||
{
|
|
||||||
if (barcodeIn != "")
|
|
||||||
{
|
|
||||||
Postazione.messaggiText = string.Format("{0}: {1}", traduci("BCodeIns"), barcodeIn);
|
|
||||||
switch (MagClass.tipoBCode_L5(barcodeIn))
|
|
||||||
{
|
|
||||||
case tipoCodiceBarcode.AL:
|
|
||||||
// verifico codice AL sia coerente: ACCETTO SOLO ALR...
|
|
||||||
if (checkAL(barcodeIn))
|
|
||||||
{
|
|
||||||
// verifico se è accettabile (non DTX)
|
|
||||||
if (DataMatrix.mgr.taDtx2UDC.getByAL(barcodeIn).Rows.Count == 0)
|
|
||||||
{
|
|
||||||
// imposto AL corrente...
|
|
||||||
destAL = barcodeIn;
|
|
||||||
Postazione.CssClass = "stileAttesa";
|
|
||||||
Postazione.warningText = "";
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
Postazione.warningText = traduci("ErrAL_Dtx");
|
|
||||||
Postazione.CssClass = "stileComandoKo";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case tipoCodiceBarcode.UDC:
|
|
||||||
// verifico se è accettabile (non DTX)
|
|
||||||
if (DataMatrix.mgr.taDtx2UDC.getByUDC(barcodeIn).Rows.Count == 0)
|
|
||||||
{
|
|
||||||
// imposto UDC corrente...
|
|
||||||
sourceUDC = barcodeIn;
|
|
||||||
currParticolare = MagClass.magazzino.taCartellini.getByUdc(sourceUDC)[0].Particolare;
|
|
||||||
qta = Convert.ToInt32(DataProxy.obj.taCartellini.stp_getByUdc(barcodeIn)[0].Qta);
|
|
||||||
Postazione.CssClass = "stileAttesa";
|
|
||||||
Postazione.warningText = "";
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
Postazione.warningText = traduci("ErrUDC_Dtx");
|
|
||||||
Postazione.CssClass = "stileComandoKo";
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case tipoCodiceBarcode.Comando:
|
|
||||||
// se è reset cancello tutto!
|
|
||||||
if (barcodeIn == memLayer.ML.cdv("cmdReset"))
|
|
||||||
{
|
|
||||||
sourceUDC = "";
|
|
||||||
destAL = "";
|
|
||||||
Postazione.messaggiText = "";
|
|
||||||
Postazione.warningText = "";
|
|
||||||
doUpdate();
|
|
||||||
}
|
|
||||||
Postazione.CssClass = "stileAttesa";
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
Postazione.messaggiText = "";
|
|
||||||
Postazione.warningText = traduci("ERR-UNK-001");
|
|
||||||
Postazione.CssClass = "stileComandoND";
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
barcodeIn = "";
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
Postazione.messaggiText = traduci("AttesaBCode");
|
|
||||||
Postazione.CssClass = "stileAttesa";
|
|
||||||
}
|
|
||||||
doUpdate();
|
|
||||||
}
|
|
||||||
/// <summary>
|
|
||||||
/// Verifica l'AL se sia ok x procedere:
|
|
||||||
/// - Tipo "R"
|
|
||||||
/// - Attivo
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="AL"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
protected bool checkAL(string AL)
|
|
||||||
{
|
|
||||||
bool answ = false;
|
|
||||||
// verifico codice AL sia coerente: ACCETTO SOLO ALR...
|
|
||||||
if (AL.StartsWith("AL" + codTipoAL))
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
answ = MagClass.magazzino.taEA.getByAL_TipoAttivo(AL, codTipoAL).Rows.Count > 0;
|
|
||||||
}
|
|
||||||
catch
|
|
||||||
{ }
|
|
||||||
if (!answ)
|
|
||||||
{
|
|
||||||
Postazione.warningText = traduci("ErroreAlNonRxAttivo");
|
|
||||||
Postazione.CssClass = "stileComandoKo";
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
Postazione.warningText = "";
|
|
||||||
Postazione.CssClass = "stileComandoOk";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
Postazione.warningText = traduci("ErrAL_TipoErrato");
|
|
||||||
Postazione.CssClass = "stileComandoKo";
|
|
||||||
}
|
|
||||||
return answ;
|
|
||||||
}
|
|
||||||
/// <summary>
|
|
||||||
/// aggiorna componenti + focus a barcode
|
|
||||||
/// </summary>
|
|
||||||
public void doUpdate()
|
|
||||||
{
|
|
||||||
grViewDest.DataBind();
|
|
||||||
grViewSource.DataBind();
|
|
||||||
updateBtns();
|
|
||||||
// raise dell'evento
|
|
||||||
if (eh_reqUpdate != null)
|
|
||||||
{
|
|
||||||
eh_reqUpdate(this, new EventArgs());
|
|
||||||
}
|
|
||||||
txtBarcode.Focus();
|
|
||||||
}
|
|
||||||
/// <summary>
|
|
||||||
/// fix visibilità btnMove
|
|
||||||
/// </summary>
|
|
||||||
private void updateBtns()
|
|
||||||
{
|
|
||||||
bool btnVis = false;
|
|
||||||
// se ho source e dest mostro travasa...
|
|
||||||
if (destAL != "" && sourceUDC != "")
|
|
||||||
{
|
|
||||||
DS_magazzino.V_statoCelleCapienzaAssegnatiRow riga;
|
|
||||||
int capienza = 6; // hard coded...
|
|
||||||
try
|
|
||||||
{
|
|
||||||
riga = MagClass.magazzino.taStatoCelle.getByIdxCella(Postazione.currIdxCella)[0];
|
|
||||||
capienza = riga.Capienza;
|
|
||||||
}
|
|
||||||
catch
|
|
||||||
{
|
|
||||||
capienza = 6; // hard coded...
|
|
||||||
}
|
|
||||||
// se ho particolare già in AL
|
|
||||||
if (MagClass.magazzino.taCartellini.getByParticolareAL(currParticolare, destAL).Rows.Count > 0)
|
|
||||||
{
|
|
||||||
btnVis = true;
|
|
||||||
}
|
|
||||||
// oppure ho < (capienza) UDC/part in AL
|
|
||||||
else if (MagClass.magazzino.taAL2UDC.getByAL(destAL).Rows.Count < capienza)
|
|
||||||
{
|
|
||||||
btnVis = true;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
Postazione.warningText = traduci("ErrAlPieno");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
divTravasa.Visible = btnVis;
|
|
||||||
divStampa.Visible = btnVis;
|
|
||||||
}
|
|
||||||
/// <summary>
|
|
||||||
/// sposto la qta richiesta, eventualmente creando nuovo UDC
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="sender"></param>
|
|
||||||
/// <param name="e"></param>
|
|
||||||
protected void lbtMove_Click(object sender, EventArgs e)
|
|
||||||
{
|
|
||||||
// controlli preliminari
|
|
||||||
if (qta > 0)
|
|
||||||
{
|
|
||||||
string destUDC = checkCreaUDC();
|
|
||||||
// sposta la qta richiesta da UDC sorgente ad UDC dest
|
|
||||||
MagClass.magazzino.travasoQtaUDC(sourceUDC, destUDC, qta, Postazione.IP);
|
|
||||||
Postazione.warningText = "";
|
|
||||||
Postazione.messaggiText = string.Format("{0} {1}", qta, traduci("Spostati"));
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
Postazione.warningText = traduci("ErroreNoQta");
|
|
||||||
Postazione.CssClass = "stileComandoKo";
|
|
||||||
}
|
|
||||||
doUpdate();
|
|
||||||
}
|
|
||||||
/// <summary>
|
|
||||||
/// crea eventualmente UDC per particolare in AL di destinazione e restituisce codice UDC
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="qty"></param>
|
|
||||||
/// <param name="particolare"></param>
|
|
||||||
private string checkCreaUDC()
|
|
||||||
{
|
|
||||||
string udcDest = "";
|
|
||||||
DateTime adesso = DateTime.Now;
|
|
||||||
// verifico se ho già quel particolare tra quelli dell'AL...
|
|
||||||
try
|
|
||||||
{
|
|
||||||
udcDest = MagClass.magazzino.taCartellini.getByParticolareAL(currParticolare, destAL)[0].UDC;
|
|
||||||
}
|
|
||||||
catch
|
|
||||||
{
|
|
||||||
udcDest = "";
|
|
||||||
}
|
|
||||||
if (udcDest == "")
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
// creo nuovo UDC RX... direttamente in posizione definitiva e con un evento differente...
|
|
||||||
udcDest = MagClass.magazzino.creaUdc(flusso, "", currParticolare, "", "", "", "", "", 0, memLayer.ML.cdv("CodImballoRX"), "U", MagClass.magazzino.CodSoggCurrUser, 0, 0, 0, adesso, 0, statoUDC, memLayer.ML.cdvi("IdxPosizioneRX"), "IdxPosizioneRx", codEventoUdc, "", "", adesso.Year, Request.UserHostName);
|
|
||||||
// associo UDC a AL...
|
|
||||||
MagClass.magazzino.taAL2UDC.Insert(destAL, udcDest, adesso, MagClass.magazzino.CodSoggCurrUser);
|
|
||||||
}
|
|
||||||
catch (Exception exc)
|
|
||||||
{
|
|
||||||
logger.lg.scriviLog(string.Format("Errore in creazione UDC temp RX x travaso: {0}{1}", Environment.NewLine, exc));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (udcDest != "")
|
|
||||||
{
|
|
||||||
Postazione.CssClass = "stileAttesa";
|
|
||||||
Postazione.warningText = "";
|
|
||||||
Postazione.messaggiText = traduci("partAdded");
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
Postazione.CssClass = "stileComandoKo";
|
|
||||||
Postazione.warningText = traduci("ErroreUdcDest");
|
|
||||||
}
|
|
||||||
return udcDest;
|
|
||||||
}
|
|
||||||
/// <summary>
|
|
||||||
/// richiesta (ri)stampa UDC
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="sender"></param>
|
|
||||||
/// <param name="e"></param>
|
|
||||||
public void ristampa()
|
|
||||||
{
|
|
||||||
MagClass.magazzino.stampaAL(udcReq, Postazione.printer, Request.UserHostName);
|
|
||||||
// registro ri-stampa UDC
|
|
||||||
MagClass.magazzino.taSAO.insertQuery(DateTime.Now, MagClass.magazzino.CodSoggCurrUser, Postazione.name, Postazione.IP, udcReq, "", "stampaAL", "Ri-Stampato AL Rx NT in post PRE TT");
|
|
||||||
Postazione.CssClass = "stileAttesa";
|
|
||||||
}
|
|
||||||
/// <summary>
|
|
||||||
/// udc da stampare
|
|
||||||
/// </summary>
|
|
||||||
protected string udcReq
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return memLayer.ML.StringSessionObj("udcSelSAO");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
/// <summary>
|
|
||||||
/// (ri)stampa AL
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="sender"></param>
|
|
||||||
/// <param name="e"></param>
|
|
||||||
protected void lbtStampaAL_Click(object sender, EventArgs e)
|
|
||||||
{
|
|
||||||
// verifico postazione sia valida...
|
|
||||||
if (Postazione.name != "" && Postazione.IP != "" && Postazione.currCodCella != "")
|
|
||||||
{
|
|
||||||
// lancio stampa
|
|
||||||
MagClass.magazzino.stampaAL(destAL, Postazione.printer, Request.UserHostName);
|
|
||||||
Postazione.CssClass = "stileAttesa";
|
|
||||||
Postazione.warningText = "";
|
|
||||||
Postazione.messaggiText = traduci("cartAlStampato");
|
|
||||||
// resetto particolare...
|
|
||||||
currParticolare = "";
|
|
||||||
sourceUDC = "";
|
|
||||||
destAL = "";
|
|
||||||
doUpdate();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
// ricarico che mi manca postazione!
|
|
||||||
Postazione.CssClass = "stileAttesa";
|
|
||||||
Postazione.warningText = traduci("ERR-POS-001");
|
|
||||||
Postazione.messaggiText = "";
|
|
||||||
Response.Redirect(user_std.pagCorrente);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// Codice AL target
|
||||||
|
/// </summary>
|
||||||
|
protected string destAL
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return lblAL.Text.Trim();
|
||||||
|
}
|
||||||
|
set
|
||||||
|
{
|
||||||
|
lblAL.Text = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// Codice UDC sorgente
|
||||||
|
/// </summary>
|
||||||
|
protected string sourceUDC
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return lblUdc.Text.Trim();
|
||||||
|
}
|
||||||
|
set
|
||||||
|
{
|
||||||
|
lblUdc.Text = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// indica il codice articolo correntemente selezionato
|
||||||
|
/// </summary>
|
||||||
|
protected string currParticolare
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return memLayer.ML.StringSessionObj(string.Format("currParticolare_{0}", uid));
|
||||||
|
}
|
||||||
|
set
|
||||||
|
{
|
||||||
|
memLayer.ML.setSessionVal(string.Format("currParticolare_{0}", uid), value, memLayer.ML.confReadBool("keepParticolareSel"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// qta pezzi x UDC
|
||||||
|
/// </summary>
|
||||||
|
public int qta
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
int qta = 0;
|
||||||
|
try
|
||||||
|
{
|
||||||
|
qta = Convert.ToInt32(txtQta.Text.Trim());
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{ }
|
||||||
|
return qta;
|
||||||
|
}
|
||||||
|
set
|
||||||
|
{
|
||||||
|
txtQta.Text = value.ToString();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// caricamento pagina
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="sender"></param>
|
||||||
|
/// <param name="e"></param>
|
||||||
|
protected void Page_Load(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
if (!Page.IsPostBack)
|
||||||
|
{
|
||||||
|
Postazione.messaggiText = "";
|
||||||
|
Postazione.warningText = "";
|
||||||
|
currParticolare = "";
|
||||||
|
}
|
||||||
|
checkBarcode();
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// wrapper traduzione
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="lemma"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public string traduci(object lemma)
|
||||||
|
{
|
||||||
|
return user_std.UtSn.Traduci(lemma.ToString());
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// valore barcode
|
||||||
|
/// </summary>
|
||||||
|
public string barcodeIn
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return txtBarcode.Text.Trim();
|
||||||
|
}
|
||||||
|
set
|
||||||
|
{
|
||||||
|
txtBarcode.Text = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// controlla se ci sia un barcode
|
||||||
|
/// </summary>
|
||||||
|
private void checkBarcode()
|
||||||
|
{
|
||||||
|
if (barcodeIn != "")
|
||||||
|
{
|
||||||
|
Postazione.messaggiText = string.Format("{0}: {1}", traduci("BCodeIns"), barcodeIn);
|
||||||
|
switch (MagClass.tipoBCode_L5(barcodeIn))
|
||||||
|
{
|
||||||
|
case tipoCodiceBarcode.AL:
|
||||||
|
// verifico codice AL sia coerente: ACCETTO SOLO ALR...
|
||||||
|
if (checkAL(barcodeIn))
|
||||||
|
{
|
||||||
|
// verifico se è accettabile (non DTX)
|
||||||
|
if (DataMatrix_mgr.taDtx2UDC.getByAL(barcodeIn).Rows.Count == 0)
|
||||||
|
{
|
||||||
|
// imposto AL corrente...
|
||||||
|
destAL = barcodeIn;
|
||||||
|
Postazione.CssClass = "stileAttesa";
|
||||||
|
Postazione.warningText = "";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Postazione.warningText = traduci("ErrAL_Dtx");
|
||||||
|
Postazione.CssClass = "stileComandoKo";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case tipoCodiceBarcode.UDC:
|
||||||
|
// verifico se è accettabile (non DTX)
|
||||||
|
if (DataMatrix_mgr.taDtx2UDC.getByUDC(barcodeIn).Rows.Count == 0)
|
||||||
|
{
|
||||||
|
// imposto UDC corrente...
|
||||||
|
sourceUDC = barcodeIn;
|
||||||
|
currParticolare = MagClass.magazzino.taCartellini.getByUdc(sourceUDC)[0].Particolare;
|
||||||
|
qta = Convert.ToInt32(DataProxy.obj.taCartellini.stp_getByUdc(barcodeIn)[0].Qta);
|
||||||
|
Postazione.CssClass = "stileAttesa";
|
||||||
|
Postazione.warningText = "";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Postazione.warningText = traduci("ErrUDC_Dtx");
|
||||||
|
Postazione.CssClass = "stileComandoKo";
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case tipoCodiceBarcode.Comando:
|
||||||
|
// se è reset cancello tutto!
|
||||||
|
if (barcodeIn == memLayer.ML.cdv("cmdReset"))
|
||||||
|
{
|
||||||
|
sourceUDC = "";
|
||||||
|
destAL = "";
|
||||||
|
Postazione.messaggiText = "";
|
||||||
|
Postazione.warningText = "";
|
||||||
|
doUpdate();
|
||||||
|
}
|
||||||
|
Postazione.CssClass = "stileAttesa";
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
Postazione.messaggiText = "";
|
||||||
|
Postazione.warningText = traduci("ERR-UNK-001");
|
||||||
|
Postazione.CssClass = "stileComandoND";
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
barcodeIn = "";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Postazione.messaggiText = traduci("AttesaBCode");
|
||||||
|
Postazione.CssClass = "stileAttesa";
|
||||||
|
}
|
||||||
|
doUpdate();
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// Verifica l'AL se sia ok x procedere:
|
||||||
|
/// - Tipo "R"
|
||||||
|
/// - Attivo
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="AL"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
protected bool checkAL(string AL)
|
||||||
|
{
|
||||||
|
bool answ = false;
|
||||||
|
// verifico codice AL sia coerente: ACCETTO SOLO ALR...
|
||||||
|
if (AL.StartsWith("AL" + codTipoAL))
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
answ = MagClass.magazzino.taEA.getByAL_TipoAttivo(AL, codTipoAL).Rows.Count > 0;
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{ }
|
||||||
|
if (!answ)
|
||||||
|
{
|
||||||
|
Postazione.warningText = traduci("ErroreAlNonRxAttivo");
|
||||||
|
Postazione.CssClass = "stileComandoKo";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Postazione.warningText = "";
|
||||||
|
Postazione.CssClass = "stileComandoOk";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Postazione.warningText = traduci("ErrAL_TipoErrato");
|
||||||
|
Postazione.CssClass = "stileComandoKo";
|
||||||
|
}
|
||||||
|
return answ;
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// aggiorna componenti + focus a barcode
|
||||||
|
/// </summary>
|
||||||
|
public void doUpdate()
|
||||||
|
{
|
||||||
|
grViewDest.DataBind();
|
||||||
|
grViewSource.DataBind();
|
||||||
|
updateBtns();
|
||||||
|
// raise dell'evento
|
||||||
|
if (eh_reqUpdate != null)
|
||||||
|
{
|
||||||
|
eh_reqUpdate(this, new EventArgs());
|
||||||
|
}
|
||||||
|
txtBarcode.Focus();
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// fix visibilità btnMove
|
||||||
|
/// </summary>
|
||||||
|
private void updateBtns()
|
||||||
|
{
|
||||||
|
bool btnVis = false;
|
||||||
|
// se ho source e dest mostro travasa...
|
||||||
|
if (destAL != "" && sourceUDC != "")
|
||||||
|
{
|
||||||
|
DS_magazzino.V_statoCelleCapienzaAssegnatiRow riga;
|
||||||
|
int capienza = 6; // hard coded...
|
||||||
|
try
|
||||||
|
{
|
||||||
|
riga = MagClass.magazzino.taStatoCelle.getByIdxCella(Postazione.currIdxCella)[0];
|
||||||
|
capienza = riga.Capienza;
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{
|
||||||
|
capienza = 6; // hard coded...
|
||||||
|
}
|
||||||
|
// se ho particolare già in AL
|
||||||
|
if (MagClass.magazzino.taCartellini.getByParticolareAL(currParticolare, destAL).Rows.Count > 0)
|
||||||
|
{
|
||||||
|
btnVis = true;
|
||||||
|
}
|
||||||
|
// oppure ho < (capienza) UDC/part in AL
|
||||||
|
else if (MagClass.magazzino.taAL2UDC.getByAL(destAL).Rows.Count < capienza)
|
||||||
|
{
|
||||||
|
btnVis = true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Postazione.warningText = traduci("ErrAlPieno");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
divTravasa.Visible = btnVis;
|
||||||
|
divStampa.Visible = btnVis;
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// sposto la qta richiesta, eventualmente creando nuovo UDC
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="sender"></param>
|
||||||
|
/// <param name="e"></param>
|
||||||
|
protected void lbtMove_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
// controlli preliminari
|
||||||
|
if (qta > 0)
|
||||||
|
{
|
||||||
|
string destUDC = checkCreaUDC();
|
||||||
|
// sposta la qta richiesta da UDC sorgente ad UDC dest
|
||||||
|
MagClass.magazzino.travasoQtaUDC(sourceUDC, destUDC, qta, Postazione.IP);
|
||||||
|
Postazione.warningText = "";
|
||||||
|
Postazione.messaggiText = string.Format("{0} {1}", qta, traduci("Spostati"));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Postazione.warningText = traduci("ErroreNoQta");
|
||||||
|
Postazione.CssClass = "stileComandoKo";
|
||||||
|
}
|
||||||
|
doUpdate();
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// crea eventualmente UDC per particolare in AL di destinazione e restituisce codice UDC
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="qty"></param>
|
||||||
|
/// <param name="particolare"></param>
|
||||||
|
private string checkCreaUDC()
|
||||||
|
{
|
||||||
|
string udcDest = "";
|
||||||
|
DateTime adesso = DateTime.Now;
|
||||||
|
// verifico se ho già quel particolare tra quelli dell'AL...
|
||||||
|
try
|
||||||
|
{
|
||||||
|
udcDest = MagClass.magazzino.taCartellini.getByParticolareAL(currParticolare, destAL)[0].UDC;
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{
|
||||||
|
udcDest = "";
|
||||||
|
}
|
||||||
|
if (udcDest == "")
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
// creo nuovo UDC RX... direttamente in posizione definitiva e con un evento differente...
|
||||||
|
udcDest = MagClass.magazzino.creaUdc(flusso, "", currParticolare, "", "", "", "", "", 0, memLayer.ML.cdv("CodImballoRX"), "U", MagClass.magazzino.CodSoggCurrUser, 0, 0, 0, adesso, 0, statoUDC, memLayer.ML.cdvi("IdxPosizioneRX"), "IdxPosizioneRx", codEventoUdc, "", "", adesso.Year, Request.UserHostName);
|
||||||
|
// associo UDC a AL...
|
||||||
|
MagClass.magazzino.taAL2UDC.Insert(destAL, udcDest, adesso, MagClass.magazzino.CodSoggCurrUser);
|
||||||
|
}
|
||||||
|
catch (Exception exc)
|
||||||
|
{
|
||||||
|
logger.lg.scriviLog(string.Format("Errore in creazione UDC temp RX x travaso: {0}{1}", Environment.NewLine, exc));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (udcDest != "")
|
||||||
|
{
|
||||||
|
Postazione.CssClass = "stileAttesa";
|
||||||
|
Postazione.warningText = "";
|
||||||
|
Postazione.messaggiText = traduci("partAdded");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Postazione.CssClass = "stileComandoKo";
|
||||||
|
Postazione.warningText = traduci("ErroreUdcDest");
|
||||||
|
}
|
||||||
|
return udcDest;
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// richiesta (ri)stampa UDC
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="sender"></param>
|
||||||
|
/// <param name="e"></param>
|
||||||
|
public void ristampa()
|
||||||
|
{
|
||||||
|
MagClass.magazzino.stampaAL(udcReq, Postazione.printer, Request.UserHostName);
|
||||||
|
// registro ri-stampa UDC
|
||||||
|
MagClass.magazzino.taSAO.insertQuery(DateTime.Now, MagClass.magazzino.CodSoggCurrUser, Postazione.name, Postazione.IP, udcReq, "", "stampaAL", "Ri-Stampato AL Rx NT in post PRE TT");
|
||||||
|
Postazione.CssClass = "stileAttesa";
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// udc da stampare
|
||||||
|
/// </summary>
|
||||||
|
protected string udcReq
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return memLayer.ML.StringSessionObj("udcSelSAO");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// (ri)stampa AL
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="sender"></param>
|
||||||
|
/// <param name="e"></param>
|
||||||
|
protected void lbtStampaAL_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
// verifico postazione sia valida...
|
||||||
|
if (Postazione.name != "" && Postazione.IP != "" && Postazione.currCodCella != "")
|
||||||
|
{
|
||||||
|
// lancio stampa
|
||||||
|
MagClass.magazzino.stampaAL(destAL, Postazione.printer, Request.UserHostName);
|
||||||
|
Postazione.CssClass = "stileAttesa";
|
||||||
|
Postazione.warningText = "";
|
||||||
|
Postazione.messaggiText = traduci("cartAlStampato");
|
||||||
|
// resetto particolare...
|
||||||
|
currParticolare = "";
|
||||||
|
sourceUDC = "";
|
||||||
|
destAL = "";
|
||||||
|
doUpdate();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// ricarico che mi manca postazione!
|
||||||
|
Postazione.CssClass = "stileAttesa";
|
||||||
|
Postazione.warningText = traduci("ERR-POS-001");
|
||||||
|
Postazione.messaggiText = "";
|
||||||
|
Response.Redirect(user_std.pagCorrente);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -4,58 +4,62 @@ using System;
|
|||||||
|
|
||||||
namespace GMW.WebUserControls
|
namespace GMW.WebUserControls
|
||||||
{
|
{
|
||||||
public partial class mod_SearchProvDtx : System.Web.UI.UserControl
|
public partial class mod_SearchProvDtx : System.Web.UI.UserControl
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Oggetto locale gestione classe datamatrix...
|
||||||
|
/// </summary>
|
||||||
|
protected DataMatrix DataMatrix_mgr = new DataMatrix();
|
||||||
|
protected void Page_Load(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
protected void Page_Load(object sender, EventArgs e)
|
doSearch();
|
||||||
{
|
|
||||||
doSearch();
|
|
||||||
}
|
|
||||||
/// <summary>
|
|
||||||
/// wrapper metodo traduzione
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="lemma"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
public string traduci(string lemma)
|
|
||||||
{
|
|
||||||
return user_std.UtSn.Traduci(lemma);
|
|
||||||
}
|
|
||||||
public void doSearch()
|
|
||||||
{
|
|
||||||
lblDtx.Text = dtx_sel;
|
|
||||||
lblPart.Text = part_sel;
|
|
||||||
mod_listDtx1.doUpdate();
|
|
||||||
}
|
|
||||||
/// <summary>
|
|
||||||
/// codice Dtx cercato
|
|
||||||
/// </summary>
|
|
||||||
public string dtx_sel
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
string answ = memLayer.ML.StringSessionObj("FullSearchValue");
|
|
||||||
// cerco se esista il datamatrix cercato... se non trovo ritorno ""
|
|
||||||
if (DataMatrix.mgr.taDtx2UDC.getByDtx(answ).Rows.Count == 0) answ = "";
|
|
||||||
return answ;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
/// <summary>
|
|
||||||
/// particolare associato al datamatrix
|
|
||||||
/// </summary>
|
|
||||||
public string part_sel
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
string answ = "";
|
|
||||||
try
|
|
||||||
{
|
|
||||||
// vers 2.9 modifica per multi-datamatrix
|
|
||||||
answ = DataMatrix.mgr.taDecode.GetData(dtx_sel, "")[0].Particolare;
|
|
||||||
}
|
|
||||||
catch
|
|
||||||
{ }
|
|
||||||
return answ;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// wrapper metodo traduzione
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="lemma"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public string traduci(string lemma)
|
||||||
|
{
|
||||||
|
return user_std.UtSn.Traduci(lemma);
|
||||||
|
}
|
||||||
|
public void doSearch()
|
||||||
|
{
|
||||||
|
lblDtx.Text = dtx_sel;
|
||||||
|
lblPart.Text = part_sel;
|
||||||
|
mod_listDtx1.doUpdate();
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// codice Dtx cercato
|
||||||
|
/// </summary>
|
||||||
|
public string dtx_sel
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
string answ = memLayer.ML.StringSessionObj("FullSearchValue");
|
||||||
|
// cerco se esista il datamatrix cercato... se non trovo ritorno ""
|
||||||
|
if (DataMatrix_mgr.taDtx2UDC.getByDtx(answ).Rows.Count == 0) answ = "";
|
||||||
|
return answ;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// particolare associato al datamatrix
|
||||||
|
/// </summary>
|
||||||
|
public string part_sel
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
string answ = "";
|
||||||
|
try
|
||||||
|
{
|
||||||
|
// vers 2.9 modifica per multi-datamatrix
|
||||||
|
answ = DataMatrix_mgr.taDecode.GetData(dtx_sel, "")[0].Particolare;
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{ }
|
||||||
|
return answ;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -6,179 +6,181 @@ using System.Web.UI.WebControls;
|
|||||||
|
|
||||||
namespace GMW.WebUserControls
|
namespace GMW.WebUserControls
|
||||||
{
|
{
|
||||||
public partial class mod_anagFormatiDtx : ApplicationUserControl
|
public partial class mod_anagFormatiDtx : ApplicationUserControl
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Oggetto locale gestione classe datamatrix...
|
||||||
|
/// </summary>
|
||||||
|
protected DataMatrix DataMatrix_mgr = new DataMatrix();
|
||||||
|
/// <summary>
|
||||||
|
/// reset della selezione
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="sender"></param>
|
||||||
|
/// <param name="e"></param>
|
||||||
|
protected void btnReset_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
|
resetSelezione();
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// reset della selezione
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="sender"></param>
|
|
||||||
/// <param name="e"></param>
|
|
||||||
protected void btnReset_Click(object sender, EventArgs e)
|
|
||||||
{
|
|
||||||
resetSelezione();
|
|
||||||
}
|
|
||||||
/// <summary>
|
|
||||||
/// resetta la selezione dei valori in caso di modifiche su altri controlli
|
|
||||||
/// </summary>
|
|
||||||
public void resetSelezione()
|
|
||||||
{
|
|
||||||
grView.SelectedIndex = -1;
|
|
||||||
grView.DataBind();
|
|
||||||
raiseEvent(ucEvType.Reset);
|
|
||||||
}
|
|
||||||
/// <summary>
|
|
||||||
/// inserisce nuovo valore da footer
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="sender"></param>
|
|
||||||
/// <param name="e"></param>
|
|
||||||
protected void lblIns_click(object sender, EventArgs e)
|
|
||||||
{
|
|
||||||
// click su inserimento, chiamo il metodo insert dell'ObjectDataSource
|
|
||||||
ods.Insert();
|
|
||||||
}
|
|
||||||
/// <summary>
|
|
||||||
/// gestione evento richiesta nuovo valore (mostra footer, ...)
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="sender"></param>
|
|
||||||
/// <param name="e"></param>
|
|
||||||
protected void btnNew_Click(object sender, EventArgs e)
|
|
||||||
{
|
|
||||||
// reset selezione...
|
|
||||||
resetSelezione();
|
|
||||||
// mostro il footer oppure la riga dei dettagli x nuovo...
|
|
||||||
if (grView.FooterRow != null)
|
|
||||||
{
|
|
||||||
grView.FooterRow.Visible = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
/// <summary>
|
|
||||||
/// determina se sia eliminabile il record (=non usato)
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="idxMaker"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
public bool delEnabled(object idxObj)
|
|
||||||
{
|
|
||||||
bool answ = isWritable();
|
|
||||||
// solo se ha diritti scrittura controllo
|
|
||||||
if (answ)
|
|
||||||
{
|
|
||||||
string cod = idxObj.ToString();
|
|
||||||
// "" == ND NON VA modificato...
|
|
||||||
if (cod != "")
|
|
||||||
{
|
|
||||||
// se non ND cerco se ci sono specifiche --> non eliminabile!
|
|
||||||
int trovati = 0;
|
|
||||||
// controllo se ci siano celle associate
|
|
||||||
trovati = DataMatrix.mgr.taSpecDtmx.getByFormatoDtmx(cod).Rows.Count;
|
|
||||||
// controllo se ci sono record correlati...
|
|
||||||
if (trovati > 0)
|
|
||||||
{
|
|
||||||
answ = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
answ = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return answ;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// elenco colonne del datagrid
|
|
||||||
/// </summary>
|
|
||||||
/// <returns></returns>
|
|
||||||
protected DataColumnCollection colonneObj()
|
|
||||||
{
|
|
||||||
DS_DataMatrix.AnagFormatiDtmxDataTable tabella = new DS_DataMatrix.AnagFormatiDtmxDataTable();
|
|
||||||
DataColumnCollection colonne = tabella.Columns;
|
|
||||||
return colonne;
|
|
||||||
}
|
|
||||||
/// <summary>
|
|
||||||
/// recupera i dati di un nuovo record contenuti nel footer di un gridView;
|
|
||||||
/// questi devono essere opportunamente nominati (es: txt{0}, dl{0}, ...)
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="sender"></param>
|
|
||||||
/// <param name="e"></param>
|
|
||||||
protected void recuperaFooter(object sender, ObjectDataSourceMethodEventArgs e)
|
|
||||||
{
|
|
||||||
//recupero la riga footer...
|
|
||||||
DataColumnCollection colonne = colonneObj();
|
|
||||||
string nomeCol;
|
|
||||||
string tipoColonna = "";
|
|
||||||
foreach (DataColumn colonna in colonne)
|
|
||||||
{
|
|
||||||
nomeCol = colonna.ColumnName;
|
|
||||||
// cerco un textbox o quello che sia...
|
|
||||||
if (grView.FooterRow.FindControl(string.Format("txt{0}", nomeCol)) != null)
|
|
||||||
{
|
|
||||||
tipoColonna = "textBox";
|
|
||||||
}
|
|
||||||
else if (grView.FooterRow.FindControl(string.Format("dl{0}", nomeCol)) != null)
|
|
||||||
{
|
|
||||||
tipoColonna = "dropDownList";
|
|
||||||
}
|
|
||||||
else if (grView.FooterRow.FindControl(string.Format("chk{0}", nomeCol)) != null)
|
|
||||||
{
|
|
||||||
tipoColonna = "checkBox";
|
|
||||||
}
|
|
||||||
else if (grView.FooterRow.FindControl(string.Format("selAjax_{0}", nomeCol)) != null)
|
|
||||||
{
|
|
||||||
tipoColonna = "selAjax";
|
|
||||||
}
|
|
||||||
// in base al tipo salvo negli inputparameters dell'ODS
|
|
||||||
switch (tipoColonna)
|
|
||||||
{
|
|
||||||
case "textBox":
|
|
||||||
e.InputParameters[nomeCol] = ((TextBox)grView.FooterRow.FindControl(string.Format("txt{0}", nomeCol))).Text;
|
|
||||||
break;
|
|
||||||
case "dropDownList":
|
|
||||||
e.InputParameters[nomeCol] = ((DropDownList)grView.FooterRow.FindControl(string.Format("dl{0}", nomeCol))).SelectedValue;
|
|
||||||
break;
|
|
||||||
case "checkBox":
|
|
||||||
e.InputParameters[nomeCol] = ((CheckBox)grView.FooterRow.FindControl(string.Format("chk{0}", nomeCol))).Checked;
|
|
||||||
break;
|
|
||||||
case "selAjax":
|
|
||||||
e.InputParameters[nomeCol] = ((mod_selettore_ajax)grView.FooterRow.FindControl(string.Format("selAjax_{0}", nomeCol))).valore;
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
tipoColonna = "";
|
|
||||||
}
|
|
||||||
if (e.InputParameters["DataFormat"] == null) e.InputParameters["DataFormat"] = "";
|
|
||||||
}
|
|
||||||
|
|
||||||
protected void grView_SelectedIndexChanged(object sender, EventArgs e)
|
|
||||||
{
|
|
||||||
raiseEvent(ucEvType.Selected);
|
|
||||||
}
|
|
||||||
|
|
||||||
public string FormatoDtmxSel
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
string answ = "";
|
|
||||||
try
|
|
||||||
{
|
|
||||||
answ = grView.SelectedValue.ToString();
|
|
||||||
}
|
|
||||||
catch
|
|
||||||
{ }
|
|
||||||
return answ;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
protected void ods_Updating(object sender, ObjectDataSourceMethodEventArgs e)
|
|
||||||
{
|
|
||||||
if (e.InputParameters["DataFormat"] == null) e.InputParameters["DataFormat"] = "";
|
|
||||||
}
|
|
||||||
|
|
||||||
protected void grView_PageIndexChanged(object sender, EventArgs e)
|
|
||||||
{
|
|
||||||
resetSelezione();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// resetta la selezione dei valori in caso di modifiche su altri controlli
|
||||||
|
/// </summary>
|
||||||
|
public void resetSelezione()
|
||||||
|
{
|
||||||
|
grView.SelectedIndex = -1;
|
||||||
|
grView.DataBind();
|
||||||
|
raiseEvent(ucEvType.Reset);
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// inserisce nuovo valore da footer
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="sender"></param>
|
||||||
|
/// <param name="e"></param>
|
||||||
|
protected void lblIns_click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
// click su inserimento, chiamo il metodo insert dell'ObjectDataSource
|
||||||
|
ods.Insert();
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// gestione evento richiesta nuovo valore (mostra footer, ...)
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="sender"></param>
|
||||||
|
/// <param name="e"></param>
|
||||||
|
protected void btnNew_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
// reset selezione...
|
||||||
|
resetSelezione();
|
||||||
|
// mostro il footer oppure la riga dei dettagli x nuovo...
|
||||||
|
if (grView.FooterRow != null)
|
||||||
|
{
|
||||||
|
grView.FooterRow.Visible = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// determina se sia eliminabile il record (=non usato)
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="idxMaker"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public bool delEnabled(object idxObj)
|
||||||
|
{
|
||||||
|
bool answ = isWritable();
|
||||||
|
// solo se ha diritti scrittura controllo
|
||||||
|
if (answ)
|
||||||
|
{
|
||||||
|
string cod = idxObj.ToString();
|
||||||
|
// "" == ND NON VA modificato...
|
||||||
|
if (cod != "")
|
||||||
|
{
|
||||||
|
// se non ND cerco se ci sono specifiche --> non eliminabile!
|
||||||
|
int trovati = 0;
|
||||||
|
// controllo se ci siano celle associate
|
||||||
|
trovati = DataMatrix_mgr.taSpecDtmx.getByFormatoDtmx(cod).Rows.Count;
|
||||||
|
// controllo se ci sono record correlati...
|
||||||
|
if (trovati > 0)
|
||||||
|
{
|
||||||
|
answ = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
answ = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return answ;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// elenco colonne del datagrid
|
||||||
|
/// </summary>
|
||||||
|
/// <returns></returns>
|
||||||
|
protected DataColumnCollection colonneObj()
|
||||||
|
{
|
||||||
|
DS_DataMatrix.AnagFormatiDtmxDataTable tabella = new DS_DataMatrix.AnagFormatiDtmxDataTable();
|
||||||
|
DataColumnCollection colonne = tabella.Columns;
|
||||||
|
return colonne;
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// recupera i dati di un nuovo record contenuti nel footer di un gridView;
|
||||||
|
/// questi devono essere opportunamente nominati (es: txt{0}, dl{0}, ...)
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="sender"></param>
|
||||||
|
/// <param name="e"></param>
|
||||||
|
protected void recuperaFooter(object sender, ObjectDataSourceMethodEventArgs e)
|
||||||
|
{
|
||||||
|
//recupero la riga footer...
|
||||||
|
DataColumnCollection colonne = colonneObj();
|
||||||
|
string nomeCol;
|
||||||
|
string tipoColonna = "";
|
||||||
|
foreach (DataColumn colonna in colonne)
|
||||||
|
{
|
||||||
|
nomeCol = colonna.ColumnName;
|
||||||
|
// cerco un textbox o quello che sia...
|
||||||
|
if (grView.FooterRow.FindControl(string.Format("txt{0}", nomeCol)) != null)
|
||||||
|
{
|
||||||
|
tipoColonna = "textBox";
|
||||||
|
}
|
||||||
|
else if (grView.FooterRow.FindControl(string.Format("dl{0}", nomeCol)) != null)
|
||||||
|
{
|
||||||
|
tipoColonna = "dropDownList";
|
||||||
|
}
|
||||||
|
else if (grView.FooterRow.FindControl(string.Format("chk{0}", nomeCol)) != null)
|
||||||
|
{
|
||||||
|
tipoColonna = "checkBox";
|
||||||
|
}
|
||||||
|
else if (grView.FooterRow.FindControl(string.Format("selAjax_{0}", nomeCol)) != null)
|
||||||
|
{
|
||||||
|
tipoColonna = "selAjax";
|
||||||
|
}
|
||||||
|
// in base al tipo salvo negli inputparameters dell'ODS
|
||||||
|
switch (tipoColonna)
|
||||||
|
{
|
||||||
|
case "textBox":
|
||||||
|
e.InputParameters[nomeCol] = ((TextBox)grView.FooterRow.FindControl(string.Format("txt{0}", nomeCol))).Text;
|
||||||
|
break;
|
||||||
|
case "dropDownList":
|
||||||
|
e.InputParameters[nomeCol] = ((DropDownList)grView.FooterRow.FindControl(string.Format("dl{0}", nomeCol))).SelectedValue;
|
||||||
|
break;
|
||||||
|
case "checkBox":
|
||||||
|
e.InputParameters[nomeCol] = ((CheckBox)grView.FooterRow.FindControl(string.Format("chk{0}", nomeCol))).Checked;
|
||||||
|
break;
|
||||||
|
case "selAjax":
|
||||||
|
e.InputParameters[nomeCol] = ((mod_selettore_ajax)grView.FooterRow.FindControl(string.Format("selAjax_{0}", nomeCol))).valore;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
tipoColonna = "";
|
||||||
|
}
|
||||||
|
if (e.InputParameters["DataFormat"] == null) e.InputParameters["DataFormat"] = "";
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void grView_SelectedIndexChanged(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
raiseEvent(ucEvType.Selected);
|
||||||
|
}
|
||||||
|
|
||||||
|
public string FormatoDtmxSel
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
string answ = "";
|
||||||
|
try
|
||||||
|
{
|
||||||
|
answ = grView.SelectedValue.ToString();
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{ }
|
||||||
|
return answ;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void ods_Updating(object sender, ObjectDataSourceMethodEventArgs e)
|
||||||
|
{
|
||||||
|
if (e.InputParameters["DataFormat"] == null) e.InputParameters["DataFormat"] = "";
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void grView_PageIndexChanged(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
resetSelezione();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
+1078
-1075
File diff suppressed because it is too large
Load Diff
@@ -5,207 +5,211 @@ using System.Web.UI;
|
|||||||
|
|
||||||
namespace GMW.WebUserControls
|
namespace GMW.WebUserControls
|
||||||
{
|
{
|
||||||
public partial class mod_recAttributiDtx : System.Web.UI.UserControl
|
public partial class mod_recAttributiDtx : System.Web.UI.UserControl
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Oggetto locale gestione classe datamatrix...
|
||||||
|
/// </summary>
|
||||||
|
protected DataMatrix DataMatrix_mgr = new DataMatrix();
|
||||||
|
public event EventHandler eh_reqUpdate;
|
||||||
|
/// <summary>
|
||||||
|
/// Avvio pagina
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="sender"></param>
|
||||||
|
/// <param name="e"></param>
|
||||||
|
protected void Page_Load(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
public event EventHandler eh_reqUpdate;
|
if (!Page.IsPostBack)
|
||||||
/// <summary>
|
{
|
||||||
/// Avvio pagina
|
resetIN();
|
||||||
/// </summary>
|
}
|
||||||
/// <param name="sender"></param>
|
checkBarcode();
|
||||||
/// <param name="e"></param>
|
|
||||||
protected void Page_Load(object sender, EventArgs e)
|
|
||||||
{
|
|
||||||
if (!Page.IsPostBack)
|
|
||||||
{
|
|
||||||
resetIN();
|
|
||||||
}
|
|
||||||
checkBarcode();
|
|
||||||
}
|
|
||||||
/// <summary>
|
|
||||||
/// restta input
|
|
||||||
/// </summary>
|
|
||||||
private void resetIN()
|
|
||||||
{
|
|
||||||
AddAttr = true;
|
|
||||||
lblCodAttr.Text = currAttr;
|
|
||||||
}
|
|
||||||
/// <summary>
|
|
||||||
/// Aggiungi/Rimuovi attributo
|
|
||||||
/// </summary>
|
|
||||||
public bool AddAttr
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return chkAdd.Checked;
|
|
||||||
}
|
|
||||||
set
|
|
||||||
{
|
|
||||||
chkAdd.Checked = value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
/// <summary>
|
|
||||||
/// wrapper traduzione
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="lemma"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
public string traduci(object lemma)
|
|
||||||
{
|
|
||||||
return user_std.UtSn.Traduci(lemma.ToString());
|
|
||||||
}
|
|
||||||
/// <summary>
|
|
||||||
/// tipologia di attributo registrato con DataMatrix
|
|
||||||
/// </summary>
|
|
||||||
public tipoAttrDtx tipologia { get; set; }
|
|
||||||
/// <summary>
|
|
||||||
/// valore barcode
|
|
||||||
/// </summary>
|
|
||||||
public string barcodeIn
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return txtBarcode.Text.Trim();
|
|
||||||
}
|
|
||||||
set
|
|
||||||
{
|
|
||||||
txtBarcode.Text = value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
/// <summary>
|
|
||||||
/// controlla se ci sia un barcode
|
|
||||||
/// </summary>
|
|
||||||
private void checkBarcode()
|
|
||||||
{
|
|
||||||
if (barcodeIn != "")
|
|
||||||
{
|
|
||||||
Postazione.messaggiText = string.Format("{0}: {1}", traduci("BCodeIns"), barcodeIn);
|
|
||||||
switch (MagClass.tipoBCode_L5(barcodeIn))
|
|
||||||
{
|
|
||||||
case tipoCodiceBarcode.DataMatrixTrovato:
|
|
||||||
// recupero da UDC
|
|
||||||
try
|
|
||||||
{
|
|
||||||
// se si tratta di prove distruttive registrando attributi si fa update di UDC e link...
|
|
||||||
DataMatrix.mgr.taAtt2Dtx.insertAndProc(barcodeIn, AddAttr, currAttr, tipologia.ToString(), DateTime.Now, MagClass.magazzino.CodSoggCurrUser);
|
|
||||||
if (AddAttr)
|
|
||||||
{
|
|
||||||
Postazione.messaggiText = string.Format("{0}: {1}", traduci("RegistratoAttributo"), tipologia);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
Postazione.messaggiText = string.Format("{0}: {1}", traduci("EliminatoAttributo"), tipologia);
|
|
||||||
}
|
|
||||||
Postazione.warningText = "";
|
|
||||||
Postazione.CssClass = "stileComandoOk";
|
|
||||||
}
|
|
||||||
catch
|
|
||||||
{
|
|
||||||
Postazione.warningText = traduci("ERR-A2D-001");
|
|
||||||
Postazione.CssClass = "stileComandoKo";
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case tipoCodiceBarcode.Comando:
|
|
||||||
// se è reset cancello tutto!
|
|
||||||
if (barcodeIn == memLayer.ML.cdv("cmdReset"))
|
|
||||||
{
|
|
||||||
resetIN();
|
|
||||||
Postazione.messaggiText = "";
|
|
||||||
Postazione.warningText = "";
|
|
||||||
doUpdate();
|
|
||||||
}
|
|
||||||
Postazione.CssClass = "stileAttesa";
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
Postazione.messaggiText = "";
|
|
||||||
Postazione.warningText = traduci("ERR-UNK-001");
|
|
||||||
Postazione.CssClass = "stileComandoND";
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
barcodeIn = "";
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
Postazione.messaggiText = traduci("AttesaBCode");
|
|
||||||
Postazione.CssClass = "stileAttesa";
|
|
||||||
}
|
|
||||||
doUpdate();
|
|
||||||
}
|
|
||||||
/// <summary>
|
|
||||||
/// modificato attributo registra/elimina attributo
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="sender"></param>
|
|
||||||
/// <param name="e"></param>
|
|
||||||
protected void chkAdd_CheckedChanged(object sender, EventArgs e)
|
|
||||||
{
|
|
||||||
doUpdate();
|
|
||||||
}
|
|
||||||
/// <summary>
|
|
||||||
/// aggiorna componenti + focus a barcode
|
|
||||||
/// </summary>
|
|
||||||
public void doUpdate()
|
|
||||||
{
|
|
||||||
if (AddAttr)
|
|
||||||
{
|
|
||||||
chkAdd.Text = traduci("AggiungiAttr");
|
|
||||||
lblAdd.Attributes.Remove("class");
|
|
||||||
lblAdd.Attributes.Add("class", "btn btn-warning");
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
chkAdd.Text = traduci("TogliAttr");
|
|
||||||
lblAdd.Attributes.Remove("class");
|
|
||||||
lblAdd.Attributes.Add("class", "btn btn-danger");
|
|
||||||
}
|
|
||||||
grView.DataBind();
|
|
||||||
// raise dell'evento
|
|
||||||
if (eh_reqUpdate != null)
|
|
||||||
{
|
|
||||||
eh_reqUpdate(this, new EventArgs());
|
|
||||||
}
|
|
||||||
txtBarcode.Focus();
|
|
||||||
}
|
|
||||||
/// <summary>
|
|
||||||
/// codice attributo corrente da tipologia attributi controllo (hard coded)
|
|
||||||
/// </summary>
|
|
||||||
public string currAttr
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
string answ = "";
|
|
||||||
switch (tipologia)
|
|
||||||
{
|
|
||||||
case tipoAttrDtx.ExtraCiclo:
|
|
||||||
answ = "EC";
|
|
||||||
break;
|
|
||||||
case tipoAttrDtx.ProveDimensionali:
|
|
||||||
answ = "PD";
|
|
||||||
break;
|
|
||||||
case tipoAttrDtx.ProveDistruttive:
|
|
||||||
answ = "DI";
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
answ = "";
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
return answ;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// restta input
|
||||||
|
/// </summary>
|
||||||
|
private void resetIN()
|
||||||
|
{
|
||||||
|
AddAttr = true;
|
||||||
|
lblCodAttr.Text = currAttr;
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// Aggiungi/Rimuovi attributo
|
||||||
|
/// </summary>
|
||||||
|
public bool AddAttr
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return chkAdd.Checked;
|
||||||
|
}
|
||||||
|
set
|
||||||
|
{
|
||||||
|
chkAdd.Checked = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// wrapper traduzione
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="lemma"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public string traduci(object lemma)
|
||||||
|
{
|
||||||
|
return user_std.UtSn.Traduci(lemma.ToString());
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// tipologia di attributo registrato con DataMatrix
|
||||||
|
/// </summary>
|
||||||
|
public tipoAttrDtx tipologia { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// valore barcode
|
||||||
|
/// </summary>
|
||||||
|
public string barcodeIn
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return txtBarcode.Text.Trim();
|
||||||
|
}
|
||||||
|
set
|
||||||
|
{
|
||||||
|
txtBarcode.Text = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// controlla se ci sia un barcode
|
||||||
|
/// </summary>
|
||||||
|
private void checkBarcode()
|
||||||
|
{
|
||||||
|
if (barcodeIn != "")
|
||||||
|
{
|
||||||
|
Postazione.messaggiText = string.Format("{0}: {1}", traduci("BCodeIns"), barcodeIn);
|
||||||
|
switch (MagClass.tipoBCode_L5(barcodeIn))
|
||||||
|
{
|
||||||
|
case tipoCodiceBarcode.DataMatrixTrovato:
|
||||||
|
// recupero da UDC
|
||||||
|
try
|
||||||
|
{
|
||||||
|
// se si tratta di prove distruttive registrando attributi si fa update di UDC e link...
|
||||||
|
DataMatrix_mgr.taAtt2Dtx.insertAndProc(barcodeIn, AddAttr, currAttr, tipologia.ToString(), DateTime.Now, MagClass.magazzino.CodSoggCurrUser);
|
||||||
|
if (AddAttr)
|
||||||
|
{
|
||||||
|
Postazione.messaggiText = string.Format("{0}: {1}", traduci("RegistratoAttributo"), tipologia);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Postazione.messaggiText = string.Format("{0}: {1}", traduci("EliminatoAttributo"), tipologia);
|
||||||
|
}
|
||||||
|
Postazione.warningText = "";
|
||||||
|
Postazione.CssClass = "stileComandoOk";
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{
|
||||||
|
Postazione.warningText = traduci("ERR-A2D-001");
|
||||||
|
Postazione.CssClass = "stileComandoKo";
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case tipoCodiceBarcode.Comando:
|
||||||
|
// se è reset cancello tutto!
|
||||||
|
if (barcodeIn == memLayer.ML.cdv("cmdReset"))
|
||||||
|
{
|
||||||
|
resetIN();
|
||||||
|
Postazione.messaggiText = "";
|
||||||
|
Postazione.warningText = "";
|
||||||
|
doUpdate();
|
||||||
|
}
|
||||||
|
Postazione.CssClass = "stileAttesa";
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
Postazione.messaggiText = "";
|
||||||
|
Postazione.warningText = traduci("ERR-UNK-001");
|
||||||
|
Postazione.CssClass = "stileComandoND";
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
barcodeIn = "";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Postazione.messaggiText = traduci("AttesaBCode");
|
||||||
|
Postazione.CssClass = "stileAttesa";
|
||||||
|
}
|
||||||
|
doUpdate();
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// modificato attributo registra/elimina attributo
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="sender"></param>
|
||||||
|
/// <param name="e"></param>
|
||||||
|
protected void chkAdd_CheckedChanged(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
doUpdate();
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// aggiorna componenti + focus a barcode
|
||||||
|
/// </summary>
|
||||||
|
public void doUpdate()
|
||||||
|
{
|
||||||
|
if (AddAttr)
|
||||||
|
{
|
||||||
|
chkAdd.Text = traduci("AggiungiAttr");
|
||||||
|
lblAdd.Attributes.Remove("class");
|
||||||
|
lblAdd.Attributes.Add("class", "btn btn-warning");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
chkAdd.Text = traduci("TogliAttr");
|
||||||
|
lblAdd.Attributes.Remove("class");
|
||||||
|
lblAdd.Attributes.Add("class", "btn btn-danger");
|
||||||
|
}
|
||||||
|
grView.DataBind();
|
||||||
|
// raise dell'evento
|
||||||
|
if (eh_reqUpdate != null)
|
||||||
|
{
|
||||||
|
eh_reqUpdate(this, new EventArgs());
|
||||||
|
}
|
||||||
|
txtBarcode.Focus();
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// codice attributo corrente da tipologia attributi controllo (hard coded)
|
||||||
|
/// </summary>
|
||||||
|
public string currAttr
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
string answ = "";
|
||||||
|
switch (tipologia)
|
||||||
|
{
|
||||||
|
case tipoAttrDtx.ExtraCiclo:
|
||||||
|
answ = "EC";
|
||||||
|
break;
|
||||||
|
case tipoAttrDtx.ProveDimensionali:
|
||||||
|
answ = "PD";
|
||||||
|
break;
|
||||||
|
case tipoAttrDtx.ProveDistruttive:
|
||||||
|
answ = "DI";
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
answ = "";
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return answ;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Tipologia attributi legati a DTX ammessi/Gestiti
|
/// Tipologia attributi legati a DTX ammessi/Gestiti
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public enum tipoAttrDtx
|
public enum tipoAttrDtx
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gestione ExtraCiclo
|
/// Gestione ExtraCiclo
|
||||||
/// </summary>
|
/// </summary>
|
||||||
ExtraCiclo,
|
ExtraCiclo,
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gestione prove dimensionali
|
/// Gestione prove dimensionali
|
||||||
/// </summary>
|
/// </summary>
|
||||||
ProveDimensionali,
|
ProveDimensionali,
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gestione prove distruttive
|
/// Gestione prove distruttive
|
||||||
/// </summary>
|
/// </summary>
|
||||||
ProveDistruttive
|
ProveDistruttive
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,325 +5,330 @@ using System.Web.UI;
|
|||||||
|
|
||||||
namespace GMW.WebUserControls
|
namespace GMW.WebUserControls
|
||||||
{
|
{
|
||||||
public partial class mod_setAttrDtx : System.Web.UI.UserControl
|
public partial class mod_setAttrDtx : System.Web.UI.UserControl
|
||||||
{ /// <summary>
|
{
|
||||||
/// flusso associato (hard coded) a sterrati
|
/// <summary>
|
||||||
/// </summary>
|
/// Oggetto locale gestione classe datamatrix...
|
||||||
protected string flusso = "ST";
|
/// </summary>
|
||||||
/// <summary>
|
protected DataMatrix DataMatrix_mgr = new DataMatrix();
|
||||||
/// stato associato (hard coded) a sterrati
|
/// <summary>
|
||||||
/// </summary>
|
/// flusso associato (hard coded) a sterrati
|
||||||
protected string statoUDC = "Sterr";
|
/// </summary>
|
||||||
/// <summary>
|
protected string flusso = "ST";
|
||||||
/// tipo di evento associato alla creazione dell'UDC
|
/// <summary>
|
||||||
/// </summary>
|
/// stato associato (hard coded) a sterrati
|
||||||
protected string eventoUDC = "UDC_SBFUS";
|
/// </summary>
|
||||||
public event EventHandler eh_reqUpdate;
|
protected string statoUDC = "Sterr";
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// stringa UID univoca
|
/// tipo di evento associato alla creazione dell'UDC
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string uid
|
protected string eventoUDC = "UDC_SBFUS";
|
||||||
|
public event EventHandler eh_reqUpdate;
|
||||||
|
/// <summary>
|
||||||
|
/// stringa UID univoca
|
||||||
|
/// </summary>
|
||||||
|
public string uid
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return this.UniqueID.Replace("$", "_").Replace("-", "_");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// caricamento pagina
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="sender"></param>
|
||||||
|
/// <param name="e"></param>
|
||||||
|
protected void Page_Load(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
if (!Page.IsPostBack)
|
||||||
|
{
|
||||||
|
traduciObj();
|
||||||
|
divBlocca.Visible = false;
|
||||||
|
idxCella = Postazione.currIdxCella;
|
||||||
|
}
|
||||||
|
doChecks();
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// IDX cella associata alla linea corrente
|
||||||
|
/// </summary>
|
||||||
|
protected int idxCella
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
int answ = 0;
|
||||||
|
if (memLayer.ML.isInSessionObject("IdxCellaLineaST"))
|
||||||
{
|
{
|
||||||
get
|
answ = memLayer.ML.IntSessionObj("IdxCellaLineaST");
|
||||||
{
|
|
||||||
return this.UniqueID.Replace("$", "_").Replace("-", "_");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
/// <summary>
|
return answ;
|
||||||
/// caricamento pagina
|
}
|
||||||
/// </summary>
|
set
|
||||||
/// <param name="sender"></param>
|
{
|
||||||
/// <param name="e"></param>
|
memLayer.ML.setSessionVal("IdxCellaLineaST", value);
|
||||||
protected void Page_Load(object sender, EventArgs e)
|
}
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// effettua controlli visibilità
|
||||||
|
/// </summary>
|
||||||
|
private void doChecks()
|
||||||
|
{
|
||||||
|
checkBarcode();
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// sistemo labels oggetti
|
||||||
|
/// </summary>
|
||||||
|
private void traduciObj()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// restituisce il nome della pagina corrente
|
||||||
|
/// </summary>
|
||||||
|
protected string PagCorrente
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
string answ = "";
|
||||||
|
Uri MyUrl = Request.Url;
|
||||||
|
string delimStr = "/";
|
||||||
|
char[] delimiter = delimStr.ToCharArray();
|
||||||
|
string[] finalUrl = MyUrl.LocalPath.ToString().Split(delimiter);
|
||||||
|
int n = finalUrl.Length;
|
||||||
|
answ = finalUrl[n - 1].ToString();
|
||||||
|
DataLayer_AnagGen.PermessiRow riga = (DataLayer_AnagGen.PermessiRow)user_std.UtSn.permessi.Select(string.Format("URL = '{0}'", answ))[0];
|
||||||
|
answ = riga.NOME;
|
||||||
|
return answ;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// wrapper traduzione
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="lemma"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public string traduci(object lemma)
|
||||||
|
{
|
||||||
|
return user_std.UtSn.Traduci(lemma.ToString());
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// indica il codice articolo correntemente selezionato
|
||||||
|
/// </summary>
|
||||||
|
protected string currParticolare
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return memLayer.ML.StringSessionObj(string.Format("currParticolare_{0}", uid));
|
||||||
|
}
|
||||||
|
set
|
||||||
|
{
|
||||||
|
memLayer.ML.setSessionVal(string.Format("currParticolare_{0}", uid), value, memLayer.ML.confReadBool("keepParticolareSel"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// indica UDC correntemente selezionato
|
||||||
|
/// </summary>
|
||||||
|
protected string currUDC
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return memLayer.ML.StringSessionObj(string.Format("UDC_{0}", uid));
|
||||||
|
}
|
||||||
|
set
|
||||||
|
{
|
||||||
|
memLayer.ML.setSessionVal(string.Format("UDC_{0}", uid), value, memLayer.ML.confReadBool("keepParticolareSel"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// indica se i caratteri vadano forzati a maiuscoli
|
||||||
|
/// </summary>
|
||||||
|
public bool forceUppercase
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return memLayer.ML.confReadBool("forceUppercase");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// valore barcode
|
||||||
|
/// </summary>
|
||||||
|
public string barcodeIn
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return txtBarcode.Text.Trim();
|
||||||
|
}
|
||||||
|
set
|
||||||
|
{
|
||||||
|
txtBarcode.Text = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// Formato Datamatrix della linea selezionata
|
||||||
|
/// </summary>
|
||||||
|
protected string FormatoDtmxLinea
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return ddlFormDmtx.SelectedValue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// Formato Datamatrix dell'ultimo barcode letto
|
||||||
|
/// </summary>
|
||||||
|
protected string FormatoDtmxBarcode
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
string answ = "";
|
||||||
|
try
|
||||||
{
|
{
|
||||||
if (!Page.IsPostBack)
|
answ = DataMatrix_mgr.taVerifica.GetData(barcodeIn)[0].FormatoDtmx;
|
||||||
{
|
|
||||||
traduciObj();
|
|
||||||
divBlocca.Visible = false;
|
|
||||||
idxCella = Postazione.currIdxCella;
|
|
||||||
}
|
|
||||||
doChecks();
|
|
||||||
}
|
}
|
||||||
/// <summary>
|
catch
|
||||||
/// IDX cella associata alla linea corrente
|
{ }
|
||||||
/// </summary>
|
return answ;
|
||||||
protected int idxCella
|
}
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// controlla se ci sia un barcode
|
||||||
|
/// </summary>
|
||||||
|
private void checkBarcode()
|
||||||
|
{
|
||||||
|
if (barcodeIn != "")
|
||||||
|
{
|
||||||
|
Postazione.messaggiText = string.Format("Barcode digitato: {0}", barcodeIn);
|
||||||
|
tipoCodiceBarcode tipoBC = MagClass.tipoBCode_L5(barcodeIn);
|
||||||
|
switch (tipoBC)
|
||||||
{
|
{
|
||||||
get
|
case tipoCodiceBarcode.DataMatrixTrovato:
|
||||||
|
// verifico formato datamatrix letto sia quello della linea...
|
||||||
|
if (FormatoDtmxBarcode != FormatoDtmxLinea)
|
||||||
{
|
{
|
||||||
int answ = 0;
|
// errore corrispondenza formato Dtmx
|
||||||
if (memLayer.ML.isInSessionObject("IdxCellaLineaST"))
|
Postazione.messaggiText = barcodeIn;
|
||||||
{
|
Postazione.warningText = traduci("ERR-DTX-014");
|
||||||
answ = memLayer.ML.IntSessionObj("IdxCellaLineaST");
|
Postazione.CssClass = "stileComandoKo";
|
||||||
}
|
|
||||||
return answ;
|
|
||||||
}
|
|
||||||
set
|
|
||||||
{
|
|
||||||
memLayer.ML.setSessionVal("IdxCellaLineaST", value);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
/// <summary>
|
|
||||||
/// effettua controlli visibilità
|
|
||||||
/// </summary>
|
|
||||||
private void doChecks()
|
|
||||||
{
|
|
||||||
checkBarcode();
|
|
||||||
}
|
|
||||||
/// <summary>
|
|
||||||
/// sistemo labels oggetti
|
|
||||||
/// </summary>
|
|
||||||
private void traduciObj()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
/// <summary>
|
|
||||||
/// restituisce il nome della pagina corrente
|
|
||||||
/// </summary>
|
|
||||||
protected string PagCorrente
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
string answ = "";
|
|
||||||
Uri MyUrl = Request.Url;
|
|
||||||
string delimStr = "/";
|
|
||||||
char[] delimiter = delimStr.ToCharArray();
|
|
||||||
string[] finalUrl = MyUrl.LocalPath.ToString().Split(delimiter);
|
|
||||||
int n = finalUrl.Length;
|
|
||||||
answ = finalUrl[n - 1].ToString();
|
|
||||||
DataLayer_AnagGen.PermessiRow riga = (DataLayer_AnagGen.PermessiRow)user_std.UtSn.permessi.Select(string.Format("URL = '{0}'", answ))[0];
|
|
||||||
answ = riga.NOME;
|
|
||||||
return answ;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
/// <summary>
|
|
||||||
/// wrapper traduzione
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="lemma"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
public string traduci(object lemma)
|
|
||||||
{
|
|
||||||
return user_std.UtSn.Traduci(lemma.ToString());
|
|
||||||
}
|
|
||||||
/// <summary>
|
|
||||||
/// indica il codice articolo correntemente selezionato
|
|
||||||
/// </summary>
|
|
||||||
protected string currParticolare
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return memLayer.ML.StringSessionObj(string.Format("currParticolare_{0}", uid));
|
|
||||||
}
|
|
||||||
set
|
|
||||||
{
|
|
||||||
memLayer.ML.setSessionVal(string.Format("currParticolare_{0}", uid), value, memLayer.ML.confReadBool("keepParticolareSel"));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
/// <summary>
|
|
||||||
/// indica UDC correntemente selezionato
|
|
||||||
/// </summary>
|
|
||||||
protected string currUDC
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return memLayer.ML.StringSessionObj(string.Format("UDC_{0}", uid));
|
|
||||||
}
|
|
||||||
set
|
|
||||||
{
|
|
||||||
memLayer.ML.setSessionVal(string.Format("UDC_{0}", uid), value, memLayer.ML.confReadBool("keepParticolareSel"));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
/// <summary>
|
|
||||||
/// indica se i caratteri vadano forzati a maiuscoli
|
|
||||||
/// </summary>
|
|
||||||
public bool forceUppercase
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return memLayer.ML.confReadBool("forceUppercase");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
/// <summary>
|
|
||||||
/// valore barcode
|
|
||||||
/// </summary>
|
|
||||||
public string barcodeIn
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return txtBarcode.Text.Trim();
|
|
||||||
}
|
|
||||||
set
|
|
||||||
{
|
|
||||||
txtBarcode.Text = value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
/// <summary>
|
|
||||||
/// Formato Datamatrix della linea selezionata
|
|
||||||
/// </summary>
|
|
||||||
protected string FormatoDtmxLinea
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return ddlFormDmtx.SelectedValue;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
/// <summary>
|
|
||||||
/// Formato Datamatrix dell'ultimo barcode letto
|
|
||||||
/// </summary>
|
|
||||||
protected string FormatoDtmxBarcode
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
string answ = "";
|
|
||||||
try
|
|
||||||
{
|
|
||||||
answ = DataMatrix.mgr.taVerifica.GetData(barcodeIn)[0].FormatoDtmx;
|
|
||||||
}
|
|
||||||
catch
|
|
||||||
{ }
|
|
||||||
return answ;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
/// <summary>
|
|
||||||
/// controlla se ci sia un barcode
|
|
||||||
/// </summary>
|
|
||||||
private void checkBarcode()
|
|
||||||
{
|
|
||||||
if (barcodeIn != "")
|
|
||||||
{
|
|
||||||
Postazione.messaggiText = string.Format("Barcode digitato: {0}", barcodeIn);
|
|
||||||
tipoCodiceBarcode tipoBC = MagClass.tipoBCode_L5(barcodeIn);
|
|
||||||
switch (tipoBC)
|
|
||||||
{
|
|
||||||
case tipoCodiceBarcode.DataMatrixTrovato:
|
|
||||||
// verifico formato datamatrix letto sia quello della linea...
|
|
||||||
if (FormatoDtmxBarcode != FormatoDtmxLinea)
|
|
||||||
{
|
|
||||||
// errore corrispondenza formato Dtmx
|
|
||||||
Postazione.messaggiText = barcodeIn;
|
|
||||||
Postazione.warningText = traduci("ERR-DTX-014");
|
|
||||||
Postazione.CssClass = "stileComandoKo";
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
|
|
||||||
Postazione.messaggiText = string.Format("{0} {1} su dtx TROVATO {2}", traduci("AssegnatoAttr"), ddlTipoAttr.SelectedValue, barcodeIn);
|
|
||||||
Postazione.CssClass = "stileComandoOk";
|
|
||||||
// assegno attributo!
|
|
||||||
DataMatrix.mgr.taAtt2Dtx.insertAndProc(barcodeIn, true, "XF", string.Format("Assegnazione Attr {0} su Dtmx TROVATO tipo {1}", ddlTipoAttr.SelectedValue, ddlFormDmtx.SelectedValue), DateTime.Now, MagClass.magazzino.CodSoggCurrUser);
|
|
||||||
grView.DataBind();
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case tipoCodiceBarcode.DataMatrixDecodificato:
|
|
||||||
// verifico formato datamatrix letto sia quello della linea...
|
|
||||||
if (FormatoDtmxBarcode != FormatoDtmxLinea)
|
|
||||||
{
|
|
||||||
// errore corrispondenza formato Dtmx
|
|
||||||
Postazione.messaggiText = barcodeIn;
|
|
||||||
Postazione.warningText = traduci("ERR-DTX-014");
|
|
||||||
Postazione.CssClass = "stileComandoKo";
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
|
|
||||||
Postazione.messaggiText = string.Format("{0} {1} su dtx DECODIFICATO {2}", traduci("AssegnatoAttr"), ddlTipoAttr.SelectedValue, barcodeIn);
|
|
||||||
Postazione.CssClass = "stileComandoOk";
|
|
||||||
// assegno attributo!
|
|
||||||
DataMatrix.mgr.taAtt2Dtx.insertAndProc(barcodeIn, true, "XF", string.Format("Assegnazione Attr {0} su Dtmx DECODIFICATO tipo {1}", ddlTipoAttr.SelectedValue, ddlFormDmtx.SelectedValue), DateTime.Now, MagClass.magazzino.CodSoggCurrUser);
|
|
||||||
grView.DataBind();
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
Postazione.messaggiText += " - codice <b>non riconosciuto</b>!";
|
|
||||||
Postazione.CssClass = "stileComandoND";
|
|
||||||
divBlocca.Visible = false;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
barcodeIn = "";
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Postazione.messaggiText = traduci("AttesaBCode");
|
|
||||||
Postazione.CssClass = "stileAttesa";
|
|
||||||
}
|
|
||||||
txtBarcode.Focus();
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
Postazione.messaggiText = string.Format("{0} {1} su dtx TROVATO {2}", traduci("AssegnatoAttr"), ddlTipoAttr.SelectedValue, barcodeIn);
|
||||||
/// aggiorna tabella + focus a barcode
|
Postazione.CssClass = "stileComandoOk";
|
||||||
/// </summary>
|
// assegno attributo!
|
||||||
public void doUpdate()
|
DataMatrix_mgr.taAtt2Dtx.insertAndProc(barcodeIn, true, "XF", string.Format("Assegnazione Attr {0} su Dtmx TROVATO tipo {1}", ddlTipoAttr.SelectedValue, ddlFormDmtx.SelectedValue), DateTime.Now, MagClass.magazzino.CodSoggCurrUser);
|
||||||
{
|
grView.DataBind();
|
||||||
idxCella = Postazione.currIdxCella;
|
}
|
||||||
grView.DataBind();
|
break;
|
||||||
txtBarcode.Focus();
|
case tipoCodiceBarcode.DataMatrixDecodificato:
|
||||||
// raise dell'evento
|
// verifico formato datamatrix letto sia quello della linea...
|
||||||
if (eh_reqUpdate != null)
|
if (FormatoDtmxBarcode != FormatoDtmxLinea)
|
||||||
{
|
{
|
||||||
eh_reqUpdate(this, new EventArgs());
|
// errore corrispondenza formato Dtmx
|
||||||
|
Postazione.messaggiText = barcodeIn;
|
||||||
|
Postazione.warningText = traduci("ERR-DTX-014");
|
||||||
|
Postazione.CssClass = "stileComandoKo";
|
||||||
}
|
}
|
||||||
}
|
else
|
||||||
/// <summary>
|
{
|
||||||
/// effettua reset dati
|
|
||||||
/// </summary>
|
|
||||||
public void doResetData()
|
|
||||||
{
|
|
||||||
// resetto i dati QtaTot e particolare...
|
|
||||||
currParticolare = "";
|
|
||||||
doChecks();
|
|
||||||
}
|
|
||||||
|
|
||||||
protected void grView_PageIndexChanged(object sender, EventArgs e)
|
Postazione.messaggiText = string.Format("{0} {1} su dtx DECODIFICATO {2}", traduci("AssegnatoAttr"), ddlTipoAttr.SelectedValue, barcodeIn);
|
||||||
{
|
Postazione.CssClass = "stileComandoOk";
|
||||||
// fix dell'ODS
|
// assegno attributo!
|
||||||
checkFixOds();
|
DataMatrix_mgr.taAtt2Dtx.insertAndProc(barcodeIn, true, "XF", string.Format("Assegnazione Attr {0} su Dtmx DECODIFICATO tipo {1}", ddlTipoAttr.SelectedValue, ddlFormDmtx.SelectedValue), DateTime.Now, MagClass.magazzino.CodSoggCurrUser);
|
||||||
}
|
grView.DataBind();
|
||||||
protected void grView_Sorted(object sender, EventArgs e)
|
}
|
||||||
{
|
break;
|
||||||
// fix dell'ODS
|
default:
|
||||||
checkFixOds();
|
Postazione.messaggiText += " - codice <b>non riconosciuto</b>!";
|
||||||
}
|
Postazione.CssClass = "stileComandoND";
|
||||||
/// <summary>
|
|
||||||
/// aggiorno ods al binding..
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="sender"></param>
|
|
||||||
/// <param name="e"></param>
|
|
||||||
protected void ods_DataBinding(object sender, EventArgs e)
|
|
||||||
{
|
|
||||||
// fix dell'ODS
|
|
||||||
checkFixOds();
|
|
||||||
}
|
|
||||||
/// <summary>
|
|
||||||
/// verifica se attivo filtro company e imposta ods di conseguenza...
|
|
||||||
/// </summary>
|
|
||||||
private void checkFixOds()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// sblocca UDC
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="sender"></param>
|
|
||||||
/// <param name="e"></param>
|
|
||||||
protected void BloccaUDC_Click(object sender, EventArgs e)
|
|
||||||
{
|
|
||||||
// va cancellata la sua relazioni Fuso-Sterrato e va spostato in locazione Fusi Terra
|
|
||||||
DataMatrix.mgr.taAtt2Dtx.insertAndProc(barcodeIn, true, "XF", "NC FUS B48", DateTime.Now, MagClass.magazzino.CodSoggCurrUser);
|
|
||||||
// resetto selezione
|
|
||||||
divBlocca.Visible = false;
|
divBlocca.Visible = false;
|
||||||
currUDC = "";
|
break;
|
||||||
currParticolare = "";
|
|
||||||
doUpdate();
|
|
||||||
}
|
|
||||||
|
|
||||||
protected void ddlFormDmtx_SelectedIndexChanged(object sender, EventArgs e)
|
|
||||||
{
|
|
||||||
checkFixOds();
|
|
||||||
}
|
|
||||||
|
|
||||||
protected void ddlTipoAttr_SelectedIndexChanged(object sender, EventArgs e)
|
|
||||||
{
|
|
||||||
checkFixOds();
|
|
||||||
}
|
}
|
||||||
|
barcodeIn = "";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Postazione.messaggiText = traduci("AttesaBCode");
|
||||||
|
Postazione.CssClass = "stileAttesa";
|
||||||
|
}
|
||||||
|
txtBarcode.Focus();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// aggiorna tabella + focus a barcode
|
||||||
|
/// </summary>
|
||||||
|
public void doUpdate()
|
||||||
|
{
|
||||||
|
idxCella = Postazione.currIdxCella;
|
||||||
|
grView.DataBind();
|
||||||
|
txtBarcode.Focus();
|
||||||
|
// raise dell'evento
|
||||||
|
if (eh_reqUpdate != null)
|
||||||
|
{
|
||||||
|
eh_reqUpdate(this, new EventArgs());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// effettua reset dati
|
||||||
|
/// </summary>
|
||||||
|
public void doResetData()
|
||||||
|
{
|
||||||
|
// resetto i dati QtaTot e particolare...
|
||||||
|
currParticolare = "";
|
||||||
|
doChecks();
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void grView_PageIndexChanged(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
// fix dell'ODS
|
||||||
|
checkFixOds();
|
||||||
|
}
|
||||||
|
protected void grView_Sorted(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
// fix dell'ODS
|
||||||
|
checkFixOds();
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// aggiorno ods al binding..
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="sender"></param>
|
||||||
|
/// <param name="e"></param>
|
||||||
|
protected void ods_DataBinding(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
// fix dell'ODS
|
||||||
|
checkFixOds();
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// verifica se attivo filtro company e imposta ods di conseguenza...
|
||||||
|
/// </summary>
|
||||||
|
private void checkFixOds()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// sblocca UDC
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="sender"></param>
|
||||||
|
/// <param name="e"></param>
|
||||||
|
protected void BloccaUDC_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
// va cancellata la sua relazioni Fuso-Sterrato e va spostato in locazione Fusi Terra
|
||||||
|
DataMatrix_mgr.taAtt2Dtx.insertAndProc(barcodeIn, true, "XF", "NC FUS B48", DateTime.Now, MagClass.magazzino.CodSoggCurrUser);
|
||||||
|
// resetto selezione
|
||||||
|
divBlocca.Visible = false;
|
||||||
|
currUDC = "";
|
||||||
|
currParticolare = "";
|
||||||
|
doUpdate();
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void ddlFormDmtx_SelectedIndexChanged(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
checkFixOds();
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void ddlTipoAttr_SelectedIndexChanged(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
checkFixOds();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -7,158 +7,162 @@ using System.Web.UI.WebControls;
|
|||||||
|
|
||||||
namespace GMW.WebUserControls
|
namespace GMW.WebUserControls
|
||||||
{
|
{
|
||||||
public partial class mod_specDmtx : ApplicationUserControl
|
public partial class mod_specDmtx : ApplicationUserControl
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Oggetto locale gestione classe datamatrix...
|
||||||
|
/// </summary>
|
||||||
|
protected DataMatrix DataMatrix_mgr = new DataMatrix();
|
||||||
|
/// <summary>
|
||||||
|
/// reset della selezione
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="sender"></param>
|
||||||
|
/// <param name="e"></param>
|
||||||
|
protected void btnReset_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
/// <summary>
|
resetSelezione();
|
||||||
/// reset della selezione
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="sender"></param>
|
|
||||||
/// <param name="e"></param>
|
|
||||||
protected void btnReset_Click(object sender, EventArgs e)
|
|
||||||
{
|
|
||||||
resetSelezione();
|
|
||||||
}
|
|
||||||
/// <summary>
|
|
||||||
/// resetta la selezione dei valori in caso di modifiche su altri controlli
|
|
||||||
/// </summary>
|
|
||||||
public void resetSelezione()
|
|
||||||
{
|
|
||||||
grView.SelectedIndex = -1;
|
|
||||||
grView.DataBind();
|
|
||||||
raiseEvent(ucEvType.Reset);
|
|
||||||
}
|
|
||||||
/// <summary>
|
|
||||||
/// inserisce nuovo valore da footer
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="sender"></param>
|
|
||||||
/// <param name="e"></param>
|
|
||||||
protected void lblIns_click(object sender, EventArgs e)
|
|
||||||
{
|
|
||||||
// click su inserimento, chiamo il metodo insert dell'ObjectDataSource
|
|
||||||
ods.Insert();
|
|
||||||
}
|
|
||||||
/// <summary>
|
|
||||||
/// gestione evento richiesta nuovo valore (mostra footer, ...)
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="sender"></param>
|
|
||||||
/// <param name="e"></param>
|
|
||||||
protected void btnNew_Click(object sender, EventArgs e)
|
|
||||||
{
|
|
||||||
// reset selezione...
|
|
||||||
resetSelezione();
|
|
||||||
// mostro il footer oppure la riga dei dettagli x nuovo...
|
|
||||||
if (grView.FooterRow != null)
|
|
||||||
{
|
|
||||||
grView.FooterRow.Visible = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
/// <summary>
|
|
||||||
/// determina se sia eliminabile il record (=non usato)
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="idxMaker"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
public bool delEnabled(object idxObj)
|
|
||||||
{
|
|
||||||
bool answ = isWritable();
|
|
||||||
|
|
||||||
return answ;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// elenco colonne del datagrid
|
|
||||||
/// </summary>
|
|
||||||
/// <returns></returns>
|
|
||||||
protected DataColumnCollection colonneObj()
|
|
||||||
{
|
|
||||||
DS_DataMatrix.TabSpecDtxDataTable tabella = new DS_DataMatrix.TabSpecDtxDataTable();
|
|
||||||
DataColumnCollection colonne = tabella.Columns;
|
|
||||||
return colonne;
|
|
||||||
}
|
|
||||||
/// <summary>
|
|
||||||
/// recupera i dati di un nuovo record contenuti nel footer di un gridView;
|
|
||||||
/// questi devono essere opportunamente nominati (es: txt{0}, dl{0}, ...)
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="sender"></param>
|
|
||||||
/// <param name="e"></param>
|
|
||||||
protected void recuperaFooter(object sender, ObjectDataSourceMethodEventArgs e)
|
|
||||||
{
|
|
||||||
//recupero la riga footer...
|
|
||||||
DataColumnCollection colonne = colonneObj();
|
|
||||||
string nomeCol;
|
|
||||||
string tipoColonna = "";
|
|
||||||
foreach (DataColumn colonna in colonne)
|
|
||||||
{
|
|
||||||
nomeCol = colonna.ColumnName;
|
|
||||||
// cerco un textbox o quello che sia...
|
|
||||||
if (grView.FooterRow.FindControl(string.Format("txt{0}", nomeCol)) != null)
|
|
||||||
{
|
|
||||||
tipoColonna = "textBox";
|
|
||||||
}
|
|
||||||
else if (grView.FooterRow.FindControl(string.Format("dl{0}", nomeCol)) != null)
|
|
||||||
{
|
|
||||||
tipoColonna = "dropDownList";
|
|
||||||
}
|
|
||||||
else if (grView.FooterRow.FindControl(string.Format("chk{0}", nomeCol)) != null)
|
|
||||||
{
|
|
||||||
tipoColonna = "checkBox";
|
|
||||||
}
|
|
||||||
else if (grView.FooterRow.FindControl(string.Format("selAjax_{0}", nomeCol)) != null)
|
|
||||||
{
|
|
||||||
tipoColonna = "selAjax";
|
|
||||||
}
|
|
||||||
// in base al tipo salvo negli inputparameters dell'ODS
|
|
||||||
switch (tipoColonna)
|
|
||||||
{
|
|
||||||
case "textBox":
|
|
||||||
e.InputParameters[nomeCol] = ((TextBox)grView.FooterRow.FindControl(string.Format("txt{0}", nomeCol))).Text;
|
|
||||||
break;
|
|
||||||
case "dropDownList":
|
|
||||||
e.InputParameters[nomeCol] = ((DropDownList)grView.FooterRow.FindControl(string.Format("dl{0}", nomeCol))).SelectedValue;
|
|
||||||
break;
|
|
||||||
case "checkBox":
|
|
||||||
e.InputParameters[nomeCol] = ((CheckBox)grView.FooterRow.FindControl(string.Format("chk{0}", nomeCol))).Checked;
|
|
||||||
break;
|
|
||||||
case "selAjax":
|
|
||||||
e.InputParameters[nomeCol] = ((mod_selettore_ajax)grView.FooterRow.FindControl(string.Format("selAjax_{0}", nomeCol))).valore;
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
tipoColonna = "";
|
|
||||||
}
|
|
||||||
// imposto formato Dtmx
|
|
||||||
e.InputParameters["FormatoDtmx"] = FormatoDtmx;
|
|
||||||
if (e.InputParameters["ValoreStr"] == null) e.InputParameters["ValoreStr"] = "";
|
|
||||||
}
|
|
||||||
|
|
||||||
protected void grView_SelectedIndexChanged(object sender, EventArgs e)
|
|
||||||
{
|
|
||||||
raiseEvent(ucEvType.Selected);
|
|
||||||
}
|
|
||||||
|
|
||||||
public string FormatoDtmx
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return hfFormatoDtmx.Value;
|
|
||||||
}
|
|
||||||
set
|
|
||||||
{
|
|
||||||
hfFormatoDtmx.Value = value;
|
|
||||||
grView.SelectedIndex = -1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
protected void ods_Updating(object sender, ObjectDataSourceMethodEventArgs e)
|
|
||||||
{
|
|
||||||
if (e.InputParameters["ValoreStr"] == null) e.InputParameters["ValoreStr"] = "";
|
|
||||||
}
|
|
||||||
|
|
||||||
protected void btnNewFromEmpty_Click(object sender, EventArgs e)
|
|
||||||
{
|
|
||||||
// creo record x la lunghezza
|
|
||||||
DataMatrix.mgr.taSpecDtmx.Insert(FormatoDtmx, "LUNGH", "", FormatoDtmx.Length, "", 0, true);
|
|
||||||
grView.DataBind();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// resetta la selezione dei valori in caso di modifiche su altri controlli
|
||||||
|
/// </summary>
|
||||||
|
public void resetSelezione()
|
||||||
|
{
|
||||||
|
grView.SelectedIndex = -1;
|
||||||
|
grView.DataBind();
|
||||||
|
raiseEvent(ucEvType.Reset);
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// inserisce nuovo valore da footer
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="sender"></param>
|
||||||
|
/// <param name="e"></param>
|
||||||
|
protected void lblIns_click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
// click su inserimento, chiamo il metodo insert dell'ObjectDataSource
|
||||||
|
ods.Insert();
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// gestione evento richiesta nuovo valore (mostra footer, ...)
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="sender"></param>
|
||||||
|
/// <param name="e"></param>
|
||||||
|
protected void btnNew_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
// reset selezione...
|
||||||
|
resetSelezione();
|
||||||
|
// mostro il footer oppure la riga dei dettagli x nuovo...
|
||||||
|
if (grView.FooterRow != null)
|
||||||
|
{
|
||||||
|
grView.FooterRow.Visible = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// determina se sia eliminabile il record (=non usato)
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="idxMaker"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public bool delEnabled(object idxObj)
|
||||||
|
{
|
||||||
|
bool answ = isWritable();
|
||||||
|
|
||||||
|
return answ;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// elenco colonne del datagrid
|
||||||
|
/// </summary>
|
||||||
|
/// <returns></returns>
|
||||||
|
protected DataColumnCollection colonneObj()
|
||||||
|
{
|
||||||
|
DS_DataMatrix.TabSpecDtxDataTable tabella = new DS_DataMatrix.TabSpecDtxDataTable();
|
||||||
|
DataColumnCollection colonne = tabella.Columns;
|
||||||
|
return colonne;
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// recupera i dati di un nuovo record contenuti nel footer di un gridView;
|
||||||
|
/// questi devono essere opportunamente nominati (es: txt{0}, dl{0}, ...)
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="sender"></param>
|
||||||
|
/// <param name="e"></param>
|
||||||
|
protected void recuperaFooter(object sender, ObjectDataSourceMethodEventArgs e)
|
||||||
|
{
|
||||||
|
//recupero la riga footer...
|
||||||
|
DataColumnCollection colonne = colonneObj();
|
||||||
|
string nomeCol;
|
||||||
|
string tipoColonna = "";
|
||||||
|
foreach (DataColumn colonna in colonne)
|
||||||
|
{
|
||||||
|
nomeCol = colonna.ColumnName;
|
||||||
|
// cerco un textbox o quello che sia...
|
||||||
|
if (grView.FooterRow.FindControl(string.Format("txt{0}", nomeCol)) != null)
|
||||||
|
{
|
||||||
|
tipoColonna = "textBox";
|
||||||
|
}
|
||||||
|
else if (grView.FooterRow.FindControl(string.Format("dl{0}", nomeCol)) != null)
|
||||||
|
{
|
||||||
|
tipoColonna = "dropDownList";
|
||||||
|
}
|
||||||
|
else if (grView.FooterRow.FindControl(string.Format("chk{0}", nomeCol)) != null)
|
||||||
|
{
|
||||||
|
tipoColonna = "checkBox";
|
||||||
|
}
|
||||||
|
else if (grView.FooterRow.FindControl(string.Format("selAjax_{0}", nomeCol)) != null)
|
||||||
|
{
|
||||||
|
tipoColonna = "selAjax";
|
||||||
|
}
|
||||||
|
// in base al tipo salvo negli inputparameters dell'ODS
|
||||||
|
switch (tipoColonna)
|
||||||
|
{
|
||||||
|
case "textBox":
|
||||||
|
e.InputParameters[nomeCol] = ((TextBox)grView.FooterRow.FindControl(string.Format("txt{0}", nomeCol))).Text;
|
||||||
|
break;
|
||||||
|
case "dropDownList":
|
||||||
|
e.InputParameters[nomeCol] = ((DropDownList)grView.FooterRow.FindControl(string.Format("dl{0}", nomeCol))).SelectedValue;
|
||||||
|
break;
|
||||||
|
case "checkBox":
|
||||||
|
e.InputParameters[nomeCol] = ((CheckBox)grView.FooterRow.FindControl(string.Format("chk{0}", nomeCol))).Checked;
|
||||||
|
break;
|
||||||
|
case "selAjax":
|
||||||
|
e.InputParameters[nomeCol] = ((mod_selettore_ajax)grView.FooterRow.FindControl(string.Format("selAjax_{0}", nomeCol))).valore;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
tipoColonna = "";
|
||||||
|
}
|
||||||
|
// imposto formato Dtmx
|
||||||
|
e.InputParameters["FormatoDtmx"] = FormatoDtmx;
|
||||||
|
if (e.InputParameters["ValoreStr"] == null) e.InputParameters["ValoreStr"] = "";
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void grView_SelectedIndexChanged(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
raiseEvent(ucEvType.Selected);
|
||||||
|
}
|
||||||
|
|
||||||
|
public string FormatoDtmx
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return hfFormatoDtmx.Value;
|
||||||
|
}
|
||||||
|
set
|
||||||
|
{
|
||||||
|
hfFormatoDtmx.Value = value;
|
||||||
|
grView.SelectedIndex = -1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void ods_Updating(object sender, ObjectDataSourceMethodEventArgs e)
|
||||||
|
{
|
||||||
|
if (e.InputParameters["ValoreStr"] == null) e.InputParameters["ValoreStr"] = "";
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void btnNewFromEmpty_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
// creo record x la lunghezza
|
||||||
|
DataMatrix_mgr.taSpecDtmx.Insert(FormatoDtmx, "LUNGH", "", FormatoDtmx.Length, "", 0, true);
|
||||||
|
grView.DataBind();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -5,344 +5,348 @@ using System.Web.UI;
|
|||||||
|
|
||||||
namespace GMW.WebUserControls
|
namespace GMW.WebUserControls
|
||||||
{
|
{
|
||||||
public partial class mod_spostaDataMatrix : System.Web.UI.UserControl
|
public partial class mod_spostaDataMatrix : System.Web.UI.UserControl
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Oggetto locale gestione classe datamatrix...
|
||||||
|
/// </summary>
|
||||||
|
protected DataMatrix DataMatrix_mgr = new DataMatrix();
|
||||||
|
/// <summary>
|
||||||
|
/// controlli al caricamento pagina
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="sender"></param>
|
||||||
|
/// <param name="e"></param>
|
||||||
|
protected void Page_Load(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
/// <summary>
|
// se primo caricamento resetto gitterbox...)
|
||||||
/// controlli al caricamento pagina
|
if (!Page.IsPostBack)
|
||||||
/// </summary>
|
{
|
||||||
/// <param name="sender"></param>
|
currGitterBox = "";
|
||||||
/// <param name="e"></param>
|
pnlAll.CssClass = "stileAttesa";
|
||||||
protected void Page_Load(object sender, EventArgs e)
|
}
|
||||||
|
checkBarcode();
|
||||||
|
lblPezziGitterbox.Text = string.Format("{0} pz.", pezziGitterbox);
|
||||||
|
lblCurrentPage.Text = traduci(PagCorrente);
|
||||||
|
if (currGitterBox != "")
|
||||||
|
{
|
||||||
|
lblGitterBoxAttivo.Text = string.Format("Gitterbox selezionato <b>{0}</b>", currGitterBox);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
lblGitterBoxAttivo.Text = "...";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// restituisce il nome della pagina corrente
|
||||||
|
/// </summary>
|
||||||
|
protected string PagCorrente
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
string answ = "";
|
||||||
|
Uri MyUrl = Request.Url;
|
||||||
|
string delimStr = "/";
|
||||||
|
char[] delimiter = delimStr.ToCharArray();
|
||||||
|
string[] finalUrl = MyUrl.LocalPath.ToString().Split(delimiter);
|
||||||
|
int n = finalUrl.Length;
|
||||||
|
answ = finalUrl[n - 1].ToString();
|
||||||
|
DataLayer_AnagGen.PermessiRow riga = (DataLayer_AnagGen.PermessiRow)user_std.UtSn.permessi.Select(string.Format("URL = '{0}'", answ))[0];
|
||||||
|
answ = riga.NOME;
|
||||||
|
return answ;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// wrapper traduzione
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="lemma"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public string traduci(object lemma)
|
||||||
|
{
|
||||||
|
return user_std.UtSn.Traduci(lemma.ToString());
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// num pezzi del gitterbox
|
||||||
|
/// </summary>
|
||||||
|
public int pezziGitterbox
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
int answ = 0;
|
||||||
|
try
|
||||||
{
|
{
|
||||||
// se primo caricamento resetto gitterbox...)
|
answ = (int)MagClass.magazzino.taCartellini.getByUdc(currGitterBox)[0].Qta;
|
||||||
if (!Page.IsPostBack)
|
}
|
||||||
|
catch
|
||||||
|
{ }
|
||||||
|
return answ;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// indica il gitterbox correntemente selezionato
|
||||||
|
/// </summary>
|
||||||
|
protected string currGitterBox
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return memLayer.ML.StringSessionObj("currGitterBox");
|
||||||
|
}
|
||||||
|
set
|
||||||
|
{
|
||||||
|
memLayer.ML.setSessionVal("currGitterBox", value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// controllo booleano sul gitterbox se sia ok x caricamento altri pezzi (ovvero en contiene meno del max consentito
|
||||||
|
/// </summary>
|
||||||
|
protected bool gitterboxOk
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
bool answ = false;
|
||||||
|
int maxPezzi = memLayer.ML.confReadInt("qtaOdette");
|
||||||
|
int numPezzi = maxPezzi;
|
||||||
|
try
|
||||||
|
{
|
||||||
|
numPezzi = (int)MagClass.magazzino.taCartellini.getByUdc(currGitterBox)[0].Qta;
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{
|
||||||
|
httpLog(string.Format("Non sono riuscito a trovare dati per il gitterbox {0}", currGitterBox), tipoLog.ERROR);
|
||||||
|
}
|
||||||
|
// controllo se il codice sia "Pieno", ovvero max pezzi
|
||||||
|
if (numPezzi < maxPezzi)
|
||||||
|
{
|
||||||
|
answ = true;
|
||||||
|
}
|
||||||
|
return answ;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// wrapper per log con salvataggio dell'IP del chiamante
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="_testoPre"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public bool httpLog(string _testoPre)
|
||||||
|
{
|
||||||
|
bool answ = false;
|
||||||
|
string postazione_IP = "";
|
||||||
|
try
|
||||||
|
{
|
||||||
|
postazione_IP = string.Format(" | {0} | ", Request.UserHostName);
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{ }
|
||||||
|
logger.lg.scriviLog(postazione_IP + _testoPre);
|
||||||
|
return answ;
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// wrapper per log con salvataggio dell'IP del chiamante
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="_testoPre"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public bool httpLog(string testoLog, tipoLog tipo)
|
||||||
|
{
|
||||||
|
bool answ = false;
|
||||||
|
string postazione_IP = "";
|
||||||
|
try
|
||||||
|
{
|
||||||
|
postazione_IP = string.Format(" | {0} | ", Request.UserHostName);
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{ }
|
||||||
|
logger.lg.scriviLog(postazione_IP + testoLog, tipo);
|
||||||
|
return answ;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// controlla se ci sia un barcode
|
||||||
|
/// </summary>
|
||||||
|
private void checkBarcode()
|
||||||
|
{
|
||||||
|
if (barcodeIn != "")
|
||||||
|
{
|
||||||
|
lblMessaggi.Text = string.Format("Barcode digitato: {0}", barcodeIn);
|
||||||
|
switch (tipoBCode)
|
||||||
|
{
|
||||||
|
case tipoCodiceBarcode.Gitterbox:
|
||||||
|
// imposto il gitterbox corrente
|
||||||
|
currGitterBox = barcodeIn;
|
||||||
|
if (gitterboxOk)
|
||||||
{
|
{
|
||||||
|
// controllo se il gitterbox non sia stato già associato ad una etichetta odette - non si può spostare
|
||||||
|
if (Odette.mgr.gitterboxInOdette(currGitterBox))
|
||||||
|
{
|
||||||
currGitterBox = "";
|
currGitterBox = "";
|
||||||
pnlAll.CssClass = "stileAttesa";
|
lblMessaggi.Text += " - gitterbox <b>associato</b>ad odette!!! non impostabile.";
|
||||||
|
pnlAll.CssClass = "stileComandoKo";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
lblMessaggi.Text += " - impostato nuovo gitterbox di destinazione!";
|
||||||
|
pnlAll.CssClass = "stileComandoOk";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
checkBarcode();
|
else
|
||||||
lblPezziGitterbox.Text = string.Format("{0} pz.", pezziGitterbox);
|
{
|
||||||
lblCurrentPage.Text = traduci(PagCorrente);
|
lblMessaggi.Text += " - gitterbox <b>pieno</b>!!! impostato, ma non si possono versare altri pezzi.";
|
||||||
|
pnlAll.CssClass = "stileComandoKo";
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case tipoCodiceBarcode.DataMatrixTrovato:
|
||||||
|
// se c'è un gitterbox attivo sposto il datamatrix
|
||||||
if (currGitterBox != "")
|
if (currGitterBox != "")
|
||||||
{
|
{
|
||||||
lblGitterBoxAttivo.Text = string.Format("Gitterbox selezionato <b>{0}</b>", currGitterBox);
|
if (gitterboxOk)
|
||||||
}
|
{
|
||||||
else
|
decimal dataMatrix = Convert.ToDecimal(barcodeIn);
|
||||||
{
|
// controllo che esissta il datamatrix...
|
||||||
lblGitterBoxAttivo.Text = "...";
|
if (Odette.mgr.datamatrixEsiste(dataMatrix))
|
||||||
}
|
|
||||||
}
|
|
||||||
/// <summary>
|
|
||||||
/// restituisce il nome della pagina corrente
|
|
||||||
/// </summary>
|
|
||||||
protected string PagCorrente
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
string answ = "";
|
|
||||||
Uri MyUrl = Request.Url;
|
|
||||||
string delimStr = "/";
|
|
||||||
char[] delimiter = delimStr.ToCharArray();
|
|
||||||
string[] finalUrl = MyUrl.LocalPath.ToString().Split(delimiter);
|
|
||||||
int n = finalUrl.Length;
|
|
||||||
answ = finalUrl[n - 1].ToString();
|
|
||||||
DataLayer_AnagGen.PermessiRow riga = (DataLayer_AnagGen.PermessiRow)user_std.UtSn.permessi.Select(string.Format("URL = '{0}'", answ))[0];
|
|
||||||
answ = riga.NOME;
|
|
||||||
return answ;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
/// <summary>
|
|
||||||
/// wrapper traduzione
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="lemma"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
public string traduci(object lemma)
|
|
||||||
{
|
|
||||||
return user_std.UtSn.Traduci(lemma.ToString());
|
|
||||||
}
|
|
||||||
/// <summary>
|
|
||||||
/// num pezzi del gitterbox
|
|
||||||
/// </summary>
|
|
||||||
public int pezziGitterbox
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
int answ = 0;
|
|
||||||
try
|
|
||||||
{
|
{
|
||||||
answ = (int)MagClass.magazzino.taCartellini.getByUdc(currGitterBox)[0].Qta;
|
// effettuo spostamento del datamatrix nel nuovo gitterbox
|
||||||
}
|
if (!Odette.mgr.datamatrixInOdette(dataMatrix))
|
||||||
catch
|
{
|
||||||
{ }
|
// controllo che il gitterbox sia coerente col datamatrix per prodotto...
|
||||||
return answ;
|
if (Odette.mgr.dtMtxGtboxCompatibili(dataMatrix, currGitterBox))
|
||||||
}
|
{
|
||||||
}
|
DataMatrix_mgr.taElencoDM.spostaInGitterbox(dataMatrix, currGitterBox, MagClass.magazzino.CodSoggCurrUser);
|
||||||
/// <summary>
|
lblMessaggi.Text += " - spostato nel gitterbox attivo!";
|
||||||
/// indica il gitterbox correntemente selezionato
|
pnlAll.CssClass = "stileComandoAdd";
|
||||||
/// </summary>
|
}
|
||||||
protected string currGitterBox
|
else
|
||||||
{
|
{
|
||||||
get
|
lblMessaggi.Text += " - datamatrix non spostabile, il gitterbox contiene prodotti diversi!";
|
||||||
{
|
pnlAll.CssClass = "stileErr01";
|
||||||
return memLayer.ML.StringSessionObj("currGitterBox");
|
}
|
||||||
}
|
}
|
||||||
set
|
else
|
||||||
{
|
{
|
||||||
memLayer.ML.setSessionVal("currGitterBox", value);
|
lblMessaggi.Text += " - datamatrix non spostabile, in gitterbox già associato ad odette!";
|
||||||
}
|
pnlAll.CssClass = "stileErr03";
|
||||||
}
|
}
|
||||||
/// <summary>
|
|
||||||
/// controllo booleano sul gitterbox se sia ok x caricamento altri pezzi (ovvero en contiene meno del max consentito
|
|
||||||
/// </summary>
|
|
||||||
protected bool gitterboxOk
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
bool answ = false;
|
|
||||||
int maxPezzi = memLayer.ML.confReadInt("qtaOdette");
|
|
||||||
int numPezzi = maxPezzi;
|
|
||||||
try
|
|
||||||
{
|
|
||||||
numPezzi = (int)MagClass.magazzino.taCartellini.getByUdc(currGitterBox)[0].Qta;
|
|
||||||
}
|
|
||||||
catch
|
|
||||||
{
|
|
||||||
httpLog(string.Format("Non sono riuscito a trovare dati per il gitterbox {0}", currGitterBox), tipoLog.ERROR);
|
|
||||||
}
|
|
||||||
// controllo se il codice sia "Pieno", ovvero max pezzi
|
|
||||||
if (numPezzi < maxPezzi)
|
|
||||||
{
|
|
||||||
answ = true;
|
|
||||||
}
|
|
||||||
return answ;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
/// <summary>
|
|
||||||
/// wrapper per log con salvataggio dell'IP del chiamante
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="_testoPre"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
public bool httpLog(string _testoPre)
|
|
||||||
{
|
|
||||||
bool answ = false;
|
|
||||||
string postazione_IP = "";
|
|
||||||
try
|
|
||||||
{
|
|
||||||
postazione_IP = string.Format(" | {0} | ", Request.UserHostName);
|
|
||||||
}
|
|
||||||
catch
|
|
||||||
{ }
|
|
||||||
logger.lg.scriviLog(postazione_IP + _testoPre);
|
|
||||||
return answ;
|
|
||||||
}
|
|
||||||
/// <summary>
|
|
||||||
/// wrapper per log con salvataggio dell'IP del chiamante
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="_testoPre"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
public bool httpLog(string testoLog, tipoLog tipo)
|
|
||||||
{
|
|
||||||
bool answ = false;
|
|
||||||
string postazione_IP = "";
|
|
||||||
try
|
|
||||||
{
|
|
||||||
postazione_IP = string.Format(" | {0} | ", Request.UserHostName);
|
|
||||||
}
|
|
||||||
catch
|
|
||||||
{ }
|
|
||||||
logger.lg.scriviLog(postazione_IP + testoLog, tipo);
|
|
||||||
return answ;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// controlla se ci sia un barcode
|
|
||||||
/// </summary>
|
|
||||||
private void checkBarcode()
|
|
||||||
{
|
|
||||||
if (barcodeIn != "")
|
|
||||||
{
|
|
||||||
lblMessaggi.Text = string.Format("Barcode digitato: {0}", barcodeIn);
|
|
||||||
switch (tipoBCode)
|
|
||||||
{
|
|
||||||
case tipoCodiceBarcode.Gitterbox:
|
|
||||||
// imposto il gitterbox corrente
|
|
||||||
currGitterBox = barcodeIn;
|
|
||||||
if (gitterboxOk)
|
|
||||||
{
|
|
||||||
// controllo se il gitterbox non sia stato già associato ad una etichetta odette - non si può spostare
|
|
||||||
if (Odette.mgr.gitterboxInOdette(currGitterBox))
|
|
||||||
{
|
|
||||||
currGitterBox = "";
|
|
||||||
lblMessaggi.Text += " - gitterbox <b>associato</b>ad odette!!! non impostabile.";
|
|
||||||
pnlAll.CssClass = "stileComandoKo";
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
lblMessaggi.Text += " - impostato nuovo gitterbox di destinazione!";
|
|
||||||
pnlAll.CssClass = "stileComandoOk";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
lblMessaggi.Text += " - gitterbox <b>pieno</b>!!! impostato, ma non si possono versare altri pezzi.";
|
|
||||||
pnlAll.CssClass = "stileComandoKo";
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case tipoCodiceBarcode.DataMatrixTrovato:
|
|
||||||
// se c'è un gitterbox attivo sposto il datamatrix
|
|
||||||
if (currGitterBox != "")
|
|
||||||
{
|
|
||||||
if (gitterboxOk)
|
|
||||||
{
|
|
||||||
decimal dataMatrix = Convert.ToDecimal(barcodeIn);
|
|
||||||
// controllo che esissta il datamatrix...
|
|
||||||
if (Odette.mgr.datamatrixEsiste(dataMatrix))
|
|
||||||
{
|
|
||||||
// effettuo spostamento del datamatrix nel nuovo gitterbox
|
|
||||||
if (!Odette.mgr.datamatrixInOdette(dataMatrix))
|
|
||||||
{
|
|
||||||
// controllo che il gitterbox sia coerente col datamatrix per prodotto...
|
|
||||||
if (Odette.mgr.dtMtxGtboxCompatibili(dataMatrix, currGitterBox))
|
|
||||||
{
|
|
||||||
DataMatrix.mgr.taElencoDM.spostaInGitterbox(dataMatrix, currGitterBox, MagClass.magazzino.CodSoggCurrUser);
|
|
||||||
lblMessaggi.Text += " - spostato nel gitterbox attivo!";
|
|
||||||
pnlAll.CssClass = "stileComandoAdd";
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
lblMessaggi.Text += " - datamatrix non spostabile, il gitterbox contiene prodotti diversi!";
|
|
||||||
pnlAll.CssClass = "stileErr01";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
lblMessaggi.Text += " - datamatrix non spostabile, in gitterbox già associato ad odette!";
|
|
||||||
pnlAll.CssClass = "stileErr03";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
lblMessaggi.Text += " - datamatrix non trovato!";
|
|
||||||
pnlAll.CssClass = "stileErr02";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
lblMessaggi.Text += " - il gitterbox è <b>pieno</b>!!!";
|
|
||||||
pnlAll.CssClass = "stileComandoKo";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
// altrimenti segnalo che manca il gitterbox di destinazione
|
|
||||||
lblMessaggi.Text += " - <b>errore</b>, manca un gitterbox di destinazione!";
|
|
||||||
pnlAll.CssClass = "stileComandoKo";
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case tipoCodiceBarcode.Comando:
|
|
||||||
// controllo se è svuota gitterbox, nel caso lo svuoto
|
|
||||||
string cmdSvuotaGbox = memLayer.ML.cdv("cmdSvuotaGitterBox");
|
|
||||||
string cmdEsci = memLayer.ML.cdv("cmdEsci");
|
|
||||||
if (barcodeIn == cmdSvuotaGbox)
|
|
||||||
{
|
|
||||||
if (gitterboxOk)
|
|
||||||
{
|
|
||||||
DataMatrix.mgr.taElencoDM.svuotaGitterbox(currGitterBox, MagClass.magazzino.CodSoggCurrUser);
|
|
||||||
lblMessaggi.Text += " - <b>Gitterbox svuotato</b>!";
|
|
||||||
pnlAll.CssClass = "stileAttesa";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if (barcodeIn == cmdEsci)
|
|
||||||
{
|
|
||||||
currGitterBox = "";
|
|
||||||
Response.Redirect("~/menu.aspx");
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
lblMessaggi.Text += " - codice comando <b>non riconosciuto</b>!";
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
lblMessaggi.Text += " - codice <b>non riconosciuto</b>!";
|
|
||||||
pnlAll.CssClass = "stileComandoND";
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
barcodeIn = "";
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
lblMessaggi.Text = traduci("AttesaBCode");
|
|
||||||
pnlAll.CssClass = "stileAttesa";
|
|
||||||
}
|
|
||||||
grView.DataBind();
|
|
||||||
txtBarcode.Focus();
|
|
||||||
}
|
|
||||||
/// <summary>
|
|
||||||
///
|
|
||||||
/// </summary>
|
|
||||||
public tipoCodiceBarcode tipoBCode
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
tipoCodiceBarcode answ = tipoCodiceBarcode.ND;
|
|
||||||
int trovati = 0;
|
|
||||||
// controllo non si tratti di un comando...
|
|
||||||
string preCmd = memLayer.ML.AppConf["prefComandi"];
|
|
||||||
if (barcodeIn.StartsWith(preCmd))
|
|
||||||
{
|
|
||||||
answ = tipoCodiceBarcode.Comando;
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
try
|
lblMessaggi.Text += " - datamatrix non trovato!";
|
||||||
{
|
pnlAll.CssClass = "stileErr02";
|
||||||
// cerco tra gitterbox (UDC)...
|
|
||||||
trovati = MagClass.magazzino.taCartellini.getByUdc(barcodeIn).Rows.Count;
|
|
||||||
// cerco tra datamatrix
|
|
||||||
if (trovati > 0)
|
|
||||||
{
|
|
||||||
answ = tipoCodiceBarcode.Gitterbox;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
trovati = DataMatrix.mgr.taElencoDM.getByCode(Convert.ToDecimal(barcodeIn)).Rows.Count;
|
|
||||||
if (trovati > 0)
|
|
||||||
{
|
|
||||||
answ = tipoCodiceBarcode.DataMatrixTrovato;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
catch
|
|
||||||
{
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return answ;
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
lblMessaggi.Text += " - il gitterbox è <b>pieno</b>!!!";
|
||||||
|
pnlAll.CssClass = "stileComandoKo";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
else
|
||||||
/// <summary>
|
|
||||||
/// valore barcode
|
|
||||||
/// </summary>
|
|
||||||
public string barcodeIn
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
{
|
||||||
return txtBarcode.Text.Trim();
|
// altrimenti segnalo che manca il gitterbox di destinazione
|
||||||
|
lblMessaggi.Text += " - <b>errore</b>, manca un gitterbox di destinazione!";
|
||||||
|
pnlAll.CssClass = "stileComandoKo";
|
||||||
}
|
}
|
||||||
set
|
break;
|
||||||
|
case tipoCodiceBarcode.Comando:
|
||||||
|
// controllo se è svuota gitterbox, nel caso lo svuoto
|
||||||
|
string cmdSvuotaGbox = memLayer.ML.cdv("cmdSvuotaGitterBox");
|
||||||
|
string cmdEsci = memLayer.ML.cdv("cmdEsci");
|
||||||
|
if (barcodeIn == cmdSvuotaGbox)
|
||||||
{
|
{
|
||||||
txtBarcode.Text = value;
|
if (gitterboxOk)
|
||||||
|
{
|
||||||
|
DataMatrix_mgr.taElencoDM.svuotaGitterbox(currGitterBox, MagClass.magazzino.CodSoggCurrUser);
|
||||||
|
lblMessaggi.Text += " - <b>Gitterbox svuotato</b>!";
|
||||||
|
pnlAll.CssClass = "stileAttesa";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
else if (barcodeIn == cmdEsci)
|
||||||
/// <summary>
|
|
||||||
/// indica se i caratteri vadano forzati a maiuscoli
|
|
||||||
/// </summary>
|
|
||||||
public bool forceUppercase
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
{
|
||||||
return memLayer.ML.confReadBool("forceUppercase");
|
currGitterBox = "";
|
||||||
|
Response.Redirect("~/menu.aspx");
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
lblMessaggi.Text += " - codice comando <b>non riconosciuto</b>!";
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
lblMessaggi.Text += " - codice <b>non riconosciuto</b>!";
|
||||||
|
pnlAll.CssClass = "stileComandoND";
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
barcodeIn = "";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
lblMessaggi.Text = traduci("AttesaBCode");
|
||||||
|
pnlAll.CssClass = "stileAttesa";
|
||||||
|
}
|
||||||
|
grView.DataBind();
|
||||||
|
txtBarcode.Focus();
|
||||||
}
|
}
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public tipoCodiceBarcode tipoBCode
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
tipoCodiceBarcode answ = tipoCodiceBarcode.ND;
|
||||||
|
int trovati = 0;
|
||||||
|
// controllo non si tratti di un comando...
|
||||||
|
string preCmd = memLayer.ML.AppConf["prefComandi"];
|
||||||
|
if (barcodeIn.StartsWith(preCmd))
|
||||||
|
{
|
||||||
|
answ = tipoCodiceBarcode.Comando;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
// cerco tra gitterbox (UDC)...
|
||||||
|
trovati = MagClass.magazzino.taCartellini.getByUdc(barcodeIn).Rows.Count;
|
||||||
|
// cerco tra datamatrix
|
||||||
|
if (trovati > 0)
|
||||||
|
{
|
||||||
|
answ = tipoCodiceBarcode.Gitterbox;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
trovati = DataMatrix_mgr.taElencoDM.getByCode(Convert.ToDecimal(barcodeIn)).Rows.Count;
|
||||||
|
if (trovati > 0)
|
||||||
|
{
|
||||||
|
answ = tipoCodiceBarcode.DataMatrixTrovato;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return answ;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// valore barcode
|
||||||
|
/// </summary>
|
||||||
|
public string barcodeIn
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return txtBarcode.Text.Trim();
|
||||||
|
}
|
||||||
|
set
|
||||||
|
{
|
||||||
|
txtBarcode.Text = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// indica se i caratteri vadano forzati a maiuscoli
|
||||||
|
/// </summary>
|
||||||
|
public bool forceUppercase
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return memLayer.ML.confReadBool("forceUppercase");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -6,190 +6,194 @@ using System.Web.UI.WebControls;
|
|||||||
|
|
||||||
namespace GMW.WebUserControls
|
namespace GMW.WebUserControls
|
||||||
{
|
{
|
||||||
public partial class mod_trascPn2Part : ApplicationUserControl
|
public partial class mod_trascPn2Part : ApplicationUserControl
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Oggetto locale gestione classe datamatrix...
|
||||||
|
/// </summary>
|
||||||
|
protected DataMatrix DataMatrix_mgr = new DataMatrix();
|
||||||
|
/// <summary>
|
||||||
|
/// reset della selezione
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="sender"></param>
|
||||||
|
/// <param name="e"></param>
|
||||||
|
protected void btnReset_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
/// <summary>
|
resetSelezione();
|
||||||
/// reset della selezione
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="sender"></param>
|
|
||||||
/// <param name="e"></param>
|
|
||||||
protected void btnReset_Click(object sender, EventArgs e)
|
|
||||||
{
|
|
||||||
resetSelezione();
|
|
||||||
}
|
|
||||||
/// <summary>
|
|
||||||
/// resetta la selezione dei valori in caso di modifiche su altri controlli
|
|
||||||
/// </summary>
|
|
||||||
public void resetSelezione()
|
|
||||||
{
|
|
||||||
grView.SelectedIndex = -1;
|
|
||||||
grView.DataBind();
|
|
||||||
raiseEvent(ucEvType.Reset);
|
|
||||||
}
|
|
||||||
/// <summary>
|
|
||||||
/// inserisce nuovo valore da footer
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="sender"></param>
|
|
||||||
/// <param name="e"></param>
|
|
||||||
protected void lblIns_click(object sender, EventArgs e)
|
|
||||||
{
|
|
||||||
// click su inserimento, chiamo il metodo insert dell'ObjectDataSource
|
|
||||||
ods.Insert();
|
|
||||||
}
|
|
||||||
/// <summary>
|
|
||||||
/// gestione evento richiesta nuovo valore (mostra footer, ...)
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="sender"></param>
|
|
||||||
/// <param name="e"></param>
|
|
||||||
protected void btnNew_Click(object sender, EventArgs e)
|
|
||||||
{
|
|
||||||
// reset selezione...
|
|
||||||
resetSelezione();
|
|
||||||
// mostro il footer oppure la riga dei dettagli x nuovo...
|
|
||||||
if (grView.FooterRow != null)
|
|
||||||
{
|
|
||||||
grView.FooterRow.Visible = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
/// <summary>
|
|
||||||
/// determina se sia eliminabile il record (=non usato)
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="idxMaker"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
public bool delEnabled(object idxObj)
|
|
||||||
{
|
|
||||||
bool answ = isWritable();
|
|
||||||
|
|
||||||
return answ;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// elenco colonne del datagrid
|
|
||||||
/// </summary>
|
|
||||||
/// <returns></returns>
|
|
||||||
protected DataColumnCollection colonneObj()
|
|
||||||
{
|
|
||||||
DS_DataMatrix.TrascDatamatrixDataTable tabella = new DS_DataMatrix.TrascDatamatrixDataTable();
|
|
||||||
DataColumnCollection colonne = tabella.Columns;
|
|
||||||
return colonne;
|
|
||||||
}
|
|
||||||
/// <summary>
|
|
||||||
/// recupera i dati di un nuovo record contenuti nel footer di un gridView;
|
|
||||||
/// questi devono essere opportunamente nominati (es: txt{0}, dl{0}, ...)
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="sender"></param>
|
|
||||||
/// <param name="e"></param>
|
|
||||||
protected void recuperaFooter(object sender, ObjectDataSourceMethodEventArgs e)
|
|
||||||
{
|
|
||||||
//recupero la riga footer...
|
|
||||||
DataColumnCollection colonne = colonneObj();
|
|
||||||
string nomeCol;
|
|
||||||
string tipoColonna = "";
|
|
||||||
foreach (DataColumn colonna in colonne)
|
|
||||||
{
|
|
||||||
nomeCol = colonna.ColumnName;
|
|
||||||
// cerco un textbox o quello che sia...
|
|
||||||
if (grView.FooterRow.FindControl(string.Format("txt{0}", nomeCol)) != null)
|
|
||||||
{
|
|
||||||
tipoColonna = "textBox";
|
|
||||||
}
|
|
||||||
else if (grView.FooterRow.FindControl(string.Format("dl{0}", nomeCol)) != null)
|
|
||||||
{
|
|
||||||
tipoColonna = "dropDownList";
|
|
||||||
}
|
|
||||||
else if (grView.FooterRow.FindControl(string.Format("chk{0}", nomeCol)) != null)
|
|
||||||
{
|
|
||||||
tipoColonna = "checkBox";
|
|
||||||
}
|
|
||||||
else if (grView.FooterRow.FindControl(string.Format("selAjax_{0}", nomeCol)) != null)
|
|
||||||
{
|
|
||||||
tipoColonna = "selAjax";
|
|
||||||
}
|
|
||||||
// in base al tipo salvo negli inputparameters dell'ODS
|
|
||||||
switch (tipoColonna)
|
|
||||||
{
|
|
||||||
case "textBox":
|
|
||||||
e.InputParameters[nomeCol] = ((TextBox)grView.FooterRow.FindControl(string.Format("txt{0}", nomeCol))).Text;
|
|
||||||
break;
|
|
||||||
case "dropDownList":
|
|
||||||
e.InputParameters[nomeCol] = ((DropDownList)grView.FooterRow.FindControl(string.Format("dl{0}", nomeCol))).SelectedValue;
|
|
||||||
break;
|
|
||||||
case "checkBox":
|
|
||||||
e.InputParameters[nomeCol] = ((CheckBox)grView.FooterRow.FindControl(string.Format("chk{0}", nomeCol))).Checked;
|
|
||||||
break;
|
|
||||||
case "selAjax":
|
|
||||||
e.InputParameters[nomeCol] = ((mod_selettore_ajax)grView.FooterRow.FindControl(string.Format("selAjax_{0}", nomeCol))).valore;
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
tipoColonna = "";
|
|
||||||
}
|
|
||||||
if (e.InputParameters["PartNumber"] == null) e.InputParameters["PartNumber"] = "";
|
|
||||||
if (e.InputParameters["Particolare"] == null) e.InputParameters["Particolare"] = "";
|
|
||||||
if (e.InputParameters["FormatoDtmx"] == null) e.InputParameters["FormatoDtmx"] = "";
|
|
||||||
}
|
|
||||||
|
|
||||||
protected void ods_Deleting(object sender, ObjectDataSourceMethodEventArgs e)
|
|
||||||
{
|
|
||||||
if (e.InputParameters["Original_PartNumber"] == null) e.InputParameters["Original_PartNumber"] = "";
|
|
||||||
}
|
|
||||||
|
|
||||||
protected void grView_SelectedIndexChanged(object sender, EventArgs e)
|
|
||||||
{
|
|
||||||
raiseEvent(ucEvType.Selected);
|
|
||||||
}
|
|
||||||
public string FormatoDtmx
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return hfFormatoDtmx.Value;
|
|
||||||
}
|
|
||||||
set
|
|
||||||
{
|
|
||||||
hfFormatoDtmx.Value = value;
|
|
||||||
grView.SelectedIndex = -1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
public string PartNumber
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return hfPartNumber.Value;
|
|
||||||
}
|
|
||||||
set
|
|
||||||
{
|
|
||||||
hfPartNumber.Value = value;
|
|
||||||
grView.SelectedIndex = -1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
public string PartNumberSel
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
string answ = "";
|
|
||||||
try
|
|
||||||
{
|
|
||||||
answ = grView.SelectedDataKey["PartNumber"].ToString();
|
|
||||||
}
|
|
||||||
catch
|
|
||||||
{ }
|
|
||||||
return answ;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
protected void ods_Updating(object sender, ObjectDataSourceMethodEventArgs e)
|
|
||||||
{
|
|
||||||
if (e.InputParameters["PartNumber"] == null) e.InputParameters["PartNumber"] = "";
|
|
||||||
if (e.InputParameters["Particolare"] == null) e.InputParameters["Particolare"] = "";
|
|
||||||
if (e.InputParameters["FormatoDtmx"] == null) e.InputParameters["FormatoDtmx"] = "";
|
|
||||||
if (e.InputParameters["Original_PartNumber"] == null) e.InputParameters["Original_PartNumber"] = "";
|
|
||||||
}
|
|
||||||
|
|
||||||
protected void btnNewFromEmpty_Click(object sender, EventArgs e)
|
|
||||||
{
|
|
||||||
// creo record lunghezza 1...
|
|
||||||
DataMatrix.mgr.taTDtmx.Insert("000", "000", FormatoDtmx);
|
|
||||||
grView.DataBind();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// resetta la selezione dei valori in caso di modifiche su altri controlli
|
||||||
|
/// </summary>
|
||||||
|
public void resetSelezione()
|
||||||
|
{
|
||||||
|
grView.SelectedIndex = -1;
|
||||||
|
grView.DataBind();
|
||||||
|
raiseEvent(ucEvType.Reset);
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// inserisce nuovo valore da footer
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="sender"></param>
|
||||||
|
/// <param name="e"></param>
|
||||||
|
protected void lblIns_click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
// click su inserimento, chiamo il metodo insert dell'ObjectDataSource
|
||||||
|
ods.Insert();
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// gestione evento richiesta nuovo valore (mostra footer, ...)
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="sender"></param>
|
||||||
|
/// <param name="e"></param>
|
||||||
|
protected void btnNew_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
// reset selezione...
|
||||||
|
resetSelezione();
|
||||||
|
// mostro il footer oppure la riga dei dettagli x nuovo...
|
||||||
|
if (grView.FooterRow != null)
|
||||||
|
{
|
||||||
|
grView.FooterRow.Visible = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// determina se sia eliminabile il record (=non usato)
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="idxMaker"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public bool delEnabled(object idxObj)
|
||||||
|
{
|
||||||
|
bool answ = isWritable();
|
||||||
|
|
||||||
|
return answ;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// elenco colonne del datagrid
|
||||||
|
/// </summary>
|
||||||
|
/// <returns></returns>
|
||||||
|
protected DataColumnCollection colonneObj()
|
||||||
|
{
|
||||||
|
DS_DataMatrix.TrascDatamatrixDataTable tabella = new DS_DataMatrix.TrascDatamatrixDataTable();
|
||||||
|
DataColumnCollection colonne = tabella.Columns;
|
||||||
|
return colonne;
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// recupera i dati di un nuovo record contenuti nel footer di un gridView;
|
||||||
|
/// questi devono essere opportunamente nominati (es: txt{0}, dl{0}, ...)
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="sender"></param>
|
||||||
|
/// <param name="e"></param>
|
||||||
|
protected void recuperaFooter(object sender, ObjectDataSourceMethodEventArgs e)
|
||||||
|
{
|
||||||
|
//recupero la riga footer...
|
||||||
|
DataColumnCollection colonne = colonneObj();
|
||||||
|
string nomeCol;
|
||||||
|
string tipoColonna = "";
|
||||||
|
foreach (DataColumn colonna in colonne)
|
||||||
|
{
|
||||||
|
nomeCol = colonna.ColumnName;
|
||||||
|
// cerco un textbox o quello che sia...
|
||||||
|
if (grView.FooterRow.FindControl(string.Format("txt{0}", nomeCol)) != null)
|
||||||
|
{
|
||||||
|
tipoColonna = "textBox";
|
||||||
|
}
|
||||||
|
else if (grView.FooterRow.FindControl(string.Format("dl{0}", nomeCol)) != null)
|
||||||
|
{
|
||||||
|
tipoColonna = "dropDownList";
|
||||||
|
}
|
||||||
|
else if (grView.FooterRow.FindControl(string.Format("chk{0}", nomeCol)) != null)
|
||||||
|
{
|
||||||
|
tipoColonna = "checkBox";
|
||||||
|
}
|
||||||
|
else if (grView.FooterRow.FindControl(string.Format("selAjax_{0}", nomeCol)) != null)
|
||||||
|
{
|
||||||
|
tipoColonna = "selAjax";
|
||||||
|
}
|
||||||
|
// in base al tipo salvo negli inputparameters dell'ODS
|
||||||
|
switch (tipoColonna)
|
||||||
|
{
|
||||||
|
case "textBox":
|
||||||
|
e.InputParameters[nomeCol] = ((TextBox)grView.FooterRow.FindControl(string.Format("txt{0}", nomeCol))).Text;
|
||||||
|
break;
|
||||||
|
case "dropDownList":
|
||||||
|
e.InputParameters[nomeCol] = ((DropDownList)grView.FooterRow.FindControl(string.Format("dl{0}", nomeCol))).SelectedValue;
|
||||||
|
break;
|
||||||
|
case "checkBox":
|
||||||
|
e.InputParameters[nomeCol] = ((CheckBox)grView.FooterRow.FindControl(string.Format("chk{0}", nomeCol))).Checked;
|
||||||
|
break;
|
||||||
|
case "selAjax":
|
||||||
|
e.InputParameters[nomeCol] = ((mod_selettore_ajax)grView.FooterRow.FindControl(string.Format("selAjax_{0}", nomeCol))).valore;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
tipoColonna = "";
|
||||||
|
}
|
||||||
|
if (e.InputParameters["PartNumber"] == null) e.InputParameters["PartNumber"] = "";
|
||||||
|
if (e.InputParameters["Particolare"] == null) e.InputParameters["Particolare"] = "";
|
||||||
|
if (e.InputParameters["FormatoDtmx"] == null) e.InputParameters["FormatoDtmx"] = "";
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void ods_Deleting(object sender, ObjectDataSourceMethodEventArgs e)
|
||||||
|
{
|
||||||
|
if (e.InputParameters["Original_PartNumber"] == null) e.InputParameters["Original_PartNumber"] = "";
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void grView_SelectedIndexChanged(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
raiseEvent(ucEvType.Selected);
|
||||||
|
}
|
||||||
|
public string FormatoDtmx
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return hfFormatoDtmx.Value;
|
||||||
|
}
|
||||||
|
set
|
||||||
|
{
|
||||||
|
hfFormatoDtmx.Value = value;
|
||||||
|
grView.SelectedIndex = -1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public string PartNumber
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return hfPartNumber.Value;
|
||||||
|
}
|
||||||
|
set
|
||||||
|
{
|
||||||
|
hfPartNumber.Value = value;
|
||||||
|
grView.SelectedIndex = -1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public string PartNumberSel
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
string answ = "";
|
||||||
|
try
|
||||||
|
{
|
||||||
|
answ = grView.SelectedDataKey["PartNumber"].ToString();
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{ }
|
||||||
|
return answ;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
protected void ods_Updating(object sender, ObjectDataSourceMethodEventArgs e)
|
||||||
|
{
|
||||||
|
if (e.InputParameters["PartNumber"] == null) e.InputParameters["PartNumber"] = "";
|
||||||
|
if (e.InputParameters["Particolare"] == null) e.InputParameters["Particolare"] = "";
|
||||||
|
if (e.InputParameters["FormatoDtmx"] == null) e.InputParameters["FormatoDtmx"] = "";
|
||||||
|
if (e.InputParameters["Original_PartNumber"] == null) e.InputParameters["Original_PartNumber"] = "";
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void btnNewFromEmpty_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
// creo record lunghezza 1...
|
||||||
|
DataMatrix_mgr.taTDtmx.Insert("000", "000", FormatoDtmx);
|
||||||
|
grView.DataBind();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -3,150 +3,154 @@ using System;
|
|||||||
|
|
||||||
namespace GMW.WebUserControls
|
namespace GMW.WebUserControls
|
||||||
{
|
{
|
||||||
public partial class mod_verificaDmtx : GMW_data.UserControl
|
public partial class mod_verificaDmtx : GMW_data.UserControl
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Oggetto locale gestione classe datamatrix...
|
||||||
|
/// </summary>
|
||||||
|
protected DataMatrix DataMatrix_mgr = new DataMatrix();
|
||||||
|
protected void Page_Load(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
protected void Page_Load(object sender, EventArgs e)
|
txtBarcode.Focus();
|
||||||
{
|
|
||||||
txtBarcode.Focus();
|
|
||||||
}
|
|
||||||
/// <summary>
|
|
||||||
/// controlla se ci sia un barcode
|
|
||||||
/// </summary>
|
|
||||||
private void checkBarcode()
|
|
||||||
{
|
|
||||||
bool isDecodOk = false;
|
|
||||||
bool isInList = true;
|
|
||||||
|
|
||||||
// verifico
|
|
||||||
isDecodOk = (DataMatrix.mgr.taAnagFormDtx.getFormatiCompatibili(barcodeIn).Rows.Count > 0);
|
|
||||||
isInList = (DataMatrix.mgr.taVED.getByKey(barcodeIn).Rows.Count > 0);
|
|
||||||
|
|
||||||
// imposto di conseguenza grafica e info
|
|
||||||
string classDivDec = "col-sm-6 bg-danger";
|
|
||||||
string classDivList = "col-sm-6 bg-danger";
|
|
||||||
if (isDecodOk)
|
|
||||||
{
|
|
||||||
//divDecod.Attributes.Add("class", "col-sm-6 bg-success");
|
|
||||||
classDivDec = "col-sm-6 bg-success";
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
//divDecod.Attributes.Add("class", "col-sm-6 bg-danger");
|
|
||||||
classDivDec = "col-sm-6 bg-danger";
|
|
||||||
}
|
|
||||||
if (isInList)
|
|
||||||
{
|
|
||||||
//divElenco.Attributes.Add("class", "col-sm-6 bg-success");
|
|
||||||
classDivList = "col-sm-6 bg-success";
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
//divElenco.Attributes.Add("class", "col-sm-6 bg-danger");
|
|
||||||
classDivList = "col-sm-6 bg-danger";
|
|
||||||
}
|
|
||||||
// aggiorno visualizzazione...
|
|
||||||
if (isDecodOk || isInList)
|
|
||||||
{
|
|
||||||
lblBarcode.Text = string.Format("Datamatrix: <b>{0}</b>", barcodeIn);
|
|
||||||
if (isDecodOk)
|
|
||||||
{
|
|
||||||
lblEsitoDec.Text = string.Format("{0}: <b>OK</b>", traduci("VerificaDecodifica"));
|
|
||||||
DS_DataMatrix.AnagFormatiDtmxRow riga = (DS_DataMatrix.AnagFormatiDtmxRow)DataMatrix.mgr.taAnagFormDtx.getFormatiCompatibili(barcodeIn).Rows[0];
|
|
||||||
lblFormatoDmtxDec.Text = string.Format("Formato: <b>{0}</b>", riga.FormatoDtmx);
|
|
||||||
// controllo se il PartNum venga decodificato --> lo decodifico e mostro entrambi
|
|
||||||
string PartNumIn = barcodeIn.Substring(riga.PartNumberPos - 1, riga.PartNumberLun);
|
|
||||||
string PartNum = "";
|
|
||||||
string Particolare = "";
|
|
||||||
if (DataMatrix.mgr.taTPN.getByPN_IN(PartNumIn).Rows.Count > 0)
|
|
||||||
{
|
|
||||||
PartNum = ((DS_DataMatrix.TrascPartNumRow)DataMatrix.mgr.taTPN.getByPN_IN(PartNumIn).Rows[0]).PartNumberOUT;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
PartNum = PartNumIn;
|
|
||||||
}
|
|
||||||
try
|
|
||||||
{
|
|
||||||
Particolare = ((DS_DataMatrix.TrascDatamatrixRow)DataMatrix.mgr.taTDtmx.getByPnFormato(riga.FormatoDtmx, PartNum).Rows[0]).Particolare;
|
|
||||||
}
|
|
||||||
catch
|
|
||||||
{
|
|
||||||
Particolare = "Non Trovato";
|
|
||||||
lblEsitoDec.Text += "/<b>ND</b>";
|
|
||||||
classDivDec = "col-sm-6 bg-warning";
|
|
||||||
}
|
|
||||||
lblPartNumDec.Text = string.Format("Part Num: <b>{0}</b>", PartNum);
|
|
||||||
// se fosse stato decodificato
|
|
||||||
if (PartNum != PartNumIn)
|
|
||||||
{
|
|
||||||
lblPartNumDec.Text += string.Format("<br><i>({0})</i>", PartNumIn);
|
|
||||||
}
|
|
||||||
lblCodPartDec.Text = string.Format("Cod Part: <b>{0}</b>", Particolare);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
lblEsitoDec.Text += string.Format("{0}: <b>KO</b>", traduci("VerificaDecodifica"));
|
|
||||||
lblFormatoDmtxDec.Text = "...";
|
|
||||||
lblPartNumDec.Text = "..";
|
|
||||||
lblCodPartDec.Text = ".";
|
|
||||||
}
|
|
||||||
if (isInList)
|
|
||||||
{
|
|
||||||
lblEsitoAcq.Text = string.Format("{0}: <b>OK</b>", traduci("VerificaAcquisizioni"));
|
|
||||||
DS_DataMatrix.v_ElencoDmtxRow riga = ((DS_DataMatrix.v_ElencoDmtxRow)DataMatrix.mgr.taVED.getByKey(barcodeIn).Rows[0]);
|
|
||||||
lblFormatoDmtxAcq.Text = string.Format("Formato MM: <b>{0}</b>", riga.FormatoDtmxMM);
|
|
||||||
lblEsitoMarc.Text = string.Format("Esito marcatura MM: <b>{0}</b>", riga.EsitoMarcatura);
|
|
||||||
lblPartNumAcq.Text = string.Format("Part Num MM: <b>{0}</b>", riga.PartNumber);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
lblEsitoAcq.Text = string.Format("{0}: <b>KO</b>", traduci("VerificaAcquisizioni"));
|
|
||||||
lblFormatoDmtxAcq.Text = "...";
|
|
||||||
lblEsitoMarc.Text = "..";
|
|
||||||
lblPartNumAcq.Text = ".";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
lblBarcode.Text = string.Format("Codice non riconosciuto: <b>{0}</b>", barcodeIn);
|
|
||||||
lblEsitoDec.Text = "....";
|
|
||||||
lblFormatoDmtxDec.Text = "...";
|
|
||||||
lblPartNumDec.Text = "..";
|
|
||||||
lblCodPartDec.Text = ".";
|
|
||||||
lblEsitoAcq.Text = "....";
|
|
||||||
lblFormatoDmtxAcq.Text = "...";
|
|
||||||
lblEsitoMarc.Text = "..";
|
|
||||||
lblPartNumAcq.Text = ".";
|
|
||||||
}
|
|
||||||
|
|
||||||
// fix grafico
|
|
||||||
divDecod.Attributes.Remove("class");
|
|
||||||
divDecod.Attributes.Add("class", classDivDec);
|
|
||||||
divElenco.Attributes.Remove("class");
|
|
||||||
divElenco.Attributes.Add("class", classDivList);
|
|
||||||
|
|
||||||
// sistemazione generale
|
|
||||||
barcodeIn = "";
|
|
||||||
txtBarcode.Focus();
|
|
||||||
}
|
|
||||||
/// <summary>
|
|
||||||
/// valore barcode
|
|
||||||
/// </summary>
|
|
||||||
public string barcodeIn
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return txtBarcode.Text.Trim();
|
|
||||||
}
|
|
||||||
set
|
|
||||||
{
|
|
||||||
txtBarcode.Text = value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
protected void txtBarcode_TextChanged(object sender, EventArgs e)
|
|
||||||
{
|
|
||||||
checkBarcode();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// controlla se ci sia un barcode
|
||||||
|
/// </summary>
|
||||||
|
private void checkBarcode()
|
||||||
|
{
|
||||||
|
bool isDecodOk = false;
|
||||||
|
bool isInList = true;
|
||||||
|
|
||||||
|
// verifico
|
||||||
|
isDecodOk = (DataMatrix_mgr.taAnagFormDtx.getFormatiCompatibili(barcodeIn).Rows.Count > 0);
|
||||||
|
isInList = (DataMatrix_mgr.taVED.getByKey(barcodeIn).Rows.Count > 0);
|
||||||
|
|
||||||
|
// imposto di conseguenza grafica e info
|
||||||
|
string classDivDec = "col-sm-6 bg-danger";
|
||||||
|
string classDivList = "col-sm-6 bg-danger";
|
||||||
|
if (isDecodOk)
|
||||||
|
{
|
||||||
|
//divDecod.Attributes.Add("class", "col-sm-6 bg-success");
|
||||||
|
classDivDec = "col-sm-6 bg-success";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
//divDecod.Attributes.Add("class", "col-sm-6 bg-danger");
|
||||||
|
classDivDec = "col-sm-6 bg-danger";
|
||||||
|
}
|
||||||
|
if (isInList)
|
||||||
|
{
|
||||||
|
//divElenco.Attributes.Add("class", "col-sm-6 bg-success");
|
||||||
|
classDivList = "col-sm-6 bg-success";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
//divElenco.Attributes.Add("class", "col-sm-6 bg-danger");
|
||||||
|
classDivList = "col-sm-6 bg-danger";
|
||||||
|
}
|
||||||
|
// aggiorno visualizzazione...
|
||||||
|
if (isDecodOk || isInList)
|
||||||
|
{
|
||||||
|
lblBarcode.Text = string.Format("Datamatrix: <b>{0}</b>", barcodeIn);
|
||||||
|
if (isDecodOk)
|
||||||
|
{
|
||||||
|
lblEsitoDec.Text = string.Format("{0}: <b>OK</b>", traduci("VerificaDecodifica"));
|
||||||
|
DS_DataMatrix.AnagFormatiDtmxRow riga = (DS_DataMatrix.AnagFormatiDtmxRow)DataMatrix_mgr.taAnagFormDtx.getFormatiCompatibili(barcodeIn).Rows[0];
|
||||||
|
lblFormatoDmtxDec.Text = string.Format("Formato: <b>{0}</b>", riga.FormatoDtmx);
|
||||||
|
// controllo se il PartNum venga decodificato --> lo decodifico e mostro entrambi
|
||||||
|
string PartNumIn = barcodeIn.Substring(riga.PartNumberPos - 1, riga.PartNumberLun);
|
||||||
|
string PartNum = "";
|
||||||
|
string Particolare = "";
|
||||||
|
if (DataMatrix_mgr.taTPN.getByPN_IN(PartNumIn).Rows.Count > 0)
|
||||||
|
{
|
||||||
|
PartNum = ((DS_DataMatrix.TrascPartNumRow)DataMatrix_mgr.taTPN.getByPN_IN(PartNumIn).Rows[0]).PartNumberOUT;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
PartNum = PartNumIn;
|
||||||
|
}
|
||||||
|
try
|
||||||
|
{
|
||||||
|
Particolare = ((DS_DataMatrix.TrascDatamatrixRow)DataMatrix_mgr.taTDtmx.getByPnFormato(riga.FormatoDtmx, PartNum).Rows[0]).Particolare;
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{
|
||||||
|
Particolare = "Non Trovato";
|
||||||
|
lblEsitoDec.Text += "/<b>ND</b>";
|
||||||
|
classDivDec = "col-sm-6 bg-warning";
|
||||||
|
}
|
||||||
|
lblPartNumDec.Text = string.Format("Part Num: <b>{0}</b>", PartNum);
|
||||||
|
// se fosse stato decodificato
|
||||||
|
if (PartNum != PartNumIn)
|
||||||
|
{
|
||||||
|
lblPartNumDec.Text += string.Format("<br><i>({0})</i>", PartNumIn);
|
||||||
|
}
|
||||||
|
lblCodPartDec.Text = string.Format("Cod Part: <b>{0}</b>", Particolare);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
lblEsitoDec.Text += string.Format("{0}: <b>KO</b>", traduci("VerificaDecodifica"));
|
||||||
|
lblFormatoDmtxDec.Text = "...";
|
||||||
|
lblPartNumDec.Text = "..";
|
||||||
|
lblCodPartDec.Text = ".";
|
||||||
|
}
|
||||||
|
if (isInList)
|
||||||
|
{
|
||||||
|
lblEsitoAcq.Text = string.Format("{0}: <b>OK</b>", traduci("VerificaAcquisizioni"));
|
||||||
|
DS_DataMatrix.v_ElencoDmtxRow riga = ((DS_DataMatrix.v_ElencoDmtxRow)DataMatrix_mgr.taVED.getByKey(barcodeIn).Rows[0]);
|
||||||
|
lblFormatoDmtxAcq.Text = string.Format("Formato MM: <b>{0}</b>", riga.FormatoDtmxMM);
|
||||||
|
lblEsitoMarc.Text = string.Format("Esito marcatura MM: <b>{0}</b>", riga.EsitoMarcatura);
|
||||||
|
lblPartNumAcq.Text = string.Format("Part Num MM: <b>{0}</b>", riga.PartNumber);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
lblEsitoAcq.Text = string.Format("{0}: <b>KO</b>", traduci("VerificaAcquisizioni"));
|
||||||
|
lblFormatoDmtxAcq.Text = "...";
|
||||||
|
lblEsitoMarc.Text = "..";
|
||||||
|
lblPartNumAcq.Text = ".";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
lblBarcode.Text = string.Format("Codice non riconosciuto: <b>{0}</b>", barcodeIn);
|
||||||
|
lblEsitoDec.Text = "....";
|
||||||
|
lblFormatoDmtxDec.Text = "...";
|
||||||
|
lblPartNumDec.Text = "..";
|
||||||
|
lblCodPartDec.Text = ".";
|
||||||
|
lblEsitoAcq.Text = "....";
|
||||||
|
lblFormatoDmtxAcq.Text = "...";
|
||||||
|
lblEsitoMarc.Text = "..";
|
||||||
|
lblPartNumAcq.Text = ".";
|
||||||
|
}
|
||||||
|
|
||||||
|
// fix grafico
|
||||||
|
divDecod.Attributes.Remove("class");
|
||||||
|
divDecod.Attributes.Add("class", classDivDec);
|
||||||
|
divElenco.Attributes.Remove("class");
|
||||||
|
divElenco.Attributes.Add("class", classDivList);
|
||||||
|
|
||||||
|
// sistemazione generale
|
||||||
|
barcodeIn = "";
|
||||||
|
txtBarcode.Focus();
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// valore barcode
|
||||||
|
/// </summary>
|
||||||
|
public string barcodeIn
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return txtBarcode.Text.Trim();
|
||||||
|
}
|
||||||
|
set
|
||||||
|
{
|
||||||
|
txtBarcode.Text = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void txtBarcode_TextChanged(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
checkBarcode();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
+153
-153
@@ -2,161 +2,161 @@
|
|||||||
|
|
||||||
namespace GMW_data
|
namespace GMW_data
|
||||||
{
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// fa da proxy singleton x gli oggetti legati ai DATAMATRIX
|
||||||
|
/// </summary>
|
||||||
|
public class DataMatrix
|
||||||
|
{
|
||||||
|
#region area table adapters
|
||||||
|
|
||||||
|
public DS_DataMatrixTableAdapters.ElencoDataMatrixTableAdapter taElencoDM;
|
||||||
|
public DS_DataMatrixTableAdapters.v_trasfDataMatrixTableAdapter taDtMtxOrig;
|
||||||
|
public DS_DataMatrixTableAdapters.stp_verificaDtxTableAdapter taVerifica;
|
||||||
|
public DS_DataMatrixTableAdapters.stp_decodeDtxTableAdapter taDecode;
|
||||||
|
public DS_DataMatrixTableAdapters.stp_conteggioDtxTableAdapter taConteggio;
|
||||||
|
public DS_DataMatrixTableAdapters.v_DtxAcquisitiTableAdapter taDtxAcq;
|
||||||
|
public DS_DataMatrixTableAdapters.Dtx2UDCTableAdapter taDtx2UDC;
|
||||||
|
public DS_DataMatrixTableAdapters.stp_getFirstLastDtxTableAdapter taFirstLastUdc;
|
||||||
|
public DS_DataMatrixTableAdapters.stp_DtxGetAvailFreeAnomTableAdapter taDtxAvailFree;
|
||||||
|
public DS_DataMatrixTableAdapters.stp_DtxCheckBlockedTableAdapter taDtxBlocked;
|
||||||
|
public DS_DataMatrixTableAdapters.Attr2DtxTableAdapter taAtt2Dtx;
|
||||||
|
public DS_DataMatrixTableAdapters.AnagFormatiDtmxTableAdapter taAnagFormDtx;
|
||||||
|
public DS_DataMatrixTableAdapters.v_DtxAcquisitiTableAdapter taDtxAcquisiti;
|
||||||
|
public DS_DataMatrixTableAdapters.v_ElencoDmtxTableAdapter taVED;
|
||||||
|
public DS_DataMatrixTableAdapters.TabSpecDtxTableAdapter taSpecDtmx;
|
||||||
|
public DS_DataMatrixTableAdapters.TrascPartNumTableAdapter taTPN;
|
||||||
|
public DS_DataMatrixTableAdapters.TrascDatamatrixTableAdapter taTDtmx;
|
||||||
|
public DS_DataMatrixTableAdapters.Linea2Dtx_IETableAdapter taL2D;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// fa da proxy singleton x gli oggetti legati ai DATAMATRIX
|
/// init dei table adapters
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class DataMatrix
|
protected void initTA()
|
||||||
{
|
{
|
||||||
#region area table adapters
|
taElencoDM = new GMW_data.DS_DataMatrixTableAdapters.ElencoDataMatrixTableAdapter();
|
||||||
|
taDtMtxOrig = new GMW_data.DS_DataMatrixTableAdapters.v_trasfDataMatrixTableAdapter();
|
||||||
public DS_DataMatrixTableAdapters.ElencoDataMatrixTableAdapter taElencoDM;
|
taDtMtxOrig = new GMW_data.DS_DataMatrixTableAdapters.v_trasfDataMatrixTableAdapter();
|
||||||
public DS_DataMatrixTableAdapters.v_trasfDataMatrixTableAdapter taDtMtxOrig;
|
taVerifica = new DS_DataMatrixTableAdapters.stp_verificaDtxTableAdapter();
|
||||||
public DS_DataMatrixTableAdapters.stp_verificaDtxTableAdapter taVerifica;
|
taDecode = new DS_DataMatrixTableAdapters.stp_decodeDtxTableAdapter();
|
||||||
public DS_DataMatrixTableAdapters.stp_decodeDtxTableAdapter taDecode;
|
taConteggio = new DS_DataMatrixTableAdapters.stp_conteggioDtxTableAdapter();
|
||||||
public DS_DataMatrixTableAdapters.stp_conteggioDtxTableAdapter taConteggio;
|
taDtxAcq = new DS_DataMatrixTableAdapters.v_DtxAcquisitiTableAdapter();
|
||||||
public DS_DataMatrixTableAdapters.v_DtxAcquisitiTableAdapter taDtxAcq;
|
taDtx2UDC = new DS_DataMatrixTableAdapters.Dtx2UDCTableAdapter();
|
||||||
public DS_DataMatrixTableAdapters.Dtx2UDCTableAdapter taDtx2UDC;
|
taFirstLastUdc = new DS_DataMatrixTableAdapters.stp_getFirstLastDtxTableAdapter();
|
||||||
public DS_DataMatrixTableAdapters.stp_getFirstLastDtxTableAdapter taFirstLastUdc;
|
taDtxAvailFree = new DS_DataMatrixTableAdapters.stp_DtxGetAvailFreeAnomTableAdapter();
|
||||||
public DS_DataMatrixTableAdapters.stp_DtxGetAvailFreeAnomTableAdapter taDtxAvailFree;
|
taDtxBlocked = new DS_DataMatrixTableAdapters.stp_DtxCheckBlockedTableAdapter();
|
||||||
public DS_DataMatrixTableAdapters.stp_DtxCheckBlockedTableAdapter taDtxBlocked;
|
taAtt2Dtx = new DS_DataMatrixTableAdapters.Attr2DtxTableAdapter();
|
||||||
public DS_DataMatrixTableAdapters.Attr2DtxTableAdapter taAtt2Dtx;
|
taAnagFormDtx = new DS_DataMatrixTableAdapters.AnagFormatiDtmxTableAdapter();
|
||||||
public DS_DataMatrixTableAdapters.AnagFormatiDtmxTableAdapter taAnagFormDtx;
|
taDtxAcquisiti = new DS_DataMatrixTableAdapters.v_DtxAcquisitiTableAdapter();
|
||||||
public DS_DataMatrixTableAdapters.v_DtxAcquisitiTableAdapter taDtxAcquisiti;
|
taVED = new DS_DataMatrixTableAdapters.v_ElencoDmtxTableAdapter();
|
||||||
public DS_DataMatrixTableAdapters.v_ElencoDmtxTableAdapter taVED;
|
taSpecDtmx = new DS_DataMatrixTableAdapters.TabSpecDtxTableAdapter();
|
||||||
public DS_DataMatrixTableAdapters.TabSpecDtxTableAdapter taSpecDtmx;
|
taTPN = new DS_DataMatrixTableAdapters.TrascPartNumTableAdapter();
|
||||||
public DS_DataMatrixTableAdapters.TrascPartNumTableAdapter taTPN;
|
taTDtmx = new DS_DataMatrixTableAdapters.TrascDatamatrixTableAdapter();
|
||||||
public DS_DataMatrixTableAdapters.TrascDatamatrixTableAdapter taTDtmx;
|
taL2D = new DS_DataMatrixTableAdapters.Linea2Dtx_IETableAdapter();
|
||||||
public DS_DataMatrixTableAdapters.Linea2Dtx_IETableAdapter taL2D;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// init dei table adapters
|
|
||||||
/// </summary>
|
|
||||||
protected void initTA()
|
|
||||||
{
|
|
||||||
taElencoDM = new GMW_data.DS_DataMatrixTableAdapters.ElencoDataMatrixTableAdapter();
|
|
||||||
taDtMtxOrig = new GMW_data.DS_DataMatrixTableAdapters.v_trasfDataMatrixTableAdapter();
|
|
||||||
taDtMtxOrig = new GMW_data.DS_DataMatrixTableAdapters.v_trasfDataMatrixTableAdapter();
|
|
||||||
taVerifica = new DS_DataMatrixTableAdapters.stp_verificaDtxTableAdapter();
|
|
||||||
taDecode = new DS_DataMatrixTableAdapters.stp_decodeDtxTableAdapter();
|
|
||||||
taConteggio = new DS_DataMatrixTableAdapters.stp_conteggioDtxTableAdapter();
|
|
||||||
taDtxAcq = new DS_DataMatrixTableAdapters.v_DtxAcquisitiTableAdapter();
|
|
||||||
taDtx2UDC = new DS_DataMatrixTableAdapters.Dtx2UDCTableAdapter();
|
|
||||||
taFirstLastUdc = new DS_DataMatrixTableAdapters.stp_getFirstLastDtxTableAdapter();
|
|
||||||
taDtxAvailFree = new DS_DataMatrixTableAdapters.stp_DtxGetAvailFreeAnomTableAdapter();
|
|
||||||
taDtxBlocked = new DS_DataMatrixTableAdapters.stp_DtxCheckBlockedTableAdapter();
|
|
||||||
taAtt2Dtx = new DS_DataMatrixTableAdapters.Attr2DtxTableAdapter();
|
|
||||||
taAnagFormDtx = new DS_DataMatrixTableAdapters.AnagFormatiDtmxTableAdapter();
|
|
||||||
taDtxAcquisiti = new DS_DataMatrixTableAdapters.v_DtxAcquisitiTableAdapter();
|
|
||||||
taVED = new DS_DataMatrixTableAdapters.v_ElencoDmtxTableAdapter();
|
|
||||||
taSpecDtmx = new DS_DataMatrixTableAdapters.TabSpecDtxTableAdapter();
|
|
||||||
taTPN = new DS_DataMatrixTableAdapters.TrascPartNumTableAdapter();
|
|
||||||
taTDtmx = new DS_DataMatrixTableAdapters.TrascDatamatrixTableAdapter();
|
|
||||||
taL2D = new DS_DataMatrixTableAdapters.Linea2Dtx_IETableAdapter();
|
|
||||||
}
|
|
||||||
/// <summary>
|
|
||||||
/// effettua setup dei connection strings da web.config delal singola applicazione
|
|
||||||
/// </summary>
|
|
||||||
protected virtual void setupConnectionStringBase()
|
|
||||||
{
|
|
||||||
// connections strings del db verso GMW
|
|
||||||
string connString = memLayer.ML.confReadString("GMWConnectionString");
|
|
||||||
taElencoDM.Connection.ConnectionString = connString;
|
|
||||||
taDtMtxOrig.Connection.ConnectionString = connString;
|
|
||||||
taVerifica.Connection.ConnectionString = connString;
|
|
||||||
taDecode.Connection.ConnectionString = connString;
|
|
||||||
taConteggio.Connection.ConnectionString = connString;
|
|
||||||
taDtxAcq.Connection.ConnectionString = connString;
|
|
||||||
taDtx2UDC.Connection.ConnectionString = connString;
|
|
||||||
taFirstLastUdc.Connection.ConnectionString = connString;
|
|
||||||
taDtxAvailFree.Connection.ConnectionString = connString;
|
|
||||||
taDtxBlocked.Connection.ConnectionString = connString;
|
|
||||||
taAtt2Dtx.Connection.ConnectionString = connString;
|
|
||||||
taAnagFormDtx.Connection.ConnectionString = connString;
|
|
||||||
taDtxAcquisiti.Connection.ConnectionString = connString;
|
|
||||||
taVED.Connection.ConnectionString = connString;
|
|
||||||
taSpecDtmx.Connection.ConnectionString = connString;
|
|
||||||
taTPN.Connection.ConnectionString = connString;
|
|
||||||
taTDtmx.Connection.ConnectionString = connString;
|
|
||||||
taL2D.Connection.ConnectionString = connString;
|
|
||||||
}
|
|
||||||
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
public DataMatrix()
|
|
||||||
{
|
|
||||||
initTA();
|
|
||||||
setupConnectionStringBase();
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// singleton datamatrix
|
|
||||||
/// </summary>
|
|
||||||
public static DataMatrix mgr = new DataMatrix();
|
|
||||||
/// <summary>
|
|
||||||
/// effettua import nuovi dati datamatrix/gitterbox
|
|
||||||
/// </summary>
|
|
||||||
/// <returns></returns>
|
|
||||||
public bool importNuoviDati()
|
|
||||||
{
|
|
||||||
bool answ = false;
|
|
||||||
try
|
|
||||||
{
|
|
||||||
taElencoDM.stp_DtMtrx_import(memLayer.ML.cdv("CodCS"), memLayer.ML.cdvi("IdxPosizioneOdette"), MagClass.magazzino.CodSoggCurrUser);
|
|
||||||
answ = true;
|
|
||||||
}
|
|
||||||
catch
|
|
||||||
{ }
|
|
||||||
return answ;
|
|
||||||
}
|
|
||||||
/// <summary>
|
|
||||||
/// restituisce codice gitterbox dato datamatrix
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="codDataMatrix"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
public string gitterboxFromDataMatrix(decimal codDataMatrix)
|
|
||||||
{
|
|
||||||
string answ = "";
|
|
||||||
try
|
|
||||||
{
|
|
||||||
answ = taElencoDM.getByCode(codDataMatrix)[0].CodGitterbox;
|
|
||||||
}
|
|
||||||
catch
|
|
||||||
{ }
|
|
||||||
return answ;
|
|
||||||
}
|
|
||||||
/// <summary>
|
|
||||||
/// restituisce codice gitterbox ORIGINALE (pre import) dato datamatrix
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="codDataMatrix"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
public string gitterboxOrigFromDataMatrix(decimal codDataMatrix)
|
|
||||||
{
|
|
||||||
string answ = "";
|
|
||||||
try
|
|
||||||
{
|
|
||||||
answ = DataMatrix.mgr.taDtMtxOrig.getByDtMtx(codDataMatrix.ToString())[0].CodGitterbox;
|
|
||||||
}
|
|
||||||
catch
|
|
||||||
{ }
|
|
||||||
return answ;
|
|
||||||
}
|
|
||||||
/// <summary>
|
|
||||||
/// verifica SE il codice datamatrix POSSA rappresentare un codice valido, ovvero
|
|
||||||
/// - lunghezza compatibile coi formati supportati
|
|
||||||
/// - decodifica datamatrix (da formato plausibile, 1 o +) con esito positivo
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="DataMatrix"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
public bool maybeDatamatrix(string DataMatrix)
|
|
||||||
{
|
|
||||||
bool answ = false;
|
|
||||||
// provo a verificare direttamente con score function...
|
|
||||||
DS_DataMatrix.AnagFormatiDtmxDataTable tab = taAnagFormDtx.getFormatiCompatibili(DataMatrix);
|
|
||||||
if (tab.Rows.Count > 0)
|
|
||||||
{
|
|
||||||
answ = true;
|
|
||||||
}
|
|
||||||
return answ;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// effettua setup dei connection strings da web.config delal singola applicazione
|
||||||
|
/// </summary>
|
||||||
|
protected virtual void setupConnectionStringBase()
|
||||||
|
{
|
||||||
|
// connections strings del db verso GMW
|
||||||
|
string connString = memLayer.ML.confReadString("GMWConnectionString");
|
||||||
|
taElencoDM.Connection.ConnectionString = connString;
|
||||||
|
taDtMtxOrig.Connection.ConnectionString = connString;
|
||||||
|
taVerifica.Connection.ConnectionString = connString;
|
||||||
|
taDecode.Connection.ConnectionString = connString;
|
||||||
|
taConteggio.Connection.ConnectionString = connString;
|
||||||
|
taDtxAcq.Connection.ConnectionString = connString;
|
||||||
|
taDtx2UDC.Connection.ConnectionString = connString;
|
||||||
|
taFirstLastUdc.Connection.ConnectionString = connString;
|
||||||
|
taDtxAvailFree.Connection.ConnectionString = connString;
|
||||||
|
taDtxBlocked.Connection.ConnectionString = connString;
|
||||||
|
taAtt2Dtx.Connection.ConnectionString = connString;
|
||||||
|
taAnagFormDtx.Connection.ConnectionString = connString;
|
||||||
|
taDtxAcquisiti.Connection.ConnectionString = connString;
|
||||||
|
taVED.Connection.ConnectionString = connString;
|
||||||
|
taSpecDtmx.Connection.ConnectionString = connString;
|
||||||
|
taTPN.Connection.ConnectionString = connString;
|
||||||
|
taTDtmx.Connection.ConnectionString = connString;
|
||||||
|
taL2D.Connection.ConnectionString = connString;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
public DataMatrix()
|
||||||
|
{
|
||||||
|
initTA();
|
||||||
|
setupConnectionStringBase();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// singleton datamatrix
|
||||||
|
/// </summary>
|
||||||
|
public static DataMatrix mgr = new DataMatrix();
|
||||||
|
/// <summary>
|
||||||
|
/// effettua import nuovi dati datamatrix/gitterbox
|
||||||
|
/// </summary>
|
||||||
|
/// <returns></returns>
|
||||||
|
public bool importNuoviDati()
|
||||||
|
{
|
||||||
|
bool answ = false;
|
||||||
|
try
|
||||||
|
{
|
||||||
|
taElencoDM.stp_DtMtrx_import(memLayer.ML.cdv("CodCS"), memLayer.ML.cdvi("IdxPosizioneOdette"), MagClass.magazzino.CodSoggCurrUser);
|
||||||
|
answ = true;
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{ }
|
||||||
|
return answ;
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// restituisce codice gitterbox dato datamatrix
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="codDataMatrix"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public string gitterboxFromDataMatrix(decimal codDataMatrix)
|
||||||
|
{
|
||||||
|
string answ = "";
|
||||||
|
try
|
||||||
|
{
|
||||||
|
answ = taElencoDM.getByCode(codDataMatrix)[0].CodGitterbox;
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{ }
|
||||||
|
return answ;
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// restituisce codice gitterbox ORIGINALE (pre import) dato datamatrix
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="codDataMatrix"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public string gitterboxOrigFromDataMatrix(decimal codDataMatrix)
|
||||||
|
{
|
||||||
|
string answ = "";
|
||||||
|
try
|
||||||
|
{
|
||||||
|
answ = taDtMtxOrig.getByDtMtx(codDataMatrix.ToString())[0].CodGitterbox;
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{ }
|
||||||
|
return answ;
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// verifica SE il codice datamatrix POSSA rappresentare un codice valido, ovvero
|
||||||
|
/// - lunghezza compatibile coi formati supportati
|
||||||
|
/// - decodifica datamatrix (da formato plausibile, 1 o +) con esito positivo
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="DataMatrix"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public bool maybeDatamatrix(string DataMatrix)
|
||||||
|
{
|
||||||
|
bool answ = false;
|
||||||
|
// provo a verificare direttamente con score function...
|
||||||
|
DS_DataMatrix.AnagFormatiDtmxDataTable tab = taAnagFormDtx.getFormatiCompatibili(DataMatrix);
|
||||||
|
if (tab.Rows.Count > 0)
|
||||||
|
{
|
||||||
|
answ = true;
|
||||||
|
}
|
||||||
|
return answ;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+3321
-3321
File diff suppressed because it is too large
Load Diff
+448
-444
@@ -4,118 +4,122 @@ using System;
|
|||||||
|
|
||||||
namespace GMW_data
|
namespace GMW_data
|
||||||
{
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// fa da proxy singleton x gli oggetti legati ai cartellini ODETTE
|
||||||
|
/// </summary>
|
||||||
|
public class Odette
|
||||||
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// fa da proxy singleton x gli oggetti legati ai cartellini ODETTE
|
/// Oggetto locale gestione classe datamatrix...
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class Odette
|
protected DataMatrix DataMatrix_mgr = new DataMatrix();
|
||||||
|
#region area table adapters
|
||||||
|
|
||||||
|
public DS_OdetteTableAdapters.OdetteTableAdapter taOdette;
|
||||||
|
public DS_OdetteTableAdapters.BORI202JTableAdapter taBORI;
|
||||||
|
public DS_OdetteTableAdapters.stp_OdetteStatoCreateTableAdapter taOdCreate;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// init dei table adapters
|
||||||
|
/// </summary>
|
||||||
|
protected void initTA()
|
||||||
{
|
{
|
||||||
#region area table adapters
|
taOdette = new GMW_data.DS_OdetteTableAdapters.OdetteTableAdapter();
|
||||||
|
taBORI = new GMW_data.DS_OdetteTableAdapters.BORI202JTableAdapter();
|
||||||
|
taOdCreate = new GMW_data.DS_OdetteTableAdapters.stp_OdetteStatoCreateTableAdapter();
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// effettua setup dei connection strings da web.config delal singola applicazione
|
||||||
|
/// </summary>
|
||||||
|
protected virtual void setupConnectionStringBase()
|
||||||
|
{
|
||||||
|
string connString = memLayer.ML.confReadString("GMWConnectionString");
|
||||||
|
// connections strings del db
|
||||||
|
taOdette.Connection.ConnectionString = connString;
|
||||||
|
taBORI.Connection.ConnectionString = connString;
|
||||||
|
taOdCreate.Connection.ConnectionString = connString;
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
|
|
||||||
public DS_OdetteTableAdapters.OdetteTableAdapter taOdette;
|
protected Odette()
|
||||||
public DS_OdetteTableAdapters.BORI202JTableAdapter taBORI;
|
{
|
||||||
public DS_OdetteTableAdapters.stp_OdetteStatoCreateTableAdapter taOdCreate;
|
initTA();
|
||||||
|
setupConnectionStringBase();
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
#region area protected
|
||||||
/// init dei table adapters
|
|
||||||
/// </summary>
|
|
||||||
protected void initTA()
|
|
||||||
{
|
|
||||||
taOdette = new GMW_data.DS_OdetteTableAdapters.OdetteTableAdapter();
|
|
||||||
taBORI = new GMW_data.DS_OdetteTableAdapters.BORI202JTableAdapter();
|
|
||||||
taOdCreate = new GMW_data.DS_OdetteTableAdapters.stp_OdetteStatoCreateTableAdapter();
|
|
||||||
}
|
|
||||||
/// <summary>
|
|
||||||
/// effettua setup dei connection strings da web.config delal singola applicazione
|
|
||||||
/// </summary>
|
|
||||||
protected virtual void setupConnectionStringBase()
|
|
||||||
{
|
|
||||||
string connString = memLayer.ML.confReadString("GMWConnectionString");
|
|
||||||
// connections strings del db
|
|
||||||
taOdette.Connection.ConnectionString = connString;
|
|
||||||
taBORI.Connection.ConnectionString = connString;
|
|
||||||
taOdCreate.Connection.ConnectionString = connString;
|
|
||||||
}
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
protected Odette()
|
/// <summary>
|
||||||
{
|
/// carica le label di lingua su un etichetta odette (che deve già esistere)
|
||||||
initTA();
|
/// </summary>
|
||||||
setupConnectionStringBase();
|
/// <param name="UDC"></param>
|
||||||
}
|
/// <param name="lingua"></param>
|
||||||
|
/// <returns></returns>
|
||||||
#region area protected
|
protected bool caricaEtichetteLinguaPerOdette(string UDC, string lingua)
|
||||||
|
{
|
||||||
/// <summary>
|
bool answ = false;
|
||||||
/// carica le label di lingua su un etichetta odette (che deve già esistere)
|
// controllo se etichetta odette esiste...
|
||||||
/// </summary>
|
if (taOdette.getByUdc(UDC).Rows.Count > 0)
|
||||||
/// <param name="UDC"></param>
|
{
|
||||||
/// <param name="lingua"></param>
|
// carico le mie labels tradotte...
|
||||||
/// <returns></returns>
|
string Campo1_1 = traduci("Campo1_1", lingua);
|
||||||
protected bool caricaEtichetteLinguaPerOdette(string UDC, string lingua)
|
string Campo2_1 = traduci("Campo2_1", lingua);
|
||||||
{
|
string Campo3_1 = traduci("Campo3_1", lingua);
|
||||||
bool answ = false;
|
string Campo4_1 = traduci("Campo4_1", lingua);
|
||||||
// controllo se etichetta odette esiste...
|
string Campo5_1 = traduci("Campo5_1", lingua);
|
||||||
if (taOdette.getByUdc(UDC).Rows.Count > 0)
|
string Campo6_1 = traduci("Campo6_1", lingua);
|
||||||
{
|
string Campo7_1 = traduci("Campo7_1", lingua);
|
||||||
// carico le mie labels tradotte...
|
string Campo8_1 = traduci("Campo8_1", lingua);
|
||||||
string Campo1_1 = traduci("Campo1_1", lingua);
|
string Campo9_1 = traduci("Campo9_1", lingua);
|
||||||
string Campo2_1 = traduci("Campo2_1", lingua);
|
string Campo10_1 = traduci("Campo10_1", lingua);
|
||||||
string Campo3_1 = traduci("Campo3_1", lingua);
|
string Campo11_1_1 = traduci("Campo11_1_1", lingua);
|
||||||
string Campo4_1 = traduci("Campo4_1", lingua);
|
string Campo11_2_1 = traduci("Campo11_2_1", lingua);
|
||||||
string Campo5_1 = traduci("Campo5_1", lingua);
|
string Campo12_1 = traduci("Campo12_1", lingua);
|
||||||
string Campo6_1 = traduci("Campo6_1", lingua);
|
string Campo13_1 = traduci("Campo13_1", lingua);
|
||||||
string Campo7_1 = traduci("Campo7_1", lingua);
|
string Campo14_1 = traduci("Campo14_1", lingua);
|
||||||
string Campo8_1 = traduci("Campo8_1", lingua);
|
string Campo15_1 = traduci("Campo15_1", lingua);
|
||||||
string Campo9_1 = traduci("Campo9_1", lingua);
|
string Campo16_1 = traduci("Campo16_1", lingua);
|
||||||
string Campo10_1 = traduci("Campo10_1", lingua);
|
// effettuo update!
|
||||||
string Campo11_1_1 = traduci("Campo11_1_1", lingua);
|
taOdette.updateLingua(UDC, Campo1_1, Campo2_1, Campo3_1, Campo4_1, Campo5_1, Campo6_1, Campo7_1, Campo8_1, Campo9_1, Campo10_1, Campo11_1_1, Campo11_2_1, Campo12_1, Campo13_1, Campo14_1, Campo15_1, Campo16_1);
|
||||||
string Campo11_2_1 = traduci("Campo11_2_1", lingua);
|
}
|
||||||
string Campo12_1 = traduci("Campo12_1", lingua);
|
else
|
||||||
string Campo13_1 = traduci("Campo13_1", lingua);
|
{
|
||||||
string Campo14_1 = traduci("Campo14_1", lingua);
|
logger.lg.scriviLog(string.Format("Attenzione! etichetta odette non trovata per l'UDC {0}", UDC), tipoLog.ERROR);
|
||||||
string Campo15_1 = traduci("Campo15_1", lingua);
|
}
|
||||||
string Campo16_1 = traduci("Campo16_1", lingua);
|
return answ;
|
||||||
// effettuo update!
|
}
|
||||||
taOdette.updateLingua(UDC, Campo1_1, Campo2_1, Campo3_1, Campo4_1, Campo5_1, Campo6_1, Campo7_1, Campo8_1, Campo9_1, Campo10_1, Campo11_1_1, Campo11_2_1, Campo12_1, Campo13_1, Campo14_1, Campo15_1, Campo16_1);
|
/// <summary>
|
||||||
}
|
/// verifica una etichetta odette e salva in db il valore di check x consistenza dei dati
|
||||||
else
|
/// </summary>
|
||||||
{
|
/// <param name="UDC"></param>
|
||||||
logger.lg.scriviLog(string.Format("Attenzione! etichetta odette non trovata per l'UDC {0}", UDC), tipoLog.ERROR);
|
/// <returns></returns>
|
||||||
}
|
protected bool updateStatoOdette(string UDC)
|
||||||
return answ;
|
{
|
||||||
}
|
bool answ = false;
|
||||||
/// <summary>
|
try
|
||||||
/// verifica una etichetta odette e salva in db il valore di check x consistenza dei dati
|
{
|
||||||
/// </summary>
|
// effettuo verifiche sulla riga odette...
|
||||||
/// <param name="UDC"></param>
|
// !!!FARE!!!
|
||||||
/// <returns></returns>
|
answ = true;
|
||||||
protected bool updateStatoOdette(string UDC)
|
taOdette.setStato(UDC, answ);
|
||||||
{
|
}
|
||||||
bool answ = false;
|
catch
|
||||||
try
|
{ }
|
||||||
{
|
return answ;
|
||||||
// effettuo verifiche sulla riga odette...
|
}
|
||||||
// !!!FARE!!!
|
/// <summary>
|
||||||
answ = true;
|
/// carica i dati per l'etichetta Odette provenienti dalla bolla indicata
|
||||||
taOdette.setStato(UDC, answ);
|
/// </summary>
|
||||||
}
|
/// <param name="UDC"></param>
|
||||||
catch
|
/// <param name="RaggMag"></param>
|
||||||
{ }
|
/// <param name="GrpBolla"></param>
|
||||||
return answ;
|
/// <param name="numBolla">codice bolla</param>
|
||||||
}
|
/// <param name="dataBolla">data bolla formato YYYYMMDD</param>
|
||||||
/// <summary>
|
/// <param name="particolare"></param>
|
||||||
/// carica i dati per l'etichetta Odette provenienti dalla bolla indicata
|
/// <returns></returns>
|
||||||
/// </summary>
|
protected bool caricaDatiBollaEtichettaOdette(string UDC, string RaggMag, string GrpBolla, decimal numBolla, decimal dataBolla, string particolare)
|
||||||
/// <param name="UDC"></param>
|
{
|
||||||
/// <param name="RaggMag"></param>
|
// versione vecchia: ora faccio tutto con stored!
|
||||||
/// <param name="GrpBolla"></param>
|
|
||||||
/// <param name="numBolla">codice bolla</param>
|
|
||||||
/// <param name="dataBolla">data bolla formato YYYYMMDD</param>
|
|
||||||
/// <param name="particolare"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
protected bool caricaDatiBollaEtichettaOdette(string UDC, string RaggMag, string GrpBolla, decimal numBolla, decimal dataBolla, string particolare)
|
|
||||||
{
|
|
||||||
// versione vecchia: ora faccio tutto con stored!
|
|
||||||
#if false
|
#if false
|
||||||
bool answ = false;
|
bool answ = false;
|
||||||
string ragSocCli = "";
|
string ragSocCli = "";
|
||||||
@@ -371,343 +375,343 @@ namespace GMW_data
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
bool answ = false;
|
bool answ = false;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
taOdette.caricaDatiBollaEtichettaOdette(memLayer.ML.cdv("CodCS"), UDC, numBolla.ToString(), dataBolla.ToString(), RaggMag, GrpBolla, particolare);
|
taOdette.caricaDatiBollaEtichettaOdette(memLayer.ML.cdv("CodCS"), UDC, numBolla.ToString(), dataBolla.ToString(), RaggMag, GrpBolla, particolare);
|
||||||
answ = true;
|
answ = true;
|
||||||
}
|
}
|
||||||
catch
|
catch
|
||||||
{
|
{
|
||||||
answ = false;
|
answ = false;
|
||||||
}
|
}
|
||||||
return answ;
|
return answ;
|
||||||
}
|
|
||||||
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
#region area public
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// singleton
|
|
||||||
/// </summary>
|
|
||||||
public static Odette mgr = new Odette();
|
|
||||||
/// <summary>
|
|
||||||
/// wrapper traduzione
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="lemma"></param>
|
|
||||||
/// <param name="lingua"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
public string traduci(string lemma, string lingua)
|
|
||||||
{
|
|
||||||
return user_std.UtSn.Traduci(lemma, lingua);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// verifica l'esistenza di una bolla dato il suo codice + data
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="RaggMag">cod raggr magazzino</param>
|
|
||||||
/// <param name="GrpBolla">gruppo bolla</param>
|
|
||||||
/// <param name="numBolla">codice bolla NUMERICO</param>
|
|
||||||
/// <param name="dataBolla">data bolla formato numerico YYYYMMDD</param>
|
|
||||||
/// <param name="particolare">codice particolare</param>
|
|
||||||
/// <returns></returns>
|
|
||||||
public bool checkCodBolla(string RaggMag, string GrpBolla, decimal numBolla, decimal dataBolla, string particolare)
|
|
||||||
{
|
|
||||||
bool answ = false;
|
|
||||||
int righeBolla = 0;
|
|
||||||
// controllo che la bolla esista...
|
|
||||||
try
|
|
||||||
{
|
|
||||||
// provo a caricarle con stored...
|
|
||||||
taBORI.caricaDatiBolla(RaggMag, GrpBolla, numBolla.ToString(), dataBolla.ToString(), particolare);
|
|
||||||
// rileggo se presenti...
|
|
||||||
righeBolla = taBORI.getByKeyFull(RaggMag, GrpBolla, Convert.ToDecimal(numBolla), Convert.ToDecimal(dataBolla), particolare).Rows.Count;
|
|
||||||
answ = (righeBolla >= 1);
|
|
||||||
}
|
|
||||||
catch(Exception exc)
|
|
||||||
{
|
|
||||||
logger.lg.scriviLog(string.Format("Errore in checkCodBolla:{0}{1}", Environment.NewLine, exc), tipoLog.EXCEPTION);
|
|
||||||
}
|
|
||||||
// controllo che la bolla non sia già associata... ovvero SENZA NESSUNA etichetta odette associata x quel particolare...
|
|
||||||
if (answ)
|
|
||||||
{
|
|
||||||
// controllo se trovo odette associate a tale bolla...
|
|
||||||
answ = (taOdette.getByBolla(RaggMag, GrpBolla, numBolla, dataBolla, particolare).Rows.Count == 0);
|
|
||||||
}
|
|
||||||
return answ;
|
|
||||||
}
|
|
||||||
/// <summary>
|
|
||||||
/// conteggia il num di colli x una data bolla
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="RaggMag">cod raggr magazzino</param>
|
|
||||||
/// <param name="GrpBolla">gruppo bolla</param>
|
|
||||||
/// <param name="numBolla">codice bolla NUMERICO</param>
|
|
||||||
/// <param name="dataBolla">data bolla formato numerico YYYYMMDD</param>
|
|
||||||
/// <param name="particolare">codice particolare</param>
|
|
||||||
/// <returns></returns>
|
|
||||||
public int totColliBolla(string RaggMag, string GrpBolla, decimal numBolla, decimal dataBolla, string particolare)
|
|
||||||
{
|
|
||||||
int answ = 0;
|
|
||||||
try
|
|
||||||
{
|
|
||||||
// calcolo il totale dei pezzi: ogni riga contiene il totale colli della bolla...
|
|
||||||
//answ = (int)taBORI.getByKeyFull(RaggMag, GrpBolla, Convert.ToDecimal(numBolla), Convert.ToDecimal(dataBolla), particolare)[0].NRC1B;
|
|
||||||
answ = Convert.ToInt32(taBORI.getByKeyFull(RaggMag, GrpBolla, Convert.ToDecimal(numBolla), Convert.ToDecimal(dataBolla), particolare).Compute("SUM(NRC1B)", ""));
|
|
||||||
}
|
|
||||||
catch
|
|
||||||
{ }
|
|
||||||
return answ;
|
|
||||||
}
|
|
||||||
/// <summary>
|
|
||||||
/// conteggia il num di pezzi x una data bolla
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="RaggMag">cod raggr magazzino</param>
|
|
||||||
/// <param name="GrpBolla">gruppo bolla</param>
|
|
||||||
/// <param name="numBolla">codice bolla NUMERICO</param>
|
|
||||||
/// <param name="dataBolla">data bolla formato numerico YYYYMMDD</param>
|
|
||||||
/// <param name="particolare">codice particolare</param>
|
|
||||||
/// <returns></returns>
|
|
||||||
public int totPezziBolla(string RaggMag, string GrpBolla, decimal numBolla, decimal dataBolla, string particolare)
|
|
||||||
{
|
|
||||||
int answ = 0;
|
|
||||||
try
|
|
||||||
{
|
|
||||||
// rileggo se presenti...
|
|
||||||
answ = Convert.ToInt32(taBORI.getByKeyFull(RaggMag, GrpBolla, Convert.ToDecimal(numBolla), Convert.ToDecimal(dataBolla), particolare).Compute("SUM(QTCNS)", ""));
|
|
||||||
//answ = (int)taBORI.getByKeyFull(RaggMag, GrpBolla, Convert.ToDecimal(numBolla), Convert.ToDecimal(dataBolla), particolare)[0].QTCNS;
|
|
||||||
}
|
|
||||||
catch
|
|
||||||
{ }
|
|
||||||
return answ;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// crea tutte le righe encessarie alal stampa dei cartellini Odette dati lista di prelievo, bolla da associare
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="CodLista">codice lista di prelievo</param>
|
|
||||||
/// <param name="RaggMag">cod raggr magazzino</param>
|
|
||||||
/// <param name="GrpBolla">gruppo bolla</param>
|
|
||||||
/// <param name="numBolla">codice bolla NUMERICO</param>
|
|
||||||
/// <param name="dataBolla">data bolla formato numerico YYYYMMDD</param>
|
|
||||||
/// <param name="particolare">codice particolare</param>
|
|
||||||
/// <param name="Lingua">IT/EN/...</param>
|
|
||||||
/// <returns>in caso di errore e ritorno false, salva in sessione il messaggio di errore relativo in errCreazOdette</returns>
|
|
||||||
public bool creaOdetteByBollaPackList(string CodLista, string RaggMag, string GrpBolla, decimal numBolla, decimal dataBolla, string particolare, string lingua)
|
|
||||||
{
|
|
||||||
bool answ = false;
|
|
||||||
string errCreazOdette = "";
|
|
||||||
int totUdc = 0;
|
|
||||||
int totPz = 0;
|
|
||||||
int udcOk = 0;
|
|
||||||
DS_magazzino.RigheListePrelievoDataTable ElencoUdc = new DS_magazzino.RigheListePrelievoDataTable();
|
|
||||||
// conto totale etichette da creare
|
|
||||||
try
|
|
||||||
{
|
|
||||||
ElencoUdc = MagClass.magazzino.taRigheListePrelievo.getByCodLista(CodLista);
|
|
||||||
totUdc = ElencoUdc.Rows.Count;
|
|
||||||
totPz = (int)MagClass.magazzino.taElencoListePrelievo.getByCodLista(CodLista)[0].Prelevato;
|
|
||||||
}
|
|
||||||
catch
|
|
||||||
{
|
|
||||||
errCreazOdette = string.Format("Errore: non ci sono UDC da creare per la PackList {0}", CodLista);
|
|
||||||
logger.lg.scriviLog(errCreazOdette, tipoLog.ERROR);
|
|
||||||
}
|
|
||||||
// in primis comunque verifico che la bolla ci sia altrimenti non procedo (anche se avrebbe già dovuto controllare...)
|
|
||||||
if (checkCodBolla(RaggMag, GrpBolla, numBolla, dataBolla, particolare) && totUdc > 0)
|
|
||||||
{
|
|
||||||
// controllo se il totale colli corrisponde al totale UDC..
|
|
||||||
if (totColliBolla(RaggMag, GrpBolla, numBolla, dataBolla, particolare) == totUdc || true) // controllo disattivato 2013.03.22 perché i colli riga sono i colli totali bolla
|
|
||||||
{
|
|
||||||
// controllo se il totale pezzi corrisponde al totale qta...
|
|
||||||
if (totPezziBolla(RaggMag, GrpBolla, numBolla, dataBolla, particolare) == totPz)
|
|
||||||
{
|
|
||||||
// leggo elenco UDC da packing list
|
|
||||||
foreach (DS_magazzino.RigheListePrelievoRow rigaUdc in ElencoUdc)
|
|
||||||
{
|
|
||||||
// per ogni UDC creo una riga
|
|
||||||
taOdette.upsertUdc(rigaUdc.UDC, memLayer.ML.cdv("CodCS"), numBolla.ToString(), dataBolla.ToString(), RaggMag, GrpBolla, particolare, CodLista, memLayer.ML.confReadString("indStabFrom"), rigaUdc.Qta.ToString());
|
|
||||||
udcOk++;
|
|
||||||
// per ogni riga inserisco traduzione nella lingua richiesta
|
|
||||||
caricaEtichetteLinguaPerOdette(rigaUdc.UDC, lingua);
|
|
||||||
// vado a caricare i dati dalla tab dei dati bolle
|
|
||||||
caricaDatiBollaEtichettaOdette(rigaUdc.UDC, RaggMag, GrpBolla, numBolla, dataBolla, particolare);
|
|
||||||
// effettuo check della riga odette e determino se sia conforme
|
|
||||||
updateStatoOdette(rigaUdc.UDC);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
errCreazOdette = string.Format("Errore assegnazione bolle/odette, il num di pezzi non corrisponde: num bolla {0} del {1}, lista prelievo {2}", numBolla, dataBolla, CodLista);
|
|
||||||
logger.lg.scriviLog(errCreazOdette, tipoLog.ERROR);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
errCreazOdette = string.Format("Errore assegnazione bolle/odette, il num di colli non corrisponde: num bolla {0} del {1}, lista prelievo {2}", numBolla, dataBolla, CodLista);
|
|
||||||
logger.lg.scriviLog(errCreazOdette, tipoLog.ERROR);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
errCreazOdette = string.Format("Tentativo di generazione etichette odette da bolla inesistente/già impiegata: codice {0} del {1}", numBolla, dataBolla);
|
|
||||||
logger.lg.scriviLog(errCreazOdette, tipoLog.ERROR);
|
|
||||||
}
|
|
||||||
// controllo se tutte le etichette sono sstate create
|
|
||||||
if (totUdc == udcOk)
|
|
||||||
{
|
|
||||||
answ = true;
|
|
||||||
}
|
|
||||||
memLayer.ML.setSessionVal("errCreazOdette", errCreazOdette);
|
|
||||||
return answ;
|
|
||||||
}
|
|
||||||
/// <summary>
|
|
||||||
/// Stampa tutte le etichette odette di una lista di prelievo
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="CodLista"></param>
|
|
||||||
/// <param name="printerName"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
public bool stampaOdettePackingList(string CodLista, string printerName)
|
|
||||||
{
|
|
||||||
bool answ = false;
|
|
||||||
int totOdette = 0;
|
|
||||||
DS_Odette.OdetteDataTable ElencoOdette = new DS_Odette.OdetteDataTable();
|
|
||||||
// conto totale etichette Odette con StatusOK=1 corrispondenti a lista prelievo
|
|
||||||
try
|
|
||||||
{
|
|
||||||
ElencoOdette = taOdette.getByCodLista(CodLista);
|
|
||||||
totOdette = ElencoOdette.Rows.Count;
|
|
||||||
}
|
|
||||||
catch
|
|
||||||
{
|
|
||||||
logger.lg.scriviLog(string.Format("Errore: non ci sono UDC da creare per la PackList {0}", CodLista), tipoLog.ERROR);
|
|
||||||
}
|
|
||||||
// in primis comunque verifico che la bolla ci sia altrimenti non procedo (anche se avrebbe già dovuto controllare...)
|
|
||||||
if (totOdette > 0)
|
|
||||||
{
|
|
||||||
// processo elenco Odette
|
|
||||||
foreach (DS_Odette.OdetteRow rigaOdette in ElencoOdette)
|
|
||||||
{
|
|
||||||
stampaEtichettaOdette(rigaOdette.CampoUDC, printerName);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
logger.lg.scriviLog(string.Format("Attenzione: non ho trovaot etichette odette valide per la lista di prelievo {0}", CodLista), tipoLog.ERROR);
|
|
||||||
}
|
|
||||||
return answ;
|
|
||||||
}
|
|
||||||
/// <summary>
|
|
||||||
/// stampa una singola etichetta odette
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="UDC"></param>
|
|
||||||
/// <param name="printerName"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
public bool stampaEtichettaOdette(string UDC, string printerName)
|
|
||||||
{
|
|
||||||
bool answ = false;
|
|
||||||
// chiamo il report...
|
|
||||||
try
|
|
||||||
{
|
|
||||||
answ = reportPrinter.obj.stampaCartellino(tipoCartellino.cartOdette, UDC, printerName);
|
|
||||||
}
|
|
||||||
catch
|
|
||||||
{
|
|
||||||
logger.lg.scriviLog(String.Format("Errore nella stmapa del cartellino per l'UDC {0}", UDC), tipoLog.ERROR);
|
|
||||||
}
|
|
||||||
return answ;
|
|
||||||
}
|
|
||||||
/// <summary>
|
|
||||||
/// determina se ci siano odette x la lista di prelievo
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="codLista"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
public bool listaHasOdette(string codLista)
|
|
||||||
{
|
|
||||||
bool answ = false;
|
|
||||||
try
|
|
||||||
{
|
|
||||||
DS_Odette.stp_OdetteStatoCreateRow rigaCreate = taOdCreate.GetData(codLista)[0];
|
|
||||||
answ = rigaCreate.OdetteCreate > 0;
|
|
||||||
}
|
|
||||||
catch
|
|
||||||
{ }
|
|
||||||
return answ;
|
|
||||||
}
|
|
||||||
/// <summary>
|
|
||||||
/// restituisce info se un gitterbox abbia una etichetta odette associata
|
|
||||||
/// <param name="codGitterbox"></param>
|
|
||||||
/// </summary>
|
|
||||||
public bool gitterboxInOdette(string codGitterbox)
|
|
||||||
{
|
|
||||||
bool answ = false;
|
|
||||||
try
|
|
||||||
{
|
|
||||||
answ = taOdette.getByUdc(codGitterbox).Rows.Count > 0;
|
|
||||||
}
|
|
||||||
catch
|
|
||||||
{ }
|
|
||||||
return answ;
|
|
||||||
}
|
|
||||||
/// <summary>
|
|
||||||
/// restituisce info se un datamatrix faccia parte di un gitterbox con una etichetta odette associata
|
|
||||||
/// </summary>
|
|
||||||
public bool datamatrixInOdette(decimal codDataMatrix)
|
|
||||||
{
|
|
||||||
bool answ = false;
|
|
||||||
string codGitterbox = DataMatrix.mgr.gitterboxFromDataMatrix(codDataMatrix);
|
|
||||||
answ = gitterboxInOdette(codGitterbox);
|
|
||||||
return answ;
|
|
||||||
}
|
|
||||||
/// <summary>
|
|
||||||
/// Restituisce info se un datamatrix possa essere spostato tra 2 gitterbox (il suo d'origine e quello indicato),
|
|
||||||
/// mantenendo l'omogeneità dei prodotti nel gitterbox.
|
|
||||||
/// Verifiche:
|
|
||||||
/// - se il datamatrix ha un gitterbox associato --> le prime 2 cifre dei gitterbox devono coincidere
|
|
||||||
/// - se il datamatrix non ha un gitterbox associato --> rileggo gitterbox originale pre importazione e faccio verifica dei primi 2 char
|
|
||||||
/// <param name="codDataMatrix"></param>
|
|
||||||
/// <param name="codGitterbox"></param>
|
|
||||||
/// </summary>
|
|
||||||
public bool dtMtxGtboxCompatibili(decimal codDataMatrix, string codGitterboxTo)
|
|
||||||
{
|
|
||||||
bool answ = false;
|
|
||||||
string codGitterboxFrom = "";
|
|
||||||
try
|
|
||||||
{
|
|
||||||
codGitterboxFrom = DataMatrix.mgr.gitterboxFromDataMatrix(codDataMatrix);
|
|
||||||
if (codGitterboxFrom != "EmptyGBox")
|
|
||||||
{
|
|
||||||
answ = (codGitterboxFrom.Substring(0, 2) == codGitterboxTo.Substring(0, 2));
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
// cerco gitterbox originale...
|
|
||||||
codGitterboxFrom = DataMatrix.mgr.gitterboxOrigFromDataMatrix(codDataMatrix);
|
|
||||||
answ = (codGitterboxFrom.Substring(0, 2) == codGitterboxTo.Substring(0, 2));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
catch
|
|
||||||
{ }
|
|
||||||
return answ;
|
|
||||||
}
|
|
||||||
/// <summary>
|
|
||||||
/// restituisce info se un datamatrix esista
|
|
||||||
/// <param name="codDataMatrix"></param>
|
|
||||||
/// </summary>
|
|
||||||
public bool datamatrixEsiste(decimal codDataMatrix)
|
|
||||||
{
|
|
||||||
bool answ = false;
|
|
||||||
try
|
|
||||||
{
|
|
||||||
answ = DataMatrix.mgr.taElencoDM.getByCode(codDataMatrix).Rows.Count > 0;
|
|
||||||
}
|
|
||||||
catch
|
|
||||||
{ }
|
|
||||||
return answ;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region area public
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// singleton
|
||||||
|
/// </summary>
|
||||||
|
public static Odette mgr = new Odette();
|
||||||
|
/// <summary>
|
||||||
|
/// wrapper traduzione
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="lemma"></param>
|
||||||
|
/// <param name="lingua"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public string traduci(string lemma, string lingua)
|
||||||
|
{
|
||||||
|
return user_std.UtSn.Traduci(lemma, lingua);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// verifica l'esistenza di una bolla dato il suo codice + data
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="RaggMag">cod raggr magazzino</param>
|
||||||
|
/// <param name="GrpBolla">gruppo bolla</param>
|
||||||
|
/// <param name="numBolla">codice bolla NUMERICO</param>
|
||||||
|
/// <param name="dataBolla">data bolla formato numerico YYYYMMDD</param>
|
||||||
|
/// <param name="particolare">codice particolare</param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public bool checkCodBolla(string RaggMag, string GrpBolla, decimal numBolla, decimal dataBolla, string particolare)
|
||||||
|
{
|
||||||
|
bool answ = false;
|
||||||
|
int righeBolla = 0;
|
||||||
|
// controllo che la bolla esista...
|
||||||
|
try
|
||||||
|
{
|
||||||
|
// provo a caricarle con stored...
|
||||||
|
taBORI.caricaDatiBolla(RaggMag, GrpBolla, numBolla.ToString(), dataBolla.ToString(), particolare);
|
||||||
|
// rileggo se presenti...
|
||||||
|
righeBolla = taBORI.getByKeyFull(RaggMag, GrpBolla, Convert.ToDecimal(numBolla), Convert.ToDecimal(dataBolla), particolare).Rows.Count;
|
||||||
|
answ = (righeBolla >= 1);
|
||||||
|
}
|
||||||
|
catch (Exception exc)
|
||||||
|
{
|
||||||
|
logger.lg.scriviLog(string.Format("Errore in checkCodBolla:{0}{1}", Environment.NewLine, exc), tipoLog.EXCEPTION);
|
||||||
|
}
|
||||||
|
// controllo che la bolla non sia già associata... ovvero SENZA NESSUNA etichetta odette associata x quel particolare...
|
||||||
|
if (answ)
|
||||||
|
{
|
||||||
|
// controllo se trovo odette associate a tale bolla...
|
||||||
|
answ = (taOdette.getByBolla(RaggMag, GrpBolla, numBolla, dataBolla, particolare).Rows.Count == 0);
|
||||||
|
}
|
||||||
|
return answ;
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// conteggia il num di colli x una data bolla
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="RaggMag">cod raggr magazzino</param>
|
||||||
|
/// <param name="GrpBolla">gruppo bolla</param>
|
||||||
|
/// <param name="numBolla">codice bolla NUMERICO</param>
|
||||||
|
/// <param name="dataBolla">data bolla formato numerico YYYYMMDD</param>
|
||||||
|
/// <param name="particolare">codice particolare</param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public int totColliBolla(string RaggMag, string GrpBolla, decimal numBolla, decimal dataBolla, string particolare)
|
||||||
|
{
|
||||||
|
int answ = 0;
|
||||||
|
try
|
||||||
|
{
|
||||||
|
// calcolo il totale dei pezzi: ogni riga contiene il totale colli della bolla...
|
||||||
|
//answ = (int)taBORI.getByKeyFull(RaggMag, GrpBolla, Convert.ToDecimal(numBolla), Convert.ToDecimal(dataBolla), particolare)[0].NRC1B;
|
||||||
|
answ = Convert.ToInt32(taBORI.getByKeyFull(RaggMag, GrpBolla, Convert.ToDecimal(numBolla), Convert.ToDecimal(dataBolla), particolare).Compute("SUM(NRC1B)", ""));
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{ }
|
||||||
|
return answ;
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// conteggia il num di pezzi x una data bolla
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="RaggMag">cod raggr magazzino</param>
|
||||||
|
/// <param name="GrpBolla">gruppo bolla</param>
|
||||||
|
/// <param name="numBolla">codice bolla NUMERICO</param>
|
||||||
|
/// <param name="dataBolla">data bolla formato numerico YYYYMMDD</param>
|
||||||
|
/// <param name="particolare">codice particolare</param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public int totPezziBolla(string RaggMag, string GrpBolla, decimal numBolla, decimal dataBolla, string particolare)
|
||||||
|
{
|
||||||
|
int answ = 0;
|
||||||
|
try
|
||||||
|
{
|
||||||
|
// rileggo se presenti...
|
||||||
|
answ = Convert.ToInt32(taBORI.getByKeyFull(RaggMag, GrpBolla, Convert.ToDecimal(numBolla), Convert.ToDecimal(dataBolla), particolare).Compute("SUM(QTCNS)", ""));
|
||||||
|
//answ = (int)taBORI.getByKeyFull(RaggMag, GrpBolla, Convert.ToDecimal(numBolla), Convert.ToDecimal(dataBolla), particolare)[0].QTCNS;
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{ }
|
||||||
|
return answ;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// crea tutte le righe encessarie alal stampa dei cartellini Odette dati lista di prelievo, bolla da associare
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="CodLista">codice lista di prelievo</param>
|
||||||
|
/// <param name="RaggMag">cod raggr magazzino</param>
|
||||||
|
/// <param name="GrpBolla">gruppo bolla</param>
|
||||||
|
/// <param name="numBolla">codice bolla NUMERICO</param>
|
||||||
|
/// <param name="dataBolla">data bolla formato numerico YYYYMMDD</param>
|
||||||
|
/// <param name="particolare">codice particolare</param>
|
||||||
|
/// <param name="Lingua">IT/EN/...</param>
|
||||||
|
/// <returns>in caso di errore e ritorno false, salva in sessione il messaggio di errore relativo in errCreazOdette</returns>
|
||||||
|
public bool creaOdetteByBollaPackList(string CodLista, string RaggMag, string GrpBolla, decimal numBolla, decimal dataBolla, string particolare, string lingua)
|
||||||
|
{
|
||||||
|
bool answ = false;
|
||||||
|
string errCreazOdette = "";
|
||||||
|
int totUdc = 0;
|
||||||
|
int totPz = 0;
|
||||||
|
int udcOk = 0;
|
||||||
|
DS_magazzino.RigheListePrelievoDataTable ElencoUdc = new DS_magazzino.RigheListePrelievoDataTable();
|
||||||
|
// conto totale etichette da creare
|
||||||
|
try
|
||||||
|
{
|
||||||
|
ElencoUdc = MagClass.magazzino.taRigheListePrelievo.getByCodLista(CodLista);
|
||||||
|
totUdc = ElencoUdc.Rows.Count;
|
||||||
|
totPz = (int)MagClass.magazzino.taElencoListePrelievo.getByCodLista(CodLista)[0].Prelevato;
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{
|
||||||
|
errCreazOdette = string.Format("Errore: non ci sono UDC da creare per la PackList {0}", CodLista);
|
||||||
|
logger.lg.scriviLog(errCreazOdette, tipoLog.ERROR);
|
||||||
|
}
|
||||||
|
// in primis comunque verifico che la bolla ci sia altrimenti non procedo (anche se avrebbe già dovuto controllare...)
|
||||||
|
if (checkCodBolla(RaggMag, GrpBolla, numBolla, dataBolla, particolare) && totUdc > 0)
|
||||||
|
{
|
||||||
|
// controllo se il totale colli corrisponde al totale UDC..
|
||||||
|
if (totColliBolla(RaggMag, GrpBolla, numBolla, dataBolla, particolare) == totUdc || true) // controllo disattivato 2013.03.22 perché i colli riga sono i colli totali bolla
|
||||||
|
{
|
||||||
|
// controllo se il totale pezzi corrisponde al totale qta...
|
||||||
|
if (totPezziBolla(RaggMag, GrpBolla, numBolla, dataBolla, particolare) == totPz)
|
||||||
|
{
|
||||||
|
// leggo elenco UDC da packing list
|
||||||
|
foreach (DS_magazzino.RigheListePrelievoRow rigaUdc in ElencoUdc)
|
||||||
|
{
|
||||||
|
// per ogni UDC creo una riga
|
||||||
|
taOdette.upsertUdc(rigaUdc.UDC, memLayer.ML.cdv("CodCS"), numBolla.ToString(), dataBolla.ToString(), RaggMag, GrpBolla, particolare, CodLista, memLayer.ML.confReadString("indStabFrom"), rigaUdc.Qta.ToString());
|
||||||
|
udcOk++;
|
||||||
|
// per ogni riga inserisco traduzione nella lingua richiesta
|
||||||
|
caricaEtichetteLinguaPerOdette(rigaUdc.UDC, lingua);
|
||||||
|
// vado a caricare i dati dalla tab dei dati bolle
|
||||||
|
caricaDatiBollaEtichettaOdette(rigaUdc.UDC, RaggMag, GrpBolla, numBolla, dataBolla, particolare);
|
||||||
|
// effettuo check della riga odette e determino se sia conforme
|
||||||
|
updateStatoOdette(rigaUdc.UDC);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
errCreazOdette = string.Format("Errore assegnazione bolle/odette, il num di pezzi non corrisponde: num bolla {0} del {1}, lista prelievo {2}", numBolla, dataBolla, CodLista);
|
||||||
|
logger.lg.scriviLog(errCreazOdette, tipoLog.ERROR);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
errCreazOdette = string.Format("Errore assegnazione bolle/odette, il num di colli non corrisponde: num bolla {0} del {1}, lista prelievo {2}", numBolla, dataBolla, CodLista);
|
||||||
|
logger.lg.scriviLog(errCreazOdette, tipoLog.ERROR);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
errCreazOdette = string.Format("Tentativo di generazione etichette odette da bolla inesistente/già impiegata: codice {0} del {1}", numBolla, dataBolla);
|
||||||
|
logger.lg.scriviLog(errCreazOdette, tipoLog.ERROR);
|
||||||
|
}
|
||||||
|
// controllo se tutte le etichette sono sstate create
|
||||||
|
if (totUdc == udcOk)
|
||||||
|
{
|
||||||
|
answ = true;
|
||||||
|
}
|
||||||
|
memLayer.ML.setSessionVal("errCreazOdette", errCreazOdette);
|
||||||
|
return answ;
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// Stampa tutte le etichette odette di una lista di prelievo
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="CodLista"></param>
|
||||||
|
/// <param name="printerName"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public bool stampaOdettePackingList(string CodLista, string printerName)
|
||||||
|
{
|
||||||
|
bool answ = false;
|
||||||
|
int totOdette = 0;
|
||||||
|
DS_Odette.OdetteDataTable ElencoOdette = new DS_Odette.OdetteDataTable();
|
||||||
|
// conto totale etichette Odette con StatusOK=1 corrispondenti a lista prelievo
|
||||||
|
try
|
||||||
|
{
|
||||||
|
ElencoOdette = taOdette.getByCodLista(CodLista);
|
||||||
|
totOdette = ElencoOdette.Rows.Count;
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{
|
||||||
|
logger.lg.scriviLog(string.Format("Errore: non ci sono UDC da creare per la PackList {0}", CodLista), tipoLog.ERROR);
|
||||||
|
}
|
||||||
|
// in primis comunque verifico che la bolla ci sia altrimenti non procedo (anche se avrebbe già dovuto controllare...)
|
||||||
|
if (totOdette > 0)
|
||||||
|
{
|
||||||
|
// processo elenco Odette
|
||||||
|
foreach (DS_Odette.OdetteRow rigaOdette in ElencoOdette)
|
||||||
|
{
|
||||||
|
stampaEtichettaOdette(rigaOdette.CampoUDC, printerName);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
logger.lg.scriviLog(string.Format("Attenzione: non ho trovaot etichette odette valide per la lista di prelievo {0}", CodLista), tipoLog.ERROR);
|
||||||
|
}
|
||||||
|
return answ;
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// stampa una singola etichetta odette
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="UDC"></param>
|
||||||
|
/// <param name="printerName"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public bool stampaEtichettaOdette(string UDC, string printerName)
|
||||||
|
{
|
||||||
|
bool answ = false;
|
||||||
|
// chiamo il report...
|
||||||
|
try
|
||||||
|
{
|
||||||
|
answ = reportPrinter.obj.stampaCartellino(tipoCartellino.cartOdette, UDC, printerName);
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{
|
||||||
|
logger.lg.scriviLog(String.Format("Errore nella stmapa del cartellino per l'UDC {0}", UDC), tipoLog.ERROR);
|
||||||
|
}
|
||||||
|
return answ;
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// determina se ci siano odette x la lista di prelievo
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="codLista"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public bool listaHasOdette(string codLista)
|
||||||
|
{
|
||||||
|
bool answ = false;
|
||||||
|
try
|
||||||
|
{
|
||||||
|
DS_Odette.stp_OdetteStatoCreateRow rigaCreate = taOdCreate.GetData(codLista)[0];
|
||||||
|
answ = rigaCreate.OdetteCreate > 0;
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{ }
|
||||||
|
return answ;
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// restituisce info se un gitterbox abbia una etichetta odette associata
|
||||||
|
/// <param name="codGitterbox"></param>
|
||||||
|
/// </summary>
|
||||||
|
public bool gitterboxInOdette(string codGitterbox)
|
||||||
|
{
|
||||||
|
bool answ = false;
|
||||||
|
try
|
||||||
|
{
|
||||||
|
answ = taOdette.getByUdc(codGitterbox).Rows.Count > 0;
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{ }
|
||||||
|
return answ;
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// restituisce info se un datamatrix faccia parte di un gitterbox con una etichetta odette associata
|
||||||
|
/// </summary>
|
||||||
|
public bool datamatrixInOdette(decimal codDataMatrix)
|
||||||
|
{
|
||||||
|
bool answ = false;
|
||||||
|
string codGitterbox = DataMatrix_mgr.gitterboxFromDataMatrix(codDataMatrix);
|
||||||
|
answ = gitterboxInOdette(codGitterbox);
|
||||||
|
return answ;
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// Restituisce info se un datamatrix possa essere spostato tra 2 gitterbox (il suo d'origine e quello indicato),
|
||||||
|
/// mantenendo l'omogeneità dei prodotti nel gitterbox.
|
||||||
|
/// Verifiche:
|
||||||
|
/// - se il datamatrix ha un gitterbox associato --> le prime 2 cifre dei gitterbox devono coincidere
|
||||||
|
/// - se il datamatrix non ha un gitterbox associato --> rileggo gitterbox originale pre importazione e faccio verifica dei primi 2 char
|
||||||
|
/// <param name="codDataMatrix"></param>
|
||||||
|
/// <param name="codGitterbox"></param>
|
||||||
|
/// </summary>
|
||||||
|
public bool dtMtxGtboxCompatibili(decimal codDataMatrix, string codGitterboxTo)
|
||||||
|
{
|
||||||
|
bool answ = false;
|
||||||
|
string codGitterboxFrom = "";
|
||||||
|
try
|
||||||
|
{
|
||||||
|
codGitterboxFrom = DataMatrix_mgr.gitterboxFromDataMatrix(codDataMatrix);
|
||||||
|
if (codGitterboxFrom != "EmptyGBox")
|
||||||
|
{
|
||||||
|
answ = (codGitterboxFrom.Substring(0, 2) == codGitterboxTo.Substring(0, 2));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// cerco gitterbox originale...
|
||||||
|
codGitterboxFrom = DataMatrix_mgr.gitterboxOrigFromDataMatrix(codDataMatrix);
|
||||||
|
answ = (codGitterboxFrom.Substring(0, 2) == codGitterboxTo.Substring(0, 2));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{ }
|
||||||
|
return answ;
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// restituisce info se un datamatrix esista
|
||||||
|
/// <param name="codDataMatrix"></param>
|
||||||
|
/// </summary>
|
||||||
|
public bool datamatrixEsiste(decimal codDataMatrix)
|
||||||
|
{
|
||||||
|
bool answ = false;
|
||||||
|
try
|
||||||
|
{
|
||||||
|
answ = DataMatrix_mgr.taElencoDM.getByCode(codDataMatrix).Rows.Count > 0;
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{ }
|
||||||
|
return answ;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -5,7 +5,10 @@ namespace GMW_data
|
|||||||
{
|
{
|
||||||
public class UserControlBCodeMan : GMW_data.UserControl
|
public class UserControlBCodeMan : GMW_data.UserControl
|
||||||
{
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Oggetto locale gestione classe datamatrix...
|
||||||
|
/// </summary>
|
||||||
|
protected DataMatrix DataMatrix_mgr = new DataMatrix();
|
||||||
#region Conf stili css
|
#region Conf stili css
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -283,7 +286,7 @@ namespace GMW_data
|
|||||||
string answ = "";
|
string answ = "";
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
answ = DataMatrix.mgr.taVerifica.GetData(datamatrix)[0].FormatoDtmx;
|
answ = DataMatrix_mgr.taVerifica.GetData(datamatrix)[0].FormatoDtmx;
|
||||||
}
|
}
|
||||||
catch
|
catch
|
||||||
{ }
|
{ }
|
||||||
@@ -297,7 +300,7 @@ namespace GMW_data
|
|||||||
string answ = "";
|
string answ = "";
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
answ = DataMatrix.mgr.taTDtmx.getByParticolare(Particolare)[0].FormatoDtmx;
|
answ = DataMatrix_mgr.taTDtmx.getByParticolare(Particolare)[0].FormatoDtmx;
|
||||||
}
|
}
|
||||||
catch
|
catch
|
||||||
{ }
|
{ }
|
||||||
@@ -315,11 +318,11 @@ namespace GMW_data
|
|||||||
string answ = "";
|
string answ = "";
|
||||||
if (byTable)
|
if (byTable)
|
||||||
{
|
{
|
||||||
answ = DataMatrix.mgr.taDtxAcquisiti.getByKey(barcodeIn)[0].Particolare;
|
answ = DataMatrix_mgr.taDtxAcquisiti.getByKey(barcodeIn)[0].Particolare;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
answ = DataMatrix.mgr.taDecode.GetData(barcodeIn, FormatoDtmxLinea)[0].Particolare;
|
answ = DataMatrix_mgr.taDecode.GetData(barcodeIn, FormatoDtmxLinea)[0].Particolare;
|
||||||
}
|
}
|
||||||
return answ;
|
return answ;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user