Nuovi obj validazione

This commit is contained in:
Samuele E. Locatelli
2019-12-31 09:05:57 +01:00
parent 8536322919
commit 4e411feeb5
6 changed files with 198 additions and 1 deletions
+8 -1
View File
@@ -1,6 +1,8 @@
<%@ Page Title="" Language="C#" MasterPageFile="~/SiteContent.master" AutoEventWireup="true" CodeBehind="PartValidation.aspx.cs" Inherits="NKC_WF.PartValidation" %>
<%@ Register Src="~/WebUserControls/cmp_batchList.ascx" TagPrefix="uc1" TagName="cmp_batchList" %>
<%@ Register Src="~/WebUserControls/cmp_validationSummary.ascx" TagPrefix="uc1" TagName="cmp_validationSummary" %>
<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">
<div class="container">
@@ -9,7 +11,12 @@
<h3><%: traduci("PartValidation") %></h3>
</div>
<div class="card-body">
<div class="row">
<div class="row">
<div class="col-12">
<uc1:cmp_validationSummary runat="server" id="cmp_validationSummary" />
</div>
</div>
<div class="row">
<div class="col-12" runat="server" id="divBatchList">
<uc1:cmp_batchList runat="server" ID="cmp_batchList" listMode="PartsEval" />
</div>
+5
View File
@@ -6,7 +6,12 @@ namespace NKC_WF
{
protected void Page_Load(object sender, EventArgs e)
{
cmp_validationSummary.eh_doRefresh += Cmp_validationSummary_eh_doRefresh;
}
private void Cmp_validationSummary_eh_doRefresh(object sender, EventArgs e)
{
cmp_batchList.doUpdate();
}
}
}
+9
View File
@@ -14,6 +14,15 @@ namespace NKC_WF
public partial class PartValidation
{
/// <summary>
/// Controllo cmp_validationSummary.
/// </summary>
/// <remarks>
/// Campo generato automaticamente.
/// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
/// </remarks>
protected global::NKC_WF.WebUserControls.cmp_validationSummary cmp_validationSummary;
/// <summary>
/// Controllo divBatchList.
/// </summary>
@@ -0,0 +1,58 @@
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="cmp_validationSummary.ascx.cs" Inherits="NKC_WF.WebUserControls.cmp_validationSummary" %>
<div class="row">
<div class="col-6">
<h3>Validation Summary</h3>
</div>
<div class="col-3">
<asp:LinkButton runat="server" ID="lbtRevalidate" CssClass="btn btn-sm btn-danger btn-block" OnClick="lbtRevalidate_Click"><i class="fa fa-bell-o" aria-hidden="true"></i> Re-Validate PARTS (KO)</asp:LinkButton>
</div>
<div class="col-3">
<asp:LinkButton runat="server" ID="lbtValidateMissing" CssClass="btn btn-sm btn-secondary btn-block" OnClick="lbtValidateMissing_Click"><i class="fa fa-bell-o" aria-hidden="true"></i> Validate NEW PARTS</asp:LinkButton>
</div>
</div>
<asp:FormView ID="frmView" runat="server" DataSourceID="ods" Width="100%">
<ItemTemplate>
<div class="row">
<div class="col-3 text-info">
<div class="row">
<div class="col">
# Parts
</div>
<div class="col text-right font-weight-bold">
<asp:Label ID="TotPartsLabel" runat="server" Text='<%# Eval("TotParts") %>' />
</div>
</div>
</div>
<div class="col-3 text-success">
<div class="row">
<div class="col">
# Validated
</div>
<div class="col text-right font-weight-bold">
<asp:Label ID="QtyOkLabel" runat="server" Text='<%# Eval("QtyOk") %>' />
</div>
</div>
</div>
<div class="col-3 text-danger">
<div class="row">
<div class="col">
# NOT Valid
</div>
<div class="col text-right font-weight-bold">
<asp:Label ID="QtyKoLabel" runat="server" Text='<%# Eval("QtyKo") %>' />
</div>
</div>
</div>
<div class="col-3 text-secondary">
<div class="row">
<div class="col">
# Unknown
</div>
<div class="col text-right font-weight-bold">
<asp:Label ID="QtyUnknLabel" runat="server" Text='<%# Eval("QtyUnkn") %>' />
</div>
</div>
</ItemTemplate>
</asp:FormView>
<asp:ObjectDataSource ID="ods" runat="server" OldValuesParameterFormatString="original_{0}" SelectMethod="GetData" TypeName="AppData.DS_AppTableAdapters.PartValidParetoTableAdapter"></asp:ObjectDataSource>
@@ -0,0 +1,65 @@
using AppData;
using SteamWare;
using System;
using System.Web.UI;
namespace NKC_WF.WebUserControls
{
public partial class cmp_validationSummary : BaseUserControl
{
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
fixVisibility();
}
}
/// <summary>
/// fix visibilità buttons
/// </summary>
private void fixVisibility()
{
// controllo SE HO nuove PARTS da validare...
var tabItems2Valid = DataLayer.man.taIL.getNeedValid();
var tabItemsUnValid = DataLayer.man.taIL.getUnValid();
lbtValidateMissing.Visible = tabItems2Valid.Count > 0;
lbtRevalidate.Visible = tabItemsUnValid.Count > 0;
}
protected void lbtValidateMissing_Click(object sender, EventArgs e)
{
// chiamo stored x creazione NUOVI BATCH...
try
{
DataLayer.man.taBL.createPartValBatch(memLayer.ML.CRS("cadBaseBath"));
// eventualmente mando primo batch da validare...
bool newValidSent = ComLib.sendFirstValidationBatch();
}
catch
{ }
// update!
doUpdate();
}
protected void lbtRevalidate_Click(object sender, EventArgs e)
{
// rimetto da validare tramite stored
try
{
DataLayer.man.taBL.resetPartUnValid(memLayer.ML.CRS("cadBaseBath"));
// eventualmente mando primo batch da validare...
bool newValidSent = ComLib.sendFirstValidationBatch();
}
catch
{ }
// update!
doUpdate();
}
private void doUpdate()
{
frmView.DataBind();
raiseEvent();
}
}
}
@@ -0,0 +1,53 @@
//------------------------------------------------------------------------------
// <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_validationSummary
{
/// <summary>
/// Controllo lbtRevalidate.
/// </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 lbtRevalidate;
/// <summary>
/// Controllo lbtValidateMissing.
/// </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 lbtValidateMissing;
/// <summary>
/// Controllo frmView.
/// </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.FormView frmView;
/// <summary>
/// Controllo ods.
/// </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.ObjectDataSource ods;
}
}