Fix visualizazione condizionale DISEGNI e controlli(/warning in testa)
This commit is contained in:
@@ -30,25 +30,28 @@ namespace MoonProTablet.WebUserControls
|
||||
{
|
||||
// default è ND...
|
||||
bool answ = false;
|
||||
// recupero da anagrafica articoli...
|
||||
try
|
||||
// SE abilitata gestione controlli...
|
||||
if (memLayer.ML.cdvb("enableDisegno"))
|
||||
{
|
||||
DS_ProdTempi.AnagArticoliDataTable tab = DataLayer.obj.taAnagArt.getByCod(_codArticolo.ToString());
|
||||
if (tab.Rows.Count > 0)
|
||||
// recupero da anagrafica articoli...
|
||||
try
|
||||
{
|
||||
//DS_ProdTempi.AnagArticoliRow riga = DataLayer.obj.taAnagArt.getByCod(_codArticolo.ToString())[0];
|
||||
DS_ProdTempi.AnagArticoliRow riga = tab[0];
|
||||
answ = (riga.Disegno != "");
|
||||
DS_ProdTempi.AnagArticoliDataTable tab = DataLayer.obj.taAnagArt.getByCod(_codArticolo.ToString());
|
||||
if (tab.Rows.Count > 0)
|
||||
{
|
||||
DS_ProdTempi.AnagArticoliRow riga = tab[0];
|
||||
answ = (riga.Disegno != "");
|
||||
}
|
||||
else
|
||||
{
|
||||
logger.lg.scriviLog(string.Format("Attenzione! nessuna informazione trovata per l'articolo {0}", _codArticolo), tipoLog.WARNING);
|
||||
}
|
||||
}
|
||||
else
|
||||
catch (Exception exc)
|
||||
{
|
||||
logger.lg.scriviLog(string.Format("Attenzione! nessuna informazione trovata per l'articolo {0}", _codArticolo), tipoLog.WARNING);
|
||||
logger.lg.scriviLog(string.Format("Errore in ricostruzione URL disegno:{0}{1}", Environment.NewLine, exc), tipoLog.EXCEPTION);
|
||||
}
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
logger.lg.scriviLog(string.Format("Errore in ricostruzione URL disegno:{0}{1}", Environment.NewLine, exc), tipoLog.EXCEPTION);
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
/// <summary>
|
||||
@@ -164,22 +167,26 @@ namespace MoonProTablet.WebUserControls
|
||||
public bool showReqControl(object IdxMacchina)
|
||||
{
|
||||
bool answ = false;
|
||||
int intervalloControlli = memLayer.ML.CRI("intervalloControlli");
|
||||
// cerco ultimo controllo fatto
|
||||
DateTime lastControl = DateTime.Now.AddYears(-1);
|
||||
try
|
||||
// SE abilitata gestione controlli...
|
||||
if (memLayer.ML.cdvb("enableControlli"))
|
||||
{
|
||||
var tab = DataLayer.obj.taRC.getLast(idxMacchina);
|
||||
if (tab.Count > 0)
|
||||
int intervalloControlli = memLayer.ML.CRI("intervalloControlli");
|
||||
// cerco ultimo controllo fatto
|
||||
DateTime lastControl = DateTime.Now.AddYears(-1);
|
||||
try
|
||||
{
|
||||
lastControl = tab[0].DataOra;
|
||||
var tab = DataLayer.obj.taRC.getLast(idxMacchina);
|
||||
if (tab.Count > 0)
|
||||
{
|
||||
lastControl = tab[0].DataOra;
|
||||
}
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
if (Math.Abs(DateTime.Now.Subtract(lastControl).TotalMinutes) >= intervalloControlli)
|
||||
{
|
||||
answ = true;
|
||||
}
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
if (Math.Abs(DateTime.Now.Subtract(lastControl).TotalMinutes) >= intervalloControlli)
|
||||
{
|
||||
answ = true;
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user