Eliminazione componente inutilizzata
This commit is contained in:
@@ -1,53 +0,0 @@
|
||||
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="cmp_orderStatus.ascx.cs" Inherits="NKC_WF.WebUserControls.cmp_orderStatus" %>
|
||||
|
||||
|
||||
<asp:UpdatePanel ID="updPanelStatus" runat="server">
|
||||
<ContentTemplate>
|
||||
<div class="row">
|
||||
<div class="col-6">
|
||||
Stiamo processando il batch <b><%: Session["BatchID"] %></b>
|
||||
<br />
|
||||
nome file: pippo.csv
|
||||
<br />
|
||||
Sono contenuti num XX Ordini per un totale di YY Items.
|
||||
</div>
|
||||
<div class="col-6">
|
||||
<h3>
|
||||
<asp:Label runat="server" ID="lblStatusCode" /></h3>
|
||||
<asp:Label runat="server" ID="lblProcNotes" />
|
||||
</div>
|
||||
<div class="col-12" runat="server" id="divProgress" visible="false">
|
||||
<div class="progress">
|
||||
<div class="progress-bar progress-bar-striped progress-bar-animated" role="progressbar" aria-valuenow="75" aria-valuemin="0" aria-valuemax="100" style="width: 75%"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-6">
|
||||
<dl class="row">
|
||||
<dd class="col-sm-6"><%: traduci("NestingRuntime") %></dd>
|
||||
<dt class="col-sm-6 text-right">
|
||||
<asp:Label runat="server" ID="lblNestingRuntime" />
|
||||
(sec)</dt>
|
||||
</dl>
|
||||
</div>
|
||||
<div class="col-6">
|
||||
<dl class="row">
|
||||
<dd class="col-sm-6"><%: traduci("WorkingEstTime") %></dd>
|
||||
<dt class="col-sm-6 text-right">
|
||||
<asp:Label runat="server" ID="lblWrktimeEst" />
|
||||
(minutes)</dt>
|
||||
</dl>
|
||||
</div>
|
||||
<div class="col-12" runat="server" id="divButtons">
|
||||
<div class="row">
|
||||
<div class="col-6">
|
||||
<asp:LinkButton runat="server" CssClass="btn btn-block btn-success" ID="lbtConfirm" OnClick="lbtConfirm_Click">Accetta</asp:LinkButton>
|
||||
</div>
|
||||
<div class="col-6">
|
||||
<asp:LinkButton runat="server" CssClass="btn btn-block btn-danger" ID="lbtCancel" OnClick="lbtCancel_Click">Annulla</asp:LinkButton>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<asp:Timer ID="TimerUpdateStatus" runat="server" Enabled="false" Interval="500" OnTick="TimerUpdateStatus_Tick"></asp:Timer>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
@@ -1,98 +0,0 @@
|
||||
using AppData;
|
||||
using Newtonsoft.Json;
|
||||
using NKC_SDK;
|
||||
using SteamWare;
|
||||
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_orderStatus : System.Web.UI.UserControl
|
||||
{
|
||||
public orderStatus statoBatch = new orderStatus();
|
||||
/// <summary>
|
||||
/// Hash redis per il canale di comunicazione dei batch eseguiti/in esecuzione
|
||||
/// </summary>
|
||||
protected string batchInChannel = "NKC:IN:batchReq";
|
||||
/// <summary>
|
||||
/// Wrapper traduzione termini
|
||||
/// </summary>
|
||||
/// <param name="lemma"></param>
|
||||
/// <returns></returns>
|
||||
public string traduci(string lemma)
|
||||
{
|
||||
return SteamWare.user_std.UtSn.Traduci(lemma);
|
||||
}
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
updateStatus();
|
||||
}
|
||||
/// <summary>
|
||||
/// ID del batch corrente
|
||||
/// </summary>
|
||||
protected int currBatchID
|
||||
{
|
||||
get
|
||||
{
|
||||
int answ = 0;
|
||||
if (memLayer.ML.isInSessionObject("BatchID"))
|
||||
{
|
||||
answ = memLayer.ML.IntSessionObj("BatchID");
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// Aggiorna visualizzazione status processo
|
||||
/// </summary>
|
||||
private void updateStatus()
|
||||
{
|
||||
// se trova batch non riportati in REDIS li scrive x richiedere processing
|
||||
string batchKey = $"{batchInChannel}:{currBatchID}";
|
||||
// per prima cosa recupero da REDIS lo stato...
|
||||
bool statusPresent = !string.IsNullOrEmpty(memLayer.ML.getRSV(batchKey));
|
||||
if (statusPresent)
|
||||
{
|
||||
string payload = memLayer.ML.getRSV(batchKey);
|
||||
if (!string.IsNullOrEmpty(payload))
|
||||
{
|
||||
try
|
||||
{
|
||||
statoBatch = JsonConvert.DeserializeObject<orderStatus>(payload);
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
// aggiorno componente...
|
||||
lblStatusCode.Text = statoBatch.ProcessStatus.ToString();
|
||||
lblProcNotes.Text = statoBatch.ProcessNotes;
|
||||
lblNestingRuntime.Text = statoBatch.ProcessingRuntime.ToString();
|
||||
lblWrktimeEst.Text = (statoBatch.EstimatedWorktime / 60).ToString();
|
||||
// secondo status mostro barra...
|
||||
divProgress.Visible = (statoBatch.ProcessStatus > procStatus.waiting && statoBatch.ProcessStatus < procStatus.error);
|
||||
divButtons.Visible = (statoBatch.ProcessStatus > procStatus.error && statoBatch.ProcessStatus < procStatus.accepted);
|
||||
}
|
||||
}
|
||||
TimerUpdateStatus.Enabled = statusPresent;
|
||||
|
||||
}
|
||||
|
||||
protected void TimerUpdateStatus_Tick(object sender, EventArgs e)
|
||||
{
|
||||
updateStatus();
|
||||
}
|
||||
|
||||
protected void lbtConfirm_Click(object sender, EventArgs e)
|
||||
{
|
||||
// accettazione ordine: scrivo su DB e QUINDI su redis indico accepted
|
||||
}
|
||||
|
||||
protected void lbtCancel_Click(object sender, EventArgs e)
|
||||
{
|
||||
// rifiuto ordine: ELIMINO su DB e QUINDI su redis indico refused
|
||||
}
|
||||
}
|
||||
}
|
||||
-105
@@ -1,105 +0,0 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <generato automaticamente>
|
||||
// Codice generato da uno strumento.
|
||||
//
|
||||
// Le modifiche a questo file possono causare un comportamento non corretto e verranno perse se
|
||||
// il codice viene rigenerato.
|
||||
// </generato automaticamente>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace NKC_WF.WebUserControls {
|
||||
|
||||
|
||||
public partial class cmp_orderStatus {
|
||||
|
||||
/// <summary>
|
||||
/// Controllo updPanelStatus.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Campo generato automaticamente.
|
||||
/// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.UpdatePanel updPanelStatus;
|
||||
|
||||
/// <summary>
|
||||
/// Controllo lblStatusCode.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Campo generato automaticamente.
|
||||
/// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Label lblStatusCode;
|
||||
|
||||
/// <summary>
|
||||
/// Controllo lblProcNotes.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Campo generato automaticamente.
|
||||
/// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Label lblProcNotes;
|
||||
|
||||
/// <summary>
|
||||
/// Controllo divProgress.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Campo generato automaticamente.
|
||||
/// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.HtmlControls.HtmlGenericControl divProgress;
|
||||
|
||||
/// <summary>
|
||||
/// Controllo lblNestingRuntime.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Campo generato automaticamente.
|
||||
/// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Label lblNestingRuntime;
|
||||
|
||||
/// <summary>
|
||||
/// Controllo lblWrktimeEst.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Campo generato automaticamente.
|
||||
/// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Label lblWrktimeEst;
|
||||
|
||||
/// <summary>
|
||||
/// Controllo divButtons.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Campo generato automaticamente.
|
||||
/// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.HtmlControls.HtmlGenericControl divButtons;
|
||||
|
||||
/// <summary>
|
||||
/// Controllo lbtConfirm.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Campo generato automaticamente.
|
||||
/// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.LinkButton lbtConfirm;
|
||||
|
||||
/// <summary>
|
||||
/// Controllo lbtCancel.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Campo generato automaticamente.
|
||||
/// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.LinkButton lbtCancel;
|
||||
|
||||
/// <summary>
|
||||
/// Controllo TimerUpdateStatus.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Campo generato automaticamente.
|
||||
/// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.Timer TimerUpdateStatus;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user