Merge branch 'release/FixReportsChartJs01'
This commit is contained in:
@@ -324,6 +324,7 @@
|
||||
<Content Include="Scripts\Chart.js" />
|
||||
<Content Include="Scripts\Chart.min.js" />
|
||||
<Content Include="Scripts\chartjs-plugin-zoom%40next.js" />
|
||||
<Content Include="Scripts\DailyStatsPlot.js" />
|
||||
<Content Include="Scripts\esm\popper-utils.js" />
|
||||
<Content Include="Scripts\esm\popper-utils.min.js" />
|
||||
<Content Include="Scripts\esm\popper.js" />
|
||||
@@ -479,6 +480,8 @@
|
||||
<Content Include="site\PartMIA.aspx" />
|
||||
<Content Include="site\PartValidation.aspx" />
|
||||
<Content Include="site\PlannerReports.aspx" />
|
||||
<Content Include="site\PlannerReportsBatchStats.aspx" />
|
||||
<Content Include="site\PlannerReportsDailyStats.aspx" />
|
||||
<Content Include="site\PlantMgmt.aspx" />
|
||||
<Content Include="site\RemanExtLink.aspx" />
|
||||
<Content Include="site\SecondScreen.aspx" />
|
||||
@@ -486,6 +489,7 @@
|
||||
<Content Include="site\SvgFull.aspx" />
|
||||
<Content Include="site\TestAuth.aspx" />
|
||||
<Content Include="site\StackManager.aspx" />
|
||||
<Content Include="site\TestChart.aspx" />
|
||||
<Content Include="site\Unauth.aspx" />
|
||||
<Content Include="site\UpdMan.aspx" />
|
||||
<Content Include="WebUserControls\cmp_barcode.ascx" />
|
||||
@@ -1053,6 +1057,20 @@
|
||||
<Compile Include="site\PlannerReports.aspx.designer.cs">
|
||||
<DependentUpon>PlannerReports.aspx</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="site\PlannerReportsBatchStats.aspx.cs">
|
||||
<DependentUpon>PlannerReportsBatchStats.aspx</DependentUpon>
|
||||
<SubType>ASPXCodeBehind</SubType>
|
||||
</Compile>
|
||||
<Compile Include="site\PlannerReportsBatchStats.aspx.designer.cs">
|
||||
<DependentUpon>PlannerReportsBatchStats.aspx</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="site\PlannerReportsDailyStats.aspx.cs">
|
||||
<DependentUpon>PlannerReportsDailyStats.aspx</DependentUpon>
|
||||
<SubType>ASPXCodeBehind</SubType>
|
||||
</Compile>
|
||||
<Compile Include="site\PlannerReportsDailyStats.aspx.designer.cs">
|
||||
<DependentUpon>PlannerReportsDailyStats.aspx</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="site\PlantMgmt.aspx.cs">
|
||||
<DependentUpon>PlantMgmt.aspx</DependentUpon>
|
||||
<SubType>ASPXCodeBehind</SubType>
|
||||
@@ -1116,6 +1134,13 @@
|
||||
<Compile Include="site\StackManager.aspx.designer.cs">
|
||||
<DependentUpon>StackManager.aspx</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="site\TestChart.aspx.cs">
|
||||
<DependentUpon>TestChart.aspx</DependentUpon>
|
||||
<SubType>ASPXCodeBehind</SubType>
|
||||
</Compile>
|
||||
<Compile Include="site\TestChart.aspx.designer.cs">
|
||||
<DependentUpon>TestChart.aspx</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="site\Unauth.aspx.cs">
|
||||
<DependentUpon>Unauth.aspx</DependentUpon>
|
||||
<SubType>ASPXCodeBehind</SubType>
|
||||
|
||||
+11
-8
@@ -36,8 +36,9 @@
|
||||
</pages>
|
||||
<sessionState mode="Custom" customProvider="MySessionStateStore">
|
||||
<providers>
|
||||
<add name="MySessionStateStore" type="Microsoft.Web.Redis.RedisSessionStateProvider" host="127.0.0.1" accessKey="" ssl="false"
|
||||
applicationName="NKC" databaseId="2" timeout="480"/>
|
||||
<add name="MySessionStateStore" type="Microsoft.Web.Redis.RedisSessionStateProvider"
|
||||
connectionString="localhost:26379, serviceName=devel, DefaultDatabase=2, connectTimeout=5000, syncTimeout=5000, asyncTimeout=5000, abortConnect=false, ssl=false"
|
||||
applicationName="NKC"/>
|
||||
</providers>
|
||||
</sessionState>
|
||||
<httpModules>
|
||||
@@ -110,18 +111,20 @@
|
||||
<!--Errori e redirect-->
|
||||
<add key="dedupBasePath" value="true"/>
|
||||
<add key="dedupBasePathVal" value="NKC2"/>
|
||||
<add key="NKC_WFConnectionString" value="Data Source=SQL2016DEV;Initial Catalog=Sauder_NKC;Persist Security Info=True;User ID=sa;Password=keyhammer16;"/>
|
||||
<add key="DbConfConnectionString" value="Data Source=SQL2016DEV;Initial Catalog=Sauder_NKC;Persist Security Info=True;User ID=sa;Password=keyhammer16;"/>
|
||||
<add key="NKC_WFConnectionString"
|
||||
value="Data Source=SQL2016PROD;Initial Catalog=Sauder_NKC2_Prod;Persist Security Info=True;User ID=sa;Password=keyhammer16;"/>
|
||||
<add key="DbConfConnectionString"
|
||||
value="Data Source=SQL2016PROD;Initial Catalog=Sauder_NKC2_Prod;Persist Security Info=True;User ID=sa;Password=keyhammer16;"/>
|
||||
<add key="VocabolarioConnectionString"
|
||||
value="Data Source=SQL2016DEV;Initial Catalog=Sauder_NKC;Persist Security Info=True;User ID=sa;Password=keyhammer16;"/>
|
||||
value="Data Source=SQL2016PROD;Initial Catalog=Sauder_NKC2_Prod;Persist Security Info=True;User ID=sa;Password=keyhammer16;"/>
|
||||
<add key="UtenteCdcConnectionString"
|
||||
value="Data Source=SQL2016DEV;Initial Catalog=Sauder_NKC;Persist Security Info=True;User ID=sa;Password=keyhammer16;"/>
|
||||
value="Data Source=SQL2016PROD;Initial Catalog=Sauder_NKC2_Prod;Persist Security Info=True;User ID=sa;Password=keyhammer16;"/>
|
||||
<add key="PermessiConnectionString"
|
||||
value="Data Source=SQL2016DEV;Initial Catalog=Sauder_NKC;Persist Security Info=True;User ID=sa;Password=keyhammer16;"/>
|
||||
value="Data Source=SQL2016PROD;Initial Catalog=Sauder_NKC2_Prod;Persist Security Info=True;User ID=sa;Password=keyhammer16;"/>
|
||||
</appSettings>
|
||||
<connectionStrings>
|
||||
<add name="AppData.Properties.Settings.Sauder_NKCConnectionString"
|
||||
connectionString="Data Source=SQL2016DEV;Initial Catalog=Sauder_NKC;Persist Security Info=True;User ID=sa;Password=keyhammer16;"
|
||||
connectionString="Data Source=SQL2016PROD;Initial Catalog=Sauder_NKC2_Prod;Persist Security Info=True;User ID=sa;Password=keyhammer16;"
|
||||
providerName="System.Data.SqlClient"/>
|
||||
<add name="ErrorLog" connectionString="Data Source=SQL2016DEV;Initial Catalog=Elmah;Persist Security Info=True;User ID=sa;Password=keyhammer16;"
|
||||
providerName="System.Data.SqlClient"/>
|
||||
|
||||
@@ -9,10 +9,10 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-4">
|
||||
<div class="col-12 col-md-3">
|
||||
<b class="text-uppercase"><%: traduci("BatchPreviewStats") %></b>
|
||||
</div>
|
||||
<div class="col-8 text-right small">
|
||||
<div class="col-12 col-md-9 text-right small">
|
||||
<div class="form-row mb-2">
|
||||
<div class="col-5">
|
||||
<asp:LinkButton runat="server" ID="lbtExportCsv" CssClass="btn btn-sm btn-outline-success" OnClick="lbtExportCsv_Click">Create CSV <i class="fa fa-file-excel-o" aria-hidden="true"></i></asp:LinkButton>
|
||||
@@ -39,7 +39,7 @@
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text small"><%: traduci("PlotGraph") %></span>
|
||||
</div>
|
||||
<asp:CheckBox runat="server" ID="chkPlotGraph" AutoPostBack="true" OnCheckedChanged="chkPlotGraph_CheckedChanged" CssClass="form-control form-control-sm" />
|
||||
<asp:CheckBox runat="server" ID="chkPlotGraph" AutoPostBack="true" OnCheckedChanged="chkPlotGraph_CheckedChanged" CssClass="form-control form-control-sm" Checked="true" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-2">
|
||||
|
||||
@@ -142,7 +142,7 @@ namespace NKC_WF.WebUserControls
|
||||
{
|
||||
if (!Page.IsPostBack)
|
||||
{
|
||||
cmp_numRow.numRow = 25;
|
||||
cmp_numRow.numRow = 15;
|
||||
grView.PageSize = cmp_numRow.numRow;
|
||||
divGraph.Visible = false;
|
||||
divType.Visible = false;
|
||||
@@ -152,6 +152,7 @@ namespace NKC_WF.WebUserControls
|
||||
hlDownload.Visible = fileExist;
|
||||
}
|
||||
cmp_numRow.eh_doRefresh += Cmp_numRow_eh_doRefresh;
|
||||
doUpdate();
|
||||
}
|
||||
|
||||
protected void txtNumShow_TextChanged(object sender, EventArgs e)
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
var labelsTS = dataTS.map(function (item) {
|
||||
return item['x'];
|
||||
});
|
||||
//console.log('labels data', labels);
|
||||
//console.log('labels data', labelsTS);
|
||||
|
||||
var myOptions = {
|
||||
responsive: true,
|
||||
@@ -42,15 +42,17 @@
|
||||
};
|
||||
|
||||
// recupero obj chart
|
||||
//console.log('ctx ID: ', document.getElementById('myChartTS'));
|
||||
var ctx = document.getElementById('myChartTS').getContext('2d');
|
||||
|
||||
var sLeg = document.getElementById('<%=hfLegend.ClientID %>').value;
|
||||
var chart = new Chart(ctx, {
|
||||
type: 'line',
|
||||
data: {
|
||||
labels: labelsTS,
|
||||
|
||||
datasets: [{
|
||||
label: '<%=hfLegend.Value %>',
|
||||
label: sLeg,
|
||||
borderColor: 'rgb(7, 173, 236)',
|
||||
lineTension: 0,
|
||||
//steppedLine: false,
|
||||
@@ -66,22 +68,31 @@
|
||||
}
|
||||
// effettuo plotting grafico TimeSerie!
|
||||
function plotTS() {
|
||||
//console.log("api/BatchStats/<%=hfShowLast.Value %>?PlotType=<%=hfPlotType.Value%>");
|
||||
// caricamento pagina
|
||||
$.ajax({
|
||||
type: "GET",
|
||||
url: "../api/BatchStats/<%=hfShowLast.Value %>?PlotType=<%=hfPlotType.Value%>",
|
||||
contentType: "application/json; charset=utf-8",
|
||||
dataType: "json",
|
||||
success: OnSuccess_,
|
||||
error: OnErrorCall_
|
||||
});
|
||||
var hfSL = document.getElementById('<%=hfShowLast.ClientID %>');
|
||||
if (hfSL != null) {
|
||||
var lastNum = document.getElementById('<%=hfShowLast.ClientID %>').value ?? "";
|
||||
var plotType = document.getElementById('<%=hfPlotType.ClientID %>').value ?? "";
|
||||
//console.log("../api/BatchStats/"+lastNum+"?PlotType="+plotType);
|
||||
// caricamento pagina
|
||||
$.ajax({
|
||||
type: "GET",
|
||||
url: "../api/BatchStats/" + lastNum + "?PlotType=" + plotType,
|
||||
contentType: "application/json; charset=utf-8",
|
||||
dataType: "json",
|
||||
success: OnSuccess_,
|
||||
error: OnErrorCall_
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
// funzione di drawing ad OGNI pageload!
|
||||
function pageLoad() {
|
||||
// chiamo recupero dati + plot della TS
|
||||
plotTS();
|
||||
//console.log('pageLoad!');
|
||||
try {
|
||||
console.log('pageLoad BatchStats! | ID: <%= this.ID %> ');
|
||||
plotTS();
|
||||
}
|
||||
catch (error) {
|
||||
console.log(error);
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</script>
|
||||
|
||||
@@ -53,10 +53,7 @@ namespace NKC_WF.WebUserControls
|
||||
|
||||
#region Protected Methods
|
||||
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
#endregion Protected Methods
|
||||
}
|
||||
}
|
||||
@@ -9,10 +9,10 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-3">
|
||||
<div class="col-12 col-md-3">
|
||||
<b class="text-uppercase"><%: traduci("DayProdStats") %></b>
|
||||
</div>
|
||||
<div class="col-9 text-right small">
|
||||
<div class="col-12 col-md-9 text-right small">
|
||||
<div class="form-row mb-2">
|
||||
<div class="col-2">
|
||||
<asp:LinkButton runat="server" ID="lbtExportCsv" CssClass="btn btn-sm btn-outline-success" OnClick="lbtExportCsv_Click">Create CSV <i class="fa fa-file-excel-o" aria-hidden="true"></i></asp:LinkButton>
|
||||
@@ -38,7 +38,7 @@
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text small"><%: traduci("PlotGraph") %></span>
|
||||
</div>
|
||||
<asp:CheckBox runat="server" ID="chkPlotGraph" AutoPostBack="true" OnCheckedChanged="chkPlotGraph_CheckedChanged" CssClass="form-control form-control-sm" />
|
||||
<asp:CheckBox runat="server" ID="chkPlotGraph" AutoPostBack="true" OnCheckedChanged="chkPlotGraph_CheckedChanged" CssClass="form-control form-control-sm" Checked="true" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-2">
|
||||
|
||||
@@ -174,7 +174,7 @@ namespace NKC_WF.WebUserControls
|
||||
{
|
||||
if (!Page.IsPostBack)
|
||||
{
|
||||
cmp_numRow.numRow = 25;
|
||||
cmp_numRow.numRow = 15;
|
||||
grView.PageSize = cmp_numRow.numRow;
|
||||
divGraph.Visible = false;
|
||||
divType.Visible = false;
|
||||
@@ -186,6 +186,7 @@ namespace NKC_WF.WebUserControls
|
||||
hlDownload.Visible = fileExist;
|
||||
}
|
||||
cmp_numRow.eh_doRefresh += Cmp_numRow_eh_doRefresh;
|
||||
doUpdate();
|
||||
}
|
||||
|
||||
protected void txtDateEnd_TextChanged(object sender, EventArgs e)
|
||||
|
||||
@@ -4,11 +4,10 @@
|
||||
|
||||
<div class="row">
|
||||
<div class="col-12 px-2">
|
||||
<h4>Batch Stats Plot</h4>
|
||||
<h4>Daily Stats Plot</h4>
|
||||
</div>
|
||||
<div class="col-12 px-2">
|
||||
<div id="divLoading" class="alert alert-primary text-center">
|
||||
<%--<i class="fa fa-5x fa-circle-o-notch fa-spin" aria-hidden="true"></i>--%>
|
||||
<div class="progress">
|
||||
<div class="progress-bar progress-bar-striped progress-bar-animated" style="width: 40%"></div>
|
||||
</div>
|
||||
@@ -23,6 +22,7 @@
|
||||
<canvas id="myChartTS" height="200"></canvas>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
// funzione eseguita se successo al caricamento
|
||||
function OnSuccess_(reponse) {
|
||||
@@ -65,7 +65,11 @@
|
||||
};
|
||||
|
||||
// recupero obj chart
|
||||
//console.log('ctx ID: ', document.getElementById('myChartTS'));
|
||||
var ctx = document.getElementById('myChartTS').getContext('2d');
|
||||
//var ctx = document.getElementById('myChartTS').getContext('2d');
|
||||
|
||||
var sLeg = document.getElementById('<%=hfLegend.ClientID %>').value;
|
||||
|
||||
var chart = new Chart(ctx, {
|
||||
type: 'line',
|
||||
@@ -74,21 +78,21 @@
|
||||
|
||||
datasets: [
|
||||
{
|
||||
label: 'NE01: <%=hfLegend.Value %>',
|
||||
label: 'NE01: ' + sLeg,
|
||||
borderColor: 'rgb(7, 173, 236)',
|
||||
lineTension: 0,
|
||||
//steppedLine: false,
|
||||
data: dataNE01
|
||||
},
|
||||
{
|
||||
label: 'NE02: <%=hfLegend.Value %>',
|
||||
label: 'NE02: ' + sLeg,
|
||||
borderColor: 'rgb(7, 173, 26)',
|
||||
lineTension: 0,
|
||||
//steppedLine: false,
|
||||
data: dataNE02
|
||||
},
|
||||
{
|
||||
label: 'NE03: <%=hfLegend.Value %>',
|
||||
label: 'NE03: ' + sLeg,
|
||||
borderColor: 'rgb(7, 203, 126)',
|
||||
lineTension: 0,
|
||||
//steppedLine: false,
|
||||
@@ -99,10 +103,15 @@
|
||||
options: myOptions
|
||||
});
|
||||
|
||||
// nascondo panel loading
|
||||
var currDiv = document.getElementById("divLoading");
|
||||
currDiv.style.display = "none";
|
||||
console.log("style: " + currDiv.style.display);
|
||||
try {
|
||||
// nascondo panel loading
|
||||
var currDiv = document.getElementById('divLoading');
|
||||
currDiv.style.display = "none";
|
||||
console.log("style: " + currDiv.style.display);
|
||||
}
|
||||
catch (error) {
|
||||
console.log(error);
|
||||
}
|
||||
}
|
||||
// errore in reload!
|
||||
function OnErrorCall_(repo) {
|
||||
@@ -110,11 +119,20 @@
|
||||
}
|
||||
// effettuo plotting grafico TimeSerie!
|
||||
function plotTS() {
|
||||
console.log("api/DayStats/<%=hfPlaceCod.Value %>?StartDate=<%=hfDateStart.Value %>&EndDate=<%=hfDateEnd.Value %>&PlotType=<%=hfPlotType.Value%>");
|
||||
//console.log("Start plotTS");
|
||||
var placeCod = document.getElementById('<%=hfPlaceCod.ClientID %>').value;
|
||||
//console.log("placeCod: " + placeCod);
|
||||
var dtStart = document.getElementById('<%=hfDateStart.ClientID %>').value;
|
||||
//console.log("dtStart: " + dtStart);
|
||||
var dtEnd = document.getElementById('<%=hfDateEnd.ClientID %>').value;
|
||||
//console.log("dtEnd: " + dtEnd);
|
||||
var plotType = document.getElementById('<%=hfPlotType.ClientID %>').value;
|
||||
//console.log("plotType: " + plotType);
|
||||
//console.log("../api/DayStats/" + placeCod + "?StartDate=" + dtStart + "&EndDate=" + dtEnd + "&PlotType=" + plotType);
|
||||
// caricamento pagina
|
||||
$.ajax({
|
||||
type: "GET",
|
||||
url: "../api/DayStats/<%=hfPlaceCod.Value %>?StartDate=<%=hfDateStart.Value %>&EndDate=<%=hfDateEnd.Value %>&PlotType=<%=hfPlotType.Value%>",
|
||||
url: "../api/DayStats/" + placeCod + "?StartDate=" + dtStart + "&EndDate=" + dtEnd + "&PlotType=" + plotType,
|
||||
contentType: "application/json; charset=utf-8",
|
||||
dataType: "json",
|
||||
success: OnSuccess_,
|
||||
@@ -124,11 +142,22 @@
|
||||
|
||||
// funzione di drawing ad OGNI pageload!
|
||||
function pageLoad() {
|
||||
// mostro panel loading
|
||||
var currDiv = document.getElementById("divLoading");
|
||||
currDiv.style.display = "block";
|
||||
// chiamo recupero dati + plot della TS
|
||||
plotTS();
|
||||
//console.log('pageLoad!');
|
||||
//console.log('pageLoad DailyStats! | ID: <%= this.ID %> ');
|
||||
try {
|
||||
try {
|
||||
// mostro panel loading
|
||||
var currDiv = document.getElementById('divLoading');
|
||||
currDiv.style.display = "block";
|
||||
}
|
||||
catch (error) {
|
||||
console.log(error);
|
||||
}
|
||||
|
||||
// chiamo recupero dati + plot della TS
|
||||
plotTS();
|
||||
}
|
||||
catch (error) {
|
||||
console.log(error);
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -1,21 +1,11 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
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 Protected Fields
|
||||
|
||||
protected string dateFormat = "yyyy-MM-dd";
|
||||
|
||||
#endregion Protected Fields
|
||||
|
||||
#region Public Properties
|
||||
|
||||
public DateTime DateEnd
|
||||
@@ -84,11 +74,14 @@ namespace NKC_WF.WebUserControls
|
||||
|
||||
#endregion Public Properties
|
||||
|
||||
#region Protected Fields
|
||||
|
||||
protected string dateFormat = "yyyy-MM-dd";
|
||||
|
||||
#endregion Protected Fields
|
||||
|
||||
#region Protected Methods
|
||||
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
}
|
||||
|
||||
#endregion Protected Methods
|
||||
}
|
||||
|
||||
@@ -14,15 +14,6 @@
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
|
||||
//var prm = Sys.WebForms.PageRequestManager.getInstance();
|
||||
//prm.add_pageLoaded(pageLoaded);
|
||||
|
||||
//function pageLoaded(sender, args) {
|
||||
// console.log('pageLoaded!');
|
||||
// // chiamo recupero dati + plot della TS e dell'Histogram
|
||||
// plotTS();
|
||||
//}
|
||||
|
||||
// funzione eseguita se successo al caricamento
|
||||
function OnSuccess_(reponse) {
|
||||
|
||||
|
||||
@@ -1,13 +1,11 @@
|
||||
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="cmp_reportSelector.ascx.cs" Inherits="NKC_WF.WebUserControls.cmp_reportSelector" %>
|
||||
|
||||
<ul class="nav nav-pills nav-justified">
|
||||
<li class="nav-item">
|
||||
<li class="nav-item px-2">
|
||||
<asp:LinkButton runat="server" ID="lbtBatchPreview" CssClass="btn btn-block btn-outline-primary" OnClick="lbtBatchPreview_Click"><%: traduci("RepBatchPreview") %></asp:LinkButton>
|
||||
</li>
|
||||
<li class="nav-item mx-2">
|
||||
<asp:LinkButton runat="server" ID="lbtUnloadPart" CssClass="btn btn-block btn-outline-primary" OnClick="lbtUnloadPart_Click"><%: traduci("RepUnloadPart") %></asp:LinkButton>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
|
||||
<li class="nav-item px-2">
|
||||
<asp:LinkButton runat="server" ID="lbtDayStats" CssClass="btn btn-block btn-outline-primary" OnClick="lbtDailyStats_Click"><%: traduci("RepDayStats") %></asp:LinkButton>
|
||||
</li>
|
||||
</ul>
|
||||
@@ -10,14 +10,21 @@ namespace NKC_WF.WebUserControls
|
||||
{
|
||||
public partial class cmp_reportSelector : BaseUserControl
|
||||
{
|
||||
#region Protected Properties
|
||||
|
||||
protected ReportType _selReport { get; set; } = ReportType.ND;
|
||||
|
||||
#endregion Protected Properties
|
||||
|
||||
#region Public Properties
|
||||
|
||||
public string currPage
|
||||
{
|
||||
get
|
||||
{
|
||||
string url = HttpContext.Current.Request.Url.PathAndQuery;
|
||||
if (url.Contains("?"))
|
||||
{
|
||||
url = url.Substring(0, url.IndexOf("?"));
|
||||
}
|
||||
return url;
|
||||
}
|
||||
}
|
||||
|
||||
public ReportType SelReport
|
||||
{
|
||||
get
|
||||
@@ -34,57 +41,47 @@ namespace NKC_WF.WebUserControls
|
||||
|
||||
#endregion Public Properties
|
||||
|
||||
#region Protected Properties
|
||||
|
||||
protected ReportType _selReport { get; set; } = ReportType.ND;
|
||||
|
||||
#endregion Protected Properties
|
||||
|
||||
#region Protected Methods
|
||||
|
||||
protected void lbtBatchPreview_Click(object sender, EventArgs e)
|
||||
{
|
||||
Response.Redirect("PlannerReportsBatchStats");
|
||||
}
|
||||
|
||||
protected void lbtDailyStats_Click(object sender, EventArgs e)
|
||||
{
|
||||
Response.Redirect("PlannerReportsDailyStats");
|
||||
}
|
||||
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
if (currPage.Contains("PlannerReportsBatchStats"))
|
||||
{
|
||||
lbtBatchPreview.CssClass = "btn btn-block btn-primary";
|
||||
}
|
||||
else if (currPage.Contains("PlannerReportsDailyStats"))
|
||||
{
|
||||
lbtDayStats.CssClass = "btn btn-block btn-primary";
|
||||
}
|
||||
}
|
||||
|
||||
#endregion Protected Methods
|
||||
|
||||
#region Private Methods
|
||||
|
||||
private void updateDisplay()
|
||||
{
|
||||
string baseCss = "btn btn-block btn-outline-primary";
|
||||
lbtBatchPreview.CssClass = baseCss;
|
||||
lbtUnloadPart.CssClass = baseCss;
|
||||
lbtDayStats.CssClass = baseCss;
|
||||
switch (_selReport)
|
||||
{
|
||||
case ReportType.BatchStats:
|
||||
lbtBatchPreview.CssClass = "btn btn-block btn-primary";
|
||||
break;
|
||||
|
||||
case ReportType.BatchUnloadPreview:
|
||||
lbtUnloadPart.CssClass = "btn btn-block btn-primary";
|
||||
break;
|
||||
|
||||
case ReportType.DailyReport:
|
||||
lbtDayStats.CssClass = "btn btn-block btn-primary";
|
||||
break;
|
||||
|
||||
case ReportType.ND:
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
#endregion Private Methods
|
||||
|
||||
#region Protected Methods
|
||||
|
||||
protected void lbtBatchPreview_Click(object sender, EventArgs e)
|
||||
{
|
||||
SelReport = ReportType.BatchStats;
|
||||
}
|
||||
|
||||
protected void lbtDailyStats_Click(object sender, EventArgs e)
|
||||
{
|
||||
SelReport = ReportType.DailyReport;
|
||||
}
|
||||
|
||||
protected void lbtUnloadPart_Click(object sender, EventArgs e)
|
||||
{
|
||||
SelReport = ReportType.BatchUnloadPreview;
|
||||
}
|
||||
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
}
|
||||
|
||||
#endregion Protected Methods
|
||||
}
|
||||
}
|
||||
@@ -23,15 +23,6 @@ namespace NKC_WF.WebUserControls
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.LinkButton lbtBatchPreview;
|
||||
|
||||
/// <summary>
|
||||
/// lbtUnloadPart control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.LinkButton lbtUnloadPart;
|
||||
|
||||
/// <summary>
|
||||
/// lbtDayStats control.
|
||||
/// </summary>
|
||||
|
||||
@@ -2,8 +2,6 @@
|
||||
|
||||
<%@ Register Src="~/WebUserControls/cmp_SheetsStats.ascx" TagPrefix="uc1" TagName="cmp_SheetsStats" %>
|
||||
<%@ Register Src="~/WebUserControls/cmp_reportSelector.ascx" TagPrefix="uc1" TagName="cmp_reportSelector" %>
|
||||
<%@ Register Src="~/WebUserControls/cmp_BatchStatsList.ascx" TagPrefix="uc1" TagName="cmp_BatchStatsList" %>
|
||||
<%@ Register Src="~/WebUserControls/cmp_DailyStatsList.ascx" TagPrefix="uc1" TagName="cmp_DailyStatsList" %>
|
||||
|
||||
<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">
|
||||
<asp:UpdatePanel runat="server" ID="uplBody">
|
||||
@@ -17,7 +15,7 @@
|
||||
<div class="col-2">
|
||||
<h3>Reports</h3>
|
||||
</div>
|
||||
<div class="col-9">
|
||||
<div class="col-8">
|
||||
<uc1:cmp_reportSelector runat="server" ID="cmp_reportSelector" />
|
||||
<asp:UpdateProgress ID="UpdateProgressDisplay" runat="server" DisplayAfter="100">
|
||||
<ProgressTemplate>
|
||||
@@ -27,23 +25,19 @@
|
||||
</ProgressTemplate>
|
||||
</asp:UpdateProgress>
|
||||
</div>
|
||||
<div class="col-1">
|
||||
<asp:LinkButton runat="server" ID="lbtRefreshData" CssClass="btn btn-success" OnClick="lbtRefreshData_Click"><i class="fa fa-refresh" aria-hidden="true"></i> Reload</asp:LinkButton>
|
||||
<div class="col-2">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
<div class="col-3"></div>
|
||||
<div class="col-9">
|
||||
<div class="row" id="divInstruction" runat="server">
|
||||
<div class="col-12">
|
||||
<div class="text-info text-center">
|
||||
<asp:Label runat="server" ID="lblInstruction" CssClass="alert alert-primary"><i class="fa fa-arrow-up" aria-hidden="true"></i> <%# traduci("PleaseSelectReportType") %><i class="fa fa-arrow-up" aria-hidden="true"></i></asp:Label>
|
||||
<asp:Label runat="server" ID="lblInstruction" CssClass="alert alert-primary p-4 display-4"><i class="fa fa-arrow-up" aria-hidden="true"></i> <%# traduci("PleaseSelectReportType") %><i class="fa fa-arrow-up" aria-hidden="true"></i></asp:Label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<uc1:cmp_SheetsStats runat="server" ID="cmp_SheetsStats" />
|
||||
<uc1:cmp_BatchStatsList runat="server" ID="cmp_BatchStatsList" />
|
||||
<uc1:cmp_DailyStatsList runat="server" ID="cmp_DailyStatsList" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -13,18 +13,6 @@ namespace NKC_WF.site
|
||||
{
|
||||
public partial class PlannerReports : BasePage
|
||||
{
|
||||
#region Protected Properties
|
||||
|
||||
protected int savedBatchId
|
||||
{
|
||||
get
|
||||
{
|
||||
return ComLib.getCurrBatchId(PlaceCod);
|
||||
}
|
||||
}
|
||||
|
||||
#endregion Protected Properties
|
||||
|
||||
#region Public Properties
|
||||
|
||||
/// <summary>
|
||||
@@ -65,102 +53,6 @@ namespace NKC_WF.site
|
||||
|
||||
#endregion Public Properties
|
||||
|
||||
#region Private Methods
|
||||
|
||||
private void Cmp_reportSelector_eh_doRefresh(object sender, EventArgs e)
|
||||
{
|
||||
// display in base al report selezionato
|
||||
updateDisplay();
|
||||
}
|
||||
|
||||
private void TryUpdateModel()
|
||||
{
|
||||
Thread.Sleep(50);
|
||||
DateTime oggi = DateTime.Today;
|
||||
// verifica se ci sia VETO x update da redis
|
||||
string rawVal = memLayer.ML.getRSV(ComLib.redVetoDayStats);
|
||||
if (string.IsNullOrEmpty(rawVal))
|
||||
{ // effettuo calcolo statistiche
|
||||
Stopwatch stopWatchLap = new Stopwatch();
|
||||
stopWatchLap.Start();
|
||||
// se non c'è effettua ricalcolo x i giorni necessari (da ultimo ricalcolo oppure da valore web.config)
|
||||
int numDays = memLayer.ML.CRI("repNumDayPre");
|
||||
// verifico ultimo record...
|
||||
var tabLast = DLMan.taDayStats.getLast();
|
||||
try
|
||||
{
|
||||
// se vuoto: 90gg
|
||||
if (tabLast == null || tabLast.Count == 0)
|
||||
{
|
||||
numDays = 90;
|
||||
}
|
||||
else
|
||||
{
|
||||
var lastRec = tabLast[0];
|
||||
// calcolo x eccesso la differenza in giorni
|
||||
var dayDiff = Math.Ceiling(oggi.Subtract(lastRec.DataRif).TotalDays + 1);
|
||||
int numDayLast = (int)dayDiff;
|
||||
numDays = numDays > numDayLast ? numDays : numDayLast;
|
||||
}
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
// verifico ultimo giorno disponibile...
|
||||
DateTime DateEnd = oggi.AddDays(1);
|
||||
DateTime DateStart = DateEnd.AddDays(-numDays);
|
||||
DLMan.taDayStats.ProductionUpdate(DateStart, DateEnd, "*", true);
|
||||
int vetoRecalcMin = memLayer.ML.CRI("repVetoRecalcMin");
|
||||
memLayer.ML.setRSV(ComLib.redVetoDayStats, $"Recalc Done | {DateStart} --> {DateEnd}", 60 * vetoRecalcMin);
|
||||
stopWatchLap.Stop();
|
||||
lgInfo($"DayStats DB ProductionUpdate: effettuato ricalcolo statistiche | periodo {DateStart} --> {DateEnd} | elapsed: {stopWatchLap.Elapsed.TotalMilliseconds} ms | veto ricalcolo per {vetoRecalcMin} minuti");
|
||||
}
|
||||
}
|
||||
|
||||
private void updateDisplay()
|
||||
{
|
||||
lblInstruction.DataBind();
|
||||
lblInstruction.Visible = false;
|
||||
cmp_SheetsStats.Visible = false;
|
||||
cmp_BatchStatsList.Visible = false;
|
||||
cmp_DailyStatsList.Visible = false;
|
||||
switch (cmp_reportSelector.SelReport)
|
||||
{
|
||||
case ReportType.BatchStats:
|
||||
cmp_BatchStatsList.Visible = true;
|
||||
break;
|
||||
|
||||
case ReportType.BatchUnloadPreview:
|
||||
cmp_SheetsStats.Visible = true;
|
||||
break;
|
||||
|
||||
case ReportType.DailyReport:
|
||||
cmp_DailyStatsList.Visible = true;
|
||||
break;
|
||||
|
||||
case ReportType.ND:
|
||||
default:
|
||||
lblInstruction.Visible = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
#endregion Private Methods
|
||||
|
||||
#region Protected Methods
|
||||
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
if (!Page.IsPostBack)
|
||||
{
|
||||
((SiteMaster)this.Master).showSearch = false;
|
||||
doUpdate();
|
||||
}
|
||||
//TryUpdateModel();
|
||||
cmp_reportSelector.eh_doRefresh += Cmp_reportSelector_eh_doRefresh;
|
||||
}
|
||||
|
||||
#endregion Protected Methods
|
||||
|
||||
#region Public Methods
|
||||
|
||||
/// <summary>
|
||||
@@ -180,9 +72,50 @@ namespace NKC_WF.site
|
||||
|
||||
#endregion Public Methods
|
||||
|
||||
protected void lbtRefreshData_Click(object sender, EventArgs e)
|
||||
#region Protected Properties
|
||||
|
||||
protected int savedBatchId
|
||||
{
|
||||
TryUpdateModel();
|
||||
get
|
||||
{
|
||||
return ComLib.getCurrBatchId(PlaceCod);
|
||||
}
|
||||
}
|
||||
|
||||
#endregion Protected Properties
|
||||
|
||||
#region Protected Methods
|
||||
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
if (!Page.IsPostBack)
|
||||
{
|
||||
((SiteMaster)this.Master).showSearch = false;
|
||||
doUpdate();
|
||||
}
|
||||
}
|
||||
|
||||
#endregion Protected Methods
|
||||
|
||||
#region Private Methods
|
||||
|
||||
private void updateDisplay()
|
||||
{
|
||||
divInstruction.Visible = false;
|
||||
cmp_SheetsStats.Visible = false;
|
||||
cmp_reportSelector.Visible = false;
|
||||
if (BatchId == 0)
|
||||
{
|
||||
lblInstruction.DataBind();
|
||||
divInstruction.Visible = true;
|
||||
cmp_reportSelector.Visible = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
cmp_SheetsStats.Visible = true;
|
||||
}
|
||||
}
|
||||
|
||||
#endregion Private Methods
|
||||
}
|
||||
}
|
||||
+2
-20
@@ -42,13 +42,13 @@ namespace NKC_WF.site
|
||||
protected global::System.Web.UI.UpdateProgress UpdateProgressDisplay;
|
||||
|
||||
/// <summary>
|
||||
/// lbtRefreshData control.
|
||||
/// divInstruction control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.LinkButton lbtRefreshData;
|
||||
protected global::System.Web.UI.HtmlControls.HtmlGenericControl divInstruction;
|
||||
|
||||
/// <summary>
|
||||
/// lblInstruction control.
|
||||
@@ -67,23 +67,5 @@ namespace NKC_WF.site
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::NKC_WF.WebUserControls.cmp_SheetsStats cmp_SheetsStats;
|
||||
|
||||
/// <summary>
|
||||
/// cmp_BatchStatsList control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::NKC_WF.WebUserControls.cmp_BatchStatsList cmp_BatchStatsList;
|
||||
|
||||
/// <summary>
|
||||
/// cmp_DailyStatsList control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::NKC_WF.WebUserControls.cmp_DailyStatsList cmp_DailyStatsList;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,43 @@
|
||||
<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="PlannerReportsBatchStats.aspx.cs" Inherits="NKC_WF.site.PlannerReportsBatchStats" %>
|
||||
|
||||
<%@ Register Src="~/WebUserControls/cmp_reportSelector.ascx" TagPrefix="uc1" TagName="cmp_reportSelector" %>
|
||||
<%@ Register Src="~/WebUserControls/cmp_BatchStatsList.ascx" TagPrefix="uc1" TagName="cmp_BatchStatsList" %>
|
||||
|
||||
<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">
|
||||
<asp:UpdatePanel runat="server" ID="uplBody">
|
||||
<ContentTemplate>
|
||||
<div class="my-2 mx-3">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<div class="row">
|
||||
<div class="col-2">
|
||||
<h3>Reports</h3>
|
||||
</div>
|
||||
<div class="col-9">
|
||||
<uc1:cmp_reportSelector runat="server" ID="cmp_reportSelector" />
|
||||
<asp:UpdateProgress ID="UpdateProgressDisplay" runat="server" DisplayAfter="100">
|
||||
<ProgressTemplate>
|
||||
<div class="progress">
|
||||
<div class="progress-bar bg-success progress-bar-striped progress-bar-animated" style="width: 70%"></div>
|
||||
</div>
|
||||
</ProgressTemplate>
|
||||
</asp:UpdateProgress>
|
||||
</div>
|
||||
<div class="col-1">
|
||||
<asp:LinkButton runat="server" ID="lbtRefreshData" CssClass="btn btn-success" OnClick="lbtRefreshData_Click"><i class="fa fa-refresh" aria-hidden="true"></i> Reload</asp:LinkButton>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<uc1:cmp_BatchStatsList runat="server" ID="cmp_BatchStatsList" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</asp:Content>
|
||||
|
||||
@@ -0,0 +1,95 @@
|
||||
using AppData;
|
||||
using NKC_WF.WebUserControls;
|
||||
using SteamWare;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Linq;
|
||||
using System.Threading;
|
||||
using System.Web;
|
||||
using System.Web.UI;
|
||||
using System.Web.UI.WebControls;
|
||||
|
||||
namespace NKC_WF.site
|
||||
{
|
||||
public partial class PlannerReportsBatchStats : BasePage
|
||||
{
|
||||
#region Protected Properties
|
||||
|
||||
protected int savedBatchId
|
||||
{
|
||||
get
|
||||
{
|
||||
return ComLib.getCurrBatchId(PlaceCod);
|
||||
}
|
||||
}
|
||||
|
||||
#endregion Protected Properties
|
||||
|
||||
#region Protected Methods
|
||||
|
||||
protected void lbtRefreshData_Click(object sender, EventArgs e)
|
||||
{
|
||||
TryUpdateModel();
|
||||
}
|
||||
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
if (!Page.IsPostBack)
|
||||
{
|
||||
((SiteMaster)this.Master).showSearch = false;
|
||||
}
|
||||
}
|
||||
|
||||
#endregion Protected Methods
|
||||
|
||||
#region Private Methods
|
||||
|
||||
private void TryUpdateModel()
|
||||
{
|
||||
Thread.Sleep(50);
|
||||
DateTime oggi = DateTime.Today;
|
||||
// verifica se ci sia VETO x update da redis
|
||||
string rawVal = memLayer.ML.getRSV(ComLib.redVetoDayStats);
|
||||
if (string.IsNullOrEmpty(rawVal))
|
||||
{
|
||||
// effettuo calcolo statistiche
|
||||
Stopwatch stopWatchLap = new Stopwatch();
|
||||
stopWatchLap.Start();
|
||||
// se non c'è effettua ricalcolo x i giorni necessari (da ultimo ricalcolo oppure da
|
||||
// valore web.config)
|
||||
int numDays = memLayer.ML.CRI("repNumDayPre");
|
||||
// verifico ultimo record...
|
||||
var tabLast = DLMan.taDayStats.getLast();
|
||||
try
|
||||
{
|
||||
// se vuoto: 90gg
|
||||
if (tabLast == null || tabLast.Count == 0)
|
||||
{
|
||||
numDays = 90;
|
||||
}
|
||||
else
|
||||
{
|
||||
var lastRec = tabLast[0];
|
||||
// calcolo x eccesso la differenza in giorni
|
||||
var dayDiff = Math.Ceiling(oggi.Subtract(lastRec.DataRif).TotalDays + 1);
|
||||
int numDayLast = (int)dayDiff;
|
||||
numDays = numDays > numDayLast ? numDays : numDayLast;
|
||||
}
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
// verifico ultimo giorno disponibile...
|
||||
DateTime DateEnd = oggi.AddDays(1);
|
||||
DateTime DateStart = DateEnd.AddDays(-numDays);
|
||||
DLMan.taDayStats.ProductionUpdate(DateStart, DateEnd, "*", true);
|
||||
int vetoRecalcMin = memLayer.ML.CRI("repVetoRecalcMin");
|
||||
memLayer.ML.setRSV(ComLib.redVetoDayStats, $"Recalc Done | {DateStart} --> {DateEnd}", 60 * vetoRecalcMin);
|
||||
stopWatchLap.Stop();
|
||||
lgInfo($"DayStats DB ProductionUpdate: effettuato ricalcolo statistiche | periodo {DateStart} --> {DateEnd} | elapsed: {stopWatchLap.Elapsed.TotalMilliseconds} ms | veto ricalcolo per {vetoRecalcMin} minuti");
|
||||
}
|
||||
}
|
||||
|
||||
#endregion Private Methods
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace NKC_WF.site
|
||||
{
|
||||
|
||||
|
||||
public partial class PlannerReportsBatchStats
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// uplBody 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 uplBody;
|
||||
|
||||
/// <summary>
|
||||
/// cmp_reportSelector control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::NKC_WF.WebUserControls.cmp_reportSelector cmp_reportSelector;
|
||||
|
||||
/// <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>
|
||||
/// lbtRefreshData control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.LinkButton lbtRefreshData;
|
||||
|
||||
/// <summary>
|
||||
/// cmp_BatchStatsList control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::NKC_WF.WebUserControls.cmp_BatchStatsList cmp_BatchStatsList;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="PlannerReportsDailyStats.aspx.cs" Inherits="NKC_WF.site.PlannerReportsDailyStats" %>
|
||||
|
||||
<%@ Register Src="~/WebUserControls/cmp_reportSelector.ascx" TagPrefix="uc1" TagName="cmp_reportSelector" %>
|
||||
<%@ Register Src="~/WebUserControls/cmp_DailyStatsList.ascx" TagPrefix="uc1" TagName="cmp_DailyStatsList" %>
|
||||
|
||||
<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">
|
||||
<asp:UpdatePanel runat="server" ID="uplBody">
|
||||
<ContentTemplate>
|
||||
<div class="my-2 mx-3">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<div class="row">
|
||||
<div class="col-2">
|
||||
<h3>Reports</h3>
|
||||
</div>
|
||||
<div class="col-9">
|
||||
<uc1:cmp_reportSelector runat="server" ID="cmp_reportSelector" />
|
||||
<asp:UpdateProgress ID="UpdateProgressDisplay" runat="server" DisplayAfter="100">
|
||||
<ProgressTemplate>
|
||||
<div class="progress">
|
||||
<div class="progress-bar bg-success progress-bar-striped progress-bar-animated" style="width: 70%"></div>
|
||||
</div>
|
||||
</ProgressTemplate>
|
||||
</asp:UpdateProgress>
|
||||
</div>
|
||||
<div class="col-1">
|
||||
<asp:LinkButton runat="server" ID="lbtRefreshData" CssClass="btn btn-success" OnClick="lbtRefreshData_Click"><i class="fa fa-refresh" aria-hidden="true"></i> Reload</asp:LinkButton>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<uc1:cmp_DailyStatsList runat="server" ID="cmp_DailyStatsList" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</asp:Content>
|
||||
@@ -0,0 +1,95 @@
|
||||
using AppData;
|
||||
using NKC_WF.WebUserControls;
|
||||
using SteamWare;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Linq;
|
||||
using System.Threading;
|
||||
using System.Web;
|
||||
using System.Web.UI;
|
||||
using System.Web.UI.WebControls;
|
||||
|
||||
namespace NKC_WF.site
|
||||
{
|
||||
public partial class PlannerReportsDailyStats : BasePage
|
||||
{
|
||||
#region Protected Properties
|
||||
|
||||
protected int savedBatchId
|
||||
{
|
||||
get
|
||||
{
|
||||
return ComLib.getCurrBatchId(PlaceCod);
|
||||
}
|
||||
}
|
||||
|
||||
#endregion Protected Properties
|
||||
|
||||
#region Protected Methods
|
||||
|
||||
protected void lbtRefreshData_Click(object sender, EventArgs e)
|
||||
{
|
||||
TryUpdateModel();
|
||||
}
|
||||
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
if (!Page.IsPostBack)
|
||||
{
|
||||
((SiteMaster)this.Master).showSearch = false;
|
||||
}
|
||||
}
|
||||
|
||||
#endregion Protected Methods
|
||||
|
||||
#region Private Methods
|
||||
|
||||
private void TryUpdateModel()
|
||||
{
|
||||
Thread.Sleep(50);
|
||||
DateTime oggi = DateTime.Today;
|
||||
// verifica se ci sia VETO x update da redis
|
||||
string rawVal = memLayer.ML.getRSV(ComLib.redVetoDayStats);
|
||||
if (string.IsNullOrEmpty(rawVal))
|
||||
{
|
||||
// effettuo calcolo statistiche
|
||||
Stopwatch stopWatchLap = new Stopwatch();
|
||||
stopWatchLap.Start();
|
||||
// se non c'è effettua ricalcolo x i giorni necessari (da ultimo ricalcolo oppure da
|
||||
// valore web.config)
|
||||
int numDays = memLayer.ML.CRI("repNumDayPre");
|
||||
// verifico ultimo record...
|
||||
var tabLast = DLMan.taDayStats.getLast();
|
||||
try
|
||||
{
|
||||
// se vuoto: 90gg
|
||||
if (tabLast == null || tabLast.Count == 0)
|
||||
{
|
||||
numDays = 90;
|
||||
}
|
||||
else
|
||||
{
|
||||
var lastRec = tabLast[0];
|
||||
// calcolo x eccesso la differenza in giorni
|
||||
var dayDiff = Math.Ceiling(oggi.Subtract(lastRec.DataRif).TotalDays + 1);
|
||||
int numDayLast = (int)dayDiff;
|
||||
numDays = numDays > numDayLast ? numDays : numDayLast;
|
||||
}
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
// verifico ultimo giorno disponibile...
|
||||
DateTime DateEnd = oggi.AddDays(1);
|
||||
DateTime DateStart = DateEnd.AddDays(-numDays);
|
||||
DLMan.taDayStats.ProductionUpdate(DateStart, DateEnd, "*", true);
|
||||
int vetoRecalcMin = memLayer.ML.CRI("repVetoRecalcMin");
|
||||
memLayer.ML.setRSV(ComLib.redVetoDayStats, $"Recalc Done | {DateStart} --> {DateEnd}", 60 * vetoRecalcMin);
|
||||
stopWatchLap.Stop();
|
||||
lgInfo($"DayStats DB ProductionUpdate: effettuato ricalcolo statistiche | periodo {DateStart} --> {DateEnd} | elapsed: {stopWatchLap.Elapsed.TotalMilliseconds} ms | veto ricalcolo per {vetoRecalcMin} minuti");
|
||||
}
|
||||
}
|
||||
|
||||
#endregion Private Methods
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace NKC_WF.site
|
||||
{
|
||||
|
||||
|
||||
public partial class PlannerReportsDailyStats
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// uplBody 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 uplBody;
|
||||
|
||||
/// <summary>
|
||||
/// cmp_reportSelector control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::NKC_WF.WebUserControls.cmp_reportSelector cmp_reportSelector;
|
||||
|
||||
/// <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>
|
||||
/// lbtRefreshData control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.LinkButton lbtRefreshData;
|
||||
|
||||
/// <summary>
|
||||
/// cmp_DailyStatsList control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::NKC_WF.WebUserControls.cmp_DailyStatsList cmp_DailyStatsList;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
<%@ Page Title="" Language="C#" MasterPageFile="~/SiteContent.master" AutoEventWireup="true" CodeBehind="TestChart.aspx.cs" Inherits="NKC_WF.site.TestChart" %>
|
||||
|
||||
<%@ Register Src="~/WebUserControls/cmp_BatchStatsPlot.ascx" TagPrefix="uc1" TagName="cmp_BatchStatsPlot" %>
|
||||
<%@ Register Src="~/WebUserControls/cmp_DailyStatsPlot.ascx" TagPrefix="uc1" TagName="cmp_DailyStatsPlot" %>
|
||||
|
||||
|
||||
|
||||
<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">
|
||||
<h1>Chart Js test</h1>
|
||||
<asp:UpdatePanel runat="server" ID="uplBody" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<asp:LinkButton runat="server" ID="lbtRefreshData" CssClass="btn btn-success" OnClick="lbtRefreshData_Click"><i class="fa fa-refresh" aria-hidden="true"></i> Reload</asp:LinkButton>
|
||||
<asp:DropDownList runat="server" ID="ddlChart">
|
||||
<asp:ListItem Text="Graph_01" Value="1"></asp:ListItem>
|
||||
<asp:ListItem Text="Graph_02" Value="2"></asp:ListItem>
|
||||
<asp:ListItem Text="Graph_03" Value="3"></asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
<uc1:cmp_BatchStatsPlot runat="server" ID="cmp_BatchStatsPlot" />
|
||||
<uc1:cmp_DailyStatsPlot runat="server" ID="cmp_DailyStatsPlot" />
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</asp:Content>
|
||||
@@ -0,0 +1,52 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using System.Web.UI;
|
||||
using System.Web.UI.WebControls;
|
||||
|
||||
namespace NKC_WF.site
|
||||
{
|
||||
public partial class TestChart : System.Web.UI.Page
|
||||
{
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
setGraph();
|
||||
}
|
||||
|
||||
private void setGraph()
|
||||
{
|
||||
cmp_BatchStatsPlot.Visible = false;
|
||||
cmp_DailyStatsPlot.Visible = false;
|
||||
Random rnd = new Random();
|
||||
switch (ddlChart.SelectedValue)
|
||||
{
|
||||
case "1":
|
||||
int numRec = rnd.Next(50, 250);
|
||||
cmp_BatchStatsPlot.PlotType = "Yeld";
|
||||
cmp_BatchStatsPlot.ShowLast = numRec;
|
||||
cmp_BatchStatsPlot.Legend = $"PROVA | {numRec} | {DateTime.Now:HH:mm:ss}";
|
||||
cmp_BatchStatsPlot.Visible = true;
|
||||
break;
|
||||
case "2":
|
||||
cmp_DailyStatsPlot.PlaceCod = "[ALL]";
|
||||
cmp_DailyStatsPlot.PlotType = "OEE";
|
||||
cmp_DailyStatsPlot.DateStart = DateTime.Today.AddMonths(-1);
|
||||
cmp_DailyStatsPlot.DateEnd = DateTime.Today;
|
||||
cmp_DailyStatsPlot.Visible = true;
|
||||
break;
|
||||
case "3":
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
uplBody.Update();
|
||||
}
|
||||
|
||||
protected void lbtRefreshData_Click(object sender, EventArgs e)
|
||||
{
|
||||
setGraph();
|
||||
}
|
||||
}
|
||||
}
|
||||
Generated
+62
@@ -0,0 +1,62 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace NKC_WF.site
|
||||
{
|
||||
|
||||
|
||||
public partial class TestChart
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// uplBody 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 uplBody;
|
||||
|
||||
/// <summary>
|
||||
/// lbtRefreshData control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.LinkButton lbtRefreshData;
|
||||
|
||||
/// <summary>
|
||||
/// ddlChart control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.DropDownList ddlChart;
|
||||
|
||||
/// <summary>
|
||||
/// cmp_BatchStatsPlot control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::NKC_WF.WebUserControls.cmp_BatchStatsPlot cmp_BatchStatsPlot;
|
||||
|
||||
/// <summary>
|
||||
/// cmp_DailyStatsPlot control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::NKC_WF.WebUserControls.cmp_DailyStatsPlot cmp_DailyStatsPlot;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user