From b401be828fe4e18860ce78b0b6809cc2b514669b Mon Sep 17 00:00:00 2001 From: Samuele Locatelli Date: Tue, 5 Oct 2021 19:00:21 +0200 Subject: [PATCH] Update gestioen grafici daily --- NKC_WF/Controllers/DayStatsController.cs | 18 +++--- .../WebUserControls/cmp_DailyStatsList.ascx | 4 +- .../cmp_DailyStatsList.ascx.cs | 11 +++- .../cmp_DailyStatsPlot.ascx.cs | 15 +++-- NKC_WF/WebUserControls/cmp_errorDetail.ascx | 3 +- .../cmp_errorDetail.ascx.designer.cs | 58 +++++++++---------- NKC_WF/site/PlannerReports.aspx | 12 ++++ NKC_WF/site/PlannerReports.aspx.designer.cs | 18 ++++++ NKC_WF/site/UpdMan.aspx | 4 +- 9 files changed, 93 insertions(+), 50 deletions(-) diff --git a/NKC_WF/Controllers/DayStatsController.cs b/NKC_WF/Controllers/DayStatsController.cs index e74e4eb..eef2f6e 100644 --- a/NKC_WF/Controllers/DayStatsController.cs +++ b/NKC_WF/Controllers/DayStatsController.cs @@ -12,6 +12,8 @@ namespace NKC_WF.Controllers { #region Protected Fields + protected string dateFormat = "yyyy-MM-dd"; + /// /// oggetto static/singleton per fare chiamate sul datalayer /// @@ -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 /// Fine Periodo /// Tipo di grafico /// - public List Get(string id, string _StartDate, string _EndDate, string PlotType) + public List 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 answ = new List(); - answ = getDataFilt(id, StartDate, EndDate, PlotType); + answ = getDataFilt(id, dateStart, dateEnd, PlotType); // restituisco oggetto! return answ; } diff --git a/NKC_WF/WebUserControls/cmp_DailyStatsList.ascx b/NKC_WF/WebUserControls/cmp_DailyStatsList.ascx index 5bfc6d9..9f4aa3a 100644 --- a/NKC_WF/WebUserControls/cmp_DailyStatsList.ascx +++ b/NKC_WF/WebUserControls/cmp_DailyStatsList.ascx @@ -19,8 +19,8 @@ - - + +  |  <%: traduci("Machine") %> diff --git a/NKC_WF/WebUserControls/cmp_DailyStatsList.ascx.cs b/NKC_WF/WebUserControls/cmp_DailyStatsList.ascx.cs index c07c0bc..42fae3f 100644 --- a/NKC_WF/WebUserControls/cmp_DailyStatsList.ascx.cs +++ b/NKC_WF/WebUserControls/cmp_DailyStatsList.ascx.cs @@ -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 diff --git a/NKC_WF/WebUserControls/cmp_DailyStatsPlot.ascx.cs b/NKC_WF/WebUserControls/cmp_DailyStatsPlot.ascx.cs index 363c7dc..d2d73eb 100644 --- a/NKC_WF/WebUserControls/cmp_DailyStatsPlot.ascx.cs +++ b/NKC_WF/WebUserControls/cmp_DailyStatsPlot.ascx.cs @@ -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}"; } } diff --git a/NKC_WF/WebUserControls/cmp_errorDetail.ascx b/NKC_WF/WebUserControls/cmp_errorDetail.ascx index ce403b3..dabb064 100644 --- a/NKC_WF/WebUserControls/cmp_errorDetail.ascx +++ b/NKC_WF/WebUserControls/cmp_errorDetail.ascx @@ -43,7 +43,6 @@ - + \ No newline at end of file diff --git a/NKC_WF/WebUserControls/cmp_errorDetail.ascx.designer.cs b/NKC_WF/WebUserControls/cmp_errorDetail.ascx.designer.cs index 18c23a5..160d777 100644 --- a/NKC_WF/WebUserControls/cmp_errorDetail.ascx.designer.cs +++ b/NKC_WF/WebUserControls/cmp_errorDetail.ascx.designer.cs @@ -1,10 +1,10 @@ //------------------------------------------------------------------------------ -// -// Codice generato da uno strumento. +// +// 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. -// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// //------------------------------------------------------------------------------ namespace NKC_WF.WebUserControls @@ -15,74 +15,74 @@ namespace NKC_WF.WebUserControls { /// - /// Controllo lblErrorTitle. + /// lblErrorTitle control. /// /// - /// 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. /// protected global::System.Web.UI.WebControls.Label lblErrorTitle; /// - /// Controllo lblErrorExpl. + /// lblErrorExpl control. /// /// - /// 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. /// protected global::System.Web.UI.WebControls.Label lblErrorExpl; /// - /// Controllo upnlBCode. + /// upnlBCode control. /// /// - /// 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. /// protected global::System.Web.UI.UpdatePanel upnlBCode; /// - /// Controllo lblCounter. + /// lblCounter control. /// /// - /// 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. /// protected global::System.Web.UI.WebControls.Label lblCounter; /// - /// Controllo timerRedirect. + /// timerRedirect control. /// /// - /// 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. /// protected global::System.Web.UI.Timer timerRedirect; /// - /// Controllo lbtTryReset. + /// lbtTryReset control. /// /// - /// 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. /// protected global::System.Web.UI.WebControls.LinkButton lbtTryReset; /// - /// Controllo UpdateProgressDisplay. + /// UpdateProgressDisplay control. /// /// - /// 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. /// protected global::System.Web.UI.UpdateProgress UpdateProgressDisplay; /// - /// Controllo lblUserName. + /// lblUserName control. /// /// - /// 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. /// protected global::System.Web.UI.WebControls.Label lblUserName; } diff --git a/NKC_WF/site/PlannerReports.aspx b/NKC_WF/site/PlannerReports.aspx index 8245bed..97772b2 100644 --- a/NKC_WF/site/PlannerReports.aspx +++ b/NKC_WF/site/PlannerReports.aspx @@ -29,6 +29,18 @@ + + + + +
+ +
+
+
+
+
+
diff --git a/NKC_WF/site/PlannerReports.aspx.designer.cs b/NKC_WF/site/PlannerReports.aspx.designer.cs index 58fd440..8433804 100644 --- a/NKC_WF/site/PlannerReports.aspx.designer.cs +++ b/NKC_WF/site/PlannerReports.aspx.designer.cs @@ -32,6 +32,24 @@ namespace NKC_WF.site /// protected global::System.Web.UI.WebControls.Label lblInstruction; + /// + /// upnlLoading control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.UpdatePanel upnlLoading; + + /// + /// UpdateProgressDisplay control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.UpdateProgress UpdateProgressDisplay; + /// /// cmp_SheetsStats control. /// diff --git a/NKC_WF/site/UpdMan.aspx b/NKC_WF/site/UpdMan.aspx index fe1c9df..43c0ba9 100644 --- a/NKC_WF/site/UpdMan.aspx +++ b/NKC_WF/site/UpdMan.aspx @@ -1,8 +1,6 @@ <%@ Page Title="" Language="C#" MasterPageFile="~/SiteContent.master" AutoEventWireup="true" CodeBehind="UpdMan.aspx.cs" Inherits="NKC_WF.site.UpdMan" %> - -
@@ -56,4 +54,4 @@
-
+ \ No newline at end of file