Merge tag 'UpdatereportStatiCommesse01' into develop

Update x export commesse in log stati
This commit is contained in:
Samuele Locatelli
2023-05-03 15:49:24 +02:00
4 changed files with 168 additions and 152 deletions
+1
View File
@@ -1,5 +1,6 @@
using MapoDb;
using SteamWare;
using System;
namespace MP_SITE
{
+2 -2
View File
@@ -12,7 +12,7 @@
<asp:Repeater runat="server" ID="dtListCols" DataSourceID="odsCols">
<ItemTemplate>
<div class='<%# Eval("css") %>'>
<uc1:mod_statoMacchina ID="Mod_statoMacchina01" runat="server" IdxMacchina='<%# Eval("IdxMacchina") %>' />
<uc1:mod_statoMacchina ID="Mod_statoMacchina01" runat="server" IdxMacchina='<%# Eval("IdxMacchina") %>' />
</div>
</ItemTemplate>
</asp:Repeater>
@@ -27,4 +27,4 @@
</asp:Repeater>
<asp:ObjectDataSource runat="server" ID="odsRows" OldValuesParameterFormatString="original_{0}" SelectMethod="GetData" TypeName="MapoDb.DS_applicazioneTableAdapters.RigheMacchineTableAdapter" FilterExpression="RowNum > 0"></asp:ObjectDataSource>
</div>
</asp:Content>
</asp:Content>
+15
View File
@@ -5,6 +5,19 @@ namespace MP_SITE
{
public partial class MappaStato : BasePage
{
#region Public Methods
public override void Dispose()
{
repRows.Dispose();
odsRows.Dispose();
base.Dispose();
}
#endregion Public Methods
#region Protected Methods
protected void lnkCambiaModo_Click(object sender, EventArgs e)
{
// passa alla pagina richiesta...
@@ -15,5 +28,7 @@ namespace MP_SITE
protected void Page_Load(object sender, EventArgs e)
{
}
#endregion Protected Methods
}
}
+150 -150
View File
@@ -8,49 +8,6 @@ namespace MP_SITE.WebUserControls
{
public partial class mod_statoMacchina : System.Web.UI.UserControl
{
#region Private Fields
/// <summary>
/// Oggetto datalayer specifico
/// </summary>
private DataLayer DataLayerObj = new DataLayer();
#endregion Private Fields
#region Protected Fields
protected bool _linkActive = true;
/// <summary>
/// posizione macchina nella tabella
/// </summary>
protected string _locazione;
protected DS_applicazione.AnagraficaStatiDataTable tabAnagStati;
protected DS_ProdTempi.MappaStatoExplDataTable tabMSE;
#endregion Protected Fields
#region Protected Properties
/// <summary>
/// seriale associato alla macchina da controllare
/// </summary>
protected string _IdxMacchina
{
get
{
return hfIdxMacchina.Value;
}
set
{
hfIdxMacchina.Value = value.Trim();
}
}
#endregion Protected Properties
#region Public Properties
/// <summary>
@@ -119,6 +76,154 @@ namespace MP_SITE.WebUserControls
#endregion Public Properties
#region Public Methods
public override void Dispose()
{
base.Dispose();
}
/// <summary>
/// aggiorna controllo
/// </summary>
public void updateMe()
{
// SE E SOLO SE ho una macchina e/o locazione...
if (!string.IsNullOrEmpty(IdxMacchina) && !IdxMacchina.Contains("#") && (locazione != "00" && !string.IsNullOrEmpty(locazione)))
{
// effettua update visualizzazione
try
{
retrieveData();
updateLayout();
updateText();
updateImg();
updateHL();
// controllo se link attivo...
if (!_linkActive)
{
valMacchina.Enabled = false;
}
divSegnaposto.Visible = false;
}
catch (Exception exc)
{
logger.lg.scriviLog($"Eccezione in fase popolamento statoMacchina per IdxMacchina {IdxMacchina} - locazione {locazione}{Environment.NewLine}{exc}", tipoLog.EXCEPTION);
}
}
else
{
pnlMacchina.Visible = false;
}
}
#endregion Public Methods
#region Protected Fields
protected bool _linkActive = true;
/// <summary>
/// posizione macchina nella tabella
/// </summary>
protected string _locazione;
protected DS_applicazione.AnagraficaStatiDataTable tabAnagStati;
protected DS_ProdTempi.MappaStatoExplDataTable tabMSE;
#endregion Protected Fields
#region Protected Properties
/// <summary>
/// seriale associato alla macchina da controllare
/// </summary>
protected string _IdxMacchina
{
get
{
return hfIdxMacchina.Value;
}
set
{
hfIdxMacchina.Value = value.Trim();
}
}
#endregion Protected Properties
#region Protected Methods
/// <summary>
/// rimanda alla pagina di dettaglio della macchina scelta
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void lnkMacchina_Click(object sender, EventArgs e)
{
if (linkActive)
{
memLayer.ML.setSessionVal("IdxMacchina", IdxMacchina);
Response.Redirect(string.Format("~/DettaglioMacchina?IdxMacchina={0}", IdxMacchina));
}
}
/// <summary>
/// caricamento pagina
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void Page_Load(object sender, EventArgs e)
{
//updateMe();
}
/// <summary>
/// metto a posto l'immagine
/// </summary>
protected void updateImg()
{
string urlMacchina;
if (_IdxMacchina != "nd")
{
urlMacchina = $"~/images/macchine/{resoconti.mngr.urlMacchina(IdxMacchina)}";
if (urlMacchina == "thumb_")
{
urlMacchina = "~/images/empty.png";
}
else
{
imgThumb.ToolTip = resoconti.mngr.nomeMacchina(IdxMacchina);
}
string fullPath = Server.MapPath(urlMacchina);
if (!File.Exists(fullPath))
{
// metto default Steamware
urlMacchina = "~/images/macchine/Steamware.png";
}
imgThumb.ImageUrl = urlMacchina;
}
else
{
urlMacchina = "~/images/empty.png";
imgThumb.ImageUrl = urlMacchina;
}
}
#endregion Protected Methods
#region Private Fields
/// <summary>
/// Oggetto datalayer specifico
/// </summary>
private DataLayer DataLayerObj = new DataLayer();
#endregion Private Fields
#region Private Methods
/// <summary>
@@ -131,16 +236,13 @@ namespace MP_SITE.WebUserControls
string hashKeyAS = memLayer.ML.redHash("Tab:AnagStati");
string serVal = "";
if (memLayer.ML.redKeyPresent(hashKeyMSE))
//if (memLayer.ML.redHashPresent(hashKeyMSE))
{
serVal = memLayer.ML.getRSV(hashKeyMSE);
tabMSE = JsonConvert.DeserializeObject<DS_ProdTempi.MappaStatoExplDataTable>(serVal);
//tabMSE = (DS_ProdTempi.MappaStatoExplDataTable)memLayer.ML.deserializeVal(serVal);
serVal = memLayer.ML.getRSV(hashKeyAS);
tabAnagStati = JsonConvert.DeserializeObject<DS_applicazione.AnagraficaStatiDataTable>(serVal);
//tabAnagStati = (DS_applicazione.AnagraficaStatiDataTable)memLayer.ML.deserializeVal(serVal);
}
else
{
@@ -228,9 +330,8 @@ namespace MP_SITE.WebUserControls
lblStato.Text = "Stato";
lblProd.Text = "T.Ciclo"; // era OEE
lblDurata.Text = "Durata";
// 2018.02.05 cambio x fix nuovi impianti
// valMacchina.Text = tabMacchine.FindByIdxMacchina(IdxMacchina).Nome;
// valCodArticolo.Text = tabStatoMacchine.FindByIdxMacchina(IdxMacchina).CodArticolo;
// 2018.02.05 cambio x fix nuovi impianti valMacchina.Text =
// tabMacchine.FindByIdxMacchina(IdxMacchina).Nome; valCodArticolo.Text = tabStatoMacchine.FindByIdxMacchina(IdxMacchina).CodArticolo;
// leggo valori da MSE...
valMacchina.Text = tabMSE[0].Nome;
@@ -362,106 +463,5 @@ namespace MP_SITE.WebUserControls
}
#endregion Private Methods
#region Protected Methods
/// <summary>
/// rimanda alla pagina di dettaglio della macchina scelta
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void lnkMacchina_Click(object sender, EventArgs e)
{
if (linkActive)
{
memLayer.ML.setSessionVal("IdxMacchina", IdxMacchina);
Response.Redirect(string.Format("~/DettaglioMacchina?IdxMacchina={0}", IdxMacchina));
}
}
/// <summary>
/// caricamento pagina
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void Page_Load(object sender, EventArgs e)
{
//updateMe();
}
/// <summary>
/// metto a posto l'immagine
/// </summary>
protected void updateImg()
{
string urlMacchina;
if (_IdxMacchina != "nd")
{
urlMacchina = $"~/images/macchine/{resoconti.mngr.urlMacchina(IdxMacchina)}";
if (urlMacchina == "thumb_")
{
urlMacchina = "~/images/empty.png";
}
else
{
imgThumb.ToolTip = resoconti.mngr.nomeMacchina(IdxMacchina);
}
string fullPath = Server.MapPath(urlMacchina);
if (!File.Exists(fullPath))
{
// metto default Steamware
urlMacchina = "~/images/macchine/Steamware.png";
}
imgThumb.ImageUrl = urlMacchina;
}
else
{
urlMacchina = "~/images/empty.png";
imgThumb.ImageUrl = urlMacchina;
}
}
#endregion Protected Methods
#region Public Methods
/// <summary>
/// aggiorna controllo
/// </summary>
public void updateMe()
{
//SE E SOLO SE ho una macchina e/o locazione...
if (!string.IsNullOrEmpty(IdxMacchina) && !IdxMacchina.Contains("#") && (locazione != "00"))
{
// effettua update visualizzazione
try
{
retrieveData();
updateLayout();
updateText();
updateImg();
updateHL();
// controllo se link attivo...
if (!_linkActive)
{
valMacchina.Enabled = false;
}
//logger.lg.scriviLog(string.Format("Retrieve: {0}", DateTime.Now.Subtract(tick).Milliseconds), tipoLog.INFO);
divSegnaposto.Visible = false;
}
catch (Exception exc)
{
logger.lg.scriviLog($"Eccezione in fase popolamento statoMacchina per IdxMacchina {IdxMacchina} - locazione {locazione}{Environment.NewLine}{exc}", tipoLog.EXCEPTION);
}
}
else
{
pnlMacchina.Visible = false;
}
}
#endregion Public Methods
}
}