From 1f103cd87f68309bf37a934c38974abc48303eac Mon Sep 17 00:00:00 2001 From: Samuele Locatelli Date: Tue, 5 Oct 2021 16:21:28 +0200 Subject: [PATCH] inizio modulo daily stats --- .../WebUserControls/cmp_DailyStatsList.ascx | 65 +++++++++++ .../cmp_DailyStatsList.ascx.cs | 103 ++++++++++++++++++ .../cmp_DailyStatsList.ascx.designer.cs | 89 +++++++++++++++ .../WebUserControls/cmp_DailyStatsPlot.ascx | 87 +++++++++++++++ .../cmp_DailyStatsPlot.ascx.cs | 62 +++++++++++ .../cmp_DailyStatsPlot.ascx.designer.cs | 44 ++++++++ NKC_WF/WebUserControls/cmp_dailyStats.ascx | 3 - NKC_WF/WebUserControls/cmp_dailyStats.ascx.cs | 17 --- .../cmp_dailyStats.ascx.designer.cs | 16 --- 9 files changed, 450 insertions(+), 36 deletions(-) create mode 100644 NKC_WF/WebUserControls/cmp_DailyStatsList.ascx create mode 100644 NKC_WF/WebUserControls/cmp_DailyStatsList.ascx.cs create mode 100644 NKC_WF/WebUserControls/cmp_DailyStatsList.ascx.designer.cs create mode 100644 NKC_WF/WebUserControls/cmp_DailyStatsPlot.ascx create mode 100644 NKC_WF/WebUserControls/cmp_DailyStatsPlot.ascx.cs create mode 100644 NKC_WF/WebUserControls/cmp_DailyStatsPlot.ascx.designer.cs delete mode 100644 NKC_WF/WebUserControls/cmp_dailyStats.ascx delete mode 100644 NKC_WF/WebUserControls/cmp_dailyStats.ascx.cs delete mode 100644 NKC_WF/WebUserControls/cmp_dailyStats.ascx.designer.cs diff --git a/NKC_WF/WebUserControls/cmp_DailyStatsList.ascx b/NKC_WF/WebUserControls/cmp_DailyStatsList.ascx new file mode 100644 index 0000000..70f9453 --- /dev/null +++ b/NKC_WF/WebUserControls/cmp_DailyStatsList.ascx @@ -0,0 +1,65 @@ +<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="cmp_DailyStatsList.ascx.cs" Inherits="NKC_WF.WebUserControls.cmp_DailyStatsList" %> + +<%@ Register Src="~/WebUserControls/cmp_numRow.ascx" TagPrefix="uc1" TagName="cmp_numRow" %> +<%@ Register Src="~/WebUserControls/cmp_BatchStatsPlot.ascx" TagPrefix="uc1" TagName="cmp_BatchStatsPlot" %> + +
+
+ +
+
+
+
+ <%: traduci("BatchPreviewStats") %> +
+
+ <%: traduci("PlotGraph") %> + + + + + + + + + + +  |  + <%: traduci("ShowLast") %>: + +  |  + +
+
+
+
+ + + + + + + <%: traduci("NoRecord") %> + + + + + + + + + + + + + + + + + + + + + +
+
\ No newline at end of file diff --git a/NKC_WF/WebUserControls/cmp_DailyStatsList.ascx.cs b/NKC_WF/WebUserControls/cmp_DailyStatsList.ascx.cs new file mode 100644 index 0000000..d8a31be --- /dev/null +++ b/NKC_WF/WebUserControls/cmp_DailyStatsList.ascx.cs @@ -0,0 +1,103 @@ +using System; +using System.Web.UI; + +namespace NKC_WF.WebUserControls +{ + public partial class cmp_DailyStatsList : BaseUserControl + { + #region Protected Properties + + protected int ShowLast + { + get + { + int answ = 100; + int.TryParse(txtNumShow.Text, out answ); + return answ; + } + set + { + txtNumShow.Text = $"{value}"; + } + } + + #endregion Protected Properties + + #region Private Methods + + private void Cmp_numRow_eh_doRefresh(object sender, EventArgs e) + { + // recupero num righe ed aggiorno... + grView.PageSize = cmp_numRow.numRow; + grView.DataBind(); + } + + private void updateGraph() + { + cmp_BatchStatsPlot.PlotType = ddlType.SelectedValue; + cmp_BatchStatsPlot.ShowLast = ShowLast; + cmp_BatchStatsPlot.Legend = traduci($"rep_{ddlType.SelectedValue}"); + } + + #endregion Private Methods + + #region Protected Methods + + protected void chkPlotGraph_CheckedChanged(object sender, EventArgs e) + { + doUpdate(); + } + + protected void ddlPlaces_SelectedIndexChanged(object sender, EventArgs e) + { + } + + protected void ddlType_SelectedIndexChanged(object sender, EventArgs e) + { + doUpdate(); + } + + protected void grView_PageIndexChanged(object sender, EventArgs e) + { + } + + /// + /// Caricamento pagina + /// + /// + /// + protected void Page_Load(object sender, EventArgs e) + { + if (!Page.IsPostBack) + { + cmp_numRow.numRow = 10; + grView.PageSize = cmp_numRow.numRow; + divGraph.Visible = false; + ddlType.Visible = false; + } + cmp_numRow.eh_doRefresh += Cmp_numRow_eh_doRefresh; + } + + protected void txtNumShow_TextChanged(object sender, EventArgs e) + { + doUpdate(); + } + + #endregion Protected Methods + + #region Public Methods + + public void doUpdate() + { + divGraph.Visible = chkPlotGraph.Checked; + ddlType.Visible = chkPlotGraph.Checked; + if (chkPlotGraph.Checked) + { + updateGraph(); + } + grView.DataBind(); + } + + #endregion Public Methods + } +} \ No newline at end of file diff --git a/NKC_WF/WebUserControls/cmp_DailyStatsList.ascx.designer.cs b/NKC_WF/WebUserControls/cmp_DailyStatsList.ascx.designer.cs new file mode 100644 index 0000000..cc6835c --- /dev/null +++ b/NKC_WF/WebUserControls/cmp_DailyStatsList.ascx.designer.cs @@ -0,0 +1,89 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace NKC_WF.WebUserControls +{ + + + public partial class cmp_DailyStatsList + { + + /// + /// divGraph control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlGenericControl divGraph; + + /// + /// cmp_BatchStatsPlot control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::NKC_WF.WebUserControls.cmp_BatchStatsPlot cmp_BatchStatsPlot; + + /// + /// chkPlotGraph control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CheckBox chkPlotGraph; + + /// + /// ddlType control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.DropDownList ddlType; + + /// + /// txtNumShow control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox txtNumShow; + + /// + /// cmp_numRow control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::NKC_WF.WebUserControls.cmp_numRow cmp_numRow; + + /// + /// grView control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.GridView grView; + + /// + /// ods control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.ObjectDataSource ods; + } +} diff --git a/NKC_WF/WebUserControls/cmp_DailyStatsPlot.ascx b/NKC_WF/WebUserControls/cmp_DailyStatsPlot.ascx new file mode 100644 index 0000000..8e7cadf --- /dev/null +++ b/NKC_WF/WebUserControls/cmp_DailyStatsPlot.ascx @@ -0,0 +1,87 @@ +<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="cmp_DailyStatsPlot.ascx.cs" Inherits="NKC_WF.WebUserControls.cmp_DailyStatsPlot" %> + +<%--https://www.chartjs.org/--%> + +
+
+

Batch Stats Plot

+
+
+ + + + +
+
+ \ No newline at end of file diff --git a/NKC_WF/WebUserControls/cmp_DailyStatsPlot.ascx.cs b/NKC_WF/WebUserControls/cmp_DailyStatsPlot.ascx.cs new file mode 100644 index 0000000..f6d961b --- /dev/null +++ b/NKC_WF/WebUserControls/cmp_DailyStatsPlot.ascx.cs @@ -0,0 +1,62 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Web; +using System.Web.UI; +using System.Web.UI.WebControls; + +namespace NKC_WF.WebUserControls +{ + public partial class cmp_DailyStatsPlot : System.Web.UI.UserControl + { + #region Public Properties + + public string Legend + { + get + { + return hfLegend.Value; + } + set + { + hfLegend.Value = value; + } + } + + public string PlotType + { + get + { + return hfPlotType.Value; + } + set + { + hfPlotType.Value = value; + } + } + + public int ShowLast + { + get + { + int answ = 0; + int.TryParse(hfShowLast.Value, out answ); + return answ; + } + set + { + hfShowLast.Value = $"{value}"; + } + } + + #endregion Public Properties + + #region Protected Methods + + protected void Page_Load(object sender, EventArgs e) + { + } + + #endregion Protected Methods + } +} \ No newline at end of file diff --git a/NKC_WF/WebUserControls/cmp_DailyStatsPlot.ascx.designer.cs b/NKC_WF/WebUserControls/cmp_DailyStatsPlot.ascx.designer.cs new file mode 100644 index 0000000..6e282f1 --- /dev/null +++ b/NKC_WF/WebUserControls/cmp_DailyStatsPlot.ascx.designer.cs @@ -0,0 +1,44 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace NKC_WF.WebUserControls +{ + + + public partial class cmp_DailyStatsPlot + { + + /// + /// hfShowLast control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.HiddenField hfShowLast; + + /// + /// hfPlotType control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.HiddenField hfPlotType; + + /// + /// hfLegend control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.HiddenField hfLegend; + } +} diff --git a/NKC_WF/WebUserControls/cmp_dailyStats.ascx b/NKC_WF/WebUserControls/cmp_dailyStats.ascx deleted file mode 100644 index 0f29e67..0000000 --- a/NKC_WF/WebUserControls/cmp_dailyStats.ascx +++ /dev/null @@ -1,3 +0,0 @@ -<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="cmp_dailyStats.ascx.cs" Inherits="NKC_WF.WebUserControls.cmp_dailyStats" %> - -

Daily Stats

\ No newline at end of file diff --git a/NKC_WF/WebUserControls/cmp_dailyStats.ascx.cs b/NKC_WF/WebUserControls/cmp_dailyStats.ascx.cs deleted file mode 100644 index e1d8db1..0000000 --- a/NKC_WF/WebUserControls/cmp_dailyStats.ascx.cs +++ /dev/null @@ -1,17 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Web; -using System.Web.UI; -using System.Web.UI.WebControls; - -namespace NKC_WF.WebUserControls -{ - public partial class cmp_dailyStats : System.Web.UI.UserControl - { - protected void Page_Load(object sender, EventArgs e) - { - - } - } -} \ No newline at end of file diff --git a/NKC_WF/WebUserControls/cmp_dailyStats.ascx.designer.cs b/NKC_WF/WebUserControls/cmp_dailyStats.ascx.designer.cs deleted file mode 100644 index c2993df..0000000 --- a/NKC_WF/WebUserControls/cmp_dailyStats.ascx.designer.cs +++ /dev/null @@ -1,16 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - - -namespace NKC_WF.WebUserControls -{ - public partial class cmp_dailyStats - { - } -}