Merge branch 'release/UpdatereportStatiCommesse01'
This commit is contained in:
@@ -17,7 +17,7 @@ namespace MP_SITE
|
||||
{
|
||||
get
|
||||
{
|
||||
string idxMacchina = "1";
|
||||
string idxMacchina = "0";
|
||||
try
|
||||
{
|
||||
idxMacchina = memLayer.ML.StringSessionObj("IdxMacchina");
|
||||
@@ -32,6 +32,49 @@ namespace MP_SITE
|
||||
memLayer.ML.setSessionVal("IdxMacchina", value);
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// inizio periodo da mostrare
|
||||
/// </summary>
|
||||
public DateTime dtFrom
|
||||
{
|
||||
get
|
||||
{
|
||||
DateTime dtRif = DateTime.Now.AddDays(-30);
|
||||
try
|
||||
{
|
||||
string rawDate = memLayer.ML.StringSessionObj("_inizio)");
|
||||
if (!string.IsNullOrEmpty(rawDate))
|
||||
{
|
||||
DateTime.TryParse(rawDate, out dtRif);
|
||||
}
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
return dtRif;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// fine periodo da mostrare
|
||||
/// </summary>
|
||||
public DateTime dtTo
|
||||
{
|
||||
get
|
||||
{
|
||||
DateTime dtRif = DateTime.Now;
|
||||
try
|
||||
{
|
||||
string rawDate = memLayer.ML.StringSessionObj("_fine)");
|
||||
if (!string.IsNullOrEmpty(rawDate))
|
||||
{
|
||||
DateTime.TryParse(rawDate, out dtRif);
|
||||
}
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
return dtRif;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// restituisce stringa formattata in HH:mm
|
||||
@@ -43,10 +86,6 @@ namespace MP_SITE
|
||||
string answ = "";
|
||||
if (durataMinuti != null)
|
||||
{
|
||||
//string durataFormattata = "";
|
||||
//int ore = (int)Math.Floor(((double)durataMinuti) / 60);
|
||||
//durataFormattata = string.Format("{0}h:{1:#.0}min", ore, (double)durataMinuti - 60 * ore);
|
||||
//return durataFormattata;
|
||||
answ = durataMinuti.ToString();
|
||||
}
|
||||
return answ;
|
||||
@@ -76,6 +115,17 @@ namespace MP_SITE
|
||||
}
|
||||
return _resoconti.oprDaMatr(matr);
|
||||
}
|
||||
/// <summary>
|
||||
/// Recupera commessa al momento indicato
|
||||
/// </summary>
|
||||
/// <param name="_dtRif"></param>
|
||||
/// <returns></returns>
|
||||
public string commessaCorr(object _dtRif)
|
||||
{
|
||||
DateTime dtRif = DateTime.Now;
|
||||
DateTime.TryParse($"{_dtRif}", out dtRif);
|
||||
return _resoconti.commessaAttiva(idxMacchina, dtFrom, dtTo, dtRif);
|
||||
}
|
||||
|
||||
public string statoDaIdx(object idx)
|
||||
{
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using MapoDb;
|
||||
using SteamWare;
|
||||
using System;
|
||||
|
||||
namespace MP_SITE
|
||||
{
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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
|
||||
}
|
||||
}
|
||||
@@ -28,6 +28,11 @@
|
||||
<asp:Label ID="lblOperatore" runat="server" Text='<%# operatoreDaMatr(Eval("MatrOpr")) %>' />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Commessa">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="lblCommessa" runat="server" Text='<%# commessaCorr(Eval("InizioStato")) %>' />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
<asp:ObjectDataSource ID="ods_DiarioDiBordo" runat="server" OldValuesParameterFormatString="Original_{0}"
|
||||
|
||||
+11
-11
@@ -1,10 +1,10 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <generato automaticamente>
|
||||
// Codice generato da uno strumento.
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
//
|
||||
// Le modifiche a questo file possono causare un comportamento non corretto e verranno perse se
|
||||
// il codice viene rigenerato.
|
||||
// </generato automaticamente>
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace MP_SITE
|
||||
@@ -15,20 +15,20 @@ namespace MP_SITE
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// Controllo gvStati.
|
||||
/// gvStati control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Campo generato automaticamente.
|
||||
/// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.GridView gvStati;
|
||||
|
||||
/// <summary>
|
||||
/// Controllo ods_DiarioDiBordo.
|
||||
/// ods_DiarioDiBordo control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Campo generato automaticamente.
|
||||
/// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.ObjectDataSource ods_DiarioDiBordo;
|
||||
}
|
||||
|
||||
@@ -27,6 +27,11 @@
|
||||
<asp:Label ID="lblOperatore" runat="server" Text='<%# operatoreDaMatr(Eval("MatrOpr")) %>' />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Commessa">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="lblCommessa" runat="server" Text='<%# commessaCorr(Eval("InizioStato")) %>' />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
<asp:ObjectDataSource ID="ods_DiarioDiBordo" runat="server" OldValuesParameterFormatString="Original_{0}"
|
||||
|
||||
@@ -1,12 +1,11 @@
|
||||
using SteamWare;
|
||||
using System;
|
||||
using System.Web;
|
||||
using System.Web.UI;
|
||||
|
||||
namespace MP_SITE
|
||||
{
|
||||
public partial class excelExportStati : BaseExportPage
|
||||
{
|
||||
#region Internal Methods
|
||||
|
||||
internal override void aggiornamento()
|
||||
{
|
||||
gvStati.AllowPaging = false;
|
||||
@@ -17,5 +16,7 @@ namespace MP_SITE
|
||||
{
|
||||
gvStati.RenderControl(htmlWrite);
|
||||
}
|
||||
|
||||
#endregion Internal Methods
|
||||
}
|
||||
}
|
||||
@@ -1,46 +1,49 @@
|
||||
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="mod_logStati.ascx.cs" Inherits="MP_SITE.WebUserControls.mod_logStati" %>
|
||||
|
||||
<asp:GridView ID="grView" runat="server" AllowPaging="True" AllowSorting="True" AutoGenerateColumns="False" DataKeyNames="IdxMacchina,InizioStato" DataSourceID="ods" OnSorted="reportUpdt" OnPageIndexChanged="reportUpdt" CssClass="table table-striped table-sm">
|
||||
<HeaderStyle CssClass="table-info" />
|
||||
<PagerStyle CssClass="active GridPager" />
|
||||
<PagerSettings Mode="NumericFirstLast" />
|
||||
<SelectedRowStyle CssClass="info" />
|
||||
<Columns>
|
||||
<asp:BoundField DataField="InizioStato" DataFormatString="{0:dd/MM/yy HH:mm:ss}"
|
||||
HeaderText="Inizio Stato" HtmlEncode="False" ReadOnly="True" SortExpression="InizioStato" />
|
||||
<asp:TemplateField HeaderText="Stato" SortExpression="IdxStato">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="lblStato" runat="server" Text='<%# resoconti.mngr.statoDaIdx(Convert.ToInt32(Eval("IdxStato"))) %>' />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Minuti" SortExpression="DurataMinuti">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="lblDurata" runat="server" Text='<%# utility.durataEventoHMS((double)Eval("DurataMinuti")) %>' />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:BoundField DataField="CodArticolo" HeaderText="Articolo" SortExpression="CodArticolo" />
|
||||
<asp:BoundField DataField="pallet" HeaderText="Pallet" SortExpression="pallet" Visible="False" />
|
||||
<asp:TemplateField HeaderText="Operatore" SortExpression="MatrOpr">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="lblOperatore" runat="server" Text='<%# resoconti.mngr.oprDaMatr(Convert.ToInt32(Eval("MatrOpr"))) %>' />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
</Columns>
|
||||
<HeaderStyle CssClass="table-info" />
|
||||
<PagerStyle CssClass="active GridPager" />
|
||||
<PagerSettings Mode="NumericFirstLast" />
|
||||
<SelectedRowStyle CssClass="info" />
|
||||
<Columns>
|
||||
<asp:BoundField DataField="InizioStato" DataFormatString="{0:dd/MM/yy HH:mm:ss}"
|
||||
HeaderText="Inizio Stato" HtmlEncode="False" ReadOnly="True" SortExpression="InizioStato" />
|
||||
<asp:TemplateField HeaderText="Stato" SortExpression="IdxStato">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="lblStato" runat="server" Text='<%# resoconti.mngr.statoDaIdx(Convert.ToInt32(Eval("IdxStato"))) %>' />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Minuti" SortExpression="DurataMinuti">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="lblDurata" runat="server" Text='<%# utility.durataEventoHMS((double)Eval("DurataMinuti")) %>' />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:BoundField DataField="CodArticolo" HeaderText="Articolo" SortExpression="CodArticolo" />
|
||||
<asp:BoundField DataField="pallet" HeaderText="Pallet" SortExpression="pallet" Visible="False" />
|
||||
<asp:TemplateField HeaderText="Operatore" SortExpression="MatrOpr">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="lblOperatore" runat="server" Text='<%# resoconti.mngr.oprDaMatr(Convert.ToInt32(Eval("MatrOpr"))) %>' />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Commessa">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="lblCommessa" runat="server" Text='<%# commessaCorr(Eval("InizioStato")) %>' />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
<asp:ObjectDataSource ID="ods" runat="server" OldValuesParameterFormatString="Original_{0}"
|
||||
SelectMethod="GetDataFiltered" TypeName="MapoDb.DS_applicazioneTableAdapters.DiarioDiBordoTableAdapter">
|
||||
<SelectParameters>
|
||||
<asp:SessionParameter DefaultValue="1" Name="IdxMacchina" SessionField="IdxMacchina"
|
||||
Type="String" />
|
||||
<asp:SessionParameter DefaultValue="DateTime.Now.AddWeeks(-1)" Name="inizio" SessionField="_inizio"
|
||||
Type="DateTime" />
|
||||
<asp:SessionParameter DefaultValue="DateTime.Now" Name="fine" SessionField="_fine"
|
||||
Type="DateTime" />
|
||||
<asp:SessionParameter DefaultValue="0" Name="durataMin" SessionField="_durataMin"
|
||||
Type="Double" />
|
||||
</SelectParameters>
|
||||
SelectMethod="GetDataFiltered" TypeName="MapoDb.DS_applicazioneTableAdapters.DiarioDiBordoTableAdapter">
|
||||
<SelectParameters>
|
||||
<asp:SessionParameter DefaultValue="1" Name="IdxMacchina" SessionField="IdxMacchina"
|
||||
Type="String" />
|
||||
<asp:SessionParameter DefaultValue="DateTime.Now.AddWeeks(-1)" Name="inizio" SessionField="_inizio"
|
||||
Type="DateTime" />
|
||||
<asp:SessionParameter DefaultValue="DateTime.Now" Name="fine" SessionField="_fine"
|
||||
Type="DateTime" />
|
||||
<asp:SessionParameter DefaultValue="0" Name="durataMin" SessionField="_durataMin"
|
||||
Type="Double" />
|
||||
</SelectParameters>
|
||||
</asp:ObjectDataSource>
|
||||
<asp:HyperLink ID="HyperLink1" runat="server" AccessKey="X" Target="_blank" NavigateUrl="~/excelExportStati.aspx">Excel Stati - solo macchina corrente</asp:HyperLink>
|
||||
-
|
||||
<asp:HyperLink ID="HyperLink3" runat="server" AccessKey="X" Target="_blank" NavigateUrl="~/excelAllMacchineExportStati.aspx">Excel Stati - tutte le macchine</asp:HyperLink>
|
||||
<asp:HyperLink ID="HyperLink1" runat="server" AccessKey="X" Target="_blank" NavigateUrl="~/excelExportStati.aspx">Excel Stati - solo macchina corrente</asp:HyperLink> - <asp:HyperLink ID="HyperLink3" runat="server" AccessKey="X" Target="_blank" NavigateUrl="~/excelAllMacchineExportStati.aspx">Excel Stati - tutte le macchine</asp:HyperLink>
|
||||
|
||||
|
||||
@@ -3,25 +3,112 @@ using System;
|
||||
|
||||
namespace MP_SITE.WebUserControls
|
||||
{
|
||||
public partial class mod_logStati : baseProdControl
|
||||
{
|
||||
public override void doUpdate()
|
||||
public partial class mod_logStati : baseProdControl
|
||||
{
|
||||
if (memLayer.ML.CRI("_logLevel") > 5)
|
||||
{
|
||||
logger.lg.scriviLog("inizio caricamento dati LogStati", tipoLog.INFO);
|
||||
}
|
||||
grView.PageSize = _numRighe;
|
||||
ods.DataBind();
|
||||
if (memLayer.ML.CRI("_logLevel") > 5)
|
||||
{
|
||||
logger.lg.scriviLog("fine caricamento dati LogStati", tipoLog.INFO);
|
||||
}
|
||||
}
|
||||
public void reportUpdt(object sender, EventArgs e)
|
||||
{
|
||||
reportUpdate();
|
||||
}
|
||||
#region Public Properties
|
||||
|
||||
}
|
||||
/// <summary>
|
||||
/// inizio periodo da mostrare
|
||||
/// </summary>
|
||||
public DateTime dtFrom
|
||||
{
|
||||
get
|
||||
{
|
||||
DateTime dtRif = DateTime.Now.AddDays(-30);
|
||||
try
|
||||
{
|
||||
string rawDate = memLayer.ML.StringSessionObj("_inizio)");
|
||||
if (!string.IsNullOrEmpty(rawDate))
|
||||
{
|
||||
DateTime.TryParse(rawDate, out dtRif);
|
||||
}
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
return dtRif;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// fine periodo da mostrare
|
||||
/// </summary>
|
||||
public DateTime dtTo
|
||||
{
|
||||
get
|
||||
{
|
||||
DateTime dtRif = DateTime.Now;
|
||||
try
|
||||
{
|
||||
string rawDate = memLayer.ML.StringSessionObj("_fine)");
|
||||
if (!string.IsNullOrEmpty(rawDate))
|
||||
{
|
||||
DateTime.TryParse(rawDate, out dtRif);
|
||||
}
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
return dtRif;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// idx della macchina da mostrare
|
||||
/// </summary>
|
||||
public string idxMacchina
|
||||
{
|
||||
get
|
||||
{
|
||||
string idxMacchina = "1";
|
||||
try
|
||||
{
|
||||
idxMacchina = memLayer.ML.StringSessionObj("IdxMacchina");
|
||||
}
|
||||
catch
|
||||
{
|
||||
}
|
||||
return idxMacchina;
|
||||
}
|
||||
set
|
||||
{
|
||||
memLayer.ML.setSessionVal("IdxMacchina", value);
|
||||
}
|
||||
}
|
||||
|
||||
#endregion Public Properties
|
||||
|
||||
#region Public Methods
|
||||
|
||||
/// <summary>
|
||||
/// Recupera commessa al momento indicato
|
||||
/// </summary>
|
||||
/// <param name="_dtRif"></param>
|
||||
/// <returns></returns>
|
||||
public string commessaCorr(object _dtRif)
|
||||
{
|
||||
DateTime dtRif = DateTime.Now;
|
||||
DateTime.TryParse($"{_dtRif}", out dtRif);
|
||||
return _resoconti.commessaAttiva(idxMacchina, dtFrom, dtTo, dtRif);
|
||||
}
|
||||
|
||||
public override void doUpdate()
|
||||
{
|
||||
if (memLayer.ML.CRI("_logLevel") > 5)
|
||||
{
|
||||
logger.lg.scriviLog("inizio caricamento dati LogStati", tipoLog.INFO);
|
||||
}
|
||||
grView.PageSize = _numRighe;
|
||||
ods.DataBind();
|
||||
if (memLayer.ML.CRI("_logLevel") > 5)
|
||||
{
|
||||
logger.lg.scriviLog("fine caricamento dati LogStati", tipoLog.INFO);
|
||||
}
|
||||
}
|
||||
|
||||
public void reportUpdt(object sender, EventArgs e)
|
||||
{
|
||||
reportUpdate();
|
||||
}
|
||||
|
||||
#endregion Public Methods
|
||||
}
|
||||
}
|
||||
+27
-25
@@ -1,50 +1,52 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <generato automaticamente>
|
||||
// Codice generato da uno strumento.
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
//
|
||||
// Le modifiche a questo file possono causare un comportamento non corretto e verranno perse se
|
||||
// il codice viene rigenerato.
|
||||
// </generato automaticamente>
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace MP_SITE.WebUserControls {
|
||||
|
||||
|
||||
public partial class mod_logStati {
|
||||
|
||||
namespace MP_SITE.WebUserControls
|
||||
{
|
||||
|
||||
|
||||
public partial class mod_logStati
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// Controllo grView.
|
||||
/// grView control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Campo generato automaticamente.
|
||||
/// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.GridView grView;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Controllo ods.
|
||||
/// ods control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Campo generato automaticamente.
|
||||
/// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.ObjectDataSource ods;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Controllo HyperLink1.
|
||||
/// HyperLink1 control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Campo generato automaticamente.
|
||||
/// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.HyperLink HyperLink1;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Controllo HyperLink3.
|
||||
/// HyperLink3 control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Campo generato automaticamente.
|
||||
/// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.HyperLink HyperLink3;
|
||||
}
|
||||
|
||||
@@ -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
|
||||
}
|
||||
}
|
||||
@@ -1,3 +1,4 @@
|
||||
using AjaxControlToolkit;
|
||||
using MapoDb;
|
||||
using Newtonsoft.Json;
|
||||
using SteamWare;
|
||||
@@ -584,6 +585,7 @@ public class resoconti
|
||||
protected MapoDb.DS_applicazioneTableAdapters.AnagraficaStatiTableAdapter taStati;
|
||||
protected MapoDb.DS_applicazioneTableAdapters.StatoMacchineTableAdapter taStatoMacchine;
|
||||
protected MapoDb.DS_ProdTempiTableAdapters.TempiCicloRilevatiTableAdapter taTempiCiclo;
|
||||
protected MapoDb.DS_ProdTempiTableAdapters.ODLTableAdapter taODL;
|
||||
|
||||
#endregion Protected Fields
|
||||
|
||||
@@ -800,6 +802,81 @@ public class resoconti
|
||||
return _StatoMacchine;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// Recupera tab ODL per periodo e impianto indicati
|
||||
/// </summary>
|
||||
/// <param name="idxMacchina"></param>
|
||||
/// <param name="inizio"></param>
|
||||
/// <param name="fine"></param>
|
||||
/// <returns></returns>
|
||||
protected DS_ProdTempi.ODLDataTable OdlPeriodo(string idxMacchina, DateTime inizio, DateTime fine)
|
||||
{
|
||||
// cache redis di 5 minuti...
|
||||
int cacheTtl = 300;
|
||||
DS_ProdTempi.ODLDataTable odlReq = null;
|
||||
string redKey = memLayer.ML.redHash($"OdlPeriodo:{idxMacchina}:{inizio:yyyy-MM-dd}:{inizio:HH:mm}");
|
||||
string rawVal = memLayer.ML.getRSV(redKey);
|
||||
if (string.IsNullOrEmpty(rawVal))
|
||||
{
|
||||
odlReq = taODL.getByMacchinaPeriodoNoNull(idxMacchina, inizio, fine);
|
||||
rawVal = JsonConvert.SerializeObject(odlReq);
|
||||
memLayer.ML.setRSV(redKey, rawVal, cacheTtl);
|
||||
}
|
||||
else
|
||||
{
|
||||
try
|
||||
{
|
||||
odlReq = JsonConvert.DeserializeObject<DS_ProdTempi.ODLDataTable>(rawVal);
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
}
|
||||
return odlReq;
|
||||
}
|
||||
/// <summary>
|
||||
/// Recupera record odl al momento indicato
|
||||
/// </summary>
|
||||
/// <param name="idxMacchina"></param>
|
||||
/// <param name="inizio"></param>
|
||||
/// <param name="fine"></param>
|
||||
/// <param name="dataRif"></param>
|
||||
/// <returns></returns>
|
||||
protected DS_ProdTempi.ODLRow currOdl(string idxMacchina, DateTime inizio, DateTime fine, DateTime dataRif)
|
||||
{
|
||||
DS_ProdTempi.ODLRow answ = null;
|
||||
var tabOdl = OdlPeriodo(idxMacchina, inizio, fine);
|
||||
if (tabOdl != null)
|
||||
{
|
||||
answ = tabOdl
|
||||
.Where(x => x.DataInizio <= dataRif && (x.DataFine >= dataRif || x.DataFine == null))
|
||||
.FirstOrDefault();
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
/// <summary>
|
||||
/// Recupera commessa attiva al momento indicato
|
||||
/// </summary>
|
||||
/// <param name="idxMacchina"></param>
|
||||
/// <param name="inizio"></param>
|
||||
/// <param name="fine"></param>
|
||||
/// <param name="dataRif"></param>
|
||||
/// <returns></returns>
|
||||
public string commessaAttiva(string idxMacchina, DateTime inizio, DateTime fine, DateTime dataRif)
|
||||
{
|
||||
string answ = "NA";
|
||||
var tabOdl = OdlPeriodo(idxMacchina, inizio, fine);
|
||||
if (tabOdl != null)
|
||||
{
|
||||
var currRow = tabOdl
|
||||
.Where(x => x.DataInizio <= dataRif && (x.DataFine >= dataRif || x.DataFine == null))
|
||||
.FirstOrDefault();
|
||||
if (currRow != null)
|
||||
{
|
||||
answ = currRow.KeyRichiesta;
|
||||
}
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
|
||||
#endregion Protected Properties
|
||||
|
||||
@@ -925,6 +1002,7 @@ public class resoconti
|
||||
taAnagArt = new MapoDb.DS_applicazioneTableAdapters.AnagArticoliTableAdapter();
|
||||
taAnagOpr = new MapoDb.DS_applicazioneTableAdapters.AnagraficaOperatoriTableAdapter();
|
||||
taTempiCiclo = new MapoDb.DS_ProdTempiTableAdapters.TempiCicloRilevatiTableAdapter();
|
||||
taODL = new MapoDb.DS_ProdTempiTableAdapters.ODLTableAdapter();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -996,6 +1074,7 @@ public class resoconti
|
||||
taAnagArt.Connection.ConnectionString = _connectionString;
|
||||
taAnagOpr.Connection.ConnectionString = _connectionString;
|
||||
taTempiCiclo.Connection.ConnectionString = _connectionString;
|
||||
taODL.Connection.ConnectionString = _connectionString;
|
||||
}
|
||||
|
||||
#endregion Private Methods
|
||||
|
||||
Reference in New Issue
Block a user