Merge branch 'develop'
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
# Appunti di sviluppo
|
||||
|
||||
|
||||
## Criticità aperte
|
||||
|
||||
Alcune criticità aperte che si devono verificare son le seguenti
|
||||
|
||||
### MapoDb
|
||||
|
||||
* Classi DataLayer e MapoDb con "relazioni circolari": ci sono oggetti dell'uno che istanziano oggetti dell'altro, OLTRETUTTO in modo esplicito (new obj) per evitare il singleton sovrapposto (che sembra dare problemi in certi casi sotto carico) --> analizzare e rimuovere le relazioni circolari
|
||||
* Andrebbe rivista la logica tra DataLayer e MapoDB: scegliere un solo de 2 oggetti?
|
||||
* Valutare se abbandonare il paradigma del singleton (minor sessioni DB ma PARE dare problemi di sessioni che rimangono aperte...)
|
||||
|
||||
|
||||
### MP-IO
|
||||
|
||||
Collegato ai punti rpecedenti problemi di errori in gestione chiamate massive (es dichiarazione multipezzo)
|
||||
Vendored
+1
-1
@@ -12,7 +12,7 @@ pipeline {
|
||||
steps {
|
||||
/* calcolo numero versione... diverso x branch MASTER/DEVELOP */
|
||||
script {
|
||||
withEnv(['NEXT_BUILD_NUMBER=1290']) {
|
||||
withEnv(['NEXT_BUILD_NUMBER=1291']) {
|
||||
// env.versionNumber = VersionNumber(versionNumberString : '6.9.${BUILD_DATE_FORMATTED, "yyMM"}.${BUILDS_ALL_TIME}', projectStartDate : '2006-01-01', skipFailedBuilds: true)
|
||||
env.versionNumber = VersionNumber(versionNumberString : '6.9.${BUILD_DATE_FORMATTED, "yyMM"}.${BUILDS_ALL_TIME}', projectStartDate : '2006-01-01', skipFailedBuilds: true, overrideBuildsAllTime: '${NEXT_BUILD_NUMBER}')
|
||||
env.APP_NAME = 'MAPO'
|
||||
|
||||
@@ -6,6 +6,10 @@ namespace MP_ADM
|
||||
{
|
||||
public partial class DataImport : System.Web.UI.Page
|
||||
{
|
||||
/// <summary>
|
||||
/// Oggetto datalayer specifico
|
||||
/// </summary>
|
||||
DataLayer DataLayerObj = new DataLayer();
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
checkEnabled();
|
||||
@@ -35,7 +39,7 @@ namespace MP_ADM
|
||||
if (OptAdmDB_IS_EnabFileImp)
|
||||
{
|
||||
// chiamo import...
|
||||
DataLayer.obj.taWKS.All_ImportFile_Process(null, null, null, null, 0, 0);
|
||||
DataLayerObj.taWKS.All_ImportFile_Process(null, null, null, null, 0, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using SteamWare;
|
||||
using MapoDb;
|
||||
using SteamWare;
|
||||
using System.Collections.Generic;
|
||||
using System.Web.Services;
|
||||
|
||||
@@ -15,6 +16,11 @@ namespace MP_ADM.WS
|
||||
public class AutoCompletamento : System.Web.Services.WebService
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// Oggetto datalayer specifico
|
||||
/// </summary>
|
||||
DataLayer DataLayerObj = new DataLayer();
|
||||
|
||||
/// <summary>
|
||||
/// elenco articoli per ricerca interattiva
|
||||
/// </summary>
|
||||
@@ -28,7 +34,7 @@ namespace MP_ADM.WS
|
||||
if (count >= memLayer.ML.CRI("MinCharAutocomplete"))
|
||||
{
|
||||
// elenco candidati
|
||||
MapoDb.DS_Utility.v_selArticoliDataTable tabDati = MapoDb.DataLayer.obj.taSelArt.getByConditio(prefixText);
|
||||
MapoDb.DS_Utility.v_selArticoliDataTable tabDati = DataLayerObj.taSelArt.getByConditio(prefixText);
|
||||
// aggiungo ogni riga...
|
||||
foreach (MapoDb.DS_Utility.v_selArticoliRow riga in tabDati)
|
||||
{
|
||||
|
||||
@@ -9,6 +9,11 @@ namespace MP_ADM.WebUserControls
|
||||
public partial class mod_anagArticoli : System.Web.UI.UserControl
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// Oggetto datalayer specifico
|
||||
/// </summary>
|
||||
DataLayer DataLayerObj = new DataLayer();
|
||||
|
||||
#region area da NON modificare
|
||||
|
||||
#region area protected
|
||||
@@ -228,7 +233,7 @@ namespace MP_ADM.WebUserControls
|
||||
try
|
||||
{
|
||||
bool? usato = false;
|
||||
MapoDb.DataLayer.obj.taAnagArt.checkUsed(codArticolo, ref usato);
|
||||
DataLayerObj.taAnagArt.checkUsed(codArticolo, ref usato);
|
||||
answ = !(bool)usato;
|
||||
}
|
||||
catch
|
||||
@@ -252,7 +257,7 @@ namespace MP_ADM.WebUserControls
|
||||
{
|
||||
string tempCode = string.Format("_{0:yyyyMMdd-HHmmss}", DateTime.Now);
|
||||
string tempName = string.Format("Nuovo articolo creato {0:dd/MM/yyyy HH:mm:ss}", DateTime.Now);
|
||||
DataLayer.obj.taAnagArt.Insert(tempCode, tempName, "", "", "", "ART");
|
||||
DataLayerObj.taAnagArt.Insert(tempCode, tempName, "", "", "", "ART");
|
||||
// reset!
|
||||
resetSelezione();
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using SteamWare;
|
||||
using MapoDb;
|
||||
using SteamWare;
|
||||
using System;
|
||||
using System.Web.UI;
|
||||
using System.Web.UI.WebControls;
|
||||
@@ -7,6 +8,10 @@ namespace MP_ADM.WebUserControls
|
||||
{
|
||||
public partial class mod_approvProd : System.Web.UI.UserControl
|
||||
{
|
||||
/// <summary>
|
||||
/// Oggetto datalayer specifico
|
||||
/// </summary>
|
||||
DataLayer DataLayerObj = new DataLayer();
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
if (!Page.IsPostBack)
|
||||
@@ -87,7 +92,7 @@ namespace MP_ADM.WebUserControls
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
MapoDb.DataLayer.obj.taAs400.insProdAs400(IdxODL, DataRif);
|
||||
DataLayerObj.taAs400.insProdAs400(IdxODL, DataRif);
|
||||
}
|
||||
}
|
||||
grView.DataBind();
|
||||
@@ -128,7 +133,7 @@ namespace MP_ADM.WebUserControls
|
||||
switch (_comando)
|
||||
{
|
||||
case "Approva":
|
||||
MapoDb.DataLayer.obj.taAs400.insProdAs400(IdxODL, DataRif);
|
||||
DataLayerObj.taAs400.insProdAs400(IdxODL, DataRif);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
@@ -153,7 +158,7 @@ namespace MP_ADM.WebUserControls
|
||||
protected void lbtImportPending_Click(object sender, EventArgs e)
|
||||
{
|
||||
// forzo rilettura dati da approvare...
|
||||
MapoDb.DataLayer.obj.taAs400.ImportDati_ElencoConfermeProd();
|
||||
DataLayerObj.taAs400.ImportDati_ElencoConfermeProd();
|
||||
// update tab...
|
||||
grView.DataBind();
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using SteamWare;
|
||||
using MapoDb;
|
||||
using SteamWare;
|
||||
using System;
|
||||
using System.Web.UI;
|
||||
using System.Web.UI.WebControls;
|
||||
@@ -7,6 +8,10 @@ namespace MP_ADM.WebUserControls
|
||||
{
|
||||
public partial class mod_approvazioneODL : System.Web.UI.UserControl
|
||||
{
|
||||
/// <summary>
|
||||
/// Oggetto datalayer specifico
|
||||
/// </summary>
|
||||
DataLayer DataLayerObj = new DataLayer();
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
if (!Page.IsPostBack)
|
||||
@@ -76,7 +81,7 @@ namespace MP_ADM.WebUserControls
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
MapoDb.DS_ProdTempi.ODLRow rigaOdl = MapoDb.DataLayer.obj.taODL.getByIdx(idxOdl, false)[0];
|
||||
MapoDb.DS_ProdTempi.ODLRow rigaOdl = DataLayerObj.taODL.getByIdx(idxOdl, false)[0];
|
||||
// gestione buttons approvazione
|
||||
string _comando = "";
|
||||
if (SteamWare.memLayer.ML.isInSessionObject("nextObjCommand"))
|
||||
@@ -87,10 +92,10 @@ namespace MP_ADM.WebUserControls
|
||||
switch (_comando)
|
||||
{
|
||||
case "Approva":
|
||||
MapoDb.DataLayer.obj.taODL.approvaTC(idxOdl, string.Format("{0}{1}Approvato da: {2}", rigaOdl.Note, Environment.NewLine, user_std.UtSn.CognomeNome), user_std.UtSn.CognomeNome, true);
|
||||
DataLayerObj.taODL.approvaTC(idxOdl, string.Format("{0}{1}Approvato da: {2}", rigaOdl.Note, Environment.NewLine, user_std.UtSn.CognomeNome), user_std.UtSn.CognomeNome, true);
|
||||
break;
|
||||
case "Rifiuta":
|
||||
MapoDb.DataLayer.obj.taODL.approvaTC(idxOdl, string.Format("{0}{1}Rifiutato da: {2}", rigaOdl.Note, Environment.NewLine, user_std.UtSn.CognomeNome), user_std.UtSn.CognomeNome, false);
|
||||
DataLayerObj.taODL.approvaTC(idxOdl, string.Format("{0}{1}Rifiutato da: {2}", rigaOdl.Note, Environment.NewLine, user_std.UtSn.CognomeNome), user_std.UtSn.CognomeNome, false);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
||||
@@ -9,6 +9,11 @@ namespace MP_ADM.WebUserControls
|
||||
{
|
||||
public partial class mod_barcode : System.Web.UI.UserControl
|
||||
{
|
||||
/// <summary>
|
||||
/// Oggetto datalayer specifico
|
||||
/// </summary>
|
||||
DataLayer DataLayerObj = new DataLayer();
|
||||
|
||||
#region setup VARS
|
||||
|
||||
/// <summary>
|
||||
@@ -365,7 +370,7 @@ namespace MP_ADM.WebUserControls
|
||||
// recupero il codGruppo da macchina... (primo)
|
||||
if (codGruppo == "")
|
||||
{
|
||||
var tabAG = DataLayer.obj.taAG.getFaseByIdxMacc(idxMacc);
|
||||
var tabAG = DataLayerObj.taAG.getFaseByIdxMacc(idxMacc);
|
||||
if (tabAG.Rows.Count > 0)
|
||||
{
|
||||
codGruppo = tabAG[0].CodGruppo;
|
||||
@@ -377,11 +382,11 @@ namespace MP_ADM.WebUserControls
|
||||
// recupero TC promessa da ultimo per articolo/macchina
|
||||
decimal TCiclo = 0;
|
||||
int pzPallet = 1;
|
||||
DS_ProdTempi.ODLDataTable tabODL = DataLayer.obj.taODL.getByMacchinaArticolo(codArt, idxMacc);
|
||||
DS_ProdTempi.ODLDataTable tabODL = DataLayerObj.taODL.getByMacchinaArticolo(codArt, idxMacc);
|
||||
// se non lo trovo prendo da SOLO ARTICOLO
|
||||
if (tabODL.Rows.Count == 0)
|
||||
{
|
||||
tabODL = DataLayer.obj.taODL.getByMacchinaArticolo(codArt, "");
|
||||
tabODL = DataLayerObj.taODL.getByMacchinaArticolo(codArt, "");
|
||||
}
|
||||
// recupero TCiclo
|
||||
if (tabODL.Rows.Count > 0)
|
||||
@@ -399,7 +404,7 @@ namespace MP_ADM.WebUserControls
|
||||
TCiclo = 59;
|
||||
}
|
||||
// creo nuova PROMESSA ODL...
|
||||
DataLayer.obj.taPODL.insertQuery(codOrd, codOrd, true, codArt, codGruppo, idxMacc, qta, TCiclo, DateTime.Now, 1, pzPallet, descArt);
|
||||
DataLayerObj.taPODL.insertQuery(codOrd, codOrd, true, codArt, codGruppo, idxMacc, qta, TCiclo, DateTime.Now, 1, pzPallet, descArt);
|
||||
}
|
||||
}
|
||||
// resetto ricaricando
|
||||
@@ -424,7 +429,7 @@ namespace MP_ADM.WebUserControls
|
||||
{
|
||||
bool answ = false;
|
||||
// verifico se il barcode è di una macchina...
|
||||
var risultato = DataLayer.obj.taMacchine.GetByIdx(BCodeVal);
|
||||
var risultato = DataLayerObj.taMacchine.GetByIdx(BCodeVal);
|
||||
if (risultato.Rows.Count > 0)
|
||||
{
|
||||
idxMacc = BCodeVal;
|
||||
@@ -435,7 +440,7 @@ namespace MP_ADM.WebUserControls
|
||||
var rRes = risultato[0];
|
||||
nomeMacc = rRes.Descrizione;
|
||||
// imposto il gruppo cercandolo...
|
||||
var gruppi = DataLayer.obj.taAG.getByIdxMacc(BCodeVal);
|
||||
var gruppi = DataLayerObj.taAG.getByIdxMacc(BCodeVal);
|
||||
if (gruppi.Rows.Count > 0)
|
||||
{
|
||||
// salvo primo...
|
||||
@@ -507,7 +512,7 @@ namespace MP_ADM.WebUserControls
|
||||
}
|
||||
}
|
||||
// cerco esplicitamente sul DB IntegrationServices...
|
||||
var risultato = DataLayer.obj.taIS_TrDati.getOrdini(BCodeFilt);
|
||||
var risultato = DataLayerObj.taIS_TrDati.getOrdini(BCodeFilt);
|
||||
if (risultato.Rows.Count > 0)
|
||||
{
|
||||
var rRes = risultato[0];
|
||||
|
||||
@@ -1,113 +1,117 @@
|
||||
using SteamWare;
|
||||
using MapoDb;
|
||||
using SteamWare;
|
||||
using System;
|
||||
using System.Web.UI;
|
||||
using System.Web.UI.WebControls;
|
||||
|
||||
public partial class mod_calChiusura : ApplicationUserControl
|
||||
{
|
||||
public event EventHandler eh_resetSelezione;
|
||||
/// <summary>
|
||||
/// Oggetto datalayer specifico
|
||||
/// </summary>
|
||||
DataLayer DataLayerObj = new DataLayer();
|
||||
public event EventHandler eh_resetSelezione;
|
||||
|
||||
protected override void Page_Load(object sender, EventArgs e)
|
||||
protected override void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
base.Page_Load(sender, e);
|
||||
if (!Page.IsPostBack)
|
||||
{
|
||||
base.Page_Load(sender, e);
|
||||
if (!Page.IsPostBack)
|
||||
{
|
||||
grView.PageSize = _righeDataGridMed;
|
||||
btnShowInsPeriodo.Text = traduci("btnShowInsPeriodo");
|
||||
btnInsPeriodo.Text = traduci("btnInsPeriodo");
|
||||
}
|
||||
grView.PageSize = _righeDataGridMed;
|
||||
btnShowInsPeriodo.Text = traduci("btnShowInsPeriodo");
|
||||
btnInsPeriodo.Text = traduci("btnInsPeriodo");
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// gestione evento inserimento nuovo record standard (se ZERO presenti)
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void btnNewFromEmpty_Click(object sender, EventArgs e)
|
||||
/// <summary>
|
||||
/// gestione evento inserimento nuovo record standard (se ZERO presenti)
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void btnNewFromEmpty_Click(object sender, EventArgs e)
|
||||
{
|
||||
// reset selezione...
|
||||
resetSelezione();
|
||||
// i primi valori ("0") di default sono "ND"... li inserisco come standard...
|
||||
DataLayerObj.taCalFF.Insert(DateTime.Now.Date, "-- [NUOVO] non definito --");
|
||||
grView.DataBind();
|
||||
}
|
||||
/// <summary>
|
||||
/// resetta la selezione dei valori in caso di modifiche su altri controlli
|
||||
/// </summary>
|
||||
public void resetSelezione()
|
||||
{
|
||||
grView.SelectedIndex = -1;
|
||||
grView.DataBind();
|
||||
if (eh_resetSelezione != null)
|
||||
{
|
||||
// reset selezione...
|
||||
resetSelezione();
|
||||
// i primi valori ("0") di default sono "ND"... li inserisco come standard...
|
||||
MapoDb.DataLayer.obj.taCalFF.Insert(DateTime.Now.Date, "-- [NUOVO] non definito --");
|
||||
grView.DataBind();
|
||||
eh_resetSelezione(this, new EventArgs());
|
||||
}
|
||||
/// <summary>
|
||||
/// resetta la selezione dei valori in caso di modifiche su altri controlli
|
||||
/// </summary>
|
||||
public void resetSelezione()
|
||||
}
|
||||
/// <summary>
|
||||
/// evento dati associati a controllo
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void grView_DataBound(object sender, EventArgs e)
|
||||
{
|
||||
if (grView.Rows.Count > 0)
|
||||
{
|
||||
grView.SelectedIndex = -1;
|
||||
grView.DataBind();
|
||||
if (eh_resetSelezione != null)
|
||||
LinkButton lb;
|
||||
// aggiorno gli headers
|
||||
foreach (TableCell cella in grView.HeaderRow.Cells)
|
||||
{
|
||||
try
|
||||
{
|
||||
eh_resetSelezione(this, new EventArgs());
|
||||
lb = (LinkButton)cella.Controls[0];
|
||||
lb.Text = traduci(lb.Text);
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
}
|
||||
int totRecord = grView.Rows.Count + grView.PageSize * (grView.PageCount - 1);
|
||||
lblNumRec.Text = string.Format("{0} records of ~ {1}", grView.Rows.Count, totRecord);
|
||||
}
|
||||
/// <summary>
|
||||
/// evento dati associati a controllo
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void grView_DataBound(object sender, EventArgs e)
|
||||
else
|
||||
{
|
||||
if (grView.Rows.Count > 0)
|
||||
{
|
||||
LinkButton lb;
|
||||
// aggiorno gli headers
|
||||
foreach (TableCell cella in grView.HeaderRow.Cells)
|
||||
{
|
||||
try
|
||||
{
|
||||
lb = (LinkButton)cella.Controls[0];
|
||||
lb.Text = traduci(lb.Text);
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
}
|
||||
int totRecord = grView.Rows.Count + grView.PageSize * (grView.PageCount - 1);
|
||||
lblNumRec.Text = string.Format("{0} records of ~ {1}", grView.Rows.Count, totRecord);
|
||||
}
|
||||
else
|
||||
{
|
||||
lblNumRec.Text = "";
|
||||
}
|
||||
lblNumRec.Text = "";
|
||||
}
|
||||
protected void btnShowInsPeriodo_Click(object sender, EventArgs e)
|
||||
}
|
||||
protected void btnShowInsPeriodo_Click(object sender, EventArgs e)
|
||||
{
|
||||
pnlInsPeriodo.Visible = !pnlInsPeriodo.Visible;
|
||||
if (pnlInsPeriodo.Visible)
|
||||
{
|
||||
pnlInsPeriodo.Visible = !pnlInsPeriodo.Visible;
|
||||
if (pnlInsPeriodo.Visible)
|
||||
{
|
||||
btnShowInsPeriodo.Text = traduci("btnHideInsPeriodo");
|
||||
}
|
||||
else
|
||||
{
|
||||
btnShowInsPeriodo.Text = traduci("btnShowInsPeriodo");
|
||||
}
|
||||
btnShowInsPeriodo.Text = traduci("btnHideInsPeriodo");
|
||||
}
|
||||
protected void btnInsPeriodo_Click(object sender, EventArgs e)
|
||||
else
|
||||
{
|
||||
// verifico date congrue...
|
||||
DateTime inizio = Convert.ToDateTime(txtDataFrom.Text);
|
||||
DateTime fine = Convert.ToDateTime(txtDataTo.Text);
|
||||
if (fine.CompareTo(inizio) >= 0)
|
||||
{
|
||||
// inserisco le voci x tutte le date nell'intervallo...
|
||||
while (fine.CompareTo(inizio) >= 0)
|
||||
{
|
||||
|
||||
MapoDb.DataLayer.obj.taCalFF.Insert(inizio, txtDescrizione.Text);
|
||||
inizio = inizio.AddDays(1);
|
||||
}
|
||||
// update e nascondo pannello
|
||||
grView.DataBind();
|
||||
pnlInsPeriodo.Visible = false;
|
||||
btnShowInsPeriodo.Text = traduci("btnShowInsPeriodo");
|
||||
lblWarning.Visible = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
lblWarning.Visible = true;
|
||||
lblWarning.Text = traduci("OrdineDateErrato");
|
||||
}
|
||||
btnShowInsPeriodo.Text = traduci("btnShowInsPeriodo");
|
||||
}
|
||||
}
|
||||
protected void btnInsPeriodo_Click(object sender, EventArgs e)
|
||||
{
|
||||
// verifico date congrue...
|
||||
DateTime inizio = Convert.ToDateTime(txtDataFrom.Text);
|
||||
DateTime fine = Convert.ToDateTime(txtDataTo.Text);
|
||||
if (fine.CompareTo(inizio) >= 0)
|
||||
{
|
||||
// inserisco le voci x tutte le date nell'intervallo...
|
||||
while (fine.CompareTo(inizio) >= 0)
|
||||
{
|
||||
DataLayerObj.taCalFF.Insert(inizio, txtDescrizione.Text);
|
||||
inizio = inizio.AddDays(1);
|
||||
}
|
||||
// update e nascondo pannello
|
||||
grView.DataBind();
|
||||
pnlInsPeriodo.Visible = false;
|
||||
btnShowInsPeriodo.Text = traduci("btnShowInsPeriodo");
|
||||
lblWarning.Visible = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
lblWarning.Visible = true;
|
||||
lblWarning.Text = traduci("OrdineDateErrato");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,6 +6,10 @@ namespace MP_ADM.WebUserControls
|
||||
{
|
||||
public partial class mod_gestKIT : System.Web.UI.UserControl
|
||||
{
|
||||
/// <summary>
|
||||
/// Oggetto datalayer specifico
|
||||
/// </summary>
|
||||
DataLayer DataLayerObj = new DataLayer();
|
||||
|
||||
public event EventHandler eh_selKit;
|
||||
|
||||
@@ -94,10 +98,10 @@ namespace MP_ADM.WebUserControls
|
||||
// verifico di avere un codiceKIT
|
||||
checkCodKit();
|
||||
// salvo info x il cod temporaneo...
|
||||
DataLayer.obj.taWKS.insertQuery(codKitTemp, codOrd, codArt, descArt, qta);
|
||||
DataLayerObj.taWKS.insertQuery(codKitTemp, codOrd, codArt, descArt, qta);
|
||||
// verifico SE HO un KIT riconosciuto e quindi un CodArt di KIT valido...
|
||||
string currCodArtKit = "###";
|
||||
var TksTab = DataLayer.obj.taTKS.GetData(codKitTemp, 1);
|
||||
var TksTab = DataLayerObj.taTKS.GetData(codKitTemp, 1);
|
||||
bool showPODL = false;
|
||||
if (TksTab.Rows.Count > 0)
|
||||
{
|
||||
@@ -171,7 +175,7 @@ namespace MP_ADM.WebUserControls
|
||||
{
|
||||
// controllo SE HO un kit selezionato...
|
||||
string currCodArtKit = "###";
|
||||
var TksTab = DataLayer.obj.taTKS.GetData(codKitTemp, 1);
|
||||
var TksTab = DataLayerObj.taTKS.GetData(codKitTemp, 1);
|
||||
bool showPODL = false;
|
||||
if (TksTab.Rows.Count > 0)
|
||||
{
|
||||
@@ -199,7 +203,7 @@ namespace MP_ADM.WebUserControls
|
||||
private void doReset()
|
||||
{
|
||||
// elimino eventuali record ODL
|
||||
DataLayer.obj.taWKS.deleteQuery(codKitTemp);
|
||||
DataLayerObj.taWKS.deleteQuery(codKitTemp);
|
||||
codKitTemp = "";
|
||||
divPODL.Visible = false;
|
||||
checkCodKit();
|
||||
@@ -242,13 +246,13 @@ namespace MP_ADM.WebUserControls
|
||||
private void creazioneIstanzaKit(string CodArtParent)
|
||||
{
|
||||
// calcolo NUOVO codice kit...
|
||||
var tabKey = DataLayer.obj.taIstK.getNewKey();
|
||||
var tabKey = DataLayerObj.taIstK.getNewKey();
|
||||
if (tabKey.Rows.Count == 1)
|
||||
{
|
||||
// stacco un NUOVO codice KIT
|
||||
lastKitMade = tabKey[0].KeyKit;
|
||||
// inserisco ISTANZA KIT!
|
||||
DataLayer.obj.taIstK.insertByWKS(lastKitMade, CodArtParent, codKitTemp);
|
||||
DataLayerObj.taIstK.insertByWKS(lastKitMade, CodArtParent, codKitTemp);
|
||||
// faccio reset valori WKS...
|
||||
doReset();
|
||||
// ora resetto ordine caricato...
|
||||
|
||||
@@ -9,6 +9,10 @@ namespace MP_ADM.WebUserControls
|
||||
{
|
||||
public partial class mod_gestPromODL : System.Web.UI.UserControl
|
||||
{
|
||||
/// <summary>
|
||||
/// Oggetto datalayer specifico
|
||||
/// </summary>
|
||||
DataLayer DataLayerObj = new DataLayer();
|
||||
/// <summary>
|
||||
/// Determina se sia solo readonly il controllo...
|
||||
/// </summary>
|
||||
@@ -150,7 +154,7 @@ namespace MP_ADM.WebUserControls
|
||||
divEditQta.Visible = true;
|
||||
lbtNewPODL.Visible = true;
|
||||
mod_newPromessaODL.Visible = false;
|
||||
var riga = DataLayer.obj.taPODL.getByKey(idxPOdlSel)[0];
|
||||
var riga = DataLayerObj.taPODL.getByKey(idxPOdlSel)[0];
|
||||
numPz = riga.NumPezzi;
|
||||
pzPallet = riga.PzPallet;
|
||||
}
|
||||
@@ -348,7 +352,7 @@ namespace MP_ADM.WebUserControls
|
||||
/// <returns></returns>
|
||||
protected DataColumnCollection colonneObj()
|
||||
{
|
||||
MapoDb.DS_ProdTempi.ODLDataTable tabella = new MapoDb.DS_ProdTempi.ODLDataTable();
|
||||
DS_ProdTempi.ODLDataTable tabella = new DS_ProdTempi.ODLDataTable();
|
||||
DataColumnCollection colonne = tabella.Columns;
|
||||
return colonne;
|
||||
}
|
||||
@@ -360,7 +364,7 @@ namespace MP_ADM.WebUserControls
|
||||
try
|
||||
{
|
||||
idxOdl = Convert.ToInt32(_idxOdl);
|
||||
answ = (MapoDb.DataLayer.obj.taODL.getByIdx(idxOdl, true).Count > 0);
|
||||
answ = (DataLayerObj.taODL.getByIdx(idxOdl, true).Count > 0);
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
@@ -418,7 +422,7 @@ namespace MP_ADM.WebUserControls
|
||||
LinkButton imgBtn = (LinkButton)sender;
|
||||
int IdxProm = 0;
|
||||
int.TryParse(imgBtn.CommandArgument, out IdxProm);
|
||||
DataLayer.obj.taPODL.deleteQuery(IdxProm);
|
||||
DataLayerObj.taPODL.deleteQuery(IdxProm);
|
||||
doUpdate();
|
||||
}
|
||||
|
||||
@@ -433,7 +437,7 @@ namespace MP_ADM.WebUserControls
|
||||
{
|
||||
if (idxPOdlSel > 0)
|
||||
{
|
||||
DataLayer.obj.taPODL.updateQta(numPz, pzPallet, idxPOdlSel);
|
||||
DataLayerObj.taPODL.updateQta(numPz, pzPallet, idxPOdlSel);
|
||||
}
|
||||
updateCtrl();
|
||||
}
|
||||
|
||||
@@ -9,6 +9,10 @@ namespace MP_ADM.WebUserControls
|
||||
{
|
||||
public partial class mod_gestPromODL_OUT : System.Web.UI.UserControl
|
||||
{
|
||||
/// <summary>
|
||||
/// Oggetto datalayer specifico
|
||||
/// </summary>
|
||||
DataLayer DataLayerObj = new DataLayer();
|
||||
/// <summary>
|
||||
/// Determina se sia solo readonly il controllo...
|
||||
/// </summary>
|
||||
@@ -150,7 +154,7 @@ namespace MP_ADM.WebUserControls
|
||||
divEditQta.Visible = true;
|
||||
lbtNewPODL.Visible = true;
|
||||
mod_newPromessaODL.Visible = false;
|
||||
var riga = DataLayer.obj.taPODL.getByKey(idxPOdlSel)[0];
|
||||
var riga = DataLayerObj.taPODL.getByKey(idxPOdlSel)[0];
|
||||
numPz = riga.NumPezzi;
|
||||
pzPallet = riga.PzPallet;
|
||||
}
|
||||
@@ -360,7 +364,7 @@ namespace MP_ADM.WebUserControls
|
||||
try
|
||||
{
|
||||
idxOdl = Convert.ToInt32(_idxOdl);
|
||||
answ = (MapoDb.DataLayer.obj.taODL.getByIdx(idxOdl, true).Count > 0);
|
||||
answ = (DataLayerObj.taODL.getByIdx(idxOdl, true).Count > 0);
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
@@ -418,7 +422,7 @@ namespace MP_ADM.WebUserControls
|
||||
LinkButton imgBtn = (LinkButton)sender;
|
||||
int IdxProm = 0;
|
||||
int.TryParse(imgBtn.CommandArgument, out IdxProm);
|
||||
DataLayer.obj.taPODL.deleteQuery(IdxProm);
|
||||
DataLayerObj.taPODL.deleteQuery(IdxProm);
|
||||
doUpdate();
|
||||
}
|
||||
|
||||
@@ -433,7 +437,7 @@ namespace MP_ADM.WebUserControls
|
||||
{
|
||||
if (idxPOdlSel > 0)
|
||||
{
|
||||
DataLayer.obj.taPODL.updateQta(numPz, pzPallet, idxPOdlSel);
|
||||
DataLayerObj.taPODL.updateQta(numPz, pzPallet, idxPOdlSel);
|
||||
}
|
||||
updateCtrl();
|
||||
}
|
||||
@@ -623,7 +627,7 @@ namespace MP_ADM.WebUserControls
|
||||
int IdxPromessa = 0;
|
||||
int.TryParse(lb.CommandArgument, out IdxPromessa);
|
||||
// chiamo stored
|
||||
DataLayer.obj.taPromOut.movePrio(IdxPromessa, -1);
|
||||
DataLayerObj.taPromOut.movePrio(IdxPromessa, -1);
|
||||
//update!
|
||||
updateGrView();
|
||||
}
|
||||
@@ -639,7 +643,7 @@ namespace MP_ADM.WebUserControls
|
||||
int IdxPromessa = 0;
|
||||
int.TryParse(lb.CommandArgument, out IdxPromessa);
|
||||
// chiamo stored
|
||||
DataLayer.obj.taPromOut.movePrio(IdxPromessa, 1);
|
||||
DataLayerObj.taPromOut.movePrio(IdxPromessa, 1);
|
||||
//update!
|
||||
updateGrView();
|
||||
}
|
||||
@@ -679,7 +683,7 @@ namespace MP_ADM.WebUserControls
|
||||
// calcolo i limiti priorità x macchina (0 --> max x macchina)... LPI/LPS liminte priorità inferiore / superiore
|
||||
int LPI = 1;
|
||||
int LPS = 1;
|
||||
var tabella = DataLayer.obj.taPromOut.getMaxPrioByMacc(IdxMacchina, true);
|
||||
var tabella = DataLayerObj.taPromOut.getMaxPrioByMacc(IdxMacchina, true);
|
||||
if (tabella.Rows.Count > 0)
|
||||
{
|
||||
LPS = tabella[0].Priorita;
|
||||
|
||||
@@ -9,6 +9,10 @@ namespace MoonPro_site.WebUserControls
|
||||
{
|
||||
public partial class mod_gestioneODL : System.Web.UI.UserControl
|
||||
{
|
||||
/// <summary>
|
||||
/// Oggetto datalayer specifico
|
||||
/// </summary>
|
||||
DataLayer DataLayerObj = new DataLayer();
|
||||
|
||||
/// <summary>
|
||||
/// dimensione pagina
|
||||
@@ -59,7 +63,7 @@ namespace MoonPro_site.WebUserControls
|
||||
divEditQta.Visible = true;
|
||||
lbtNewODL.Visible = enableCreateNew;
|
||||
mod_newOdl1.Visible = false;
|
||||
var riga = DataLayer.obj.taODL.getByIdx(idxOdlSel, false)[0];
|
||||
var riga = DataLayerObj.taODL.getByIdx(idxOdlSel, false)[0];
|
||||
numPz = riga.NumPezzi;
|
||||
pzPallet = riga.PzPallet;
|
||||
}
|
||||
@@ -272,7 +276,7 @@ namespace MoonPro_site.WebUserControls
|
||||
try
|
||||
{
|
||||
idxOdl = Convert.ToInt32(_idxOdl);
|
||||
answ = (MapoDb.DataLayer.obj.taODL.getByIdx(idxOdl, true).Count > 0);
|
||||
answ = (DataLayerObj.taODL.getByIdx(idxOdl, true).Count > 0);
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
@@ -351,7 +355,7 @@ namespace MoonPro_site.WebUserControls
|
||||
{
|
||||
if (idxOdlSel > 0)
|
||||
{
|
||||
DataLayer.obj.taODL.updateQta(numPz, pzPallet, idxOdlSel);
|
||||
DataLayerObj.taODL.updateQta(numPz, pzPallet, idxOdlSel);
|
||||
}
|
||||
updateCtrl();
|
||||
}
|
||||
|
||||
@@ -1,10 +1,15 @@
|
||||
using SteamWare;
|
||||
using MapoDb;
|
||||
using SteamWare;
|
||||
using System;
|
||||
|
||||
namespace MoonPro_site.WebUserControls
|
||||
{
|
||||
public partial class mod_newOdl : System.Web.UI.UserControl
|
||||
{
|
||||
/// <summary>
|
||||
/// Oggetto datalayer specifico
|
||||
/// </summary>
|
||||
DataLayer DataLayerObj = new DataLayer();
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
@@ -43,7 +48,7 @@ namespace MoonPro_site.WebUserControls
|
||||
numPezzi = Convert.ToInt32(txtPezzi.Text.Trim());
|
||||
TCiclo = Convert.ToDecimal(txtTempoCiclo.Text.Trim().Replace(".", ","));
|
||||
pzPallet = Convert.ToInt32(txtPzPallet.Text.Trim());
|
||||
MapoDb.DataLayer.obj.taODL.InsertQuery(CodArticolo, MapoDb.DataLayer.MatrOpr, IdxMacchina, numPezzi, TCiclo, pzPallet, chkToAs400.Checked, txtCommessa.Text.Trim());
|
||||
DataLayerObj.taODL.InsertQuery(CodArticolo, DataLayerObj.MatrOpr, IdxMacchina, numPezzi, TCiclo, pzPallet, chkToAs400.Checked, txtCommessa.Text.Trim());
|
||||
}
|
||||
catch
|
||||
{
|
||||
@@ -148,7 +153,7 @@ namespace MoonPro_site.WebUserControls
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
MapoDb.DS_ProdTempi.ODLRow rigaOdl = MapoDb.DataLayer.obj.taODL.getByIdx(idxOdl, false)[0];
|
||||
MapoDb.DS_ProdTempi.ODLRow rigaOdl = DataLayerObj.taODL.getByIdx(idxOdl, false)[0];
|
||||
// precompilo dati pezzi/tempi
|
||||
txtPezzi.Text = rigaOdl.NumPezzi.ToString();
|
||||
txtTempoCiclo.Text = rigaOdl.TCAssegnato.ToString("0.00");
|
||||
|
||||
@@ -7,6 +7,10 @@ namespace MP_ADM.WebUserControls
|
||||
{
|
||||
public partial class mod_newPromessaODL : System.Web.UI.UserControl
|
||||
{
|
||||
/// <summary>
|
||||
/// Oggetto datalayer specifico
|
||||
/// </summary>
|
||||
DataLayer DataLayerObj = new DataLayer();
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
if (!Page.IsPostBack)
|
||||
@@ -44,7 +48,7 @@ namespace MP_ADM.WebUserControls
|
||||
idxProm = memLayer.ML.IntSessionObj("idxProm2Edit");
|
||||
}
|
||||
// provo a selezionare
|
||||
var tPODL = DataLayer.obj.taPODL.getByKey(idxProm);
|
||||
var tPODL = DataLayerObj.taPODL.getByKey(idxProm);
|
||||
if (tPODL.Rows.Count > 0)
|
||||
{
|
||||
var rPODL = tPODL[0];
|
||||
@@ -164,14 +168,14 @@ namespace MP_ADM.WebUserControls
|
||||
if (memLayer.ML.isInSessionObject("idxProm2Edit"))
|
||||
{
|
||||
int idxProm = memLayer.ML.IntSessionObj("idxProm2Edit");
|
||||
DataLayer.obj.taPODL.updateQuery(KeyReq, KeyReq, attiv, CodArticolo, Gruppo, IdxMacchina, numPezzi, TCiclo, DateTime.Now, prio, pzPallet, idxProm);
|
||||
DataLayerObj.taPODL.updateQuery(KeyReq, KeyReq, attiv, CodArticolo, Gruppo, IdxMacchina, numPezzi, TCiclo, DateTime.Now, prio, pzPallet, idxProm);
|
||||
memLayer.ML.emptySessionVal("idxProm2Edit");
|
||||
}
|
||||
else
|
||||
{
|
||||
// 2018.09.25 --> inserisco PROMESSA ODL
|
||||
//MapoDb.DataLayer.obj.taODL.InsertQuery(CodArticolo, MapoDb.DataLayer.MatrOpr, IdxMacchina, numPezzi, TCiclo, pzPallet, chkToAs400.Checked, txtCommessa.Text.Trim());
|
||||
DataLayer.obj.taPODL.insertQuery(KeyReq, KeyReq, attiv, CodArticolo, Gruppo, IdxMacchina, numPezzi, TCiclo, DateTime.Now, prio, pzPallet, "");
|
||||
//MapoDb.DataLayerObj.taODL.InsertQuery(CodArticolo, MapoDb.DataLayer.MatrOpr, IdxMacchina, numPezzi, TCiclo, pzPallet, chkToAs400.Checked, txtCommessa.Text.Trim());
|
||||
DataLayerObj.taPODL.insertQuery(KeyReq, KeyReq, attiv, CodArticolo, Gruppo, IdxMacchina, numPezzi, TCiclo, DateTime.Now, prio, pzPallet, "");
|
||||
}
|
||||
}
|
||||
catch (Exception exc)
|
||||
@@ -291,7 +295,7 @@ namespace MP_ADM.WebUserControls
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
MapoDb.DS_ProdTempi.ODLRow rigaOdl = MapoDb.DataLayer.obj.taODL.getByIdx(idxOdl, false)[0];
|
||||
DS_ProdTempi.ODLRow rigaOdl = DataLayerObj.taODL.getByIdx(idxOdl, false)[0];
|
||||
// precompilo dati pezzi/tempi
|
||||
txtNumPz.Text = rigaOdl.NumPezzi.ToString();
|
||||
if (memLayer.ML.cdvb("ADM_TC_MinSec"))
|
||||
|
||||
@@ -10,6 +10,10 @@ namespace MP_ADM.WebUserControls
|
||||
|
||||
public partial class mod_planCreate : SteamWare.UserControl
|
||||
{
|
||||
/// <summary>
|
||||
/// Oggetto datalayer specifico
|
||||
/// </summary>
|
||||
DataLayer DataLayerObj = new DataLayer();
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
if (!Page.IsPostBack)
|
||||
@@ -199,7 +203,7 @@ namespace MP_ADM.WebUserControls
|
||||
{
|
||||
int.TryParse(((Label)riga.FindControl("lblIdxPromessa")).Text, out IdxPromessa);
|
||||
// approvo la promessa COPIANDOLA
|
||||
DataLayer.obj.taPlanRichieste.approvaRich(IdxPromessa, SteamWare.user_std.UtSn.utente);
|
||||
DataLayerObj.taPlanRichieste.approvaRich(IdxPromessa, SteamWare.user_std.UtSn.utente);
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
@@ -245,7 +249,7 @@ namespace MP_ADM.WebUserControls
|
||||
{ }
|
||||
}
|
||||
}
|
||||
var resultIdxOut = DataLayer.obj.taPlanRichieste.creaGrp(IdxPromessa, SteamWare.user_std.UtSn.utente, ddlMacc.SelectedValue, CodGruppo, numPzCalc);
|
||||
var resultIdxOut = DataLayerObj.taPlanRichieste.creaGrp(IdxPromessa, SteamWare.user_std.UtSn.utente, ddlMacc.SelectedValue, CodGruppo, numPzCalc);
|
||||
// se ho trovato una promessaOUT...
|
||||
int.TryParse(resultIdxOut.ToString(), out IdxPromessaOUT);
|
||||
if (IdxPromessaOUT > 0)
|
||||
@@ -261,7 +265,7 @@ namespace MP_ADM.WebUserControls
|
||||
int.TryParse(((Label)riga.FindControl("lblIdxPromessa")).Text, out IdxPromessa);
|
||||
int.TryParse(((TextBox)riga.FindControl("txtNumPezzi")).Text, out QtyEv);
|
||||
// approvo la promessa COPIANDOLA
|
||||
DataLayer.obj.taPlanRichieste.allocaIst(IdxPromessa, IdxPromessaOUT, QtyEv, SteamWare.user_std.UtSn.utente, "GRP");
|
||||
DataLayerObj.taPlanRichieste.allocaIst(IdxPromessa, IdxPromessaOUT, QtyEv, SteamWare.user_std.UtSn.utente, "GRP");
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
|
||||
@@ -9,6 +9,11 @@ namespace MP_IO.Controllers
|
||||
{
|
||||
public class BENCHController : Controller
|
||||
{
|
||||
/// <summary>
|
||||
/// Oggetto datalayer specifico
|
||||
/// </summary>
|
||||
DataLayer DataLayerObj = new DataLayer();
|
||||
|
||||
// GET: IOB (è un check alive)
|
||||
public string Index()
|
||||
{
|
||||
@@ -144,7 +149,7 @@ namespace MP_IO.Controllers
|
||||
answ = "";
|
||||
try
|
||||
{
|
||||
Dictionary<string, string> valori = DataLayer.mDatiMacchine(id);
|
||||
Dictionary<string, string> valori = DataLayerObj.mDatiMacchine(id);
|
||||
foreach (var item in valori)
|
||||
{
|
||||
answ += string.Format("{0}|{1}<br/>", item.Key, item.Value);
|
||||
@@ -202,7 +207,7 @@ namespace MP_IO.Controllers
|
||||
answ = "";
|
||||
try
|
||||
{
|
||||
KeyValuePair<string, string>[] valori = DataLayer.mTabSMI(idxFamIn);
|
||||
KeyValuePair<string, string>[] valori = DataLayerObj.mTabSMI(idxFamIn);
|
||||
splitTime = stopWatch.ElapsedMilliseconds;
|
||||
foreach (var item in valori)
|
||||
{
|
||||
@@ -248,12 +253,12 @@ namespace MP_IO.Controllers
|
||||
if (!trovato)
|
||||
{
|
||||
// ricarico tabella!
|
||||
KeyValuePair<string, string>[] valori = DataLayer.mTabSMI(idxFamIn);
|
||||
KeyValuePair<string, string>[] valori = DataLayerObj.mTabSMI(idxFamIn);
|
||||
answ = string.Format("Ricaricata SMI per famiglia {0}<br/>", fiHASH);
|
||||
}
|
||||
answ += string.Format("Trovata {0} Hash per {1}<br />", memLayer.ML.redCountKey(fiHASH), fiHASH);
|
||||
// recupero singolo valore (stringa) x chiave
|
||||
outVal = DataLayer.valoreSMI(idxFamIn, idxMicroStato, valIOB);
|
||||
outVal = DataLayerObj.valoreSMI(idxFamIn, idxMicroStato, valIOB);
|
||||
// mostro output
|
||||
answ += string.Format("idxFamIN: {0} | idxMS: {1} | valIOB: {2} | out: {3} <br/>", idxFamIn, idxMicroStato, valIOB, outVal);
|
||||
}
|
||||
@@ -285,7 +290,7 @@ namespace MP_IO.Controllers
|
||||
answ = "";
|
||||
try
|
||||
{
|
||||
answ += string.Format("Macchina {0}, insEnabled {1}<br />", id, DataLayer.insEnab(id));
|
||||
answ += string.Format("Macchina {0}, insEnabled {1}<br />", id, DataLayerObj.insEnab(id));
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
|
||||
@@ -44,8 +44,9 @@ namespace MP_IO.Controllers
|
||||
{
|
||||
try
|
||||
{
|
||||
DataLayer DataLayerObj = new DataLayer();
|
||||
// salvo risposta!
|
||||
answ = DataLayer.insEnab(id) ? "OK" : "NO";
|
||||
answ = DataLayerObj.insEnab(id) ? "OK" : "NO";
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
@@ -68,7 +69,9 @@ namespace MP_IO.Controllers
|
||||
{
|
||||
try
|
||||
{
|
||||
answ = DataLayer.sLogEnab(id) ? "OK" : "NO";
|
||||
DataLayer DataLayerObj = new DataLayer();
|
||||
// salvo risposta
|
||||
answ = DataLayerObj.sLogEnab(id) ? "OK" : "NO";
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
@@ -95,7 +98,8 @@ namespace MP_IO.Controllers
|
||||
}
|
||||
try
|
||||
{
|
||||
answ = DataLayer.processInput(id, valore, dtEve, dtCurr, cnt);
|
||||
DataLayer DataLayerObj = new DataLayer();
|
||||
answ = DataLayerObj.processInput(id, valore, dtEve, dtCurr, cnt);
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
@@ -128,6 +132,7 @@ namespace MP_IO.Controllers
|
||||
// se ho dati...
|
||||
if (content != "")
|
||||
{
|
||||
DataLayer DataLayerObj = new DataLayer();
|
||||
// procedo a deserializzare in blocco l'oggetto...
|
||||
evJsonPayload receivedData = new evJsonPayload();
|
||||
try
|
||||
@@ -154,7 +159,7 @@ namespace MP_IO.Controllers
|
||||
}
|
||||
|
||||
// formato datetime come yyyyMMddHHmmssfff -->es: 20181223180600000
|
||||
answ = DataLayer.processInput(id, item.valore, item.dtEve.ToString("yyyyMMddHHmmssfff"), item.dtCurr.ToString("yyyyMMddHHmmssfff"), item.cnt.ToString());
|
||||
answ = DataLayerObj.processInput(id, item.valore, item.dtEve.ToString("yyyyMMddHHmmssfff"), item.dtCurr.ToString("yyyyMMddHHmmssfff"), item.cnt.ToString());
|
||||
insDone++;
|
||||
}
|
||||
// se vuoto --> OK!
|
||||
@@ -189,9 +194,10 @@ namespace MP_IO.Controllers
|
||||
}
|
||||
try
|
||||
{
|
||||
DataLayer DataLayerObj = new DataLayer();
|
||||
int count = 0;
|
||||
Int32.TryParse(cnt, out count);
|
||||
answ = DataLayer.processFluxLog(id, flux, valore, dtEve, dtCurr, count);
|
||||
answ = DataLayerObj.processFluxLog(id, flux, valore, dtEve, dtCurr, count);
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
@@ -224,6 +230,7 @@ namespace MP_IO.Controllers
|
||||
// se ho dati...
|
||||
if (content != "")
|
||||
{
|
||||
DataLayer DataLayerObj = new DataLayer();
|
||||
// procedo a deserializzare in blocco l'oggetto...
|
||||
flogJsonPayload receivedData = new flogJsonPayload();
|
||||
try
|
||||
@@ -245,7 +252,7 @@ namespace MP_IO.Controllers
|
||||
foreach (var item in receivedData.fluxData)
|
||||
{
|
||||
// formato datetime come yyyyMMddHHmmssfff -->es: 20181223180600000
|
||||
answ = DataLayer.processFluxLog(id, item.flux, item.valore, item.dtEve.ToString("yyyyMMddHHmmssfff"), item.dtCurr.ToString("yyyyMMddHHmmssfff"), item.cnt);
|
||||
answ = DataLayerObj.processFluxLog(id, item.flux, item.valore, item.dtEve.ToString("yyyyMMddHHmmssfff"), item.dtCurr.ToString("yyyyMMddHHmmssfff"), item.cnt);
|
||||
}
|
||||
// se vuoto --> OK!
|
||||
if (string.IsNullOrEmpty(answ))
|
||||
@@ -261,7 +268,7 @@ namespace MP_IO.Controllers
|
||||
// leggo parametri correnti...
|
||||
try
|
||||
{
|
||||
List<objItem> currParams = DataLayer.getCurrObjItems(id);
|
||||
List<objItem> currParams = DataLayerObj.getCurrObjItems(id);
|
||||
// ora per ogni valore RICEVUTO costruisco un oggetto in innnovazioni da inviare...x salvare in stato parametri...
|
||||
List<objItem> innovazioni = new List<objItem>();
|
||||
foreach (var item in receivedData.fluxData)
|
||||
@@ -291,7 +298,7 @@ namespace MP_IO.Controllers
|
||||
innovazioni.Add(trovato);
|
||||
}
|
||||
// faccio upsert innovations!
|
||||
DataLayer.upsertCurrObjItems(id, innovazioni);
|
||||
DataLayerObj.upsertCurrObjItems(id, innovazioni);
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
@@ -327,7 +334,8 @@ namespace MP_IO.Controllers
|
||||
{
|
||||
// deserializzo.
|
||||
liveIOB receivedData = JsonConvert.DeserializeObject<liveIOB>(content);
|
||||
answ = DataLayer.processLiveJson(id, receivedData);
|
||||
DataLayer DataLayerObj = new DataLayer();
|
||||
answ = DataLayerObj.processLiveJson(id, receivedData);
|
||||
// se vuoto --> OK!
|
||||
if (string.IsNullOrEmpty(answ))
|
||||
{
|
||||
@@ -457,7 +465,8 @@ namespace MP_IO.Controllers
|
||||
// se != null --> salvo!
|
||||
if (currMemMap != null)
|
||||
{
|
||||
DataLayer.setIobMemMap(id, currMemMap);
|
||||
DataLayer DataLayerObj = new DataLayer();
|
||||
DataLayerObj.setIobMemMap(id, currMemMap);
|
||||
answ = "OK";
|
||||
}
|
||||
}
|
||||
@@ -530,8 +539,9 @@ namespace MP_IO.Controllers
|
||||
List<objItem> currParams = new List<objItem>();
|
||||
try
|
||||
{
|
||||
DataLayer DataLayerObj = new DataLayer();
|
||||
// deserializzo.
|
||||
currParams = DataLayer.getCurrObjItems(id);
|
||||
currParams = DataLayerObj.getCurrObjItems(id);
|
||||
// se != null --> salvo!
|
||||
if (currParams != null)
|
||||
{
|
||||
@@ -565,8 +575,9 @@ namespace MP_IO.Controllers
|
||||
List<objItem> currParams = new List<objItem>();
|
||||
try
|
||||
{
|
||||
DataLayer DataLayerObj = new DataLayer();
|
||||
// deserializzo.
|
||||
currParams = DataLayer.getCurrObjItemsPendigWrite(id);
|
||||
currParams = DataLayerObj.getCurrObjItemsPendigWrite(id);
|
||||
// se != null --> salvo!
|
||||
if (currParams != null)
|
||||
{
|
||||
@@ -615,7 +626,8 @@ namespace MP_IO.Controllers
|
||||
// se != null --> salvo!
|
||||
if (currParams != null)
|
||||
{
|
||||
DataLayer.setCurrObjItems(id, currParams);
|
||||
DataLayer DataLayerObj = new DataLayer();
|
||||
DataLayerObj.setCurrObjItems(id, currParams);
|
||||
answ = "OK";
|
||||
}
|
||||
}
|
||||
@@ -662,7 +674,8 @@ namespace MP_IO.Controllers
|
||||
if (innovazioni != null)
|
||||
{
|
||||
// salvo
|
||||
DataLayer.upsertCurrObjItems(id, innovazioni);
|
||||
DataLayer DataLayerObj = new DataLayer();
|
||||
DataLayerObj.upsertCurrObjItems(id, innovazioni);
|
||||
answ = "OK";
|
||||
}
|
||||
}
|
||||
@@ -686,7 +699,8 @@ namespace MP_IO.Controllers
|
||||
}
|
||||
try
|
||||
{
|
||||
answ = DataLayer.processLiveRec(id, liveData);
|
||||
DataLayer DataLayerObj = new DataLayer();
|
||||
answ = DataLayerObj.processLiveRec(id, liveData);
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
@@ -710,7 +724,8 @@ namespace MP_IO.Controllers
|
||||
string answ = "";
|
||||
try
|
||||
{
|
||||
answ = DataLayer.currODL(id).ToString();
|
||||
DataLayer DataLayerObj = new DataLayer();
|
||||
answ = DataLayerObj.currODL(id).ToString();
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
@@ -733,7 +748,8 @@ namespace MP_IO.Controllers
|
||||
// chiamo metodo redis/db...
|
||||
try
|
||||
{
|
||||
DS_ProdTempi.ODLDataTable currTab = DataLayer.currODLRowTab(id);
|
||||
DataLayer DataLayerObj = new DataLayer();
|
||||
DS_ProdTempi.ODLDataTable currTab = DataLayerObj.currODLRowTab(id);
|
||||
if (currTab.Count > 0)
|
||||
{
|
||||
DS_ProdTempi.ODLRow odlRow = currTab[0];
|
||||
@@ -761,7 +777,8 @@ namespace MP_IO.Controllers
|
||||
// chiamo metodo redis/db...
|
||||
try
|
||||
{
|
||||
currData = DataLayer.currODLRowTab(id);
|
||||
DataLayer DataLayerObj = new DataLayer();
|
||||
currData = DataLayerObj.currODLRowTab(id);
|
||||
answ = JsonConvert.SerializeObject(currData);
|
||||
}
|
||||
catch (Exception exc)
|
||||
@@ -785,7 +802,8 @@ namespace MP_IO.Controllers
|
||||
// chiamo metodo redis/db...
|
||||
try
|
||||
{
|
||||
currData = DataLayer.currSMTab(id);
|
||||
DataLayer DataLayerObj = new DataLayer();
|
||||
currData = DataLayerObj.currSMTab(id);
|
||||
answ = JsonConvert.SerializeObject(currData);
|
||||
}
|
||||
catch (Exception exc)
|
||||
@@ -805,15 +823,16 @@ namespace MP_IO.Controllers
|
||||
// attenzione! poiché nell'URL il carattere "#" fiene filtrato ci aspettiamo il carattere "|" che poi trasformiamo ora in "#"
|
||||
id = id.Replace("|", "#");
|
||||
int answ = 0;
|
||||
DataLayer DataLayerObj = new DataLayer();
|
||||
DS_applicazione.StatoMacchineDataTable currData = null;
|
||||
// chiamo metodo redis/db...
|
||||
try
|
||||
{
|
||||
currData = DataLayer.currSMTab(id);
|
||||
currData = DataLayerObj.currSMTab(id);
|
||||
if (currData.Count > 0)
|
||||
{
|
||||
// recupero da redis elenco stati
|
||||
DS_applicazione.AnagraficaStatiDataTable anagStati = DataLayer.AnagraficaStati();
|
||||
DS_applicazione.AnagraficaStatiDataTable anagStati = DataLayerObj.AnagraficaStati();
|
||||
DS_applicazione.AnagraficaStatiRow currStato = anagStati.FindByIdxStato(currData[0].IdxStato);
|
||||
// calcolo SE sia idle... OVVERO SEMAFORO NON VERDE!!!
|
||||
if (currStato.Semaforo != "sVe")
|
||||
@@ -844,11 +863,12 @@ namespace MP_IO.Controllers
|
||||
string answ = "";
|
||||
// scrivo keep alive!!! (se necessario, altrimenti è in cache...)
|
||||
MapoDb.MapoDb connDb = new MapoDb.MapoDb();
|
||||
DataLayer DataLayerObj = new DataLayer();
|
||||
connDb.scriviKeepAlive(id, DateTime.Now);
|
||||
try
|
||||
{
|
||||
// recupero dati macchina...
|
||||
Dictionary<string, string> valori = DataLayer.mDatiMacchine(id);
|
||||
Dictionary<string, string> valori = DataLayerObj.mDatiMacchine(id);
|
||||
answ = JsonConvert.SerializeObject(valori);
|
||||
}
|
||||
catch
|
||||
@@ -867,7 +887,8 @@ namespace MP_IO.Controllers
|
||||
{
|
||||
// attenzione! poiché nell'URL il carattere "#" fiene filtrato ci aspettiamo il carattere "|" che poi trasformiamo ora in "#"
|
||||
id = id.Replace("|", "#");
|
||||
return DataLayer.forceSplitOdl(id);
|
||||
DataLayer DataLayerObj = new DataLayer();
|
||||
return DataLayerObj.forceSplitOdl(id);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -883,11 +904,12 @@ namespace MP_IO.Controllers
|
||||
string answ = "";
|
||||
// scrivo keep alive!!! (se necessario, altrimenti è in cache...)
|
||||
MapoDb.MapoDb connDb = new MapoDb.MapoDb();
|
||||
DataLayer DataLayerObj = new DataLayer();
|
||||
connDb.scriviKeepAlive(id, DateTime.Now);
|
||||
try
|
||||
{
|
||||
// leggo da REDIS eventuale elenco task x macchina...
|
||||
Dictionary<string, string> valori = DataLayer.mTaskMacchina(id);
|
||||
Dictionary<string, string> valori = DataLayerObj.mTaskMacchina(id);
|
||||
answ = JsonConvert.SerializeObject(valori);
|
||||
}
|
||||
catch
|
||||
@@ -912,6 +934,7 @@ namespace MP_IO.Controllers
|
||||
string answ = "";
|
||||
// scrivo keep alive!!! (se necessario, altrimenti è in cache...)
|
||||
MapoDb.MapoDb connDb = new MapoDb.MapoDb();
|
||||
DataLayer DataLayerObj = new DataLayer();
|
||||
connDb.scriviKeepAlive(id, DateTime.Now);
|
||||
try
|
||||
{
|
||||
@@ -920,7 +943,7 @@ namespace MP_IO.Controllers
|
||||
bool fatto = Enum.TryParse(taskName, out tName);
|
||||
if (fatto)
|
||||
{
|
||||
DataLayer.addTask4Machine(id, tName, taskVal);
|
||||
DataLayerObj.addTask4Machine(id, tName, taskVal);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -945,6 +968,7 @@ namespace MP_IO.Controllers
|
||||
string answ = "";
|
||||
// scrivo keep alive!!! (se necessario, altrimenti è in cache...)
|
||||
MapoDb.MapoDb connDb = new MapoDb.MapoDb();
|
||||
DataLayer DataLayerObj = new DataLayer();
|
||||
connDb.scriviKeepAlive(id, DateTime.Now);
|
||||
try
|
||||
{
|
||||
@@ -953,7 +977,7 @@ namespace MP_IO.Controllers
|
||||
bool fatto = Enum.TryParse(taskName, out tName);
|
||||
if (fatto)
|
||||
{
|
||||
DataLayer.remTask4Machine(id, tName);
|
||||
DataLayerObj.remTask4Machine(id, tName);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -982,7 +1006,8 @@ namespace MP_IO.Controllers
|
||||
try
|
||||
{
|
||||
// leggo da REDIS eventuale elenco task x macchina...
|
||||
Dictionary<string, string> valori = DataLayer.mOptParMacchina(id);
|
||||
DataLayer DataLayerObj = new DataLayer();
|
||||
Dictionary<string, string> valori = DataLayerObj.mOptParMacchina(id);
|
||||
answ = JsonConvert.SerializeObject(valori);
|
||||
}
|
||||
catch
|
||||
@@ -1003,10 +1028,11 @@ namespace MP_IO.Controllers
|
||||
string answ = "";
|
||||
// scrivo keep alive!!! (se necessario, altrimenti è in cache...)
|
||||
MapoDb.MapoDb connDb = new MapoDb.MapoDb();
|
||||
DataLayer DataLayerObj = new DataLayer();
|
||||
connDb.scriviKeepAlive(id, DateTime.Now);
|
||||
try
|
||||
{
|
||||
DataLayer.addOptPar4Machine(id, pName, pValue);
|
||||
DataLayerObj.addOptPar4Machine(id, pName, pValue);
|
||||
answ = getOptPar(id);
|
||||
}
|
||||
catch
|
||||
@@ -1026,10 +1052,11 @@ namespace MP_IO.Controllers
|
||||
string answ = "";
|
||||
// scrivo keep alive!!! (se necessario, altrimenti è in cache...)
|
||||
MapoDb.MapoDb connDb = new MapoDb.MapoDb();
|
||||
DataLayer DataLayerObj = new DataLayer();
|
||||
connDb.scriviKeepAlive(id, DateTime.Now);
|
||||
try
|
||||
{
|
||||
DataLayer.remOptPar4Machine(id, pName);
|
||||
DataLayerObj.remOptPar4Machine(id, pName);
|
||||
answ = getOptPar(id);
|
||||
}
|
||||
catch
|
||||
@@ -1046,7 +1073,8 @@ namespace MP_IO.Controllers
|
||||
/// <returns></returns>
|
||||
public string resetCurrODL(string id)
|
||||
{
|
||||
return DataLayer.emptyCurrODL(id);
|
||||
DataLayer DataLayerObj = new DataLayer();
|
||||
return DataLayerObj.emptyCurrODL(id);
|
||||
}
|
||||
/// <summary>
|
||||
/// Recupera COUNTER x macchina:
|
||||
@@ -1061,7 +1089,8 @@ namespace MP_IO.Controllers
|
||||
string answ = "";
|
||||
try
|
||||
{
|
||||
answ = DataLayer.pzCounter(id).ToString();
|
||||
DataLayer DataLayerObj = new DataLayer();
|
||||
answ = DataLayerObj.pzCounter(id).ToString();
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
@@ -1083,7 +1112,8 @@ namespace MP_IO.Controllers
|
||||
string answ = "";
|
||||
try
|
||||
{
|
||||
answ = DataLayer.pzCounterTC(id).ToString();
|
||||
DataLayer DataLayerObj = new DataLayer();
|
||||
answ = DataLayerObj.pzCounterTC(id).ToString();
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
@@ -1111,7 +1141,8 @@ namespace MP_IO.Controllers
|
||||
}
|
||||
try
|
||||
{
|
||||
answ = DataLayer.saveCounter(id, counter);
|
||||
DataLayer DataLayerObj = new DataLayer();
|
||||
answ = DataLayerObj.saveCounter(id, counter);
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
@@ -1136,7 +1167,8 @@ namespace MP_IO.Controllers
|
||||
logger.lg.scriviLog($"Salvataggio incremento contapezzi:{Environment.NewLine}idxMacchina: {id}{Environment.NewLine}pezzi: {qty}", tipoLog.INFO);
|
||||
try
|
||||
{
|
||||
answ = DataLayer.saveCaricoPezzi(id, qty);
|
||||
DataLayer DataLayerObj = new DataLayer();
|
||||
answ = DataLayerObj.saveCaricoPezzi(id, qty);
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
|
||||
+57
-48
@@ -3,56 +3,65 @@ using System;
|
||||
|
||||
namespace MP_IO
|
||||
{
|
||||
public partial class lastUpdate : System.Web.UI.Page
|
||||
public partial class lastUpdate : System.Web.UI.Page
|
||||
{
|
||||
/// <summary>
|
||||
/// Oggetto datalayer specifico
|
||||
/// </summary>
|
||||
DataLayer DataLayerObj = new DataLayer();
|
||||
/// <summary>
|
||||
/// load pagina
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
string idxMacchina = Request.QueryString["idxMacchina"];
|
||||
if (idxMacchina != "")
|
||||
{
|
||||
try
|
||||
{
|
||||
string idxMacchina = Request.QueryString["idxMacchina"];
|
||||
if (idxMacchina != "")
|
||||
{
|
||||
try
|
||||
{
|
||||
lblMacchina.Text = string.Format("Macchina: {0}", idxMacchina);
|
||||
}
|
||||
catch
|
||||
{
|
||||
lblLastUpdate.Text = "Macchina non nota";
|
||||
}
|
||||
// reboot
|
||||
try
|
||||
{
|
||||
DateTime lastUpd = DataLayer.obj.taRemReb.getLastByIdxMacchina(idxMacchina)[0].DataOraBoot;
|
||||
lblLastReboot.Text = string.Format("Ultimo reboot macchina: {0:dd/MM/yyyy HH:mm:ss}", lastUpd);
|
||||
}
|
||||
catch
|
||||
{
|
||||
lblLastUpdate.Text = "???";
|
||||
}
|
||||
// keep alive
|
||||
try
|
||||
{
|
||||
DateTime lastUpd = DataLayer.obj.taKeepAlive.getByIdxMacchina(idxMacchina)[0].DataOraServer;
|
||||
lblLastKeepAlive.Text = string.Format("Ultimo KeepAlive macchina: {0:dd/MM/yyyy HH:mm:ss}", lastUpd);
|
||||
}
|
||||
catch
|
||||
{
|
||||
lblLastUpdate.Text = "???";
|
||||
}
|
||||
// update stato
|
||||
try
|
||||
{
|
||||
DateTime lastUpd = DataLayer.obj.taStatoMacchine.GetDataByIdxMacchina(idxMacchina)[0].InizioStato;
|
||||
lblLastUpdate.Text = string.Format("Ultimo update stato macchina: {0:dd/MM/yyyy HH:mm:ss}", lastUpd);
|
||||
}
|
||||
catch
|
||||
{
|
||||
lblLastUpdate.Text = "???";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
lblLastUpdate.Text = "manca idx Macchina";
|
||||
}
|
||||
lblMacchina.Text = string.Format("Macchina: {0}", idxMacchina);
|
||||
}
|
||||
catch
|
||||
{
|
||||
lblLastUpdate.Text = "Macchina non nota";
|
||||
}
|
||||
// reboot
|
||||
try
|
||||
{
|
||||
DateTime lastUpd = DataLayerObj.taRemReb.getLastByIdxMacchina(idxMacchina)[0].DataOraBoot;
|
||||
lblLastReboot.Text = string.Format("Ultimo reboot macchina: {0:dd/MM/yyyy HH:mm:ss}", lastUpd);
|
||||
}
|
||||
catch
|
||||
{
|
||||
lblLastUpdate.Text = "???";
|
||||
}
|
||||
// keep alive
|
||||
try
|
||||
{
|
||||
DateTime lastUpd = DataLayerObj.taKeepAlive.getByIdxMacchina(idxMacchina)[0].DataOraServer;
|
||||
lblLastKeepAlive.Text = string.Format("Ultimo KeepAlive macchina: {0:dd/MM/yyyy HH:mm:ss}", lastUpd);
|
||||
}
|
||||
catch
|
||||
{
|
||||
lblLastUpdate.Text = "???";
|
||||
}
|
||||
// update stato
|
||||
try
|
||||
{
|
||||
DateTime lastUpd = DataLayerObj.taStatoMacchine.GetDataByIdxMacchina(idxMacchina)[0].InizioStato;
|
||||
lblLastUpdate.Text = string.Format("Ultimo update stato macchina: {0:dd/MM/yyyy HH:mm:ss}", lastUpd);
|
||||
}
|
||||
catch
|
||||
{
|
||||
lblLastUpdate.Text = "???";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
lblLastUpdate.Text = "manca idx Macchina";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -40,7 +40,8 @@ namespace MP_IO
|
||||
try
|
||||
{
|
||||
// ora salvo che la macchina è stata (ri)avviata...
|
||||
MapoDb.MapoDb.obj.registraStartup(idxMacchina, IPv4, agent, macAddr);
|
||||
MapoDb.MapoDb MapoDbObj = new MapoDb.MapoDb();
|
||||
MapoDbObj.registraStartup(idxMacchina, IPv4, agent, macAddr);
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
|
||||
@@ -11,6 +11,7 @@ namespace MP_MON.Controllers
|
||||
{
|
||||
public class MSEController : Controller
|
||||
{
|
||||
DataLayer DataLayerObj = new DataLayer();
|
||||
private MoonProEntities db = new MoonProEntities();
|
||||
|
||||
// GET: StatusMap
|
||||
@@ -27,7 +28,7 @@ namespace MP_MON.Controllers
|
||||
{
|
||||
int dataRefresh = 2000;
|
||||
string answ = "";
|
||||
answ = DataLayer.obj.currMSE;
|
||||
answ = DataLayerObj.currMSE;
|
||||
if (!string.IsNullOrEmpty(answ))
|
||||
{
|
||||
List<MappaStatoExpl> dati = getDbSaveRedis(dataRefresh);
|
||||
@@ -54,7 +55,7 @@ namespace MP_MON.Controllers
|
||||
catch
|
||||
{ }
|
||||
List<MappaStatoExpl> dati = new List<MappaStatoExpl>();
|
||||
string currMse = DataLayer.obj.currMSE;
|
||||
string currMse = DataLayerObj.currMSE;
|
||||
if (!string.IsNullOrEmpty(currMse))
|
||||
{
|
||||
try
|
||||
@@ -102,7 +103,7 @@ namespace MP_MON.Controllers
|
||||
logger.lg.scriviLog("Recuperata MSE da DB");
|
||||
dati = db.stp_MSE_getData(dataRefresh).ToList();
|
||||
// serializzo
|
||||
DataLayer.obj.currMSE = JsonConvert.SerializeObject(dati);
|
||||
DataLayerObj.currMSE = JsonConvert.SerializeObject(dati);
|
||||
return dati;
|
||||
}
|
||||
|
||||
|
||||
@@ -2,3 +2,30 @@
|
||||
|
||||
# CA1707: Gli identificatori non devono contenere caratteri di sottolineatura
|
||||
dotnet_diagnostic.CA1707.severity = none
|
||||
|
||||
# CA1051: Non dichiarare campi di istanza visibili
|
||||
dotnet_diagnostic.CA1051.severity = none
|
||||
|
||||
# CA1822: Contrassegnare i membri come static
|
||||
dotnet_diagnostic.CA1822.severity = none
|
||||
|
||||
# CA1031: Do not catch general exception types
|
||||
dotnet_diagnostic.CA1031.severity = none
|
||||
|
||||
# CA1303: Non passare valori letterali come parametri localizzati
|
||||
dotnet_diagnostic.CA1303.severity = none
|
||||
|
||||
# IDE0049: Semplifica nomi
|
||||
dotnet_style_predefined_type_for_member_access = true:none
|
||||
|
||||
# IDE0049: Semplifica nomi
|
||||
dotnet_style_predefined_type_for_locals_parameters_members = true:none
|
||||
|
||||
# CA1305: Specificare IFormatProvider
|
||||
dotnet_diagnostic.CA1305.severity = none
|
||||
|
||||
# CA1307: Specificare StringComparison
|
||||
dotnet_diagnostic.CA1307.severity = none
|
||||
|
||||
# CA2000: Elimina gli oggetti prima che siano esterni all'ambito
|
||||
dotnet_diagnostic.CA2000.severity = none
|
||||
|
||||
@@ -35,13 +35,14 @@ namespace MP_SITE
|
||||
try
|
||||
{
|
||||
// ora salvo che la macchina è stata (ri)avviata...
|
||||
MapoDb.MapoDb.obj.registraStartup(idxMacchina, IPv4, agent, macAddr);
|
||||
MapoDb.MapoDb MapoDbObj = new MapoDb.MapoDb();
|
||||
MapoDbObj.registraStartup(idxMacchina, IPv4, agent, macAddr);
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
if (memLayer.ML.CRI("_logLevel") > 5)
|
||||
{
|
||||
string errore = string.Format("Errore: {0}{1}", Environment.NewLine, exc);
|
||||
string errore = $"Errore: {Environment.NewLine}{exc}";
|
||||
logger.lg.scriviLog(errore, tipoLog.EXCEPTION);
|
||||
lblOut.Text = errore;
|
||||
}
|
||||
|
||||
@@ -112,6 +112,10 @@ namespace MP_SITE
|
||||
memLayer.ML.setSessionVal("_intervalloSeq", value);
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// Oggetto datalayer specifico
|
||||
/// </summary>
|
||||
DataLayer DataLayerObj = new DataLayer();
|
||||
protected DS_applicazione.MacchineDataTable tabMacchine;
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
@@ -120,7 +124,7 @@ namespace MP_SITE
|
||||
if (!enableGraphJS)
|
||||
{
|
||||
_resoconti = new resoconti();
|
||||
tabMacchine = MapoDb.DataLayer.obj.taMacchine.GetData();
|
||||
tabMacchine = DataLayerObj.taMacchine.GetData();
|
||||
}
|
||||
if (!Page.IsPostBack)
|
||||
{
|
||||
@@ -137,31 +141,34 @@ namespace MP_SITE
|
||||
|
||||
protected void repSeq_ItemDataBound(object sender, RepeaterItemEventArgs e)
|
||||
{
|
||||
mod_sequencerStati sequencer = (mod_sequencerStati)e.Item.FindControl("seqStato");
|
||||
sequencer.larghezza = memLayer.ML.IntSessionObj("WindowWidth") - 100;
|
||||
sequencer.graphHeight = memLayer.ML.CRI("seq_height");
|
||||
sequencer.numSplit = memLayer.ML.CRI("seq_numSpl");
|
||||
try
|
||||
if (e != null)
|
||||
{
|
||||
var datiSeq = _resoconti.sequenzaDati(sequencer.identificativo, intervalloAnalisi);
|
||||
// SE HO dati mostro
|
||||
if (datiSeq.serieDati.Count > 0)
|
||||
mod_sequencerStati sequencer = (mod_sequencerStati)e.Item.FindControl("seqStato");
|
||||
sequencer.larghezza = memLayer.ML.IntSessionObj("WindowWidth") - 100;
|
||||
sequencer.graphHeight = memLayer.ML.CRI("seq_height");
|
||||
sequencer.numSplit = memLayer.ML.CRI("seq_numSpl");
|
||||
try
|
||||
{
|
||||
sequencer.datiSequencer = datiSeq;
|
||||
sequencer.doUpdate();
|
||||
sequencer.Visible = true;
|
||||
var datiSeq = _resoconti.sequenzaDati(sequencer.identificativo, intervalloAnalisi);
|
||||
// SE HO dati mostro
|
||||
if (datiSeq.serieDati.Count > 0)
|
||||
{
|
||||
sequencer.datiSequencer = datiSeq;
|
||||
sequencer.doUpdate();
|
||||
sequencer.Visible = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
sequencer.Visible = false;
|
||||
logger.lg.scriviLog(string.Format("Dati non trovati per {0}", sequencer.identificativo), tipoLog.INFO);
|
||||
}
|
||||
}
|
||||
else
|
||||
catch (Exception exc)
|
||||
{
|
||||
logger.lg.scriviLog(string.Format("Eccezione recupero dati per {0}{1}{2}", sequencer.identificativo, Environment.NewLine, exc), tipoLog.EXCEPTION);
|
||||
sequencer.Visible = false;
|
||||
logger.lg.scriviLog(string.Format("Dati non trovati per {0}", sequencer.identificativo), tipoLog.INFO);
|
||||
}
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
logger.lg.scriviLog(string.Format("Eccezione recupero dati per {0}{1}{2}", sequencer.identificativo, Environment.NewLine, exc), tipoLog.EXCEPTION);
|
||||
sequencer.Visible = false;
|
||||
}
|
||||
}
|
||||
|
||||
protected void lnkCambiaModo_Click(object sender, EventArgs e)
|
||||
@@ -218,7 +225,10 @@ namespace MP_SITE
|
||||
protected void lnkMacchina_Click(object sender, EventArgs e)
|
||||
{
|
||||
LinkButton lb = (LinkButton)sender;
|
||||
memLayer.ML.setSessionVal("IdxMacchina", lb.CommandArgument);
|
||||
if (lb != null)
|
||||
{
|
||||
memLayer.ML.setSessionVal("IdxMacchina", lb.CommandArgument);
|
||||
}
|
||||
Response.Redirect("~/DettaglioMacchina.aspx");
|
||||
}
|
||||
|
||||
|
||||
@@ -1,10 +1,15 @@
|
||||
using SteamWare;
|
||||
using MapoDb;
|
||||
using SteamWare;
|
||||
using System;
|
||||
|
||||
namespace MP_SITE
|
||||
{
|
||||
public partial class inputSeriale : System.Web.UI.Page
|
||||
{
|
||||
/// <summary>
|
||||
/// Oggetto datalayer specifico
|
||||
/// </summary>
|
||||
DataLayer DataLayerObj = new DataLayer();
|
||||
/// <summary>
|
||||
/// caricamento pagina
|
||||
/// </summary>
|
||||
@@ -25,13 +30,13 @@ namespace MP_SITE
|
||||
try
|
||||
{
|
||||
// ora processo e salvo il valore del microstato...
|
||||
MapoDb.MapoDb.obj.checkMicroStato(idxMacchina, valore);
|
||||
DataLayerObj.checkMicroStato(idxMacchina, valore);
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
if (memLayer.ML.CRI("_logLevel") > 5)
|
||||
{
|
||||
string errore = string.Format("Errore: {0}{1}", Environment.NewLine, exc);
|
||||
string errore = $"Errore: {Environment.NewLine}{exc}";
|
||||
logger.lg.scriviLog(errore, tipoLog.EXCEPTION);
|
||||
lblOut.Text = errore;
|
||||
}
|
||||
|
||||
+22
-18
@@ -3,26 +3,30 @@ using System;
|
||||
|
||||
namespace MP_SITE
|
||||
{
|
||||
public partial class lastUpdate : System.Web.UI.Page
|
||||
public partial class lastUpdate : System.Web.UI.Page
|
||||
{
|
||||
/// <summary>
|
||||
/// Oggetto datalayer specifico
|
||||
/// </summary>
|
||||
DataLayer DataLayerObj = new DataLayer();
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
string idxMacchina = Request.QueryString["idxMacchina"];
|
||||
if (idxMacchina != "")
|
||||
{
|
||||
try
|
||||
{
|
||||
string idxMacchina = Request.QueryString["idxMacchina"];
|
||||
if (idxMacchina != "")
|
||||
{
|
||||
try
|
||||
{
|
||||
lblLastUpdate.Text = DataLayer.obj.taStatoMacchine.GetDataByIdxMacchina(idxMacchina)[0].InizioStato.ToLongTimeString();
|
||||
}
|
||||
catch
|
||||
{
|
||||
lblLastUpdate.Text = "???";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
lblLastUpdate.Text = "manca idx Macchina";
|
||||
}
|
||||
lblLastUpdate.Text = DataLayerObj.taStatoMacchine.GetDataByIdxMacchina(idxMacchina)[0].InizioStato.ToLongTimeString();
|
||||
}
|
||||
catch
|
||||
{
|
||||
lblLastUpdate.Text = "???";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
lblLastUpdate.Text = "manca idx Macchina";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,5 @@
|
||||
using SteamWare;
|
||||
using MapoDb;
|
||||
using SteamWare;
|
||||
using System.Collections.Generic;
|
||||
using System.Web.Services;
|
||||
|
||||
@@ -15,6 +16,10 @@ namespace MP_SITE.WS
|
||||
public class AutoCompletamento : System.Web.Services.WebService
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// Oggetto datalayer specifico
|
||||
/// </summary>
|
||||
DataLayer DataLayerObj = new DataLayer();
|
||||
/// <summary>
|
||||
/// elenco articoli per ricerca interattiva
|
||||
/// </summary>
|
||||
@@ -28,7 +33,7 @@ namespace MP_SITE.WS
|
||||
if (count >= memLayer.ML.CRI("MinCharAutocomplete"))
|
||||
{
|
||||
// elenco candidati
|
||||
MapoDb.DS_Utility.v_selArticoliDataTable tabDati = MapoDb.DataLayer.obj.taSelArt.getByConditio(prefixText);
|
||||
MapoDb.DS_Utility.v_selArticoliDataTable tabDati = DataLayerObj.taSelArt.getByConditio(prefixText);
|
||||
// aggiungo ogni riga...
|
||||
foreach (MapoDb.DS_Utility.v_selArticoliRow riga in tabDati)
|
||||
{
|
||||
|
||||
@@ -5,6 +5,13 @@ namespace MP_SITE.WebUserControls
|
||||
{
|
||||
public class baseProdControl : System.Web.UI.UserControl
|
||||
{
|
||||
/// <summary>
|
||||
/// Oggetto datalayer specifico
|
||||
/// </summary>
|
||||
DataLayer DataLayerObj = new DataLayer();
|
||||
/// <summary>
|
||||
/// evento update
|
||||
/// </summary>
|
||||
public event EventHandler eh_doUpdate;
|
||||
protected resoconti _resoconti;
|
||||
protected int _numRighe = 17;
|
||||
@@ -47,7 +54,7 @@ namespace MP_SITE.WebUserControls
|
||||
/// <returns></returns>
|
||||
protected bool isMulti(string idxMacchina)
|
||||
{
|
||||
return DataLayer.isMulti(idxMacchina);
|
||||
return DataLayerObj.isMulti(idxMacchina);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -6,6 +6,10 @@ namespace MP_SITE.WebUserControls
|
||||
{
|
||||
public partial class mod_datiConfermati : System.Web.UI.UserControl
|
||||
{
|
||||
/// <summary>
|
||||
/// Oggetto datalayer specifico
|
||||
/// </summary>
|
||||
DataLayer DataLayerObj = new DataLayer();
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
@@ -28,7 +32,7 @@ namespace MP_SITE.WebUserControls
|
||||
try
|
||||
{
|
||||
string IdxMacchina = memLayer.ML.StringSessionObj("IdxMacchina");
|
||||
answ = DataLayer.mDatiMacchinaVal(IdxMacchina, "Multi") != "0";
|
||||
answ = DataLayerObj.mDatiMacchinaVal(IdxMacchina, "Multi") != "0";
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
|
||||
@@ -6,6 +6,15 @@ namespace MP_SITE.WebUserControls
|
||||
{
|
||||
public partial class mod_infoAggiuntive : System.Web.UI.UserControl
|
||||
{
|
||||
/// <summary>
|
||||
/// Oggetto datalayer specifico
|
||||
/// </summary>
|
||||
DataLayer DataLayerObj = new DataLayer();
|
||||
/// <summary>
|
||||
/// load pagina con info
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
popolaLabels();
|
||||
@@ -34,7 +43,7 @@ namespace MP_SITE.WebUserControls
|
||||
// label ODL
|
||||
try
|
||||
{
|
||||
DS_ProdTempi.ODLRow rigaOdl = DataLayer.obj.taODL.getByMacchina(idxMacchina)[0];
|
||||
DS_ProdTempi.ODLRow rigaOdl = DataLayerObj.taODL.getByMacchina(idxMacchina)[0];
|
||||
odl = rigaOdl.IdxODL;
|
||||
dataFrom = rigaOdl.DataInizio;
|
||||
lblOdl.Text = string.Format("ODL num: {0}, iniziato il {1:dd/MM/yy} alle {1:HH:mm}", odl, dataFrom);
|
||||
@@ -46,7 +55,7 @@ namespace MP_SITE.WebUserControls
|
||||
/************************************
|
||||
* data la postazione corrente decide cosa mostrare e come
|
||||
************************************/
|
||||
MapoDb.DS_ProdTempi.stp_repDonati_getDatiProdMacchinaRow rigaProd = DataLayer.obj.taDatiProdMacch.GetData(idxMacchina)[0];
|
||||
MapoDb.DS_ProdTempi.stp_repDonati_getDatiProdMacchinaRow rigaProd = DataLayerObj.taDatiProdMacch.GetData(idxMacchina)[0];
|
||||
lblCodArticolo.Text = rigaProd.CodArticolo;
|
||||
lblNumPzLanciati.Text = string.Format("{0} pz.", rigaProd.PezziLanciati);
|
||||
lblNumPzConf.Text = string.Format("{0} pz.", rigaProd.PezziConf);
|
||||
@@ -175,7 +184,7 @@ namespace MP_SITE.WebUserControls
|
||||
/************************************
|
||||
* recupero dati macchina / periodo
|
||||
************************************/
|
||||
MapoDb.DS_ProdTempi.stp_repDonati_getDatiProdMacchinaPeriodoRow rigaProd = DataLayer.obj.taDatiProdMacchPer.GetData(idxMacchina, dataFrom, dataTo)[0];
|
||||
MapoDb.DS_ProdTempi.stp_repDonati_getDatiProdMacchinaPeriodoRow rigaProd = DataLayerObj.taDatiProdMacchPer.GetData(idxMacchina, dataFrom, dataTo)[0];
|
||||
|
||||
/************************************
|
||||
* calcolo pezzi fatti periodo
|
||||
@@ -187,7 +196,7 @@ namespace MP_SITE.WebUserControls
|
||||
}
|
||||
catch
|
||||
{
|
||||
pezziFatti = DataLayer.obj.taTempiCicloRilevati.getByMacchinaPeriodo(idxMacchina, dataFrom, dataTo).Rows.Count;
|
||||
pezziFatti = DataLayerObj.taTempiCicloRilevati.getByMacchinaPeriodo(idxMacchina, dataFrom, dataTo).Rows.Count;
|
||||
}
|
||||
lblNumPzFattiPer.Text = string.Format("({0} pz.)", pezziFatti);
|
||||
|
||||
|
||||
@@ -88,10 +88,10 @@ namespace MP_SITE.WebUserControls
|
||||
// solo se user è auth...
|
||||
if (user_std.UtSn.isAuth)
|
||||
{
|
||||
if (_titleString != "")
|
||||
if (!string.IsNullOrEmpty(_titleString))
|
||||
{
|
||||
_titleString = "";
|
||||
memLayer.ML.setSessionVal("_titleString",_titleString);
|
||||
memLayer.ML.setSessionVal("_titleString", _titleString);
|
||||
memLayer.ML.setSessionVal("SessionUpdateMenu", true);
|
||||
}
|
||||
else
|
||||
@@ -154,11 +154,11 @@ namespace MP_SITE.WebUserControls
|
||||
|
||||
private void updateWindowSize()
|
||||
{
|
||||
if (HiddenHeight.Value != "")
|
||||
if (!string.IsNullOrEmpty(HiddenHeight.Value))
|
||||
{
|
||||
memLayer.ML.setSessionVal("WindowHeight", HiddenHeight.Value, true);
|
||||
}
|
||||
if (HiddenWidth.Value != "")
|
||||
if (!string.IsNullOrEmpty(HiddenWidth.Value))
|
||||
{
|
||||
memLayer.ML.setSessionVal("WindowWidth", HiddenWidth.Value);
|
||||
}
|
||||
|
||||
@@ -4,202 +4,207 @@ using System;
|
||||
|
||||
namespace MP_SITE.WebUserControls
|
||||
{
|
||||
public partial class mod_semaforo : System.Web.UI.UserControl
|
||||
public partial class mod_semaforo : System.Web.UI.UserControl
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// Oggetto datalayer specifico
|
||||
/// </summary>
|
||||
DataLayer DataLayerObj = new DataLayer();
|
||||
|
||||
#region area protected / private
|
||||
|
||||
/// <summary>
|
||||
/// seriale associato alla macchina da controllare
|
||||
/// </summary>
|
||||
protected string _IdxMacchina;
|
||||
/// <summary>
|
||||
/// posizione macchina nella tabella
|
||||
/// </summary>
|
||||
protected string _locazione;
|
||||
protected resoconti _resoconti;
|
||||
|
||||
protected DS_applicazione.MacchineDataTable tabMacchine;
|
||||
protected DS_applicazione.StatoMacchineDataTable tabStatoMacchine;
|
||||
protected DS_applicazione.AnagraficaStatiDataTable tabAnagStati;
|
||||
protected DS_applicazione.KeepAliveDataTable tabKeepAlive;
|
||||
|
||||
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
#region area protected / private
|
||||
|
||||
/// <summary>
|
||||
/// seriale associato alla macchina da controllare
|
||||
/// </summary>
|
||||
protected string _IdxMacchina;
|
||||
/// <summary>
|
||||
/// posizione macchina nella tabella
|
||||
/// </summary>
|
||||
protected string _locazione;
|
||||
protected resoconti _resoconti;
|
||||
|
||||
protected DS_applicazione.MacchineDataTable tabMacchine;
|
||||
protected DS_applicazione.StatoMacchineDataTable tabStatoMacchine;
|
||||
protected DS_applicazione.AnagraficaStatiDataTable tabAnagStati;
|
||||
protected DS_applicazione.KeepAliveDataTable tabKeepAlive;
|
||||
|
||||
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
updateMe();
|
||||
}
|
||||
/// <summary>
|
||||
/// effettua traduzione del lemma
|
||||
/// </summary>
|
||||
/// <param name="lemma"></param>
|
||||
/// <returns></returns>
|
||||
public string traduci(string lemma)
|
||||
{
|
||||
return user_std.UtSn.Traduci(lemma);
|
||||
}
|
||||
/// <summary>
|
||||
/// sistema il testo
|
||||
/// </summary>
|
||||
private void updateText()
|
||||
{
|
||||
if (_IdxMacchina != "nd")
|
||||
{
|
||||
// labels
|
||||
lblDurata.Text = traduci("DurataStato");
|
||||
// valori
|
||||
lblMacchina.Text = tabMacchine.FindByIdxMacchina(IdxMacchina).Nome;
|
||||
lblCodArticolo.Text = tabStatoMacchine.FindByIdxMacchina(IdxMacchina).CodArticolo;
|
||||
int matrOper = tabStatoMacchine.FindByIdxMacchina(IdxMacchina).MatrOpr;
|
||||
DS_applicazione.AnagraficaOperatoriRow rigaOper = DataLayer.obj.taOp.getByMatrOpr(matrOper)[0];
|
||||
lblOper.Text = string.Format("{0} {1}", rigaOper.Cognome, rigaOper.Nome);
|
||||
int idxStato = 0;
|
||||
int oreTot = 0;
|
||||
float minuti = 0;
|
||||
try
|
||||
{
|
||||
MapoDb.DS_ProdTempi.stp_repDonati_getLastStatoDurataMacchinaRow rigaStato = DataLayer.obj.taDatiStatoMacch.GetData(IdxMacchina, 0.1)[0];
|
||||
idxStato = rigaStato.idxStato;
|
||||
oreTot = Convert.ToInt32(Math.Floor(rigaStato.Minuti / 60));
|
||||
minuti = (float)rigaStato.Minuti - 60 * oreTot;
|
||||
}
|
||||
catch
|
||||
{
|
||||
idxStato = tabStatoMacchine.FindByIdxMacchina(IdxMacchina).IdxStato;
|
||||
DateTime inizioStato = tabStatoMacchine.FindByIdxMacchina(IdxMacchina).InizioStato;
|
||||
DateTime ora = DateTime.Now;
|
||||
TimeSpan durata = ora.Subtract(inizioStato);
|
||||
oreTot = durata.Days * 24 + durata.Hours;
|
||||
minuti = durata.Minutes;
|
||||
}
|
||||
// aggiorno stato e durata
|
||||
lblStato.Text = tabAnagStati.FindByIdxStato(idxStato).Descrizione;
|
||||
valDurata.Text = string.Format("{0}h {1}min", oreTot, minuti);
|
||||
|
||||
// solo se in stato NON di run...
|
||||
if (idxStato != 13)
|
||||
{
|
||||
lblCausale.Text = traduci("Causale");
|
||||
valCausale.Text = tabStatoMacchine.FindByIdxMacchina(IdxMacchina).Value;
|
||||
}
|
||||
lblDurataCiclo.Text = traduci("UltimoEvento");
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// aggiorna il layout grafico
|
||||
/// </summary>
|
||||
private void updateLayout()
|
||||
{
|
||||
if (_IdxMacchina != "nd")
|
||||
{
|
||||
string filtro = string.Format("IdxMacchina = '{0}'", _IdxMacchina);
|
||||
int stato = ((DS_applicazione.StatoMacchineRow)tabStatoMacchine.Select(filtro)[0]).IdxStato;
|
||||
// in base allo stato recupero il colore...
|
||||
string codColore = ((DS_applicazione.AnagraficaStatiRow)tabAnagStati.FindByIdxStato(stato)).Semaforo;
|
||||
pnlMacchina.CssClass = codColore;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// metto a posto l'immagine
|
||||
/// </summary>
|
||||
protected void updateImg()
|
||||
{
|
||||
string urlMacchina;
|
||||
if (_IdxMacchina != "nd")
|
||||
{
|
||||
urlMacchina = string.Format("~/images/macchine/thumb_{0}", _resoconti.urlMacchina(IdxMacchina));
|
||||
if (urlMacchina == "thumb_")
|
||||
{
|
||||
urlMacchina = "~/images/empty.png";
|
||||
imgThumb.ImageUrl = urlMacchina;
|
||||
}
|
||||
else
|
||||
{
|
||||
imgThumb.ImageUrl = urlMacchina;
|
||||
imgThumb.ToolTip = _resoconti.nomeMacchina(IdxMacchina);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
urlMacchina = "~/images/empty.png";
|
||||
imgThumb.ImageUrl = urlMacchina;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// recupera i dati
|
||||
/// </summary>
|
||||
private void retrieveData()
|
||||
{
|
||||
_resoconti = new resoconti();
|
||||
// popolazione tabelle
|
||||
tabMacchine = MapoDb.DataLayer.obj.taMacchine.GetData();
|
||||
tabStatoMacchine = MapoDb.DataLayer.obj.taStatoMacchine.GetData();
|
||||
tabAnagStati = MapoDb.DataLayer.obj.taAnagStati.GetData();
|
||||
tabKeepAlive = MapoDb.DataLayer.obj.taKeepAlive.GetData();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region area public
|
||||
|
||||
/// <summary>
|
||||
/// Idx della macchina controllata
|
||||
/// </summary>
|
||||
public string IdxMacchina
|
||||
{
|
||||
get
|
||||
{
|
||||
return _IdxMacchina;
|
||||
}
|
||||
set
|
||||
{
|
||||
if (_resoconti == null)
|
||||
{
|
||||
_resoconti = new resoconti();
|
||||
}
|
||||
_IdxMacchina = value;
|
||||
_locazione = _resoconti.locazioneDaIdx(_IdxMacchina);
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// stringa locazione macchina in tabella
|
||||
/// </summary>
|
||||
public string locazione
|
||||
{
|
||||
get
|
||||
{
|
||||
return _locazione;
|
||||
}
|
||||
set
|
||||
{
|
||||
if (_resoconti == null)
|
||||
{
|
||||
_resoconti = new resoconti();
|
||||
}
|
||||
_locazione = value;
|
||||
try
|
||||
{
|
||||
_IdxMacchina = _resoconti.idxDaLocazione(_locazione);
|
||||
}
|
||||
catch
|
||||
{
|
||||
_IdxMacchina = "nd";
|
||||
}
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// aggiorna controllo
|
||||
/// </summary>
|
||||
public void updateMe()
|
||||
{
|
||||
// effettua update visualizzazione
|
||||
retrieveData();
|
||||
updateLayout();
|
||||
updateText();
|
||||
updateImg();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
updateMe();
|
||||
}
|
||||
/// <summary>
|
||||
/// effettua traduzione del lemma
|
||||
/// </summary>
|
||||
/// <param name="lemma"></param>
|
||||
/// <returns></returns>
|
||||
public string traduci(string lemma)
|
||||
{
|
||||
return user_std.UtSn.Traduci(lemma);
|
||||
}
|
||||
/// <summary>
|
||||
/// sistema il testo
|
||||
/// </summary>
|
||||
private void updateText()
|
||||
{
|
||||
if (_IdxMacchina != "nd")
|
||||
{
|
||||
// labels
|
||||
lblDurata.Text = traduci("DurataStato");
|
||||
// valori
|
||||
lblMacchina.Text = tabMacchine.FindByIdxMacchina(IdxMacchina).Nome;
|
||||
lblCodArticolo.Text = tabStatoMacchine.FindByIdxMacchina(IdxMacchina).CodArticolo;
|
||||
int matrOper = tabStatoMacchine.FindByIdxMacchina(IdxMacchina).MatrOpr;
|
||||
DS_applicazione.AnagraficaOperatoriRow rigaOper = DataLayerObj.taOp.getByMatrOpr(matrOper)[0];
|
||||
lblOper.Text = string.Format("{0} {1}", rigaOper.Cognome, rigaOper.Nome);
|
||||
int idxStato = 0;
|
||||
int oreTot = 0;
|
||||
float minuti = 0;
|
||||
try
|
||||
{
|
||||
MapoDb.DS_ProdTempi.stp_repDonati_getLastStatoDurataMacchinaRow rigaStato = DataLayerObj.taDatiStatoMacch.GetData(IdxMacchina, 0.1)[0];
|
||||
idxStato = rigaStato.idxStato;
|
||||
oreTot = Convert.ToInt32(Math.Floor(rigaStato.Minuti / 60));
|
||||
minuti = (float)rigaStato.Minuti - 60 * oreTot;
|
||||
}
|
||||
catch
|
||||
{
|
||||
idxStato = tabStatoMacchine.FindByIdxMacchina(IdxMacchina).IdxStato;
|
||||
DateTime inizioStato = tabStatoMacchine.FindByIdxMacchina(IdxMacchina).InizioStato;
|
||||
DateTime ora = DateTime.Now;
|
||||
TimeSpan durata = ora.Subtract(inizioStato);
|
||||
oreTot = durata.Days * 24 + durata.Hours;
|
||||
minuti = durata.Minutes;
|
||||
}
|
||||
// aggiorno stato e durata
|
||||
lblStato.Text = tabAnagStati.FindByIdxStato(idxStato).Descrizione;
|
||||
valDurata.Text = string.Format("{0}h {1}min", oreTot, minuti);
|
||||
|
||||
// solo se in stato NON di run...
|
||||
if (idxStato != 13)
|
||||
{
|
||||
lblCausale.Text = traduci("Causale");
|
||||
valCausale.Text = tabStatoMacchine.FindByIdxMacchina(IdxMacchina).Value;
|
||||
}
|
||||
lblDurataCiclo.Text = traduci("UltimoEvento");
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// aggiorna il layout grafico
|
||||
/// </summary>
|
||||
private void updateLayout()
|
||||
{
|
||||
if (_IdxMacchina != "nd")
|
||||
{
|
||||
string filtro = string.Format("IdxMacchina = '{0}'", _IdxMacchina);
|
||||
int stato = ((DS_applicazione.StatoMacchineRow)tabStatoMacchine.Select(filtro)[0]).IdxStato;
|
||||
// in base allo stato recupero il colore...
|
||||
string codColore = ((DS_applicazione.AnagraficaStatiRow)tabAnagStati.FindByIdxStato(stato)).Semaforo;
|
||||
pnlMacchina.CssClass = codColore;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// metto a posto l'immagine
|
||||
/// </summary>
|
||||
protected void updateImg()
|
||||
{
|
||||
string urlMacchina;
|
||||
if (_IdxMacchina != "nd")
|
||||
{
|
||||
urlMacchina = string.Format("~/images/macchine/thumb_{0}", _resoconti.urlMacchina(IdxMacchina));
|
||||
if (urlMacchina == "thumb_")
|
||||
{
|
||||
urlMacchina = "~/images/empty.png";
|
||||
imgThumb.ImageUrl = urlMacchina;
|
||||
}
|
||||
else
|
||||
{
|
||||
imgThumb.ImageUrl = urlMacchina;
|
||||
imgThumb.ToolTip = _resoconti.nomeMacchina(IdxMacchina);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
urlMacchina = "~/images/empty.png";
|
||||
imgThumb.ImageUrl = urlMacchina;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// recupera i dati
|
||||
/// </summary>
|
||||
private void retrieveData()
|
||||
{
|
||||
_resoconti = new resoconti();
|
||||
// popolazione tabelle
|
||||
tabMacchine = DataLayerObj.taMacchine.GetData();
|
||||
tabStatoMacchine = DataLayerObj.taStatoMacchine.GetData();
|
||||
tabAnagStati = DataLayerObj.taAnagStati.GetData();
|
||||
tabKeepAlive = DataLayerObj.taKeepAlive.GetData();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region area public
|
||||
|
||||
/// <summary>
|
||||
/// Idx della macchina controllata
|
||||
/// </summary>
|
||||
public string IdxMacchina
|
||||
{
|
||||
get
|
||||
{
|
||||
return _IdxMacchina;
|
||||
}
|
||||
set
|
||||
{
|
||||
if (_resoconti == null)
|
||||
{
|
||||
_resoconti = new resoconti();
|
||||
}
|
||||
_IdxMacchina = value;
|
||||
_locazione = _resoconti.locazioneDaIdx(_IdxMacchina);
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// stringa locazione macchina in tabella
|
||||
/// </summary>
|
||||
public string locazione
|
||||
{
|
||||
get
|
||||
{
|
||||
return _locazione;
|
||||
}
|
||||
set
|
||||
{
|
||||
if (_resoconti == null)
|
||||
{
|
||||
_resoconti = new resoconti();
|
||||
}
|
||||
_locazione = value;
|
||||
try
|
||||
{
|
||||
_IdxMacchina = _resoconti.idxDaLocazione(_locazione);
|
||||
}
|
||||
catch
|
||||
{
|
||||
_IdxMacchina = "nd";
|
||||
}
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// aggiorna controllo
|
||||
/// </summary>
|
||||
public void updateMe()
|
||||
{
|
||||
// effettua update visualizzazione
|
||||
retrieveData();
|
||||
updateLayout();
|
||||
updateText();
|
||||
updateImg();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
}
|
||||
}
|
||||
@@ -263,7 +263,7 @@ namespace MP_SITE.WebUserControls
|
||||
bool needRecalc = true;
|
||||
string redJson = memLayer.ML.getRSV(rKey);
|
||||
// controllo se ho già in sessione un oggetto seq...
|
||||
if (redJson != null && redJson != "")
|
||||
if (!string.IsNullOrEmpty(redJson))
|
||||
{
|
||||
try
|
||||
{
|
||||
@@ -511,10 +511,13 @@ namespace MP_SITE.WebUserControls
|
||||
// alzo evento
|
||||
if (eh_richiestaZoom != null)
|
||||
{
|
||||
ImageMapEventArgs evIM = e;
|
||||
// salvo in sessione
|
||||
memLayer.ML.setSessionVal("zoomCenter", e.PostBackValue);
|
||||
eh_richiestaZoom(this, new EventArgs());
|
||||
if (e != null)
|
||||
{
|
||||
ImageMapEventArgs evIM = e;
|
||||
// salvo in sessione
|
||||
memLayer.ML.setSessionVal("zoomCenter", e.PostBackValue);
|
||||
eh_richiestaZoom(this, new EventArgs());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -117,7 +117,7 @@ namespace MP_SITE.WebUserControls
|
||||
if (grafico.palletChange)
|
||||
{
|
||||
// controllo per inizializzare i 2 tipi...
|
||||
if (tipo_A == "")
|
||||
if (string.IsNullOrEmpty(tipo_A))
|
||||
{
|
||||
tipo_A = riga.tipo;
|
||||
if (Chart1.Series.Count < 1)
|
||||
@@ -125,7 +125,7 @@ namespace MP_SITE.WebUserControls
|
||||
Chart1.Series.Add(tipo_A);
|
||||
}
|
||||
}
|
||||
else if (tipo_B == "" && riga.tipo != tipo_A)
|
||||
else if (string.IsNullOrEmpty(tipo_B) && riga.tipo != tipo_A)
|
||||
{
|
||||
tipo_B = riga.tipo;
|
||||
if (Chart1.Series.Count < 2)
|
||||
@@ -168,7 +168,7 @@ namespace MP_SITE.WebUserControls
|
||||
}
|
||||
else // unica serie
|
||||
{
|
||||
if (tipo_A == "")
|
||||
if (string.IsNullOrEmpty(tipo_A))
|
||||
{
|
||||
tipo_A = riga.tipo;
|
||||
if (Chart1.Series.Count < 1)
|
||||
|
||||
@@ -7,6 +7,12 @@ namespace MP_SITE.WebUserControls
|
||||
{
|
||||
public partial class mod_statoMacchina : System.Web.UI.UserControl
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// Oggetto datalayer specifico
|
||||
/// </summary>
|
||||
DataLayer DataLayerObj = new DataLayer();
|
||||
|
||||
#region area protected / private
|
||||
|
||||
/// <summary>
|
||||
@@ -101,8 +107,8 @@ namespace MP_SITE.WebUserControls
|
||||
try
|
||||
{
|
||||
// popolazione tabelle
|
||||
tabMSE = DataLayer.obj.taMSE.getByIdxMacchina(IdxMacchina);
|
||||
tabAnagStati = DataLayer.obj.taAnagStati.GetData();
|
||||
tabMSE = DataLayerObj.taMSE.getByIdxMacchina(IdxMacchina);
|
||||
tabAnagStati = DataLayerObj.taAnagStati.GetData();
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
@@ -119,7 +125,7 @@ namespace MP_SITE.WebUserControls
|
||||
/// </summary>
|
||||
private void updateText()
|
||||
{
|
||||
if (_IdxMacchina != "nd" && _IdxMacchina != "")
|
||||
if (!string.IsNullOrEmpty(_IdxMacchina) && _IdxMacchina != "nd")
|
||||
{
|
||||
// labels
|
||||
lblCodArticolo.Text = "Art.";
|
||||
@@ -139,7 +145,7 @@ namespace MP_SITE.WebUserControls
|
||||
float minuti = 0;
|
||||
try
|
||||
{
|
||||
DS_ProdTempi.stp_repDonati_getLastStatoDurataMacchinaRow rigaStato = DataLayer.obj.taDatiStatoMacch.GetData(IdxMacchina, 0.1)[0];
|
||||
DS_ProdTempi.stp_repDonati_getLastStatoDurataMacchinaRow rigaStato = DataLayerObj.taDatiStatoMacch.GetData(IdxMacchina, 0.1)[0];
|
||||
idxStato = rigaStato.idxStato;
|
||||
oreTot = Convert.ToInt32(Math.Floor(rigaStato.Minuti / 60));
|
||||
minuti = (float)rigaStato.Minuti - 60 * oreTot;
|
||||
@@ -217,7 +223,7 @@ namespace MP_SITE.WebUserControls
|
||||
try
|
||||
{
|
||||
// conto num pezzi e divido 1h/pezzi
|
||||
numPezzi = DataLayer.obj.taTempiCicloRilevati.getByMacchinaPeriodo(IdxMacchina, Ora.AddHours(-1), Ora).Rows.Count;
|
||||
numPezzi = DataLayerObj.taTempiCicloRilevati.getByMacchinaPeriodo(IdxMacchina, Ora.AddHours(-1), Ora).Rows.Count;
|
||||
if (numPezzi > 0)
|
||||
{
|
||||
valProd.Text += String.Format("{0:#.00}m <br />", Math.Round((double)60 / numPezzi, 3));
|
||||
@@ -240,7 +246,7 @@ namespace MP_SITE.WebUserControls
|
||||
try
|
||||
{
|
||||
// conto num pezzi e divido 1h/pezzi
|
||||
numPezzi = DataLayer.obj.taTempiCicloRilevati.getByMacchinaPeriodo(IdxMacchina, Ora.AddHours(-8), Ora).Rows.Count;
|
||||
numPezzi = DataLayerObj.taTempiCicloRilevati.getByMacchinaPeriodo(IdxMacchina, Ora.AddHours(-8), Ora).Rows.Count;
|
||||
if (numPezzi > 0)
|
||||
{
|
||||
valProd.Text += String.Format("{0:#.00}m ", Math.Round((double)480 / numPezzi, 3));
|
||||
@@ -309,7 +315,7 @@ namespace MP_SITE.WebUserControls
|
||||
//cerco su DB...
|
||||
try
|
||||
{
|
||||
var tabDati = DataLayer.obj.taKeepAlive.getByIdxMacchina(_IdxMacchina);
|
||||
var tabDati = DataLayerObj.taKeepAlive.getByIdxMacchina(_IdxMacchina);
|
||||
if (tabDati.Rows.Count > 0)
|
||||
{
|
||||
lastKA = tabDati[0].DataOraServer;
|
||||
|
||||
+10
-1
@@ -6,6 +6,15 @@ namespace MoonProTablet
|
||||
{
|
||||
public partial class Logout : System.Web.UI.Page
|
||||
{
|
||||
/// <summary>
|
||||
/// Oggetto datalayer specifico
|
||||
/// </summary>
|
||||
DataLayer DataLayerObj = new DataLayer();
|
||||
/// <summary>
|
||||
/// Chiamata metodi x logout
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
// elimina il device da db...
|
||||
@@ -15,7 +24,7 @@ namespace MoonProTablet
|
||||
// elimina il cookie dal browser e l'utente loggato
|
||||
memLayer.ML.emptyCookieVal(cookieName);
|
||||
//svuoto dati utente in sessione...
|
||||
DataLayer.MatrOpr = 0;
|
||||
DataLayerObj.MatrOpr = 0;
|
||||
user_std.UtSn.logOffUtente();
|
||||
Session.Clear();
|
||||
// rimanda alla pagina di reg device
|
||||
|
||||
+8
-4
@@ -7,6 +7,10 @@ namespace MoonProTablet
|
||||
{
|
||||
public partial class ODL : System.Web.UI.Page
|
||||
{
|
||||
/// <summary>
|
||||
/// Oggetto datalayer specifico
|
||||
/// </summary>
|
||||
DataLayer DataLayerObj = new DataLayer();
|
||||
/// <summary>
|
||||
/// Valore protected idxODL
|
||||
/// </summary>
|
||||
@@ -24,7 +28,7 @@ namespace MoonProTablet
|
||||
{
|
||||
if (_idxOdlMacc == null)
|
||||
{
|
||||
_idxOdlMacc = DataLayer.currODL(idxMacchina, true);
|
||||
_idxOdlMacc = DataLayerObj.currODL(idxMacchina, true);
|
||||
}
|
||||
return _idxOdlMacc;
|
||||
}
|
||||
@@ -66,7 +70,7 @@ namespace MoonProTablet
|
||||
get
|
||||
{
|
||||
bool answ = false;
|
||||
answ = DataLayer.isMulti(idxMacchinaSession);
|
||||
answ = DataLayerObj.isMulti(idxMacchinaSession);
|
||||
return answ;
|
||||
}
|
||||
}
|
||||
@@ -131,7 +135,7 @@ namespace MoonProTablet
|
||||
private void Mod_ODL1_eh_reqUpdate(object sender, EventArgs e)
|
||||
{
|
||||
// forzo update macchina...
|
||||
DataLayer.obj.taMSE.forceRecalc(0, idxMacchina);
|
||||
DataLayerObj.taMSE.forceRecalc(0, idxMacchina);
|
||||
// update display!
|
||||
ddlSubMacc.DataBind();
|
||||
mod_dettMacchina1.doUpdate();
|
||||
@@ -170,7 +174,7 @@ namespace MoonProTablet
|
||||
DS_ProdTempi.stp_PzProd_getByMacchinaRow rigaProd;
|
||||
try
|
||||
{
|
||||
rigaProd = DataLayer.obj.taPzProd2conf.GetData(idxMacchina)[0];
|
||||
rigaProd = DataLayerObj.taPzProd2conf.GetData(idxMacchina)[0];
|
||||
pz2conf = rigaProd.pezziNonConfermati;
|
||||
needConfProd = (pz2conf > 0);
|
||||
}
|
||||
|
||||
+8
-3
@@ -1,4 +1,5 @@
|
||||
using SteamWare;
|
||||
using MapoDb;
|
||||
using SteamWare;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
@@ -10,6 +11,10 @@ namespace MoonProTablet
|
||||
{
|
||||
public partial class User : System.Web.UI.Page
|
||||
{
|
||||
/// <summary>
|
||||
/// Oggetto datalayer specifico
|
||||
/// </summary>
|
||||
DataLayer DataLayerObj = new DataLayer();
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
@@ -50,9 +55,9 @@ namespace MoonProTablet
|
||||
{
|
||||
swData = cognomeNome;
|
||||
}
|
||||
else if (MapoDb.DataLayer.MatrOpr > 0)
|
||||
else if (DataLayerObj.MatrOpr > 0)
|
||||
{
|
||||
swData = MapoDb.DataLayer.CognomeNomeOpr;
|
||||
swData = DataLayerObj.CognomeNomeOpr;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -8,6 +8,10 @@ namespace MoonProTablet.WebUserControls
|
||||
public partial class cmp_newODL : System.Web.UI.UserControl
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// Oggetto datalayer specifico
|
||||
/// </summary>
|
||||
DataLayer DataLayerObj = new DataLayer();
|
||||
/// <summary>
|
||||
/// registrato nuovo valore
|
||||
/// </summary>
|
||||
@@ -55,10 +59,10 @@ namespace MoonProTablet.WebUserControls
|
||||
decimal tCiclo = numMin + ((decimal)numSec) / 60;
|
||||
string note = txtNote.Text.Trim();
|
||||
// insert su DB
|
||||
DataLayer.obj.taODL.insertProvv(ddlArticolo.SelectedValue, MapoDb.DataLayer.MatrOpr, idxMacchina, numPz, tCiclo, note);
|
||||
DataLayerObj.taODL.insertProvv(ddlArticolo.SelectedValue, DataLayerObj.MatrOpr, idxMacchina, numPz, tCiclo, note);
|
||||
// calcolo stringa macchina e articolo...
|
||||
var rMacchina = DataLayer.obj.taMacchine.GetByIdx(idxMacchina)[0];
|
||||
var rArticolo = DataLayer.obj.taAnagArt.getByCod(ddlArticolo.SelectedValue)[0];
|
||||
var rMacchina = DataLayerObj.taMacchine.GetByIdx(idxMacchina)[0];
|
||||
var rArticolo = DataLayerObj.taAnagArt.getByCod(ddlArticolo.SelectedValue)[0];
|
||||
string macchina = string.Format("{0} ({1} | {2} | {3})", rMacchina.Nome, rMacchina.IdxMacchina, rMacchina.CodMacchina, rMacchina.Descrizione);
|
||||
string articolo = string.Format("{0} ({1} | {2})", rArticolo.DescArticolo, rArticolo.CodArticolo, rArticolo.Disegno);
|
||||
// invio email notifica creazione ODL PROVVISORIO (da riconciliare...)
|
||||
|
||||
@@ -23,6 +23,10 @@ namespace MoonProTablet.WebUserControls
|
||||
/// </summary>
|
||||
protected string _idxOdlAltraMacc;
|
||||
/// <summary>
|
||||
/// Oggetto DataLayer della classe
|
||||
/// </summary>
|
||||
protected DataLayer DataLayerObj = new DataLayer();
|
||||
/// <summary>
|
||||
/// IdxODL sulla macchina
|
||||
/// </summary>
|
||||
public string idxOdlMacc
|
||||
@@ -31,7 +35,7 @@ namespace MoonProTablet.WebUserControls
|
||||
{
|
||||
if (_idxOdlMacc == null)
|
||||
{
|
||||
_idxOdlMacc = DataLayer.currODL(idxMacchina, true);
|
||||
_idxOdlMacc = DataLayerObj.currODL(idxMacchina, true);
|
||||
}
|
||||
return _idxOdlMacc;
|
||||
}
|
||||
@@ -49,7 +53,7 @@ namespace MoonProTablet.WebUserControls
|
||||
{
|
||||
if (_idxOdlAltraMacc == null)
|
||||
{
|
||||
_idxOdlAltraMacc = DataLayer.currODL(idxMaccAltraTav, true);
|
||||
_idxOdlAltraMacc = DataLayerObj.currODL(idxMaccAltraTav, true);
|
||||
}
|
||||
return _idxOdlAltraMacc;
|
||||
}
|
||||
@@ -65,7 +69,7 @@ namespace MoonProTablet.WebUserControls
|
||||
{
|
||||
get
|
||||
{
|
||||
return DataLayer.isMulti(idxMacchina);
|
||||
return DataLayerObj.isMulti(idxMacchina);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -173,7 +177,7 @@ namespace MoonProTablet.WebUserControls
|
||||
DateTime dtChiusura = DateTime.Now.AddHours(-1);
|
||||
try
|
||||
{
|
||||
dtChiusura = DataLayer.obj.taODL.getLastByMacc(idxMacchina)[0].DataFine;
|
||||
dtChiusura = DataLayerObj.taODL.getLastByMacc(idxMacchina)[0].DataFine;
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
@@ -325,10 +329,6 @@ namespace MoonProTablet.WebUserControls
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// classe MapoDB x uso locale
|
||||
/// </summary>
|
||||
protected MapoDb.MapoDb controllerMapo = new MapoDb.MapoDb();
|
||||
/// <summary>
|
||||
/// Determina se sia abilitato il controllo x editing
|
||||
/// </summary>
|
||||
public bool isEnabled
|
||||
@@ -376,7 +376,7 @@ namespace MoonProTablet.WebUserControls
|
||||
string CodArticolo = "";
|
||||
try
|
||||
{
|
||||
CodArticolo = DataLayer.obj.taODL.getByIdx(idxODLSel, false)[0].CodArticolo;
|
||||
CodArticolo = DataLayerObj.taODL.getByIdx(idxODLSel, false)[0].CodArticolo;
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
@@ -496,14 +496,14 @@ namespace MoonProTablet.WebUserControls
|
||||
}
|
||||
try
|
||||
{
|
||||
currHasOdl = DataLayer.obj.taODL.getByMacchina(idxMacchina)[0].IdxODL != 0;
|
||||
currHasOdl = DataLayerObj.taODL.getByMacchina(idxMacchina)[0].IdxODL != 0;
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
logger.lg.scriviLog(string.Format("Eccezione in recupero dati currHasOdl! {0}{1}", Environment.NewLine, exc), tipoLog.EXCEPTION);
|
||||
}
|
||||
// deve controllare abbia ODL o PROMESSE odl...
|
||||
bool hasNewOdl = DataLayer.obj.taSelOdlFree.getUnused(idxMacchina, chkTutti.Checked).Rows.Count > 1;
|
||||
bool hasNewOdl = DataLayerObj.taSelOdlFree.getUnused(idxMacchina, chkTutti.Checked).Rows.Count > 1;
|
||||
// sistemo buttons!
|
||||
lbtStartAttr.Enabled = (isEnabled && (!inAttr && hasNewOdl));
|
||||
lbtStartProd.Enabled = (isEnabled && inAttr);
|
||||
@@ -522,7 +522,7 @@ namespace MoonProTablet.WebUserControls
|
||||
int idxOdl = 0;
|
||||
try
|
||||
{
|
||||
idxOdl = DataLayer.obj.taODL.getByMacchina(idxMacchina)[0].IdxODL;
|
||||
idxOdl = DataLayerObj.taODL.getByMacchina(idxMacchina)[0].IdxODL;
|
||||
updateTempoTc(idxOdl, inAttr);
|
||||
updateNoteTC(idxOdl);
|
||||
}
|
||||
@@ -538,7 +538,7 @@ namespace MoonProTablet.WebUserControls
|
||||
bool showWarn = false;
|
||||
try
|
||||
{
|
||||
showWarn = DataLayer.obj.taAnagArt.getByCod(CodArtSel)[0].FlagIsNew;
|
||||
showWarn = DataLayerObj.taAnagArt.getByCod(CodArtSel)[0].FlagIsNew;
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
@@ -556,20 +556,20 @@ namespace MoonProTablet.WebUserControls
|
||||
/// <param name="idxODL"></param>
|
||||
private void processaEvento(string idxMaccCurr, int idxEvento, string userMsg, int idxODL)
|
||||
{
|
||||
MapoDb.inputComando inCmd;
|
||||
MapoDb.inputComando inCmd2;
|
||||
inputComandoMapo inCmd;
|
||||
inputComandoMapo inCmd2;
|
||||
DS_applicazione.StatoMacchineRow rigaStato = selData.mng.rigaStato(idxMaccCurr);
|
||||
// ricavo codice articolo...
|
||||
string CodArticolo = DataLayer.obj.taODL.getByIdx(idxODL, false)[0].CodArticolo;
|
||||
string CodArticolo = DataLayerObj.taODL.getByIdx(idxODL, false)[0].CodArticolo;
|
||||
// processo evento...
|
||||
inCmd = controllerMapo.scriviRigaEventoBarcode(idxMaccCurr, idxEvento, CodArticolo, "", DataLayer.MatrOpr, rigaStato.pallet);
|
||||
inCmd = DataLayerObj.scriviRigaEventoBarcode(idxMaccCurr, idxEvento, CodArticolo, "", DataLayerObj.MatrOpr, rigaStato.pallet);
|
||||
// se la macchina è MULTI (cod#tavola) e sonoa INIZIO/FINE attrezzaggio (idxEv <=2) oppure FINE PROD processo ANCHE per la macchina madre...
|
||||
if (idxMaccCurr.IndexOf('#') > 0 && (idxEvento <= 2 || idxEvento == 7))
|
||||
{
|
||||
inCmd2 = controllerMapo.scriviRigaEventoBarcode(idxMaccParent, idxEvento, CodArticolo, "", DataLayer.MatrOpr, rigaStato.pallet);
|
||||
inCmd2 = DataLayerObj.scriviRigaEventoBarcode(idxMaccParent, idxEvento, CodArticolo, "", DataLayerObj.MatrOpr, rigaStato.pallet);
|
||||
}
|
||||
// chiamo refresh MSE
|
||||
DataLayer.obj.taMSE.forceRecalc(0, idxMaccCurr);
|
||||
DataLayerObj.taMSE.forceRecalc(0, idxMaccCurr);
|
||||
// invalido la cache di selData
|
||||
selData.mng.invalidateCache();
|
||||
lblOut.Text = userMsg;
|
||||
@@ -630,13 +630,13 @@ namespace MoonProTablet.WebUserControls
|
||||
if (enableRPO)
|
||||
{
|
||||
// leggo info da promessa...
|
||||
var rigaProm = DataLayer.obj.taPODL.getByKey(idxODL)[0];
|
||||
var rigaProm = DataLayerObj.taPODL.getByKey(idxODL)[0];
|
||||
answ = rigaProm.TCAssegnato;
|
||||
}
|
||||
else
|
||||
{
|
||||
// leggo idxOdl da ultimo odl attivo x macchina
|
||||
DS_ProdTempi.ODLRow rigaOdl = DataLayer.obj.taODL.getByIdx(idxODL, false)[0];
|
||||
DS_ProdTempi.ODLRow rigaOdl = DataLayerObj.taODL.getByIdx(idxODL, false)[0];
|
||||
answ = rigaOdl.TCAssegnato;
|
||||
}
|
||||
}
|
||||
@@ -690,13 +690,13 @@ namespace MoonProTablet.WebUserControls
|
||||
// splitto VECCHIO ODL (se è rimasto qualcosa da produrre e se ce ne è rimasto uno.......)
|
||||
try
|
||||
{
|
||||
idxODL = DataLayer.obj.taODL.getByMacchina(idxMacchina)[0].IdxODL;
|
||||
DataLayer.obj.taODL.splitODL(idxODL, DataLayer.MatrOpr, idxMacchina, TCAssegnato(idxODL), PzPallet, string.Format("inizio attrezzaggio, Sospensione ODL {0}, generato residuo con pari TCiclo: {1}", idxODL, TCAssegnato(idxODL)), false);
|
||||
idxODL = DataLayerObj.taODL.getByMacchina(idxMacchina)[0].IdxODL;
|
||||
DataLayerObj.taODL.splitODL(idxODL, DataLayerObj.MatrOpr, idxMacchina, TCAssegnato(idxODL), PzPallet, string.Format("inizio attrezzaggio, Sospensione ODL {0}, generato residuo con pari TCiclo: {1}", idxODL, TCAssegnato(idxODL)), false);
|
||||
// se è multi processo ANCHE x altra tavola...
|
||||
if (isMulti)
|
||||
{
|
||||
int _idxOdl = DataLayer.obj.taODL.getByMacchina(idxMaccAltraTav)[0].IdxODL;
|
||||
DataLayer.obj.taODL.splitODL(_idxOdl, DataLayer.MatrOpr, idxMaccAltraTav, TCAssegnato(_idxOdl), PzPallet, string.Format("inizio attrezzaggio, Sospensione ODL {0}, generato residuo con pari TCiclo: {1}", _idxOdl, TCAssegnato(_idxOdl)), false);
|
||||
int _idxOdl = DataLayerObj.taODL.getByMacchina(idxMaccAltraTav)[0].IdxODL;
|
||||
DataLayerObj.taODL.splitODL(_idxOdl, DataLayerObj.MatrOpr, idxMaccAltraTav, TCAssegnato(_idxOdl), PzPallet, string.Format("inizio attrezzaggio, Sospensione ODL {0}, generato residuo con pari TCiclo: {1}", _idxOdl, TCAssegnato(_idxOdl)), false);
|
||||
}
|
||||
}
|
||||
catch
|
||||
@@ -706,15 +706,15 @@ namespace MoonProTablet.WebUserControls
|
||||
if (enableRPO)
|
||||
{
|
||||
// creo nuovo ODL da promessa ed associo
|
||||
DataLayer.obj.taODL.inizioSetupPromessa(idxODLSel, DataLayer.MatrOpr, idxMacchina, TCRichAttr, PzPallet, txtNote.Text);
|
||||
DataLayerObj.taODL.inizioSetupPromessa(idxODLSel, DataLayerObj.MatrOpr, idxMacchina, TCRichAttr, PzPallet, txtNote.Text);
|
||||
// salvo ODL attrezzato
|
||||
idxODL_curr = DataLayer.obj.taODL.getByMacchina(idxMacchina)[0].IdxODL;
|
||||
idxODL_curr = DataLayerObj.taODL.getByMacchina(idxMacchina)[0].IdxODL;
|
||||
}
|
||||
// ODL classico
|
||||
else
|
||||
{
|
||||
// avvio NUOVO ODL
|
||||
DataLayer.obj.taODL.inizioSetup(idxODLSel, DataLayer.MatrOpr, idxMacchina, TCRichAttr, PzPallet, txtNote.Text);
|
||||
DataLayerObj.taODL.inizioSetup(idxODLSel, DataLayerObj.MatrOpr, idxMacchina, TCRichAttr, PzPallet, txtNote.Text);
|
||||
// salvo ODL Current
|
||||
idxODL_curr = idxODLSel;
|
||||
}
|
||||
@@ -726,7 +726,7 @@ namespace MoonProTablet.WebUserControls
|
||||
processaEvento(idxMacchina, idxEvento, sb.ToString(), idxODL_curr);
|
||||
// indico INIZIO SETUP su REDIS come EXE della macchina...
|
||||
string ts = string.Format("{0:yyMMdd}T{0:HHmmss.fff}Z", DateTime.Now);
|
||||
DataLayer.addTask4Machine(idxMacchina, taskType.startSetup, $"TS:{ts}|MATR:{DataLayer.MatrOpr}|ODL:{idxODL_curr}");
|
||||
DataLayerObj.addTask4Machine(idxMacchina, taskType.startSetup, $"TS:{ts}|MATR:{DataLayerObj.MatrOpr}|ODL:{idxODL_curr}");
|
||||
// se è multi CHIUDO ODL x altra tavola...
|
||||
if (isMulti)
|
||||
{
|
||||
@@ -736,10 +736,10 @@ namespace MoonProTablet.WebUserControls
|
||||
int idxOdlAltra = 0;
|
||||
try
|
||||
{
|
||||
var tabOdl = DataLayer.obj.taODL.getByMacchina(idxMaccAltraTav);
|
||||
var tabOdl = DataLayerObj.taODL.getByMacchina(idxMaccAltraTav);
|
||||
if (tabOdl.Rows.Count > 0)
|
||||
{
|
||||
idxOdlAltra = DataLayer.obj.taODL.getByMacchina(idxMaccAltraTav)[0].IdxODL;
|
||||
idxOdlAltra = DataLayerObj.taODL.getByMacchina(idxMaccAltraTav)[0].IdxODL;
|
||||
}
|
||||
}
|
||||
catch (Exception exc)
|
||||
@@ -750,7 +750,7 @@ namespace MoonProTablet.WebUserControls
|
||||
if (idxOdlAltra > 0)
|
||||
{
|
||||
sb.AppendLine("---");
|
||||
DataLayer.obj.taODL.fineProd(idxOdlAltra, idxMaccAltraTav);
|
||||
DataLayerObj.taODL.fineProd(idxOdlAltra, idxMaccAltraTav);
|
||||
evText = "Registrato inizio attrezzaggio per ODL {0} (setup seconda tavola)";
|
||||
sb.AppendLine(String.Format(evText, idxOdlAltra));
|
||||
processaEvento(idxMaccAltraTav, idxEvento, String.Format(evText, idxOdlAltra), idxOdlAltra);
|
||||
@@ -761,9 +761,9 @@ namespace MoonProTablet.WebUserControls
|
||||
checkAll();
|
||||
}
|
||||
// resetto contapezzi redis...
|
||||
DataLayer.saveCounter(idxMacchina, "0");
|
||||
DataLayerObj.saveCounter(idxMacchina, "0");
|
||||
// imposto ODL su redis...
|
||||
DataLayer.saveCurrODL(idxMacchina, idxODL_curr.ToString());
|
||||
DataLayerObj.saveCurrODL(idxMacchina, idxODL_curr.ToString());
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -789,16 +789,16 @@ namespace MoonProTablet.WebUserControls
|
||||
TCRichAttr = TCAssegnato(idxODLSel);
|
||||
}
|
||||
// leggo idxOdl da ultimo odl attivo x macchina
|
||||
int idxODL = DataLayer.obj.taODL.getByMacchina(idxMacchina)[0].IdxODL;
|
||||
int idxODL = DataLayerObj.taODL.getByMacchina(idxMacchina)[0].IdxODL;
|
||||
int idxEvento = 1; // !!!HARD CODED
|
||||
// aggiorno (se necessario) note e tempo setup
|
||||
DataLayer.obj.taODL.updateSetup(idxODL, DataLayer.MatrOpr, TCRichAttr, PzPallet, txtNote.Text);
|
||||
DataLayerObj.taODL.updateSetup(idxODL, DataLayerObj.MatrOpr, TCRichAttr, PzPallet, txtNote.Text);
|
||||
// controllo se TC Assegnato != TCRichiesto allora invio email x verifiche...
|
||||
DS_ProdTempi.ODLRow rigaOdl = DataLayer.obj.taODL.getByIdx(idxODL, false)[0];
|
||||
DS_ProdTempi.ODLRow rigaOdl = DataLayerObj.taODL.getByIdx(idxODL, false)[0];
|
||||
if (rigaOdl.TCAssegnato != TCRichAttr)
|
||||
{
|
||||
// invio email!
|
||||
DataLayer.obj.sendWarnTcChangeReq(memLayer.ML.CRS("_adminEmail"));
|
||||
DataLayerObj.sendWarnTcChangeReq(memLayer.ML.CRS("_adminEmail"));
|
||||
}
|
||||
// processo chiusura setup
|
||||
string evText = "Registrata inizio produzione per ODL {0}";
|
||||
@@ -807,13 +807,13 @@ namespace MoonProTablet.WebUserControls
|
||||
processaEvento(idxMacchina, idxEvento, sb.ToString(), idxODL);
|
||||
// indico INIZIO SETUP su REDIS come EXE della macchina...
|
||||
string ts = string.Format("{0:yyMMdd}T{0:HHmmss.fff}Z", DateTime.Now);
|
||||
//DataLayer.addTask4Machine(idxMacchina, "stopSetup", $"TS:{ts}|MATR:{DataLayer.MatrOpr}|ODL:{idxODL}");
|
||||
DataLayer.addTask4Machine(idxMacchina, taskType.stopSetup, $"TS:{ts}|MATR:{DataLayer.MatrOpr}|ODL:{idxODL}");
|
||||
//DataLayerObj.addTask4Machine(idxMacchina, "stopSetup", $"TS:{ts}|MATR:{DataLayerObj.MatrOpr}|ODL:{idxODL}");
|
||||
DataLayerObj.addTask4Machine(idxMacchina, taskType.stopSetup, $"TS:{ts}|MATR:{DataLayerObj.MatrOpr}|ODL:{idxODL}");
|
||||
// se è multi processo chiusura setup x altra tavola...
|
||||
if (isMulti)
|
||||
{
|
||||
sb.AppendLine("---");
|
||||
int idxOdlAltra = DataLayer.obj.taODL.getByMacchina(idxMaccAltraTav)[0].IdxODL;
|
||||
int idxOdlAltra = DataLayerObj.taODL.getByMacchina(idxMaccAltraTav)[0].IdxODL;
|
||||
sb.AppendLine(String.Format(evText, idxOdlAltra));
|
||||
processaEvento(idxMaccAltraTav, idxEvento, String.Format(evText, idxOdlAltra), idxOdlAltra);
|
||||
}
|
||||
@@ -837,7 +837,7 @@ namespace MoonProTablet.WebUserControls
|
||||
protected void lbtEndProd_Click(object sender, EventArgs e)
|
||||
{
|
||||
// leggo idxOdl da ultimo odl attivo x macchina
|
||||
int idxODL = DataLayer.obj.taODL.getByMacchina(idxMacchina)[0].IdxODL;
|
||||
int idxODL = DataLayerObj.taODL.getByMacchina(idxMacchina)[0].IdxODL;
|
||||
int idxEvento = 7; // !!!HARD CODED
|
||||
|
||||
// confermo prod vecchio ODL
|
||||
@@ -850,7 +850,7 @@ namespace MoonProTablet.WebUserControls
|
||||
try
|
||||
{
|
||||
// processo x macchina selezionata
|
||||
DataLayer.obj.taODL.fineProd(idxODL, idxMacchina);
|
||||
DataLayerObj.taODL.fineProd(idxODL, idxMacchina);
|
||||
string evText = "Registrata fine produzione per ODL {0}";
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.AppendLine(String.Format(evText, idxODL));
|
||||
@@ -862,7 +862,7 @@ namespace MoonProTablet.WebUserControls
|
||||
int idxOdlAltra = 0;
|
||||
string _idxOdl = idxOdlAltraMacc;
|
||||
int.TryParse(_idxOdl, out idxOdlAltra);
|
||||
DataLayer.obj.taODL.fineProd(idxOdlAltra, idxMaccAltraTav);
|
||||
DataLayerObj.taODL.fineProd(idxOdlAltra, idxMaccAltraTav);
|
||||
sb.AppendLine(String.Format(evText, idxOdlAltra));
|
||||
processaEvento(idxMaccAltraTav, idxEvento, String.Format(evText, idxOdlAltra), idxOdlAltra);
|
||||
}
|
||||
@@ -881,7 +881,7 @@ namespace MoonProTablet.WebUserControls
|
||||
try
|
||||
{
|
||||
// effettuo split su nuovo ODL
|
||||
DataLayer.obj.taODL.splitODL(idxODL, DataLayer.MatrOpr, idxMacchina, TCAssegnato(idxODL), PzPallet, string.Format("Fine Produzione, Sospensione ODL {0}, generato residuo con pari TCiclo: {1}", idxODL, TCAssegnato(idxODL)), false);
|
||||
DataLayerObj.taODL.splitODL(idxODL, DataLayerObj.MatrOpr, idxMacchina, TCAssegnato(idxODL), PzPallet, string.Format("Fine Produzione, Sospensione ODL {0}, generato residuo con pari TCiclo: {1}", idxODL, TCAssegnato(idxODL)), false);
|
||||
// processo chiusura setup
|
||||
processaEvento(idxMacchina, idxEvento, String.Format("Registrata fine produzione per ODL {0}, nuovo ODL per quantità residua", idxODL), idxODL);
|
||||
|
||||
@@ -892,7 +892,7 @@ namespace MoonProTablet.WebUserControls
|
||||
string _idxOdl = idxOdlAltraMacc;
|
||||
int.TryParse(_idxOdl, out idxOdlAltra);
|
||||
// effettuo split su nuovo ODL
|
||||
DataLayer.obj.taODL.splitODL(idxOdlAltra, DataLayer.MatrOpr, idxMaccAltraTav, TCAssegnato(idxOdlAltra), PzPallet, string.Format("Fine Produzione, Sospensione ODL {0}, generato residuo con pari TCiclo: {1}", idxOdlAltra, TCAssegnato(idxOdlAltra)), false);
|
||||
DataLayerObj.taODL.splitODL(idxOdlAltra, DataLayerObj.MatrOpr, idxMaccAltraTav, TCAssegnato(idxOdlAltra), PzPallet, string.Format("Fine Produzione, Sospensione ODL {0}, generato residuo con pari TCiclo: {1}", idxOdlAltra, TCAssegnato(idxOdlAltra)), false);
|
||||
// processo chiusura setup
|
||||
processaEvento(idxMaccAltraTav, idxEvento, String.Format("Registrata fine produzione per ODL {0}, nuovo ODL per quantità residua", idxOdlAltra), idxOdlAltra);
|
||||
}
|
||||
@@ -907,7 +907,7 @@ namespace MoonProTablet.WebUserControls
|
||||
}
|
||||
}
|
||||
// resetto ODL su redis...
|
||||
DataLayer.emptyCurrODL(idxMacchina);
|
||||
DataLayerObj.emptyCurrODL(idxMacchina);
|
||||
// aggiorno visualizzazione
|
||||
checkAll();
|
||||
// sollevo evento!
|
||||
@@ -926,15 +926,15 @@ namespace MoonProTablet.WebUserControls
|
||||
if (confZero)
|
||||
{
|
||||
// confermo produzione ZERO pezzi (in setup)
|
||||
DataLayer.obj.confermaProdMacchina(idxMacchina, memLayer.ML.CRI("modoConfProd"), 0, 0, DateTime.Now);
|
||||
DataLayerObj.confermaProdMacchina(idxMacchina, memLayer.ML.CRI("modoConfProd"), 0, 0, DateTime.Now);
|
||||
}
|
||||
else // se NON sono in setup verifico se ho pz da confermare
|
||||
{
|
||||
// recupero pz da confermare
|
||||
DS_ProdTempi.stp_PzProd_getByMacchinaRow rigaProd = DataLayer.obj.taPzProd2conf.GetData(idxMacchina)[0];
|
||||
DS_ProdTempi.stp_PzProd_getByMacchinaRow rigaProd = DataLayerObj.taPzProd2conf.GetData(idxMacchina)[0];
|
||||
if (rigaProd.pezziNonConfermati > 0)
|
||||
{
|
||||
DataLayer.obj.confermaProdMacchina(idxMacchina, memLayer.ML.CRI("modoConfProd"), rigaProd.pezziNonConfermati, 0, DateTime.Now);
|
||||
DataLayerObj.confermaProdMacchina(idxMacchina, memLayer.ML.CRI("modoConfProd"), rigaProd.pezziNonConfermati, 0, DateTime.Now);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -948,7 +948,7 @@ namespace MoonProTablet.WebUserControls
|
||||
bool splitOdl = true;
|
||||
fixSplitBtn(splitOdl);
|
||||
// recupero current idx
|
||||
int currODL = DataLayer.obj.taODL.getByMacchina(idxMacchina)[0].IdxODL;
|
||||
int currODL = DataLayerObj.taODL.getByMacchina(idxMacchina)[0].IdxODL;
|
||||
updateTempoTc(currODL, true);
|
||||
updateNoteTC(currODL);
|
||||
}
|
||||
@@ -976,7 +976,7 @@ namespace MoonProTablet.WebUserControls
|
||||
protected void lbtSplitODL_Click(object sender, EventArgs e)
|
||||
{
|
||||
// chiamo stored che genera nuovo ODL, mette note e tempo, chiude vecchi e assegna nuovo...
|
||||
int currODL = DataLayer.obj.taODL.getByMacchina(idxMacchina)[0].IdxODL;
|
||||
int currODL = DataLayerObj.taODL.getByMacchina(idxMacchina)[0].IdxODL;
|
||||
int idxEvento = 1; // !!!HARD CODED
|
||||
// controllo se TC è valorizzato..
|
||||
if (TCRichAttr == 0)
|
||||
@@ -988,13 +988,13 @@ namespace MoonProTablet.WebUserControls
|
||||
confermaProdOdl(false);
|
||||
|
||||
// effettuo split su nuovo ODL
|
||||
DataLayer.obj.taODL.splitODL(currODL, DataLayer.MatrOpr, idxMacchina, TCRichAttr, PzPallet, txtNote.Text, true);
|
||||
DataLayerObj.taODL.splitODL(currODL, DataLayerObj.MatrOpr, idxMacchina, TCRichAttr, PzPallet, txtNote.Text, true);
|
||||
|
||||
// resetto ODL su redis...
|
||||
DataLayer.emptyCurrODL(idxMacchina);
|
||||
DataLayerObj.emptyCurrODL(idxMacchina);
|
||||
|
||||
// invio email!
|
||||
DataLayer.obj.sendWarnTcChangeReq(memLayer.ML.CRS("_adminEmail"));
|
||||
DataLayerObj.sendWarnTcChangeReq(memLayer.ML.CRS("_adminEmail"));
|
||||
// processo chiusura setup
|
||||
processaEvento(idxMacchina, idxEvento, String.Format("Registrato Riattrezzaggio ODL (old: {0})", currODL), currODL);
|
||||
// sistemo buttons!
|
||||
@@ -1059,7 +1059,7 @@ namespace MoonProTablet.WebUserControls
|
||||
{
|
||||
try
|
||||
{
|
||||
testo = DataLayer.obj.taODL.getByIdx(idxOdl, false)[0].Note;
|
||||
testo = DataLayerObj.taODL.getByIdx(idxOdl, false)[0].Note;
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
@@ -1079,13 +1079,13 @@ namespace MoonProTablet.WebUserControls
|
||||
int pzPallet = 1;
|
||||
if (enableRPO && !inAttr)
|
||||
{
|
||||
var rigaProm = DataLayer.obj.taPODL.getByKey(idxOdlPodl)[0];
|
||||
var rigaProm = DataLayerObj.taPODL.getByKey(idxOdlPodl)[0];
|
||||
_TCRichAttr = rigaProm.TCAssegnato;
|
||||
pzPallet = rigaProm.PzPallet;
|
||||
}
|
||||
else
|
||||
{
|
||||
DS_ProdTempi.ODLRow rigaOdl = DataLayer.obj.taODL.getByIdx(idxOdlPodl, false)[0];
|
||||
DS_ProdTempi.ODLRow rigaOdl = DataLayerObj.taODL.getByIdx(idxOdlPodl, false)[0];
|
||||
if (rigaOdl.TCRichAttr > 0)
|
||||
{
|
||||
_TCRichAttr = rigaOdl.TCRichAttr;
|
||||
@@ -1104,8 +1104,8 @@ namespace MoonProTablet.WebUserControls
|
||||
protected void lbtConfNewRevProd_Click(object sender, EventArgs e)
|
||||
{
|
||||
// chiamo stored x allineare revProd a revUT
|
||||
string CodArticolo = DataLayer.obj.taODL.getByIdx(idxODLSel, false)[0].CodArticolo;
|
||||
DataLayer.obj.taAnagArt.setNewRev(CodArticolo);
|
||||
string CodArticolo = DataLayerObj.taODL.getByIdx(idxODLSel, false)[0].CodArticolo;
|
||||
DataLayerObj.taAnagArt.setNewRev(CodArticolo);
|
||||
checkBtnStatus();
|
||||
}
|
||||
/// <summary>
|
||||
@@ -1150,7 +1150,7 @@ namespace MoonProTablet.WebUserControls
|
||||
// se ho trovato...
|
||||
if (idxOdlAltra > 0)
|
||||
{
|
||||
DataLayer.obj.taODL.dividiDaAltraTav(idxOdlAltra, DataLayer.MatrOpr, idxMacchina);
|
||||
DataLayerObj.taODL.dividiDaAltraTav(idxOdlAltra, DataLayerObj.MatrOpr, idxMacchina);
|
||||
// messaggio utente
|
||||
string evText = "Registrata inizio attrezzaggio da split ODL {0} (come da altra tavola)";
|
||||
StringBuilder sb = new StringBuilder();
|
||||
@@ -1173,7 +1173,7 @@ namespace MoonProTablet.WebUserControls
|
||||
protected void lbtReopOdlSuTav_Click(object sender, EventArgs e)
|
||||
{
|
||||
// chiamo stored x riprendere ODL (toglie data chiusura...)
|
||||
DS_ProdTempi.ODLDataTable tabRes = DataLayer.obj.taODL.reopenGetLast(idxMacchina);
|
||||
DS_ProdTempi.ODLDataTable tabRes = DataLayerObj.taODL.reopenGetLast(idxMacchina);
|
||||
if (tabRes.Rows.Count > 0)
|
||||
{
|
||||
var riga = tabRes[0];
|
||||
@@ -1200,8 +1200,8 @@ namespace MoonProTablet.WebUserControls
|
||||
protected void lbtFixEndSetup_Click(object sender, EventArgs e)
|
||||
{
|
||||
string ts = string.Format("{0:yyMMdd}T{0:HHmmss.fff}Z", DateTime.Now);
|
||||
string outData = $"TS:{ts}|MATR:{DataLayer.MatrOpr}|ODL:{idxOdlMacc}";
|
||||
DataLayer.addTask4Machine(idxMacchina, taskType.fixStopSetup, outData);
|
||||
string outData = $"TS:{ts}|MATR:{DataLayerObj.MatrOpr}|ODL:{idxOdlMacc}";
|
||||
DataLayerObj.addTask4Machine(idxMacchina, taskType.fixStopSetup, outData);
|
||||
outData = "Inserita richiesta invio Fix chiusura attrezzaggio " + outData;
|
||||
lblOut.Text = outData;
|
||||
}
|
||||
|
||||
@@ -24,6 +24,13 @@ namespace MoonProTablet.WebUserControls
|
||||
checkloginPwdOnly();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Oggetto datalayer specifico
|
||||
/// </summary>
|
||||
DataLayer DataLayerObj = new DataLayer();
|
||||
/// <summary>
|
||||
/// controllo login solo con pwd
|
||||
/// </summary>
|
||||
private void checkloginPwdOnly()
|
||||
{
|
||||
// se abilitato login "pwdOnly" rimando a login...
|
||||
@@ -31,7 +38,7 @@ namespace MoonProTablet.WebUserControls
|
||||
{
|
||||
string UserAuthKey = txtQRCode.Text.Trim();
|
||||
// cerco se la pwd valida ci sia...
|
||||
var results = DataLayer.obj.taOp.getByAuthKey(UserAuthKey);
|
||||
var results = DataLayerObj.taOp.getByAuthKey(UserAuthKey);
|
||||
if (results.Count > 0)
|
||||
{
|
||||
// in questo caso rimando a jumper...
|
||||
|
||||
@@ -8,6 +8,10 @@ namespace MoonProTablet.WebUserControls
|
||||
{
|
||||
public partial class mod_commenti : System.Web.UI.UserControl
|
||||
{
|
||||
/// <summary>
|
||||
/// Oggetto datalayer specifico
|
||||
/// </summary>
|
||||
DataLayer DataLayerObj = new DataLayer();
|
||||
/// <summary>
|
||||
/// registrata richiesta
|
||||
/// </summary>
|
||||
@@ -89,7 +93,7 @@ namespace MoonProTablet.WebUserControls
|
||||
LinkButton imgBtn = (LinkButton)sender;
|
||||
DateTime inizioStato = Convert.ToDateTime(imgBtn.CommandArgument);
|
||||
string idxMacchina = memLayer.ML.StringSessionObj("idxMacchina");
|
||||
DataLayer.obj.taEventi.DeleteQuery(idxMacchina, inizioStato);
|
||||
DataLayerObj.taEventi.DeleteQuery(idxMacchina, inizioStato);
|
||||
doUpdate();
|
||||
}
|
||||
|
||||
|
||||
@@ -7,6 +7,10 @@ namespace MoonProTablet.WebUserControls
|
||||
{
|
||||
public partial class mod_confProd : System.Web.UI.UserControl
|
||||
{
|
||||
/// <summary>
|
||||
/// Oggetto datalayer specifico
|
||||
/// </summary>
|
||||
DataLayer DataLayerObj = new DataLayer();
|
||||
/// <summary>
|
||||
/// registrato nuovo valore
|
||||
/// </summary>
|
||||
@@ -74,7 +78,7 @@ namespace MoonProTablet.WebUserControls
|
||||
/// <param name="newDate"></param>
|
||||
public void doUpdate()
|
||||
{
|
||||
datiProdAct = DataLayer.obj.taStatoProd.GetData(idxMacchina, dtReqUpdate)[0];
|
||||
datiProdAct = DataLayerObj.taStatoProd.GetData(idxMacchina, dtReqUpdate)[0];
|
||||
// aggiorno visualizzazione...
|
||||
numPzProdotti = datiProdAct.PzTotODL;
|
||||
numPz2Rec = datiProdAct.Pz2RecTot;
|
||||
@@ -234,7 +238,7 @@ namespace MoonProTablet.WebUserControls
|
||||
{
|
||||
get
|
||||
{
|
||||
return DataLayer.isMulti(idxMacchinaSession);
|
||||
return DataLayerObj.isMulti(idxMacchinaSession);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -286,7 +290,7 @@ namespace MoonProTablet.WebUserControls
|
||||
// userò ODL del turno
|
||||
int answ = 0;
|
||||
// cerco da redis...
|
||||
int.TryParse(DataLayer.currODL(idxMacchina, true), out answ);
|
||||
int.TryParse(DataLayerObj.currODL(idxMacchina, true), out answ);
|
||||
return answ;
|
||||
}
|
||||
}
|
||||
@@ -401,7 +405,7 @@ namespace MoonProTablet.WebUserControls
|
||||
confermaPerGiorni();
|
||||
}
|
||||
// refresh tabella dati tablet...
|
||||
DataLayer.obj.taMSE.forceRecalc(0, idxMacchina);
|
||||
DataLayerObj.taMSE.forceRecalc(0, idxMacchina);
|
||||
// mostro output
|
||||
lblOut.Text = string.Format("Confermata la produzione per {0} pezzi! (+{1} pz scarto) alle {2:yyyy-MM-dd HH:mm:ss}", numPzConfermati, numPzScarto2Rec, dtReqUpdate);
|
||||
// cambio button conferma...
|
||||
@@ -418,14 +422,14 @@ namespace MoonProTablet.WebUserControls
|
||||
/// </summary>
|
||||
private void confermaPerGiorni()
|
||||
{
|
||||
DataLayer.obj.confermaProdMacchina(idxMacchina, memLayer.ML.CRI("modoConfProd"), numPzConfermati, numPzScarto2Rec, dtReqUpdate);
|
||||
DataLayerObj.confermaProdMacchina(idxMacchina, memLayer.ML.CRI("modoConfProd"), numPzConfermati, numPzScarto2Rec, dtReqUpdate);
|
||||
}
|
||||
/// <summary>
|
||||
/// effettua conferma per turni della produzione
|
||||
/// </summary>
|
||||
private void confermaPerTurni()
|
||||
{
|
||||
DataLayer.obj.confermaProdMacchina(idxMacchina, memLayer.ML.CRI("modoConfProd"), numPzConfermati, numPzScarto2Rec, dtReqUpdate);
|
||||
DataLayerObj.confermaProdMacchina(idxMacchina, memLayer.ML.CRI("modoConfProd"), numPzConfermati, numPzScarto2Rec, dtReqUpdate);
|
||||
}
|
||||
/// <summary>
|
||||
/// update post modifica pz buoni
|
||||
@@ -446,7 +450,7 @@ namespace MoonProTablet.WebUserControls
|
||||
if (numPzLasciati > 0)
|
||||
{
|
||||
// calcolo la data..
|
||||
DS_ProdTempi.TempiCicloRilevatiDataTable tab = DataLayer.obj.taTempiCicloRilevati.getLastPzByMaccQta(idxMacchina, DateTime.Now, numPzLasciati);
|
||||
DS_ProdTempi.TempiCicloRilevatiDataTable tab = DataLayerObj.taTempiCicloRilevati.getLastPzByMaccQta(idxMacchina, DateTime.Now, numPzLasciati);
|
||||
if (tab.Rows.Count > 0)
|
||||
{
|
||||
dtReqUpdate = tab[0].DataOraRif.AddSeconds(1);
|
||||
|
||||
@@ -7,6 +7,10 @@ namespace MoonProTablet.WebUserControls
|
||||
{
|
||||
public partial class mod_controlliProd : System.Web.UI.UserControl
|
||||
{
|
||||
/// <summary>
|
||||
/// Oggetto datalayer specifico
|
||||
/// </summary>
|
||||
DataLayer DataLayerObj = new DataLayer();
|
||||
/// <summary>
|
||||
/// registrato nuovo valore
|
||||
/// </summary>
|
||||
@@ -54,7 +58,7 @@ namespace MoonProTablet.WebUserControls
|
||||
{
|
||||
get
|
||||
{
|
||||
return DataLayer.isMulti(idxMacchinaSession);
|
||||
return DataLayerObj.isMulti(idxMacchinaSession);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -88,7 +92,7 @@ namespace MoonProTablet.WebUserControls
|
||||
int idxOdl = 0; // userò ODL del turno
|
||||
try
|
||||
{
|
||||
idxOdl = DataLayer.obj.taODL.getByMacchina(idxMacchina)[0].IdxODL;
|
||||
idxOdl = DataLayerObj.taODL.getByMacchina(idxMacchina)[0].IdxODL;
|
||||
}
|
||||
catch
|
||||
{
|
||||
@@ -182,7 +186,7 @@ namespace MoonProTablet.WebUserControls
|
||||
if (odlOk)
|
||||
{
|
||||
// salvo controllo KO
|
||||
DataLayer.obj.taRC.insertQuery(idxMacchina, DataLayer.MatrOpr, false, txtNoteContr.Text.Trim(), DateTime.Now);
|
||||
DataLayerObj.taRC.insertQuery(idxMacchina, DataLayerObj.MatrOpr, false, txtNoteContr.Text.Trim(), DateTime.Now);
|
||||
// sollevo evento!
|
||||
if (eh_newVal != null)
|
||||
{
|
||||
@@ -254,8 +258,8 @@ namespace MoonProTablet.WebUserControls
|
||||
if (odlOk)
|
||||
{
|
||||
// Salvo controllo come OK
|
||||
DataLayer.obj.taRC.insertQuery(idxMacchina, DataLayer.MatrOpr, true, "", DateTime.Now);
|
||||
// sollevo evento!
|
||||
DataLayerObj.taRC.insertQuery(idxMacchina, DataLayerObj.MatrOpr, true, "", DateTime.Now);
|
||||
if (eh_newVal != null)
|
||||
{
|
||||
eh_newVal(this, new EventArgs());
|
||||
|
||||
@@ -7,6 +7,10 @@ namespace MoonProTablet.WebUserControls
|
||||
{
|
||||
public partial class mod_dettMacchina : System.Web.UI.UserControl
|
||||
{
|
||||
/// <summary>
|
||||
/// Oggetto datalayer specifico
|
||||
/// </summary>
|
||||
DataLayer DataLayerObj = new DataLayer();
|
||||
/// <summary>
|
||||
/// fatto refresh --> chiedo remove modal (se c'è)
|
||||
/// </summary>
|
||||
@@ -149,7 +153,7 @@ namespace MoonProTablet.WebUserControls
|
||||
try
|
||||
{
|
||||
// in questo caso controllo idxStato... e recupero priorità se > 1 --> richiesta qualifica
|
||||
answ = (DataLayer.obj.taAnagStati.GetByIdx(idxStato)[0].Priorita > 1);
|
||||
answ = (DataLayerObj.taAnagStati.GetByIdx(idxStato)[0].Priorita > 1);
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
@@ -173,7 +177,7 @@ namespace MoonProTablet.WebUserControls
|
||||
DateTime lastControl = DateTime.Now.AddYears(-1);
|
||||
try
|
||||
{
|
||||
var tab = DataLayer.obj.taRC.getLast(idxMacchina);
|
||||
var tab = DataLayerObj.taRC.getLast(idxMacchina);
|
||||
if (tab.Count > 0)
|
||||
{
|
||||
lastControl = tab[0].DataOra;
|
||||
|
||||
@@ -6,6 +6,10 @@ namespace MoonProTablet.WebUserControls
|
||||
{
|
||||
public partial class mod_dettaglioProd : System.Web.UI.UserControl
|
||||
{
|
||||
/// <summary>
|
||||
/// Oggetto datalayer specifico
|
||||
/// </summary>
|
||||
DataLayer DataLayerObj = new DataLayer();
|
||||
/// <summary>
|
||||
/// effettua traduzione del lemma
|
||||
/// </summary>
|
||||
@@ -30,9 +34,9 @@ namespace MoonProTablet.WebUserControls
|
||||
private void popolaLabels()
|
||||
{
|
||||
// forzo ricalcolo
|
||||
DataLayer.obj.taMSE.forceRecalc(0, idxMacchina);
|
||||
DataLayerObj.taMSE.forceRecalc(0, idxMacchina);
|
||||
// leggo riga...
|
||||
DS_ProdTempi.MappaStatoExplRow rigaDati = DataLayer.obj.taMSE.getByIdxMacchina(idxMacchina)[0];
|
||||
DS_ProdTempi.MappaStatoExplRow rigaDati = DataLayerObj.taMSE.getByIdxMacchina(idxMacchina)[0];
|
||||
|
||||
// carico le info!
|
||||
lblOdl.Text = string.Format("ODL num: {0}, iniziato il {1:dd/MM/yy} alle {1:HH:mm}", rigaDati.idxODL, rigaDati.DataInizioODL);
|
||||
|
||||
@@ -12,6 +12,10 @@ namespace MoonProTablet.WebUserControls
|
||||
/// </summary>
|
||||
protected MapoDb.MapoDb controllerMapo = new MapoDb.MapoDb();
|
||||
/// <summary>
|
||||
/// Oggetto datalayer specifico
|
||||
/// </summary>
|
||||
DataLayer DataLayerObj = new DataLayer();
|
||||
/// <summary>
|
||||
/// registrato nuovo valore
|
||||
/// </summary>
|
||||
public event EventHandler eh_newVal;
|
||||
@@ -55,26 +59,26 @@ namespace MoonProTablet.WebUserControls
|
||||
{ }
|
||||
if (idxEvento > 0)
|
||||
{
|
||||
DS_applicazione.AnagraficaEventiRow rigaEvento = DataLayer.obj.taAnagEventi.GetByIdx(idxEvento)[0];
|
||||
DS_applicazione.AnagraficaEventiRow rigaEvento = DataLayerObj.taAnagEventi.GetByIdx(idxEvento)[0];
|
||||
if (rigaEvento != null)
|
||||
{
|
||||
DS_applicazione.StatoMacchineRow rigaStato = DataLayer.obj.taStatoMacchine.GetDataByIdxMacchina(idxMacchina)[0];
|
||||
DS_applicazione.StatoMacchineRow rigaStato = DataLayerObj.taStatoMacchine.GetDataByIdxMacchina(idxMacchina)[0];
|
||||
// processo evento...
|
||||
if (insRealtime)
|
||||
{
|
||||
// se realtime
|
||||
controllerMapo.scriviRigaEventoBarcode(idxMacchina, idxEvento, rigaStato.CodArticolo, "DRT", DataLayer.MatrOpr, rigaStato.pallet);
|
||||
DataLayerObj.scriviRigaEventoBarcode(idxMacchina, idxEvento, rigaStato.CodArticolo, "DRT", DataLayerObj.MatrOpr, rigaStato.pallet);
|
||||
}
|
||||
else
|
||||
{
|
||||
// in primis disabilito insert...
|
||||
DataLayer.obj.taStatoMacchine.setInsEnabled(idxMacchina, false);
|
||||
DataLayerObj.taStatoMacchine.setInsEnabled(idxMacchina, false);
|
||||
// calcolo evento
|
||||
string evento = idxEvento.ToString();
|
||||
string commento = "";
|
||||
try
|
||||
{
|
||||
evento = DataLayer.obj.taAnagEventi.GetByIdx(idxEvento)[0].Nome.Replace("Barcode - ", "");
|
||||
evento = DataLayerObj.taAnagEventi.GetByIdx(idxEvento)[0].Nome.Replace("Barcode - ", "");
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
@@ -98,14 +102,14 @@ namespace MoonProTablet.WebUserControls
|
||||
}
|
||||
// fix salvo la dichiarazione di chiusura
|
||||
commento = string.Format("999 - M.Lav EndEvt: {0} [{1}]", evento, codRich);
|
||||
controllerMapo.scriviRigaEventoBarcode(idxMacchina, 1, rigaStato.CodArticolo, commento, DataLayer.MatrOpr, rigaStato.pallet, nextEvDT.AddSeconds(-1), DateTime.Now); // 1 hard-coded x resettare
|
||||
DataLayerObj.scriviRigaEventoBarcode(idxMacchina, 1, rigaStato.CodArticolo, commento, DataLayerObj.MatrOpr, rigaStato.pallet, nextEvDT.AddSeconds(-1), DateTime.Now); // 1 hard-coded x resettare
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
// update commento!
|
||||
commento = string.Format("999 - Dich StartEvt: {0} [{1}]", evento, codRich);
|
||||
// recupero data/ora evento da inserire (quella selezionata) ed AGGIUNGO 1 sec!!! così rimane traccia
|
||||
controllerMapo.scriviRigaEventoBarcode(idxMacchina, idxEvento, rigaStato.CodArticolo, commento, DataLayer.MatrOpr, rigaStato.pallet, dataOraEv.AddSeconds(1), DateTime.Now);
|
||||
DataLayerObj.scriviRigaEventoBarcode(idxMacchina, idxEvento, rigaStato.CodArticolo, commento, DataLayerObj.MatrOpr, rigaStato.pallet, dataOraEv.AddSeconds(1), DateTime.Now);
|
||||
// eseguo ricalcolo!
|
||||
DateTime startRicalcolo = dataOraEv.AddMinutes(memLayer.ML.CRI("minAnticipoRicalcolo"));
|
||||
|
||||
@@ -113,11 +117,11 @@ namespace MoonProTablet.WebUserControls
|
||||
int rdm_nEvStep = memLayer.ML.CRI("rdm_nEvStep");
|
||||
int rdm_nEvCheck = memLayer.ML.CRI("rdm_nEvCheck");
|
||||
bool rdm_ChkOnly = memLayer.ML.CRB("rdm_ChkOnly");
|
||||
DataLayer.obj.taComm.stp_ricalcolaDatiMacchinaFromDate(idxMacchina, startRicalcolo, 1, rdm_nEvStep, rdm_nEvCheck, rdm_ChkOnly); // nella stored imposto macchina OFFline e poi ONline, parto da "minAnticipoRicalcolo" minuti prima...
|
||||
DataLayerObj.taComm.stp_ricalcolaDatiMacchinaFromDate(idxMacchina, startRicalcolo, 1, rdm_nEvStep, rdm_nEvCheck, rdm_ChkOnly); // nella stored imposto macchina OFFline e poi ONline, parto da "minAnticipoRicalcolo" minuti prima...
|
||||
// aggiorno data evento x insert eventuale commento (5 sec...)
|
||||
dataOraEv = dataOraEv.AddSeconds(5);
|
||||
// riabilito insert... anche se non dovrebbe servire x stored ricalcolo precedente...
|
||||
DataLayer.obj.taStatoMacchine.setInsEnabled(idxMacchina, true);
|
||||
DataLayerObj.taStatoMacchine.setInsEnabled(idxMacchina, true);
|
||||
}
|
||||
// mostro esito
|
||||
lblOut.Text = "Registrata dichiarazione fermata";
|
||||
@@ -130,7 +134,7 @@ namespace MoonProTablet.WebUserControls
|
||||
// refresh fermate
|
||||
repLI.DataBind();
|
||||
// faccio refresh x singola macchina 2019.03.26
|
||||
DataLayer.obj.taMSE.forceRecalc(0, idxMacchina);
|
||||
DataLayerObj.taMSE.forceRecalc(0, idxMacchina);
|
||||
// sollevo evento!
|
||||
if (eh_newVal != null)
|
||||
{
|
||||
|
||||
@@ -6,6 +6,15 @@ namespace MoonProTablet.WebUserControls
|
||||
{
|
||||
public partial class mod_enrollByAuthKey : System.Web.UI.UserControl
|
||||
{
|
||||
/// <summary>
|
||||
/// Oggetto datalayer specifico
|
||||
/// </summary>
|
||||
DataLayer DataLayerObj = new DataLayer();
|
||||
/// <summary>
|
||||
/// Page load (vuoto)
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
@@ -42,12 +51,12 @@ namespace MoonProTablet.WebUserControls
|
||||
IPv4 = Request.UserHostName;
|
||||
// calcolo authKey MD5...
|
||||
string md5UserAuthKey = SteamCrypto.EncryptString(plainUserAuthKey, memLayer.ML.CRS("cookieName"));
|
||||
if (DataLayer.obj.taOp.getByMatrAuthKey(MatrOpr, md5UserAuthKey).Rows.Count > 0)
|
||||
if (DataLayerObj.taOp.getByMatrAuthKey(MatrOpr, md5UserAuthKey).Rows.Count > 0)
|
||||
{
|
||||
fatto = tryEnroll(MatrOpr, userAgent, fatto, DeviceName, IPv4, md5UserAuthKey);
|
||||
}
|
||||
// provo con "plainUserKey"
|
||||
else if (DataLayer.obj.taOp.getByMatrAuthKey(MatrOpr, plainUserAuthKey).Rows.Count > 0)
|
||||
else if (DataLayerObj.taOp.getByMatrAuthKey(MatrOpr, plainUserAuthKey).Rows.Count > 0)
|
||||
{
|
||||
fatto = tryEnroll(MatrOpr, userAgent, fatto, DeviceName, IPv4, plainUserAuthKey);
|
||||
}
|
||||
@@ -86,7 +95,7 @@ namespace MoonProTablet.WebUserControls
|
||||
{
|
||||
try
|
||||
{
|
||||
fatto = DataLayer.obj.enrollDevice(userKey, IPv4, DeviceName, userAgent, MatrOpr);
|
||||
fatto = DataLayerObj.enrollDevice(userKey, IPv4, DeviceName, userAgent, MatrOpr);
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
|
||||
@@ -6,6 +6,15 @@ namespace MoonProTablet.WebUserControls
|
||||
{
|
||||
public partial class mod_enrollByJumperAuthKey : System.Web.UI.UserControl
|
||||
{
|
||||
/// <summary>
|
||||
/// Oggetto datalayer specifico
|
||||
/// </summary>
|
||||
DataLayer DataLayerObj = new DataLayer();
|
||||
/// <summary>
|
||||
/// Caricamento pagina
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
// procedo alla ricerca di dati via sessione x User AuthKey
|
||||
@@ -26,7 +35,7 @@ namespace MoonProTablet.WebUserControls
|
||||
try
|
||||
{
|
||||
UserAuthKey = memLayer.ML.StringSessionObj("UserAuthKey");
|
||||
MatrOpr = DataLayer.MatrOpr;
|
||||
MatrOpr = DataLayerObj.MatrOpr;
|
||||
userAgent = Request.UserAgent;
|
||||
}
|
||||
catch
|
||||
@@ -37,7 +46,7 @@ namespace MoonProTablet.WebUserControls
|
||||
DeviceName = Request.UserHostName;
|
||||
IPv4 = Request.UserHostName;
|
||||
memLayer.ML.emptyCookieVal(memLayer.ML.CRS("cookieName"));
|
||||
fatto = DataLayer.obj.enrollDevice(UserAuthKey, IPv4, DeviceName, userAgent, MatrOpr);
|
||||
fatto = DataLayerObj.enrollDevice(UserAuthKey, IPv4, DeviceName, userAgent, MatrOpr);
|
||||
if (fatto)
|
||||
{
|
||||
Response.Redirect(memLayer.ML.CRS("mainPage"));
|
||||
|
||||
@@ -19,6 +19,15 @@ namespace MoonProTablet.WebUserControls
|
||||
/// </summary>
|
||||
public event EventHandler eh_reset;
|
||||
|
||||
/// <summary>
|
||||
/// Oggetto datalayer specifico
|
||||
/// </summary>
|
||||
DataLayer DataLayerObj = new DataLayer();
|
||||
/// <summary>
|
||||
/// caricamento pagina
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
@@ -79,7 +88,7 @@ namespace MoonProTablet.WebUserControls
|
||||
try
|
||||
{
|
||||
// cerco di recuperare CodArticolo da evento
|
||||
CodArticolo = DataLayer.obj.taODL.getByMacchinaPeriodo(idxMacchina, dataOraEv, dataOraEv)[0].CodArticolo;
|
||||
CodArticolo = DataLayerObj.taODL.getByMacchinaPeriodo(idxMacchina, dataOraEv, dataOraEv)[0].CodArticolo;
|
||||
}
|
||||
catch
|
||||
{
|
||||
@@ -89,12 +98,12 @@ namespace MoonProTablet.WebUserControls
|
||||
// elimino eventuale record precedente
|
||||
try
|
||||
{
|
||||
DataLayer.obj.taEventi.DeleteQuery(idxMacchina, dataOraEv);
|
||||
DataLayerObj.taEventi.DeleteQuery(idxMacchina, dataOraEv);
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
// inserisco nuovo record
|
||||
DataLayer.obj.taEventi.Insert(idxMacchina, dataOraEv, idxTipo, CodArticolo, commento, DataLayer.MatrOpr, "-");
|
||||
DataLayerObj.taEventi.Insert(idxMacchina, dataOraEv, idxTipo, CodArticolo, commento, DataLayerObj.MatrOpr, "-");
|
||||
doUpdate();
|
||||
}
|
||||
|
||||
@@ -140,7 +149,7 @@ namespace MoonProTablet.WebUserControls
|
||||
{
|
||||
inizioStato = Convert.ToDateTime(memLayer.ML.objSessionObj("inizioStato"));
|
||||
dataOraEv = inizioStato;
|
||||
riga = DataLayer.obj.taEventi.GetByMacchinaPeriodo(idxMacchina, inizioStato, inizioStato)[0];
|
||||
riga = DataLayerObj.taEventi.GetByMacchinaPeriodo(idxMacchina, inizioStato, inizioStato)[0];
|
||||
txtDate.Text = riga.InizioStato.ToString("yyyy-MM-dd");
|
||||
txtTime.Text = riga.InizioStato.ToString("HH:mm");
|
||||
txtCommento.Text = riga.Value;
|
||||
|
||||
@@ -6,6 +6,10 @@ namespace MoonProTablet.WebUserControls
|
||||
{
|
||||
public partial class mod_pianoProdMacc : System.Web.UI.UserControl
|
||||
{
|
||||
/// <summary>
|
||||
/// Oggetto datalayer specifico
|
||||
/// </summary>
|
||||
DataLayer DataLayerObj = new DataLayer();
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
if (!Page.IsPostBack)
|
||||
@@ -135,7 +139,7 @@ namespace MoonProTablet.WebUserControls
|
||||
{
|
||||
get
|
||||
{
|
||||
return DataLayer.isMulti(idxMacchinaSession);
|
||||
return DataLayerObj.isMulti(idxMacchinaSession);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,6 +18,10 @@ namespace MoonProTablet.WebUserControls
|
||||
/// </summary>
|
||||
public event EventHandler eh_reset;
|
||||
/// <summary>
|
||||
/// Oggetto datalayer specifico
|
||||
/// </summary>
|
||||
DataLayer DataLayerObj = new DataLayer();
|
||||
/// <summary>
|
||||
/// caricamento pagina
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
@@ -89,7 +93,7 @@ namespace MoonProTablet.WebUserControls
|
||||
{
|
||||
get
|
||||
{
|
||||
return DataLayer.isMulti(idxMacchinaSession);
|
||||
return DataLayerObj.isMulti(idxMacchinaSession);
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
@@ -117,7 +121,7 @@ namespace MoonProTablet.WebUserControls
|
||||
int idxOdl = 0; // userò ODL del turno
|
||||
try
|
||||
{
|
||||
idxOdl = DataLayer.obj.taODL.getByMacchina(idxMacchina)[0].IdxODL;
|
||||
idxOdl = DataLayerObj.taODL.getByMacchina(idxMacchina)[0].IdxODL;
|
||||
}
|
||||
catch
|
||||
{
|
||||
@@ -281,7 +285,7 @@ namespace MoonProTablet.WebUserControls
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
DataLayer.obj.taRS.insertQuery(idxMacchina, dataRif, causale, numPzScarto, txtNote.Text.Trim(), DataLayer.MatrOpr);
|
||||
DataLayerObj.taRS.insertQuery(idxMacchina, dataRif, causale, numPzScarto, txtNote.Text.Trim(), DataLayerObj.MatrOpr);
|
||||
// sollevo evento!
|
||||
if (eh_newVal != null)
|
||||
{
|
||||
|
||||
@@ -13,6 +13,7 @@ namespace MoonProTablet.WebUserControls
|
||||
{
|
||||
public partial class mod_sendParameters : System.Web.UI.UserControl
|
||||
{
|
||||
DataLayer DataLayerObj = new DataLayer();
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
}
|
||||
@@ -37,14 +38,14 @@ namespace MoonProTablet.WebUserControls
|
||||
/// <returns></returns>
|
||||
public List<objItem> GetParameters()
|
||||
{
|
||||
List<objItem> dcList = DataLayer.getCurrObjItems(idxMacchina);
|
||||
List<objItem> dcList = DataLayerObj.getCurrObjItems(idxMacchina);
|
||||
return dcList;
|
||||
}
|
||||
|
||||
public void updateParameter(string Original_uid, string reqValue)
|
||||
{
|
||||
// recupero items...
|
||||
List<objItem> dcList = DataLayer.getCurrObjItems(idxMacchina);
|
||||
List<objItem> dcList = DataLayerObj.getCurrObjItems(idxMacchina);
|
||||
// cerco quello da aggiornare
|
||||
objItem trovato = dcList.Find(obj => obj.uid == Original_uid);
|
||||
List<objItem> list2Update = new List<objItem>();
|
||||
@@ -55,9 +56,9 @@ namespace MoonProTablet.WebUserControls
|
||||
trovato.reqValue = reqValue;
|
||||
trovato.lastRequest = DateTime.Now;
|
||||
list2Update.Add(trovato);
|
||||
DataLayer.upsertCurrObjItems(idxMacchina, list2Update);
|
||||
DataLayerObj.upsertCurrObjItems(idxMacchina, list2Update);
|
||||
// accodo in task 2 exe la richiesta di processing
|
||||
DataLayer.addTask4Machine(idxMacchina, taskType.setParameter, trovato.uid);
|
||||
DataLayerObj.addTask4Machine(idxMacchina, taskType.setParameter, trovato.uid);
|
||||
}
|
||||
}
|
||||
protected void lbtReload_Click(object sender, EventArgs e)
|
||||
|
||||
@@ -17,6 +17,10 @@ namespace MoonProTablet.WebUserControls
|
||||
/// </summary>
|
||||
protected string postazione_IP = "";
|
||||
/// <summary>
|
||||
/// Oggetto datalayer specifico
|
||||
/// </summary>
|
||||
DataLayer DataLayerObj = new DataLayer();
|
||||
/// <summary>
|
||||
/// Versione corrente sw
|
||||
/// </summary>
|
||||
protected Version currVersion
|
||||
@@ -39,7 +43,7 @@ namespace MoonProTablet.WebUserControls
|
||||
memLayer.ML.setSessionVal("refreshEnabled", true);
|
||||
}
|
||||
// se ho user/dominio e matricola in sessione NON controllo coockie
|
||||
if (user_std.UtSn.utente == "" || user_std.UtSn.dominio == "" || DataLayer.MatrOpr == 0)
|
||||
if (user_std.UtSn.utente == "" || user_std.UtSn.dominio == "" || DataLayerObj.MatrOpr == 0)
|
||||
{
|
||||
// altrimenti controllo se c'è utente in sessione..
|
||||
checkAuthCookieMoonProTablet();
|
||||
@@ -83,7 +87,7 @@ namespace MoonProTablet.WebUserControls
|
||||
device = DataWrap.DW.taAnagDev.getByDeviceSecret(devSecret)[0];
|
||||
UsrName = device.User_Name;
|
||||
Dominio = device.Dominio;
|
||||
DataLayer.MatrOpr = device.MatrOpr; // salvo MatrOpr!
|
||||
DataLayerObj.MatrOpr = device.MatrOpr; // salvo MatrOpr!
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
@@ -169,7 +173,7 @@ namespace MoonProTablet.WebUserControls
|
||||
{
|
||||
get
|
||||
{
|
||||
return DataLayer.MatrOpr.ToString();
|
||||
return DataLayerObj.MatrOpr.ToString();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -190,9 +194,9 @@ namespace MoonProTablet.WebUserControls
|
||||
{
|
||||
logger.lg.scriviLog(string.Format("Eccezione in User.aspx - page_load: {0}", exc), tipoLog.EXCEPTION);
|
||||
}
|
||||
if (DataLayer.MatrOpr > 0)
|
||||
if (DataLayerObj.MatrOpr > 0)
|
||||
{
|
||||
swData = DataLayer.CognomeNomeOpr;
|
||||
swData = DataLayerObj.CognomeNomeOpr;
|
||||
}
|
||||
else if (cognomeNome != "")
|
||||
{
|
||||
|
||||
@@ -11,6 +11,10 @@ namespace MoonProTablet.WebUserControls
|
||||
/// </summary>
|
||||
public event EventHandler eh_updated;
|
||||
/// <summary>
|
||||
/// Oggetto datalayer specifico
|
||||
/// </summary>
|
||||
DataLayer DataLayerObj = new DataLayer();
|
||||
/// <summary>
|
||||
/// idx macchina selezionata
|
||||
/// </summary>
|
||||
public string idxMacchina
|
||||
@@ -41,7 +45,7 @@ namespace MoonProTablet.WebUserControls
|
||||
// carico dati macchina attiva...
|
||||
try
|
||||
{
|
||||
DS_ProdTempi.TurniMacchinaRow rigaTurni = DataLayer.obj.taTurniMacc.getByIdxMacc(idxMacchina.ToString())[0];
|
||||
DS_ProdTempi.TurniMacchinaRow rigaTurni = DataLayerObj.taTurniMacc.getByIdxMacc(idxMacchina.ToString())[0];
|
||||
// fix checkboxes
|
||||
chkT1.Checked = rigaTurni.T1;
|
||||
chkT2.Checked = rigaTurni.T2;
|
||||
@@ -56,7 +60,7 @@ namespace MoonProTablet.WebUserControls
|
||||
/// <param name="turno"></param>
|
||||
private void toggleTurno(int turno)
|
||||
{
|
||||
DataLayer.obj.taTurniMacc.stp_turniMacchineUpdateTurno(idxMacchina.ToString(), turno);
|
||||
DataLayerObj.taTurniMacc.stp_turniMacchineUpdateTurno(idxMacchina.ToString(), turno);
|
||||
setupTurni();
|
||||
// sollevo evento!
|
||||
if (eh_updated != null)
|
||||
|
||||
+14
-5
@@ -7,6 +7,15 @@ namespace MoonProTablet
|
||||
{
|
||||
public partial class fixODL : System.Web.UI.Page
|
||||
{
|
||||
/// <summary>
|
||||
/// Oggetto datalayer specifico
|
||||
/// </summary>
|
||||
DataLayer DataLayerObj = new DataLayer();
|
||||
/// <summary>
|
||||
/// Caricamento pagina
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
if (!Page.IsPostBack)
|
||||
@@ -69,7 +78,7 @@ namespace MoonProTablet
|
||||
get
|
||||
{
|
||||
bool answ = false;
|
||||
answ = DataLayer.isMulti(idxMacchinaSession);
|
||||
answ = DataLayerObj.isMulti(idxMacchinaSession);
|
||||
return answ;
|
||||
}
|
||||
}
|
||||
@@ -175,12 +184,12 @@ namespace MoonProTablet
|
||||
if (enableRPO)
|
||||
{
|
||||
// registro ODL retroattivamente...
|
||||
DataLayer.obj.taODL.inizioSetupPromessaPostuma(idxODL, DataLayer.MatrOpr, idxMacchina);
|
||||
DataLayerObj.taODL.inizioSetupPromessaPostuma(idxODL, DataLayerObj.MatrOpr, idxMacchina);
|
||||
}
|
||||
else
|
||||
{
|
||||
// registro ODL retroattivamente...
|
||||
DataLayer.obj.taODL.insPostumo(idxODL, idxMacchina);
|
||||
DataLayerObj.taODL.insPostumo(idxODL, idxMacchina);
|
||||
}
|
||||
}
|
||||
// controllo: se il nuovo ODL è stato registrato --> rimando a pagina ODL/Attrezzaggio...
|
||||
@@ -188,9 +197,9 @@ namespace MoonProTablet
|
||||
try
|
||||
{
|
||||
// ricalcolo MSE
|
||||
DataLayer.obj.taMSE.getByRefreshData(0);
|
||||
DataLayerObj.taMSE.getByRefreshData(0);
|
||||
// verifico!
|
||||
int idxODL = DataLayer.obj.taMSE.getByIdxMacchina(idxMacchina)[0].idxODL;
|
||||
int idxODL = DataLayerObj.taMSE.getByIdxMacchina(idxMacchina)[0].idxODL;
|
||||
odlOk = (idxODL > 0);
|
||||
}
|
||||
catch (Exception exc)
|
||||
|
||||
@@ -16,10 +16,17 @@ namespace MapoDb
|
||||
//string mdbConnString = "mongodb://localhost:27017";
|
||||
MongoClient client;
|
||||
#endif
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Database corrente MongoDB
|
||||
/// </summary>
|
||||
IMongoDatabase database;
|
||||
/// <summary>
|
||||
/// Oggetto privato datalayer
|
||||
/// </summary>
|
||||
DataLayer DataLayerObj;
|
||||
|
||||
/// <summary>
|
||||
/// Classe gestione archivio allarmi
|
||||
/// </summary>
|
||||
@@ -32,7 +39,7 @@ namespace MapoDb
|
||||
#endif
|
||||
|
||||
database = memLayer.ML.getMongoDatabase("MAPO");
|
||||
|
||||
DataLayerObj = new DataLayer();
|
||||
}
|
||||
/// <summary>
|
||||
/// Singleton gestione istanza AlarmsManager
|
||||
@@ -63,7 +70,7 @@ namespace MapoDb
|
||||
var collAlarmEvents = database.GetCollection<alarmEvent>("AlarmEvents");
|
||||
|
||||
List<rawData> lastFluxLog = new List<rawData>();
|
||||
DS_applicazione.FluxLogDataTable tabDati = DataLayer.obj.taFL.getFiltOrd(idxMacchina, adesso.AddMinutes(-lastMinutes), adesso, true);
|
||||
DS_applicazione.FluxLogDataTable tabDati = DataLayerObj.taFL.getFiltOrd(idxMacchina, adesso.AddMinutes(-lastMinutes), adesso, true);
|
||||
if (tabDati.Count > 0)
|
||||
{
|
||||
// chiamo procedura x conversione
|
||||
|
||||
+904
-83
File diff suppressed because it is too large
Load Diff
@@ -55,6 +55,10 @@ namespace MapoDb
|
||||
/// </summary>
|
||||
IMongoDatabase database;
|
||||
/// <summary>
|
||||
/// Oggetto datalayer
|
||||
/// </summary>
|
||||
DataLayer DataLayerObj = new DataLayer();
|
||||
/// <summary>
|
||||
/// Classe gestione archivio allarmi
|
||||
/// </summary>
|
||||
public FluxArchive()
|
||||
@@ -66,6 +70,8 @@ namespace MapoDb
|
||||
#endif
|
||||
|
||||
database = memLayer.ML.getMongoDatabase("MAPO");
|
||||
// init oggetto datalayer
|
||||
DataLayerObj = new DataLayer();
|
||||
}
|
||||
public static FluxArchive man = new FluxArchive();
|
||||
/// <summary>
|
||||
@@ -103,7 +109,7 @@ namespace MapoDb
|
||||
|
||||
// faccio ciclo su OGNI macchina
|
||||
sw.Start();
|
||||
var elencoMacchine = DataLayer.obj.taMacchine.GetData();
|
||||
var elencoMacchine = DataLayerObj.taMacchine.GetData();
|
||||
foreach (var macchina in elencoMacchine)
|
||||
{
|
||||
sb.AppendLine($"Inizio processing macchina {macchina.IdxMacchina}");
|
||||
@@ -114,7 +120,7 @@ namespace MapoDb
|
||||
currDateStr = tStamp.ToString("yyyyMMdd");
|
||||
int.TryParse(currDateStr, out currYMD);
|
||||
// leggo da DB i records...
|
||||
DS_applicazione.FluxLogDataTable tabDati = DataLayer.obj.taFL.getFiltOrd(macchina.IdxMacchina, tStamp, tStamp.AddDays(1), true);
|
||||
DS_applicazione.FluxLogDataTable tabDati = DataLayerObj.taFL.getFiltOrd(macchina.IdxMacchina, tStamp, tStamp.AddDays(1), true);
|
||||
// solo se ho dati...
|
||||
if (tabDati.Count > 0)
|
||||
{
|
||||
|
||||
+15
-871
@@ -1,3 +1,4 @@
|
||||
using MapoSDK;
|
||||
using SteamWare;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
@@ -6,59 +7,6 @@ using System.Data;
|
||||
namespace MapoDb
|
||||
{
|
||||
|
||||
public struct inputComando
|
||||
{
|
||||
/// <summary>
|
||||
/// input comando valido si/no
|
||||
/// </summary>
|
||||
public bool isValid;
|
||||
/// <summary>
|
||||
/// testo da mostrare all'utente
|
||||
/// </summary>
|
||||
public string text2show;
|
||||
/// <summary>
|
||||
/// idx evento associato al comando
|
||||
/// </summary>
|
||||
public int idxTipoEvento;
|
||||
/// <summary>
|
||||
/// input precedente
|
||||
/// </summary>
|
||||
public string precInput;
|
||||
/// <summary>
|
||||
/// descrizione comando
|
||||
/// </summary>
|
||||
public string descrComando;
|
||||
/// <summary>
|
||||
/// refresh stato macchina encessario si/no
|
||||
/// </summary>
|
||||
public bool needStatusRefresh;
|
||||
/// <summary>
|
||||
/// lista del nome dei WebBrowserBox e delle relative url, nel formato {0}##{1} {0}=nome WebBrowserBox (es. box01), {1}=url relativo (es. http://server/MoonPro/Produzione.aspx?idxMacchina=99)
|
||||
/// </summary>
|
||||
public string[] wBrowsBoxUrls;
|
||||
/// <summary>
|
||||
/// valore di output dal comando
|
||||
/// </summary>
|
||||
public string outValue;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// tipologia evento inviato
|
||||
/// </summary>
|
||||
public enum tipoInputEvento
|
||||
{
|
||||
barcode,
|
||||
hw
|
||||
}
|
||||
/// <summary>
|
||||
/// nuovo stato ingressi e eventuale evento da inviare
|
||||
/// </summary>
|
||||
public struct hwMachineState
|
||||
{
|
||||
public int next_IdxMicroStato;
|
||||
public int IdxTipoEvento;
|
||||
}
|
||||
|
||||
public class MapoDb
|
||||
{
|
||||
#region area protected
|
||||
@@ -66,8 +14,6 @@ namespace MapoDb
|
||||
protected string _separatore = ",";
|
||||
protected string _connectionString = "";
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// avvio i table adapter della classe
|
||||
/// </summary>
|
||||
@@ -117,143 +63,8 @@ namespace MapoDb
|
||||
taODL.Connection.ConnectionString = _connectionString;
|
||||
taTCRilevati.Connection.ConnectionString = _connectionString;
|
||||
}
|
||||
/// <summary>
|
||||
/// cerca codice in anagrafica macchine ed eventualmente inserisce nuova macchina
|
||||
/// </summary>
|
||||
/// <param name="IdxMacchina"></param>
|
||||
private void verificaIdxMacchina(string IdxMacchina)
|
||||
{
|
||||
bool needDB = false;
|
||||
if (!memLayer.ML.CRB("disable_verificaIdxMacchina"))
|
||||
{
|
||||
if (memLayer.ML.CRB("IOB_RedEnab"))
|
||||
{
|
||||
try
|
||||
{
|
||||
// esecuzione in REDIS...cerco status macchina...
|
||||
if (DataLayer.mDatiMacchine(IdxMacchina).Count == 0)
|
||||
{
|
||||
needDB = true;
|
||||
}
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
}
|
||||
// ...oppure segno richiesta DB...
|
||||
else
|
||||
{
|
||||
needDB = true;
|
||||
}
|
||||
if (needDB)
|
||||
{
|
||||
// 2017.07.11 se richiesto di NON usare singleton... riporto FUORI la gestione NUOVO oggetto
|
||||
if (memLayer.ML.CRB("disable_singleton"))
|
||||
{
|
||||
taMacchine = new DS_applicazioneTableAdapters.MacchineTableAdapter();
|
||||
taMSM = new DS_applicazioneTableAdapters.MicroStatoMacchinaTableAdapter();
|
||||
}
|
||||
// verifico esistenza macchina
|
||||
if (taMacchine.GetByIdx(IdxMacchina).Rows.Count == 0)
|
||||
{
|
||||
// inserisco nuova macchina...
|
||||
taMacchine.Insert(IdxMacchina, "9999", IdxMacchina, "Macchina non codificata", "-", "http://", "nd", "col", 0, 0);
|
||||
}
|
||||
// verifico ci sia un microstato macchina...
|
||||
if (taMSM.getByIdxMacchina(IdxMacchina).Rows.Count == 0)
|
||||
{
|
||||
// inserisco nuovo stato...
|
||||
taMSM.Insert(IdxMacchina, 0, DateTime.Now, "00");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// verifica se sia necessario inserire un cambio di stato impianto in modalità batch
|
||||
/// </summary>
|
||||
/// <param name="tipoInput"></param>
|
||||
/// <param name="IdxMacchina"></param>
|
||||
/// <param name="InizioStato"></param>
|
||||
/// <param name="IdxTipo"></param>
|
||||
/// <param name="CodArt"></param>
|
||||
/// <param name="Value"></param>
|
||||
/// <param name="MatrOpr"></param>
|
||||
/// <param name="pallet"></param>
|
||||
private void checkCambiaStatoBatch(tipoInputEvento tipoInput, string IdxMacchina, DateTime InizioStato, int IdxTipo, string CodArt, string Value, int MatrOpr, string pallet)
|
||||
{
|
||||
int _logLevel = memLayer.ML.CRI("_logLevel");
|
||||
DS_applicazione.TransizioneStatiDataTable tabTransStati;
|
||||
DS_applicazione.TransizioneStatiRow rigaTransStati;
|
||||
switch (tipoInput)
|
||||
{
|
||||
case tipoInputEvento.barcode:
|
||||
// effettuo cambio stato INDIPENDENTEMENTE da stato precedente
|
||||
try
|
||||
{
|
||||
tabTransStati = taTranSt.GetUserForcedTransitions(IdxMacchina, IdxTipo);
|
||||
if (tabTransStati != null)
|
||||
{
|
||||
if (tabTransStati.Count > 0)
|
||||
{
|
||||
rigaTransStati = tabTransStati[0];
|
||||
// solo se cambia stato...
|
||||
if (rigaTransStati.IdxStato != rigaTransStati.next_IdxStato)
|
||||
{
|
||||
taDiario.InsStatoBatch(IdxMacchina, InizioStato, rigaTransStati.next_IdxStato, CodArt, Value, MatrOpr, pallet);
|
||||
// aggiorno MSE
|
||||
DataLayer.obj.taMSE.forceRecalc(0, IdxMacchina);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (_logLevel > 6)
|
||||
{
|
||||
logger.lg.scriviLog($"Non trovata riga per: BARCODE | IdxMacchina: {IdxMacchina} | IdxTipo: {IdxTipo} | CodArt: {CodArt} | Value: {Value} | MatrOpr: {MatrOpr} | pallet: {pallet}", tipoLog.INFO);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
// non dovrebbe succedere... input utente da barcode dovrebbero TUTTI essere inseriti in tab transizione con famiglia 1...
|
||||
logger.lg.scriviLog($"Errore controllo transizione stato x evento barcode: BARCODE | IdxMacchina: {IdxMacchina} | IdxTipo: {IdxTipo} | CodArt: {CodArt} | Value: {Value} | MatrOpr: {MatrOpr} | pallet: {pallet}{Environment.NewLine}{exc}", tipoLog.EXCEPTION);
|
||||
}
|
||||
break;
|
||||
case tipoInputEvento.hw:
|
||||
// verifico se ci sia necessità di cambio stato
|
||||
try
|
||||
{
|
||||
tabTransStati = taTranSt.GetHwTransitions(IdxMacchina, IdxTipo);
|
||||
if (tabTransStati != null)
|
||||
{
|
||||
if (tabTransStati.Count > 0)
|
||||
{
|
||||
rigaTransStati = tabTransStati[0];
|
||||
if (rigaTransStati != null)
|
||||
{
|
||||
// solo se cambia stato...
|
||||
if (rigaTransStati.IdxStato != rigaTransStati.next_IdxStato)
|
||||
{
|
||||
taDiario.InsStatoBatch(IdxMacchina, InizioStato, rigaTransStati.next_IdxStato, CodArt, Value, MatrOpr, pallet);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (_logLevel > 6)
|
||||
{
|
||||
logger.lg.scriviLog($"Non trovata riga per: HW | IdxMacchina: {IdxMacchina} | IdxTipo: {IdxTipo} | CodArt: {CodArt} | Value: {Value} | MatrOpr: {MatrOpr} | pallet: {pallet}", tipoLog.INFO);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
// non trovo riga [0]... NON scrivo!
|
||||
logger.lg.scriviLog($"Errore controllo transizione stato x evento barcode: HW | IdxMacchina: {IdxMacchina} | IdxTipo: {IdxTipo} | CodArt: {CodArt} | Value: {Value} | MatrOpr: {MatrOpr} | pallet: {pallet}{Environment.NewLine}{exc}", tipoLog.EXCEPTION);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// metodo privato x fornire matricola che è correntemente sulla macchina
|
||||
@@ -331,11 +142,6 @@ namespace MapoDb
|
||||
AvviaTabAdapt();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Oggetto singleton x MapoDb
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static MapoDb obj = new MapoDb();
|
||||
/// <summary>
|
||||
/// restituisce la stringa di connessione al db
|
||||
/// </summary>
|
||||
@@ -352,83 +158,7 @@ namespace MapoDb
|
||||
setConnString();
|
||||
return true;
|
||||
}
|
||||
/// <summary>
|
||||
/// scrive una riga di evento nel db
|
||||
/// </summary>
|
||||
/// <param name="IdxMacchina">codice macchina</param>
|
||||
/// <param name="IdxTipo">idx evento</param>
|
||||
/// <param name="CodArticolo">Codice Articolo</param>
|
||||
/// <param name="Value">valore</param>
|
||||
/// <param name="MatrOpr">matricola operatore</param>
|
||||
/// <param name="pallet">pallet (vuoto se nd)</param>
|
||||
/// <param name="eventTime">data-ora dell'evento</param>
|
||||
/// <param name="currentTime">data-ora corrente dell'invio</param>
|
||||
/// <returns></returns>
|
||||
public inputComando scriviRigaEvento(string IdxMacchina, int IdxTipo, string CodArticolo, string Value, int MatrOpr, string pallet, DateTime eventTime, DateTime currentTime)
|
||||
{
|
||||
int inserito = 0;
|
||||
// 2017.07.11 se richiesto di NON usare singleton... riporto FUORI la gestione NUOVO oggetto
|
||||
if (memLayer.ML.CRB("disable_singleton"))
|
||||
{
|
||||
// 2017.06.09 forzo init x errori "sovrapposizioni"
|
||||
taEvList = new DS_applicazioneTableAdapters.EventListTableAdapter();
|
||||
}
|
||||
try
|
||||
{
|
||||
// verifico se esista la macchina altrimenti la creo...
|
||||
verificaIdxMacchina(IdxMacchina);
|
||||
// calcolo dataOra reale (evento + delta(ora server - ora remota)
|
||||
DateTime dataOra = eventTime.Add(DateTime.Now - currentTime);
|
||||
// inserisco evento
|
||||
inserito = taEvList.Insert(IdxMacchina, dataOra, IdxTipo, CodArticolo, Value, MatrOpr, pallet);
|
||||
// faccio controllo per eventuale cambio stato da tab transizioni...
|
||||
checkCambiaStatoBatch(tipoInputEvento.hw, IdxMacchina, dataOra, IdxTipo, CodArticolo, Value, MatrOpr, pallet);
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
logger.lg.scriviLog(string.Format("Errore in fase di scrittura evento con i seguenti dati:{0} macchina {1}{0} IdxTipo {2}{0} CodArticolo {3}{0} Value {4}{0} MatrOpr {5}{0} Pallet {6}{0} eventTime {7}{0} currentTime {8}{0} eccezione: {0}{9}", Environment.NewLine, IdxMacchina, IdxTipo, CodArticolo, Value, MatrOpr, pallet, eventTime, currentTime, exc), tipoLog.EXCEPTION);
|
||||
}
|
||||
// formatto output
|
||||
inputComando answ = new inputComando();
|
||||
answ.outValue = inserito.ToString();
|
||||
answ.needStatusRefresh = true;
|
||||
return answ;
|
||||
}
|
||||
/// <summary>
|
||||
/// scrive una riga di evento nel db
|
||||
/// </summary>
|
||||
/// <param name="IdxMacchina">codice macchina</param>
|
||||
/// <param name="IdxTipo">idx evento</param>
|
||||
/// <param name="CodArticolo">Codice Articolo</param>
|
||||
/// <param name="Value">valore</param>
|
||||
/// <param name="MatrOpr">matricola operatore</param>
|
||||
/// <param name="pallet">pallet (vuoto se nd)</param>
|
||||
/// <returns></returns>
|
||||
public inputComando scriviRigaEvento(string IdxMacchina, int IdxTipo, string CodArticolo, string Value, int MatrOpr, string pallet)
|
||||
{
|
||||
int inserito = 0;
|
||||
// 2017.06.09 forzo init x errori "sovrapposizioni"
|
||||
taEvList = new DS_applicazioneTableAdapters.EventListTableAdapter();
|
||||
try
|
||||
{
|
||||
// verifico se esista la macchina altrimenti la creo...
|
||||
verificaIdxMacchina(IdxMacchina);
|
||||
DateTime dataOra = DateTime.Now;
|
||||
// inserisco evento
|
||||
inserito = taEvList.Insert(IdxMacchina, dataOra, IdxTipo, CodArticolo, Value, MatrOpr, pallet);
|
||||
// faccio controllo per eventuale cambio stato da tab transizioni...
|
||||
checkCambiaStatoBatch(tipoInputEvento.hw, IdxMacchina, dataOra, IdxTipo, CodArticolo, Value, MatrOpr, pallet);
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
logger.lg.scriviLog(string.Format("Errore in fase di scrittura evento con i seguenti dati:{0} macchina {1}{0} IdxTipo {2}{0} CodArticolo {3}{0} Value {4}{0} MatrOpr {5}{0} Pallet {6}{0} eccezione:{0}{7}", Environment.NewLine, IdxMacchina, IdxTipo, CodArticolo, Value, MatrOpr, pallet, exc), tipoLog.EXCEPTION);
|
||||
}
|
||||
// formatto output
|
||||
inputComando answ = new inputComando();
|
||||
answ.outValue = inserito.ToString();
|
||||
answ.needStatusRefresh = true;
|
||||
return answ;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// restituisce boolean se la macchina sia abilitata x inserimento dati (tab DatiMacchine)
|
||||
/// </summary>
|
||||
@@ -445,40 +175,7 @@ namespace MapoDb
|
||||
{ }
|
||||
return answ;
|
||||
}
|
||||
/// <summary>
|
||||
/// restituisce valore dell'ODL attivo (iniziato e NON concluso)
|
||||
/// </summary>
|
||||
/// <param name="idxMacchina"></param>
|
||||
/// <returns></returns>
|
||||
public string currODL(string idxMacchina)
|
||||
{
|
||||
string answ = "";
|
||||
// recupero con stored NUOVA...
|
||||
DS_ProdTempi.ODLDataTable tabOdl = DataLayer.obj.taODL.getByMacchina(idxMacchina);
|
||||
if (tabOdl.Rows.Count > 0)
|
||||
{
|
||||
// solo SE ho idxODL (altrimenti loggo errore)
|
||||
if (tabOdl[0].IdxODL > 0)
|
||||
{
|
||||
answ = tabOdl[0].IdxODL.ToString();
|
||||
answ = answ == "" ? "0" : answ;
|
||||
}
|
||||
else
|
||||
{
|
||||
answ = "0";
|
||||
logger.lg.scriviLog("[currODL] Errore in currODL x idxMacchina " + idxMacchina + ": IdxODL = 0");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// se è empty --> 0!!!
|
||||
answ = "0";
|
||||
}
|
||||
// ultimo controllo su idxOdl...
|
||||
answ = answ == "" ? "0" : answ;
|
||||
// restituisco!
|
||||
return answ;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Testituisce tabella con riga dell'ODL attivo (iniziato e NON concluso)
|
||||
/// </summary>
|
||||
@@ -569,290 +266,8 @@ namespace MapoDb
|
||||
{ }
|
||||
return answ;
|
||||
}
|
||||
/// <summary>
|
||||
/// salva il segnale di "microstato"
|
||||
/// </summary>
|
||||
/// <param name="idxMacchina">idx macchina</param>
|
||||
/// <param name="valore">valore ingresso</param>
|
||||
/// <param name="dtEve">data-ora evento (server)</param>
|
||||
/// <param name="contatore">sequenza dati inviati</param>
|
||||
/// <returns></returns>
|
||||
public void saveSigLog(string idxMacchina, string valore, DateTime dtEve, string contatore)
|
||||
{
|
||||
int cont = 0;
|
||||
try
|
||||
{
|
||||
cont = Convert.ToInt32(contatore);
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
// 2017.07.11 se richiesto di NON usare singleton... riporto FUORI la gestione NUOVO oggetto
|
||||
if (memLayer.ML.CRB("disable_singleton"))
|
||||
{
|
||||
// 2017.06.09 forzo init x errori "sovrapposizioni"
|
||||
DataLayer.obj.taSigLog = new DS_applicazioneTableAdapters.SignalLogTableAdapter();
|
||||
}
|
||||
DataLayer.obj.taSigLog.Insert(DateTime.Now, idxMacchina, valore, dtEve, cont);
|
||||
}
|
||||
/// <summary>
|
||||
/// controlla se da il segnale di "microstato" deriva un evento da generare - modalità OFFLINE
|
||||
/// </summary>
|
||||
/// <param name="idxMacchina">idx macchina</param>
|
||||
/// <param name="valore">valore ingresso</param>
|
||||
/// <param name="dtEve">data-ora evento (server)</param>
|
||||
/// <param name="contatore">sequenza dati inviati</param>
|
||||
/// <returns></returns>
|
||||
public inputComando checkMicroStato(string idxMacchina, string valore, DateTime dtEve, string contatore)
|
||||
{
|
||||
int _logLevel = memLayer.ML.CRI("_logLevel");
|
||||
// recupero SE IMPIEGATO REDIS i valori del Dictionary della macchina...
|
||||
Dictionary<string, string> datiMacc = DataLayer.mDatiMacchine(idxMacchina);
|
||||
|
||||
if (_logLevel > 6)
|
||||
{
|
||||
logger.lg.scriviLog(string.Format("[ChkMiSt]{2}---------------------------{2}Richiesta verifica INPUT per Macchina {0}, seriale {1}", idxMacchina, valore, Environment.NewLine), tipoLog.INFO);
|
||||
}
|
||||
// formatto output
|
||||
inputComando answ = new inputComando();
|
||||
DS_applicazione.TransizioneIngressiDataTable TabTransIn;
|
||||
DS_applicazione.TransizioneIngressiRow rigaTransIn = null;
|
||||
// verifico se esista la macchina altrimenti la creo... REDIS compliant
|
||||
verificaIdxMacchina(idxMacchina);
|
||||
string CodArticolo = "";
|
||||
if (memLayer.ML.CRB("IOB_RedEnab"))
|
||||
{
|
||||
try
|
||||
{
|
||||
// esecuzione in REDIS
|
||||
CodArticolo = datiMacc["CodArticolo"];
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
}
|
||||
// ...oppure dritto su DB
|
||||
else
|
||||
{
|
||||
// esecuzione in DB...
|
||||
// recupero CodArticolo corretto
|
||||
try
|
||||
{
|
||||
// 2017.07.11 se richiesto di NON usare singleton... riporto FUORI la gestione NUOVO oggetto
|
||||
if (memLayer.ML.CRB("disable_singleton"))
|
||||
{
|
||||
// 2017.07.10 forzo init x errori "sovrapposizioni"
|
||||
taDatiMacchine = new DS_ProdTempiTableAdapters.DatiMacchineTableAdapter();
|
||||
}
|
||||
CodArticolo = taDatiMacchine.getByIdx(idxMacchina)[0].CodArticolo_A;
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
logger.lg.scriviLog(string.Format("[ChkMiSt_4a] - Eccezione in recupero CodArticolo:{0}{1}", Environment.NewLine, exc), tipoLog.EXCEPTION);
|
||||
}
|
||||
}
|
||||
// recupero next microstato
|
||||
int? valINT = 0;
|
||||
try
|
||||
{
|
||||
valINT = int.Parse(valore, System.Globalization.NumberStyles.HexNumber);
|
||||
// esecuzione in REDIS...
|
||||
if (memLayer.ML.CRB("IOB_RedEnab"))
|
||||
{
|
||||
try
|
||||
{
|
||||
int idxFamIn = Convert.ToInt32(datiMacc["IdxFamIn"]);
|
||||
int idxMicroStato = Convert.ToInt32(datiMacc["IdxMicroStato"]);
|
||||
int valIOB = Convert.ToInt32(valINT);
|
||||
int idxTipoEv = 0;
|
||||
int next_idxMS = idxMicroStato;
|
||||
// verifico esistenza tab SMI...
|
||||
string fiHASH = DataLayer.hSMI(idxFamIn);
|
||||
string todoSMI = "";
|
||||
bool trovato = memLayer.ML.redHashPresentSz(fiHASH);
|
||||
if (!trovato)
|
||||
{
|
||||
// ricarico tabella!
|
||||
KeyValuePair<string, string>[] valori = DataLayer.mTabSMI(idxFamIn);
|
||||
}
|
||||
// recupero singolo valore (stringa) x chiave
|
||||
todoSMI = DataLayer.valoreSMI(idxFamIn, idxMicroStato, valIOB);
|
||||
// solo se ho trovato un risultato nella tab SMI della famiglia macchina...
|
||||
if (todoSMI != "")
|
||||
{
|
||||
// splitto e salvo valori OUT...
|
||||
string[] valori = todoSMI.Split('_');
|
||||
idxTipoEv = Convert.ToInt32(valori[0]);
|
||||
next_idxMS = Convert.ToInt32(valori[1]);
|
||||
// creo la riga tipizzatya dai dati di redis x procedere...
|
||||
DS_applicazione.TransizioneIngressiDataTable tab = new DS_applicazione.TransizioneIngressiDataTable();
|
||||
rigaTransIn = tab.NewTransizioneIngressiRow();
|
||||
rigaTransIn.IdxFamigliaIngresso = idxFamIn;
|
||||
rigaTransIn.IdxMicroStato = idxMicroStato;
|
||||
rigaTransIn.ValoreIngresso = valIOB;
|
||||
rigaTransIn.IdxTipoEvento = idxTipoEv;
|
||||
rigaTransIn.next_IdxMicroStato = next_idxMS;
|
||||
}
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
}
|
||||
// ...oppure dritto su DB
|
||||
else
|
||||
{
|
||||
// 2017.07.11 se richiesto di NON usare singleton... riporto FUORI la gestione NUOVO oggetto
|
||||
if (memLayer.ML.CRB("disable_singleton"))
|
||||
{
|
||||
// 2017.06.09 forzo init x errori "sovrapposizioni"
|
||||
taTransIngr = new DS_applicazioneTableAdapters.TransizioneIngressiTableAdapter();
|
||||
}
|
||||
TabTransIn = taTransIngr.getByIdxMacchinaValore(idxMacchina, valINT);
|
||||
if (TabTransIn.Rows.Count > 0)
|
||||
{
|
||||
rigaTransIn = TabTransIn[0];
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
logger.lg.scriviLog(string.Format("[ChkMiSt_5a] - - Eccezione in recupero riga Trans ingressi per idxMacchina {3} e valore {2}:{0}{1}", Environment.NewLine, exc, valINT, idxMacchina), tipoLog.EXCEPTION);
|
||||
}
|
||||
// effettuo update vari SU DB!!!
|
||||
if (rigaTransIn != null)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (_logLevel > 5)
|
||||
{
|
||||
logger.lg.scriviLog(string.Format("[ChkMiSt_6a] - Salvo Update Microstato:{0}macchina: {1} | valore seriale: {2} | next micro stato: {3}", Environment.NewLine, idxMacchina, valINT, rigaTransIn.next_IdxMicroStato), tipoLog.INFO);
|
||||
}
|
||||
// 2017.07.11 se richiesto di NON usare singleton... riporto FUORI la gestione NUOVO oggetto
|
||||
if (memLayer.ML.CRB("disable_singleton"))
|
||||
{
|
||||
// 2017.06.09 forzo init x errori "sovrapposizioni"
|
||||
taMSM = new DS_applicazioneTableAdapters.MicroStatoMacchinaTableAdapter();
|
||||
}
|
||||
// salvo nuovo microstato...
|
||||
taMSM.updateQuery(rigaTransIn.next_IdxMicroStato, dtEve, valore, idxMacchina);
|
||||
// controllo se c'è evento
|
||||
if (rigaTransIn.IdxTipoEvento > 0)
|
||||
{
|
||||
if (_logLevel > 5)
|
||||
{
|
||||
logger.lg.scriviLog(string.Format("[ChkMiSt_7a] - Salvo evento:{0}macchina: {1} | tipoEvento: {2} | CodArticolo: {3} | contatore: {4} | valore: {5}", Environment.NewLine, idxMacchina, rigaTransIn.IdxTipoEvento, CodArticolo, contatore, valore), tipoLog.INFO);
|
||||
}
|
||||
string valEsteso = string.Format("[{0}] {1}", contatore.PadLeft(3, '0'), valore);
|
||||
// aggiunto contatore!
|
||||
answ = scriviRigaEvento(idxMacchina, rigaTransIn.IdxTipoEvento, CodArticolo, valEsteso, 0, "-", dtEve, DateTime.Now);
|
||||
// 2017.09.12 SE era in modalità redis RICARICA dati macchina...
|
||||
if (memLayer.ML.CRB("IOB_RedEnab"))
|
||||
{
|
||||
DataLayer.resetDatiMacchina(idxMacchina);
|
||||
}
|
||||
if (_logLevel > 5)
|
||||
{
|
||||
logger.lg.scriviLog(string.Format("[ChkMiSt_a] - Macchina {0} | seriale(INT) {1} | valEsteso {3} | answ {4}{2}---------------------------{2}", idxMacchina, valINT, Environment.NewLine, valEsteso, answ), tipoLog.INFO);
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
logger.lg.scriviLog(string.Format("[ChkMiSt_8a] - Eccezione:{0}{1}", Environment.NewLine, exc), tipoLog.EXCEPTION);
|
||||
}
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
/// <summary>
|
||||
/// controlla se da il segnale di "microstato" deriva un evento da generare - modalità OFFLINE
|
||||
/// </summary>
|
||||
/// <param name="idxMacchina">idx macchina</param>
|
||||
/// <param name="valore">valore ingresso</param>
|
||||
/// <param name="dtEve">data-ora evento (server)</param>
|
||||
/// <returns></returns>
|
||||
public inputComando checkMicroStato(string idxMacchina, string valore, DateTime dtEve)
|
||||
{
|
||||
if (memLayer.ML.CRI("_logLevel") > 6)
|
||||
{
|
||||
logger.lg.scriviLog(string.Format("{2}---------------------------{2}Richiesta verifica INPUT per Macchina {0}, seriale {1}", idxMacchina, valore, Environment.NewLine), tipoLog.INFO);
|
||||
}
|
||||
// formatto output
|
||||
inputComando answ = new inputComando();
|
||||
DS_applicazione.TransizioneIngressiDataTable TabTransIn;
|
||||
DS_applicazione.TransizioneIngressiRow rigaTransIn = null;
|
||||
// verifico se esista la macchina altrimenti la creo...
|
||||
verificaIdxMacchina(idxMacchina);
|
||||
string CodArticolo = "";
|
||||
// recupero CodArticolo corretto
|
||||
try
|
||||
{
|
||||
// 2017.07.10 forzo init x errori "sovrapposizioni"
|
||||
taDatiMacchine = new DS_ProdTempiTableAdapters.DatiMacchineTableAdapter();
|
||||
CodArticolo = taDatiMacchine.getByIdx(idxMacchina)[0].CodArticolo_A;
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
logger.lg.scriviLog(string.Format("[ChkMiSt_4b] - Eccezione in recupero CodArticolo:{0}{1}", Environment.NewLine, exc), tipoLog.EXCEPTION);
|
||||
}
|
||||
// recupero next microstato
|
||||
//int? valINT = Convert.ToInt32(valore);
|
||||
int? valINT = 0;
|
||||
try
|
||||
{
|
||||
// 2017.06.09 forzo init x errori "sovrapposizioni"
|
||||
taTransIngr = new DS_applicazioneTableAdapters.TransizioneIngressiTableAdapter();
|
||||
valINT = int.Parse(valore, System.Globalization.NumberStyles.HexNumber);
|
||||
TabTransIn = taTransIngr.getByIdxMacchinaValore(idxMacchina, valINT);
|
||||
if (TabTransIn.Rows.Count > 0)
|
||||
{
|
||||
rigaTransIn = TabTransIn[0];
|
||||
}
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
logger.lg.scriviLog(string.Format("[ChkMiSt_5b] - Eccezione in recupero riga Trans ingressi per idxMacchina {3} e valore {2}:{0}{1}", Environment.NewLine, exc, valINT, idxMacchina), tipoLog.EXCEPTION);
|
||||
}
|
||||
int _logLevel = memLayer.ML.CRI("_logLevel");
|
||||
// effettuo update vari
|
||||
if (rigaTransIn != null)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (_logLevel > 5)
|
||||
{
|
||||
logger.lg.scriviLog(string.Format("[ChkMiSt_6b] - Salvo Update Microstato:{0}macchina: {1} | valore seriale: {2} | next micro stato: {3}", Environment.NewLine, idxMacchina, valINT, rigaTransIn.next_IdxMicroStato), tipoLog.INFO);
|
||||
}
|
||||
// salvo nuovo microstato...
|
||||
taMSM.updateQuery(rigaTransIn.next_IdxMicroStato, dtEve, valore, idxMacchina);
|
||||
// controllo se c'è evento
|
||||
if (rigaTransIn.IdxTipoEvento > 0)
|
||||
{
|
||||
if (_logLevel > 5)
|
||||
{
|
||||
logger.lg.scriviLog(string.Format("[ChkMiSt_7b] - Salvo evento:{0}macchina: {1} | tipoEvento: {2} | CodArticolo: {3}", Environment.NewLine, idxMacchina, rigaTransIn.IdxTipoEvento, CodArticolo), tipoLog.INFO);
|
||||
}
|
||||
answ = scriviRigaEvento(idxMacchina, rigaTransIn.IdxTipoEvento, CodArticolo, valore, 0, "-", dtEve, DateTime.Now);
|
||||
if (_logLevel > 5)
|
||||
{
|
||||
logger.lg.scriviLog(string.Format("[ChkMiSt_b] -Macchina {0}, seriale(INT) {1}{2}---------------------------{2}", idxMacchina, valINT, Environment.NewLine), tipoLog.INFO);
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
logger.lg.scriviLog(string.Format("[ChkMiSt_8b] - Eccezione:{0}{1}", Environment.NewLine, exc), tipoLog.EXCEPTION);
|
||||
}
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
/// <summary>
|
||||
/// controlla se da il segnale di "microstato" deriva un evento da generare
|
||||
/// </summary>
|
||||
/// <param name="idxMacchina"></param>
|
||||
/// <param name="valore"></param>
|
||||
/// <returns></returns>
|
||||
public inputComando checkMicroStato(string idxMacchina, string valore)
|
||||
{
|
||||
// wrapper ad ora corrente...
|
||||
return checkMicroStato(idxMacchina, valore, DateTime.Now);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
@@ -861,14 +276,14 @@ namespace MapoDb
|
||||
/// <param name="agent"></param>
|
||||
/// <param name="macAddr">mac address (inviato dalla macchina)</param>
|
||||
/// <returns></returns>
|
||||
public inputComando registraStartup(string idxMacchina, string IPv4, string agent, string macAddr)
|
||||
public inputComandoMapo registraStartup(string idxMacchina, string IPv4, string agent, string macAddr)
|
||||
{
|
||||
if (memLayer.ML.CRI("_logLevel") > 6)
|
||||
{
|
||||
logger.lg.scriviLog(string.Format("{0}---------------------------{0}Richiesta registrazione (ri)avvio Macchina {1} - mac: {2}", Environment.NewLine, idxMacchina, macAddr), tipoLog.INFO);
|
||||
}
|
||||
// formatto output
|
||||
inputComando answ = new inputComando();
|
||||
inputComandoMapo answ = new inputComandoMapo();
|
||||
// scrivo remote reboot alive!
|
||||
scriviRemoteReboot(idxMacchina, IPv4, agent, macAddr);
|
||||
// scrivo PRIMO keep alive
|
||||
@@ -878,171 +293,7 @@ namespace MapoDb
|
||||
return answ;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// scrive una riga di evento nel db SENZA passare operatore e pallet (mette a 0 e "-")
|
||||
/// </summary>
|
||||
/// <param name="IdxMacchina">codice macchina</param>
|
||||
/// <param name="IdxTipo">idx evento</param>
|
||||
/// <param name="CodArticolo">Codice Articolo</param>
|
||||
/// <param name="Value">valore</param>
|
||||
/// <returns></returns>
|
||||
public inputComando scriviRigaEvento(string IdxMacchina, int IdxTipo, string CodArticolo, string Value)
|
||||
{
|
||||
int inserito = 0;
|
||||
try
|
||||
{
|
||||
// verifico se esista la macchina altrimenti la creo...
|
||||
verificaIdxMacchina(IdxMacchina);
|
||||
DateTime dataOra = DateTime.Now;
|
||||
// inserisco evento
|
||||
inserito = taEvList.Insert(IdxMacchina, dataOra, IdxTipo, CodArticolo, Value, 0, "-");
|
||||
// faccio controllo per eventuale cambio stato da tab transizioni...
|
||||
checkCambiaStatoBatch(tipoInputEvento.hw, IdxMacchina, dataOra, IdxTipo, CodArticolo, Value, 0, "-");
|
||||
}
|
||||
catch
|
||||
{
|
||||
logger.lg.scriviLog(string.Format("Errore in fase di scrittura evento con i seguenti dati:{0} macchina {1}{0} IdxTipo {2}{0} CodArticolo {3}{0} Value {4}{0} eccezione: {0}{5}", Environment.NewLine, IdxMacchina, IdxTipo, CodArticolo, Value), tipoLog.EXCEPTION);
|
||||
}
|
||||
// formatto output
|
||||
inputComando answ = new inputComando();
|
||||
answ.outValue = inserito.ToString();
|
||||
answ.needStatusRefresh = true;
|
||||
return answ;
|
||||
}
|
||||
/// <summary>
|
||||
/// scrive una riga di evento inviato da Barcode nel db
|
||||
/// </summary>
|
||||
/// <param name="IdxMacchina">codice macchina</param>
|
||||
/// <param name="IdxTipo">idx evento</param>
|
||||
/// <param name="CodArticolo">Codice Articolo</param>
|
||||
/// <param name="Value">valore</param>
|
||||
/// <param name="MatrOpr">matricola operatore</param>
|
||||
/// <param name="pallet">pallet (vuoto se nd)</param>
|
||||
/// <param name="eventTime">data-ora dell'evento</param>
|
||||
/// <param name="currentTime">data-ora corrente dell'invio</param>
|
||||
/// <returns></returns>
|
||||
public inputComando scriviRigaEventoBarcode(string IdxMacchina, int IdxTipo, string CodArticolo, string Value, int MatrOpr, string pallet, DateTime eventTime, DateTime currentTime)
|
||||
{
|
||||
int inserito = 0;
|
||||
try
|
||||
{
|
||||
// verifico se esista la macchina altrimenti la creo...
|
||||
verificaIdxMacchina(IdxMacchina);
|
||||
// calcolo dataOra reale (evento + delta(ora server - ora remota)
|
||||
DateTime dataOra = eventTime.Add(DateTime.Now - currentTime);
|
||||
// inserisco evento
|
||||
inserito = taEvList.Insert(IdxMacchina, dataOra, IdxTipo, CodArticolo, Value, MatrOpr, pallet);
|
||||
// faccio controllo per eventuale cambio stato da tab transizioni...
|
||||
checkCambiaStatoBatch(tipoInputEvento.barcode, IdxMacchina, dataOra, IdxTipo, CodArticolo, Value, MatrOpr, pallet);
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
logger.lg.scriviLog(string.Format("Errore in fase di scrittura evento con i seguenti dati:{0} macchina {1}{0} IdxTipo {2}{0} CodArticolo {3}{0} Value {4}{0} MatrOpr {5}{0} Pallet {6}{0} eventTime {7}{0} currentTime {8}{0} eccezione: {0}{9}", Environment.NewLine, IdxMacchina, IdxTipo, CodArticolo, Value, MatrOpr, pallet, eventTime, currentTime, exc), tipoLog.EXCEPTION);
|
||||
}
|
||||
// formatto output
|
||||
inputComando answ = new inputComando();
|
||||
answ.outValue = inserito.ToString();
|
||||
answ.needStatusRefresh = true;
|
||||
return answ;
|
||||
}
|
||||
/// <summary>
|
||||
/// scrive una riga di evento inviato da Barcode nel db
|
||||
/// </summary>
|
||||
/// <param name="IdxMacchina">codice macchina</param>
|
||||
/// <param name="IdxTipo">idx evento</param>
|
||||
/// <param name="CodArticolo">Codice Articolo</param>
|
||||
/// <param name="Value">valore</param>
|
||||
/// <param name="MatrOpr">matricola operatore</param>
|
||||
/// <param name="pallet">pallet (vuoto se nd)</param>
|
||||
/// <returns></returns>
|
||||
public inputComando scriviRigaEventoBarcode(string IdxMacchina, int IdxTipo, string CodArticolo, string Value, int MatrOpr, string pallet)
|
||||
{
|
||||
int inserito = 0;
|
||||
try
|
||||
{
|
||||
// verifico se esista la macchina altrimenti la creo...
|
||||
verificaIdxMacchina(IdxMacchina);
|
||||
DateTime dataOra = DateTime.Now;
|
||||
// inserisco evento
|
||||
inserito = taEvList.Insert(IdxMacchina, dataOra, IdxTipo, CodArticolo, Value, MatrOpr, pallet);
|
||||
// faccio controllo per eventuale cambio stato da tab transizioni...
|
||||
checkCambiaStatoBatch(tipoInputEvento.barcode, IdxMacchina, dataOra, IdxTipo, CodArticolo, Value, MatrOpr, pallet);
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
logger.lg.scriviLog(string.Format("Errore in fase di scrittura evento con i seguenti dati:{0} macchina {1}{0} IdxTipo {2}{0} CodArticolo {3}{0} Value {4}{0} MatrOpr {5}{0} Pallet {6}{0} eccezione: {0}{7}", Environment.NewLine, IdxMacchina, IdxTipo, CodArticolo, Value, MatrOpr, pallet, exc), tipoLog.EXCEPTION);
|
||||
}
|
||||
// formatto output
|
||||
inputComando answ = new inputComando();
|
||||
answ.outValue = inserito.ToString();
|
||||
answ.needStatusRefresh = true;
|
||||
return answ;
|
||||
}
|
||||
/// <summary>
|
||||
/// scrive una riga di evento inviato da Barcode nel db SENZA operatore e pallet (mette a 0 e "-")
|
||||
/// </summary>
|
||||
/// <param name="IdxMacchina">codice macchina</param>
|
||||
/// <param name="IdxTipo">idx evento</param>
|
||||
/// <param name="CodArticolo">Codice Articolo</param>
|
||||
/// <param name="Value">valore</param>
|
||||
/// <returns></returns>
|
||||
public inputComando scriviRigaEventoBarcode(string IdxMacchina, int IdxTipo, string CodArticolo, string Value)
|
||||
{
|
||||
int inserito = 0;
|
||||
try
|
||||
{
|
||||
// verifico se esista la macchina altrimenti la creo...
|
||||
verificaIdxMacchina(IdxMacchina);
|
||||
DateTime dataOra = DateTime.Now;
|
||||
// inserisco evento
|
||||
inserito = taEvList.Insert(IdxMacchina, dataOra, IdxTipo, CodArticolo, Value, 0, "-");
|
||||
// faccio controllo per eventuale cambio stato da tab transizioni...
|
||||
checkCambiaStatoBatch(tipoInputEvento.barcode, IdxMacchina, dataOra, IdxTipo, CodArticolo, Value, 0, "-");
|
||||
}
|
||||
catch
|
||||
{
|
||||
logger.lg.scriviLog(string.Format("Errore in fase di scrittura evento con i seguenti dati:{0} macchina {1}{0} IdxTipo {2}{0} CodArticolo {3}{0} Value {4}{0} eccezione: {0}{5}", Environment.NewLine, IdxMacchina, IdxTipo, CodArticolo, Value), tipoLog.EXCEPTION);
|
||||
}
|
||||
// formatto output
|
||||
inputComando answ = new inputComando();
|
||||
answ.outValue = inserito.ToString();
|
||||
answ.needStatusRefresh = true;
|
||||
return answ;
|
||||
}
|
||||
/// <summary>
|
||||
/// scrive una riga di stato nel diario di bordo
|
||||
/// </summary>
|
||||
/// <param name="IdxMacchina">codice macchina</param>
|
||||
/// <param name="IdxStato">idx stato</param>
|
||||
/// <param name="CodArticolo">Codice Articolo</param>
|
||||
/// <param name="Value">valore</param>
|
||||
/// <param name="MatrOpr">matricola operatore</param>
|
||||
/// <param name="pallet">pallet (vuoto se nd)</param>
|
||||
/// <param name="eventTime">data-ora dell'evento</param>
|
||||
/// <param name="currentTime">data-ora corrente dell'invio</param>
|
||||
/// <returns></returns>
|
||||
public inputComando scriviRigaStato(string IdxMacchina, int IdxStato, string CodArticolo, string Value, int MatrOpr, string pallet, DateTime eventTime, DateTime currentTime)
|
||||
{
|
||||
int inserito = 0;
|
||||
try
|
||||
{
|
||||
// verifico se esista la macchina altrimenti la creo...
|
||||
verificaIdxMacchina(IdxMacchina);
|
||||
// calcolo dataOra reale (evento + delta(ora server - ora remota)
|
||||
DateTime dataOra = eventTime.Add(DateTime.Now - currentTime);
|
||||
// inserisco la nuova riga di stato mentre il trigger aggiorna le tab...
|
||||
inserito = taDiario.Insert(IdxMacchina, dataOra, null, IdxStato, null, Value, CodArticolo, null, null, MatrOpr, pallet);
|
||||
}
|
||||
catch
|
||||
{
|
||||
logger.lg.scriviLog(string.Format("Errore in fase di scrittura stato con i seguenti dati:{0} macchina {1}{0} IdxStato {2}{0} CodArticolo {3}{0} Value {4}{0} MatrOpr {5}{0} Pallet {6}{0} eventTime {7}{0} currentTime {8}{0} eccezione: {0}{9}", Environment.NewLine, IdxMacchina, IdxStato, CodArticolo, Value, MatrOpr, pallet, eventTime, currentTime), tipoLog.EXCEPTION);
|
||||
}
|
||||
// formatto output
|
||||
inputComando answ = new inputComando();
|
||||
answ.outValue = inserito.ToString();
|
||||
answ.needStatusRefresh = true;
|
||||
return answ;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Restituisce una stringa su 2 righe con intestazione colonne e valore dell'oggetto cercato tutti delimitati da separatore
|
||||
/// </summary>
|
||||
@@ -1130,62 +381,9 @@ namespace MapoDb
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
/// <summary>
|
||||
/// restituisce una tabella con tutte le transizioni degli ingressi per una data macchina
|
||||
/// </summary>
|
||||
/// <param name="idxMacchina"></param>
|
||||
/// <returns></returns>
|
||||
public DS_applicazione.TransizioneIngressiDataTable getMatriceIngressi(string idxMacchina)
|
||||
{
|
||||
DS_applicazione.TransizioneIngressiDataTable answ;
|
||||
try
|
||||
{
|
||||
answ = DataLayer.obj.taTranIngr.getMatriceByIdxMacchina(idxMacchina);
|
||||
}
|
||||
catch
|
||||
{
|
||||
answ = null;
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
|
||||
#region scritture eventi simulati
|
||||
|
||||
public int scriviRigaEventoSimulata(DateTime dataOra, string IdxMacchina, int IdxTipo, string CodArticolo, string Value, int MatrOpr, string pallet)
|
||||
{
|
||||
// verifico se esista la macchina altrimenti la creo...
|
||||
verificaIdxMacchina(IdxMacchina);
|
||||
// inserisco evento
|
||||
int inserito = taEvList.Insert(IdxMacchina, dataOra, IdxTipo, CodArticolo, Value, MatrOpr, pallet);
|
||||
return inserito;
|
||||
}
|
||||
public int scriviRigaStatoSimulata(DateTime dataOra, string IdxMacchina, int IdxStato, string CodArticolo, string Value, int MatrOpr, string pallet)
|
||||
{
|
||||
// verifico se esista la macchina altrimenti la creo...
|
||||
verificaIdxMacchina(IdxMacchina);
|
||||
// inserisco la nuova riga di stato mentre il trigger aggiorna le tab...
|
||||
int inserito = taDiario.Insert(IdxMacchina, dataOra, null, IdxStato, null, Value, CodArticolo, null, null, MatrOpr, pallet);
|
||||
return inserito;
|
||||
}
|
||||
|
||||
public int scriviRigaEventoSimulata(DateTime dataOra, string IdxMacchina, int IdxTipo, string CodArticolo, string Value)
|
||||
{
|
||||
// verifico se esista la macchina altrimenti la creo...
|
||||
verificaIdxMacchina(IdxMacchina);
|
||||
// inserisco evento
|
||||
int inserito = taEvList.Insert(IdxMacchina, dataOra, IdxTipo, CodArticolo, Value, 0, "-");
|
||||
return inserito;
|
||||
}
|
||||
public int scriviRigaStatoSimulata(DateTime dataOra, string IdxMacchina, int IdxStato, string CodArticolo, string Value)
|
||||
{
|
||||
// verifico se esista la macchina altrimenti la creo...
|
||||
verificaIdxMacchina(IdxMacchina);
|
||||
// inserisco la nuova riga di stato mentre il trigger aggiorna le tab...
|
||||
int inserito = taDiario.Insert(IdxMacchina, dataOra, null, IdxStato, null, Value, CodArticolo, null, null, 0, "-");
|
||||
return inserito;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
/// <summary>
|
||||
/// cancella tutti gli eventi
|
||||
@@ -1269,9 +467,9 @@ namespace MapoDb
|
||||
/// </summary>
|
||||
/// <param name="comando"></param>
|
||||
/// <returns></returns>
|
||||
public inputComando isComando(string comando)
|
||||
public inputComandoMapo isComando(string comando)
|
||||
{
|
||||
inputComando answ = new inputComando();
|
||||
inputComandoMapo answ = new inputComandoMapo();
|
||||
answ.isValid = false;
|
||||
DS_applicazione.TransizioneEventiDataTable tabTransEv = new DS_applicazione.TransizioneEventiDataTable();
|
||||
try
|
||||
@@ -1513,62 +711,8 @@ namespace MapoDb
|
||||
return cognNome;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// restituisce il TempoCiclo effettivo (tecnico) della macchina
|
||||
/// </summary>
|
||||
/// <param name="idxMacchina"></param>
|
||||
/// <returns></returns>
|
||||
public decimal getTcEffMacchina(string idxMacchina)
|
||||
{
|
||||
decimal tc = 0;
|
||||
try
|
||||
{
|
||||
DS_ProdTempi.stp_repDonati_getDatiProdMacchinaPeriodoRow riga = DataLayer.obj.taDatiProdMacchPer.GetData(idxMacchina, DateTime.Now.AddMinutes(-30), DateTime.Now)[0];
|
||||
if (riga.TCEffRT > 0)
|
||||
{
|
||||
tc = riga.TCEffRT;
|
||||
}
|
||||
else
|
||||
{
|
||||
tc = riga.TCAssegnato;
|
||||
}
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
// imposto a 99'TC
|
||||
if (tc == 0)
|
||||
{
|
||||
tc = 99.9M;
|
||||
// scrivo log per indicare mancato caricamento dati tc dichiarato e conseguente errore sul timer - 2/11/2012 EN&CV
|
||||
logger.lg.scriviLog(string.Format("Impostato TC Tempo Ciclo a 99' (99.9M) causa mancato inserimento tempo ciclo dichiarato"));
|
||||
}
|
||||
return tc;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// rigenera la tab diario di bordo x la macchian richiesta nell'intervallo definito
|
||||
/// </summary>
|
||||
/// <param name="IdxMacchina"></param>
|
||||
/// <param name="dataInizio"></param>
|
||||
/// <param name="dataFine"></param>
|
||||
public void rigeneraDiarioDiBordo(string IdxMacchina, DateTime dataInizio, DateTime dataFine)
|
||||
{
|
||||
// elimino da diario di bordo i valori nell'intervallo...
|
||||
taDiario.DeleteByMacchinaPeriodo(IdxMacchina, dataInizio, dataFine);
|
||||
// seleziono le righe eventi interessate e le processo 1 ad 1...
|
||||
DS_applicazione.EventListDataTable tabEventi = taEvList.GetByMacchinaPeriodo(IdxMacchina, dataInizio, dataFine);
|
||||
foreach (DS_applicazione.EventListRow rigaEv in tabEventi)
|
||||
{
|
||||
if (rigaEv.IdxTipo <= 12) // è barcode
|
||||
{
|
||||
checkCambiaStatoBatch(tipoInputEvento.barcode, IdxMacchina, rigaEv.InizioStato, rigaEv.IdxTipo, rigaEv.CodArticolo, rigaEv.Value, rigaEv.MatrOpr, rigaEv.pallet);
|
||||
}
|
||||
else // è hw
|
||||
{
|
||||
checkCambiaStatoBatch(tipoInputEvento.hw, IdxMacchina, rigaEv.InizioStato, rigaEv.IdxTipo, rigaEv.CodArticolo, rigaEv.Value, rigaEv.MatrOpr, rigaEv.pallet);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// restituisce la riga di transizione del comando...
|
||||
/// </summary>
|
||||
@@ -1597,13 +741,13 @@ namespace MapoDb
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// effettua verifica del codice barcode e restituisce un oggetto inputComando che indica come proseguire
|
||||
/// effettua verifica del codice barcode e restituisce un oggetto inputComandoMapo che indica come proseguire
|
||||
/// </summary>
|
||||
/// <param name="barcodeValue"></param>
|
||||
/// <returns></returns>
|
||||
public inputComando tryBarcode(string barcodeValue)
|
||||
public inputComandoMapo tryBarcode(string barcodeValue)
|
||||
{
|
||||
inputComando answ = new inputComando();
|
||||
inputComandoMapo answ = new inputComandoMapo();
|
||||
// controllo...
|
||||
|
||||
return answ;
|
||||
|
||||
@@ -47,10 +47,11 @@ public class reportExporter
|
||||
catch
|
||||
{ }
|
||||
DataTable tab = new DataTable();
|
||||
MapoDb.DataLayer DataLayerObj = new MapoDb.DataLayer();
|
||||
switch (tipoReport)
|
||||
{
|
||||
case reportRichiesto.SchedaODL:
|
||||
tab = (DataTable)MapoDb.DataLayer.obj.taODL.getByIdx(idxOdl, false);
|
||||
tab = (DataTable)DataLayerObj.taODL.getByIdx(idxOdl, false);
|
||||
break;
|
||||
//case reportRichiesto.RichiestaIntervento:
|
||||
// tab = (DataTable)TA_app.obj.taInterventiMtz.getByIdx(Convert.ToInt32(idxObj));
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using Microsoft.Reporting.WinForms;
|
||||
using MapoDb;
|
||||
using Microsoft.Reporting.WinForms;
|
||||
using SteamWare;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
@@ -100,6 +101,7 @@ public class reportPrinter
|
||||
/// <returns>tabella dati</returns>
|
||||
private DataTable caricaDati(reportRichiesto tipoReport, string idxObj)
|
||||
{
|
||||
DataLayer DataLayerObj = new DataLayer();
|
||||
// calcolo idxODL
|
||||
int idxOdl = 0;
|
||||
try
|
||||
@@ -112,7 +114,7 @@ public class reportPrinter
|
||||
switch (tipoReport)
|
||||
{
|
||||
case reportRichiesto.SchedaODL:
|
||||
tab = (DataTable)MapoDb.DataLayer.obj.taODL.getByIdx(idxOdl, false);
|
||||
tab = (DataTable)DataLayerObj.taODL.getByIdx(idxOdl, false);
|
||||
break;
|
||||
//case reportRichiesto.RichiestaIntervento:
|
||||
// tab = (DataTable)TA_app.obj.taInterventiMtz.getByIdx(Convert.ToInt32(idxObj));
|
||||
|
||||
+10
-5
@@ -343,15 +343,17 @@ public class resoconti
|
||||
int answ = 0;
|
||||
try
|
||||
{
|
||||
DataLayer DataLayerObj = new DataLayer();
|
||||
if (memLayer.ML.CRB("RedEnab"))
|
||||
{
|
||||
// recupero SE IMPIEGATO REDIS i valori del Dictionary della macchina...
|
||||
Dictionary<string, string> datiMacc = DataLayer.mDatiMacchine(idx);
|
||||
Dictionary<string, string> datiMacc = DataLayerObj.mDatiMacchine(idx);
|
||||
answ = Convert.ToInt32(datiMacc["IdxStato"]);
|
||||
}
|
||||
if (answ == 0)
|
||||
{
|
||||
MapoDb.DS_ProdTempi.stp_repDonati_getLastStatoDurataMacchinaRow riga = MapoDb.DataLayer.obj.taDatiStatoMacch.GetData(idx, 0)[0];
|
||||
|
||||
DS_ProdTempi.stp_repDonati_getLastStatoDurataMacchinaRow riga = DataLayerObj.taDatiStatoMacch.GetData(idx, 0)[0];
|
||||
answ = riga.idxStato;
|
||||
}
|
||||
}
|
||||
@@ -651,7 +653,8 @@ public class resoconti
|
||||
else
|
||||
{
|
||||
// ciclo su tutte le macchine
|
||||
var elMacchine = DataLayer.obj.taSelMacc.getAttive();
|
||||
DataLayer DataLayerObj = new DataLayer();
|
||||
var elMacchine = DataLayerObj.taSelMacc.getAttive();
|
||||
foreach (var item in elMacchine)
|
||||
{
|
||||
sequenza.Add(new visjsDsGroups
|
||||
@@ -683,7 +686,8 @@ public class resoconti
|
||||
{
|
||||
int index = 0;
|
||||
// ciclo su tutte le macchine
|
||||
var elMacchine = DataLayer.obj.taSelMacc.getAttive();
|
||||
DataLayer DataLayerObj = new DataLayer();
|
||||
var elMacchine = DataLayerObj.taSelMacc.getAttive();
|
||||
foreach (var item in elMacchine)
|
||||
{
|
||||
sequenza.AddRange(seqSingleMachine(item.value, _intervallo, numSplit, index));
|
||||
@@ -915,7 +919,8 @@ public class resoconti
|
||||
_serie.palletChange = false;
|
||||
try
|
||||
{
|
||||
_serie.palletChange = MapoDb.DataLayer.obj.taDatiMacchine.getByIdx(idxMacchina)[0].palletChange;
|
||||
DataLayer DataLayerObj = new DataLayer();
|
||||
_serie.palletChange = DataLayerObj.taDatiMacchine.getByIdx(idxMacchina)[0].palletChange;
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
|
||||
+5
-3
@@ -10,11 +10,13 @@ public class selData
|
||||
/// Durata standard cache info
|
||||
/// </summary>
|
||||
protected int cacheDuration = 5;
|
||||
protected DataLayer DataLayerObj;
|
||||
/// <summary>
|
||||
/// classe accesso tabelle selettori
|
||||
/// </summary>
|
||||
public selData()
|
||||
{
|
||||
DataLayerObj = new DataLayer();
|
||||
}
|
||||
|
||||
public static selData mng = new selData();
|
||||
@@ -27,7 +29,7 @@ public class selData
|
||||
/// <returns></returns>
|
||||
public DS_ProdTempi.AnagArticoliDataTable getSelAllArticoli()
|
||||
{
|
||||
return DataLayer.obj.taAnagArt.GetData();
|
||||
return DataLayerObj.taAnagArt.GetData();
|
||||
}
|
||||
/// <summary>
|
||||
/// Riga dettaglio singolo articolo
|
||||
@@ -62,7 +64,7 @@ public class selData
|
||||
// se non trovo --> DB!
|
||||
try
|
||||
{
|
||||
DS_ProdTempi.AnagArticoliDataTable tab = DataLayer.obj.taAnagArt.getByCod(codArt);
|
||||
DS_ProdTempi.AnagArticoliDataTable tab = DataLayerObj.taAnagArt.getByCod(codArt);
|
||||
if (tab.Rows.Count > 0)
|
||||
{
|
||||
answ = tab[0];
|
||||
@@ -108,7 +110,7 @@ public class selData
|
||||
// se non trovo --> DB!
|
||||
try
|
||||
{
|
||||
DS_applicazione.StatoMacchineDataTable tab = DataLayer.obj.taStatoMacchine.GetDataByIdxMacchina(idxMacc);
|
||||
DS_applicazione.StatoMacchineDataTable tab = DataLayerObj.taStatoMacchine.GetDataByIdxMacchina(idxMacc);
|
||||
if (tab.Rows.Count > 0)
|
||||
{
|
||||
answ = tab[0];
|
||||
|
||||
@@ -1,6 +1,15 @@
|
||||
namespace MapoSDK
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// tipologia evento inviato
|
||||
/// </summary>
|
||||
public enum tipoInputEvento
|
||||
{
|
||||
barcode,
|
||||
hw
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Tipologia di elaborazione/funzione da applicare a VC
|
||||
/// </summary>
|
||||
|
||||
@@ -675,6 +675,60 @@ namespace MapoSDK
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
#region oggetti provenienti da MapoDb
|
||||
|
||||
/// <summary>
|
||||
/// nuovo stato ingressi e eventuale evento da inviare
|
||||
/// </summary>
|
||||
public struct hwMachineState
|
||||
{
|
||||
public int next_IdxMicroStato;
|
||||
public int IdxTipoEvento;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Struttura gestione comandi di input
|
||||
/// </summary>
|
||||
public struct inputComandoMapo
|
||||
{
|
||||
/// <summary>
|
||||
/// input comando valido si/no
|
||||
/// </summary>
|
||||
public bool isValid;
|
||||
/// <summary>
|
||||
/// testo da mostrare all'utente
|
||||
/// </summary>
|
||||
public string text2show;
|
||||
/// <summary>
|
||||
/// idx evento associato al comando
|
||||
/// </summary>
|
||||
public int idxTipoEvento;
|
||||
/// <summary>
|
||||
/// input precedente
|
||||
/// </summary>
|
||||
public string precInput;
|
||||
/// <summary>
|
||||
/// descrizione comando
|
||||
/// </summary>
|
||||
public string descrComando;
|
||||
/// <summary>
|
||||
/// refresh stato macchina encessario si/no
|
||||
/// </summary>
|
||||
public bool needStatusRefresh;
|
||||
/// <summary>
|
||||
/// lista del nome dei WebBrowserBox e delle relative url, nel formato {0}##{1} {0}=nome WebBrowserBox (es. box01), {1}=url relativo (es. http://server/MoonPro/Produzione.aspx?idxMacchina=99)
|
||||
/// </summary>
|
||||
public string[] wBrowsBoxUrls;
|
||||
/// <summary>
|
||||
/// valore di output dal comando
|
||||
/// </summary>
|
||||
public string outValue;
|
||||
}
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
#if false
|
||||
/// <summary>
|
||||
/// Classe definizione parametri singolo ordine produzione
|
||||
|
||||
Reference in New Issue
Block a user