Update gestioen grafici daily

This commit is contained in:
Samuele Locatelli
2021-10-05 19:00:21 +02:00
parent ef0afc508e
commit b401be828f
9 changed files with 93 additions and 50 deletions
+10 -8
View File
@@ -12,6 +12,8 @@ namespace NKC_WF.Controllers
{
#region Protected Fields
protected string dateFormat = "yyyy-MM-dd";
/// <summary>
/// oggetto static/singleton per fare chiamate sul datalayer
/// </summary>
@@ -68,11 +70,11 @@ namespace NKC_WF.Controllers
value = item.MinDisp;
break;
case "NumParts":
case "NumPartsProd":
value = item.ItmProd;
break;
case "NumScrap":
case "NumPartsScrap":
value = item.ItmScrap;
break;
@@ -125,17 +127,17 @@ namespace NKC_WF.Controllers
/// <param name="EndDate">Fine Periodo</param>
/// <param name="PlotType">Tipo di grafico</param>
/// <returns></returns>
public List<chartJsTSerie> Get(string id, string _StartDate, string _EndDate, string PlotType)
public List<chartJsTSerie> Get(string id, string StartDate, string EndDate, string PlotType)
{
// bonifica ID: [ALL] --> *
id = id == "[ALL]" ? "*" : id;
DateTime EndDate = DateTime.Today.AddDays(1);
DateTime StartDate = EndDate.AddDays(-10);
DateTime.TryParse(_StartDate, out StartDate);
DateTime.TryParse(_EndDate, out EndDate);
DateTime dateEnd = DateTime.Today.AddDays(1);
DateTime dateStart = dateEnd.AddDays(-10);
DateTime.TryParseExact(StartDate, dateFormat, CultureInfo.InvariantCulture, DateTimeStyles.None, out dateStart);
DateTime.TryParseExact(EndDate, dateFormat, CultureInfo.InvariantCulture, DateTimeStyles.None, out dateEnd);
List<chartJsTSerie> answ = new List<chartJsTSerie>();
answ = getDataFilt(id, StartDate, EndDate, PlotType);
answ = getDataFilt(id, dateStart, dateEnd, PlotType);
// restituisco oggetto!
return answ;
}
@@ -19,8 +19,8 @@
<asp:ListItem Text="OEE" Value="OEE"></asp:ListItem>
<asp:ListItem Text="Run Time" Value="RunTime"></asp:ListItem>
<asp:ListItem Text="Available Time" Value="AvailTime"></asp:ListItem>
<asp:ListItem Text="# Parts Produced" Value="NumParts"></asp:ListItem>
<asp:ListItem Text="# Part Scrapped" Value="NumScrap"></asp:ListItem>
<asp:ListItem Text="# Parts Produced" Value="NumPartsProd"></asp:ListItem>
<asp:ListItem Text="# Part Scrapped" Value="NumPartsScrap"></asp:ListItem>
</asp:DropDownList>
&nbsp;|&nbsp;
<%: traduci("Machine") %>
@@ -1,10 +1,17 @@
using System;
using System.Globalization;
using System.Web.UI;
namespace NKC_WF.WebUserControls
{
public partial class cmp_DailyStatsList : BaseUserControl
{
#region Protected Fields
protected string dateFormat = "yyyy-MM-dd";
#endregion Protected Fields
#region Protected Properties
protected DateTime DateEnd
@@ -12,7 +19,7 @@ namespace NKC_WF.WebUserControls
get
{
DateTime answ = DateTime.Today.AddDays(1);
DateTime.TryParse(txtDateEnd.Text, out answ);
DateTime.TryParseExact(txtDateEnd.Text, dateFormat, CultureInfo.InvariantCulture, DateTimeStyles.None, out answ);
return answ;
}
set
@@ -26,7 +33,7 @@ namespace NKC_WF.WebUserControls
get
{
DateTime answ = DateTime.Today.AddDays(-7);
DateTime.TryParse(txtDateStart.Text, out answ);
DateTime.TryParseExact(txtDateStart.Text, dateFormat, CultureInfo.InvariantCulture, DateTimeStyles.None, out answ);
return answ;
}
set
@@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Web;
using System.Web.UI;
@@ -9,6 +10,12 @@ namespace NKC_WF.WebUserControls
{
public partial class cmp_DailyStatsPlot : System.Web.UI.UserControl
{
#region Protected Fields
protected string dateFormat = "yyyy-MM-dd";
#endregion Protected Fields
#region Public Properties
public DateTime DateEnd
@@ -16,12 +23,12 @@ namespace NKC_WF.WebUserControls
get
{
DateTime answ = DateTime.Today;
DateTime.TryParse(hfDateEnd.Value, out answ);
DateTime.TryParseExact(hfDateEnd.Value, dateFormat, CultureInfo.InvariantCulture, DateTimeStyles.None, out answ);
return answ;
}
set
{
hfDateEnd.Value = $"{value:yyyy-dd-mm}";
hfDateEnd.Value = $"{value:yyyy-MM-dd}";
}
}
@@ -30,12 +37,12 @@ namespace NKC_WF.WebUserControls
get
{
DateTime answ = DateTime.Today;
DateTime.TryParse(hfDateStart.Value, out answ);
DateTime.TryParseExact(hfDateStart.Value, dateFormat, CultureInfo.InvariantCulture, DateTimeStyles.None, out answ);
return answ;
}
set
{
hfDateStart.Value = $"{value:yyyy-dd-mm}";
hfDateStart.Value = $"{value:yyyy-MM-dd}";
}
}
+1 -2
View File
@@ -43,7 +43,6 @@
</div>
</div>
<div class="card-footer">
<div class="row">
<div class="col-6 text-left">
<b>User</b>:
@@ -54,4 +53,4 @@
</div>
</div>
</div>
</div>
</div>
+29 -29
View File
@@ -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 NKC_WF.WebUserControls
@@ -15,74 +15,74 @@ namespace NKC_WF.WebUserControls
{
/// <summary>
/// Controllo lblErrorTitle.
/// lblErrorTitle 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.Label lblErrorTitle;
/// <summary>
/// Controllo lblErrorExpl.
/// lblErrorExpl 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.Label lblErrorExpl;
/// <summary>
/// Controllo upnlBCode.
/// upnlBCode 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.UpdatePanel upnlBCode;
/// <summary>
/// Controllo lblCounter.
/// lblCounter 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.Label lblCounter;
/// <summary>
/// Controllo timerRedirect.
/// timerRedirect 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.Timer timerRedirect;
/// <summary>
/// Controllo lbtTryReset.
/// lbtTryReset 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.LinkButton lbtTryReset;
/// <summary>
/// Controllo UpdateProgressDisplay.
/// UpdateProgressDisplay 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.UpdateProgress UpdateProgressDisplay;
/// <summary>
/// Controllo lblUserName.
/// lblUserName 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.Label lblUserName;
}
+12
View File
@@ -29,6 +29,18 @@
</div>
</div>
</div>
<asp:UpdatePanel ID="upnlLoading" UpdateMode="Conditional" runat="server">
<ContentTemplate>
<asp:UpdateProgress ID="UpdateProgressDisplay" runat="server" DisplayAfter="5">
<ProgressTemplate>
<div class="alert alert-primary">
<i class="fa fa-download" aria-hidden="true"></i><i class="fa fa-circle-o-notch fa-spin" aria-hidden="true"></i>
<div class="progress-bar progress-bar-striped progress-bar-animated" style="width: 50%"></div>
</div>
</ProgressTemplate>
</asp:UpdateProgress>
</ContentTemplate>
</asp:UpdatePanel>
<uc1:cmp_SheetsStats runat="server" ID="cmp_SheetsStats" />
<uc1:cmp_BatchStatsList runat="server" id="cmp_BatchStatsList" />
<uc1:cmp_DailyStatsList runat="server" id="cmp_DailyStatsList" />
+18
View File
@@ -32,6 +32,24 @@ namespace NKC_WF.site
/// </remarks>
protected global::System.Web.UI.WebControls.Label lblInstruction;
/// <summary>
/// upnlLoading control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.UpdatePanel upnlLoading;
/// <summary>
/// UpdateProgressDisplay control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.UpdateProgress UpdateProgressDisplay;
/// <summary>
/// cmp_SheetsStats control.
/// </summary>
+1 -3
View File
@@ -1,8 +1,6 @@
<%@ Page Title="" Language="C#" MasterPageFile="~/SiteContent.master" AutoEventWireup="true" CodeBehind="UpdMan.aspx.cs" Inherits="NKC_WF.site.UpdMan" %>
<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">
<div class="container">
<div class="card">
<div class="card-header">
@@ -56,4 +54,4 @@
</div>
</div>
</div>
</asp:Content>
</asp:Content>