Update export commesse
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)
|
||||
{
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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