OK gestione painted

This commit is contained in:
Samuele E. Locatelli
2020-02-17 18:00:10 +01:00
parent 73f81018d0
commit 2f4757b7bb
5 changed files with 57 additions and 17 deletions
+5 -12
View File
@@ -18102,12 +18102,11 @@ SELECT MatID, MatExtCode, MatDesc, ApprovDate, ApprovUser, L_mm, W_mm, T_mm, Mat
this._commandCollection[5].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@BinIndex", global::System.Data.SqlDbType.Int, 4, global::System.Data.ParameterDirection.Input, 10, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
this._commandCollection[6] = new global::System.Data.SqlClient.SqlCommand();
this._commandCollection[6].Connection = this.Connection;
this._commandCollection[6].CommandText = "dbo.stp_BIN_update";
this._commandCollection[6].CommandText = "dbo.stp_BIN_updatePainted";
this._commandCollection[6].CommandType = global::System.Data.CommandType.StoredProcedure;
this._commandCollection[6].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@RETURN_VALUE", global::System.Data.SqlDbType.Int, 4, global::System.Data.ParameterDirection.ReturnValue, 10, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
this._commandCollection[6].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_BinID", global::System.Data.SqlDbType.Int, 4, global::System.Data.ParameterDirection.Input, 10, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
this._commandCollection[6].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@FillDate", global::System.Data.SqlDbType.DateTime, 8, global::System.Data.ParameterDirection.Input, 23, 3, null, global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
this._commandCollection[6].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@PrintDate", global::System.Data.SqlDbType.DateTime, 8, global::System.Data.ParameterDirection.Input, 23, 3, null, global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
this._commandCollection[6].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@PaintDate", global::System.Data.SqlDbType.DateTime, 8, global::System.Data.ParameterDirection.Input, 23, 3, null, global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
@@ -18235,7 +18234,7 @@ SELECT MatID, MatExtCode, MatDesc, ApprovDate, ApprovUser, L_mm, W_mm, T_mm, Mat
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")]
[global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
[global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Select, false)]
public virtual DS_App.BinsDataTable updateQuery(global::System.Nullable<int> Original_BinID, global::System.Nullable<global::System.DateTime> FillDate, global::System.Nullable<global::System.DateTime> PrintDate) {
public virtual DS_App.BinsDataTable updatePainted(global::System.Nullable<int> Original_BinID, global::System.Nullable<global::System.DateTime> PaintDate) {
this.Adapter.SelectCommand = this.CommandCollection[6];
if ((Original_BinID.HasValue == true)) {
this.Adapter.SelectCommand.Parameters[1].Value = ((int)(Original_BinID.Value));
@@ -18243,18 +18242,12 @@ SELECT MatID, MatExtCode, MatDesc, ApprovDate, ApprovUser, L_mm, W_mm, T_mm, Mat
else {
this.Adapter.SelectCommand.Parameters[1].Value = global::System.DBNull.Value;
}
if ((FillDate.HasValue == true)) {
this.Adapter.SelectCommand.Parameters[2].Value = ((System.DateTime)(FillDate.Value));
if ((PaintDate.HasValue == true)) {
this.Adapter.SelectCommand.Parameters[2].Value = ((System.DateTime)(PaintDate.Value));
}
else {
this.Adapter.SelectCommand.Parameters[2].Value = global::System.DBNull.Value;
}
if ((PrintDate.HasValue == true)) {
this.Adapter.SelectCommand.Parameters[3].Value = ((System.DateTime)(PrintDate.Value));
}
else {
this.Adapter.SelectCommand.Parameters[3].Value = global::System.DBNull.Value;
}
DS_App.BinsDataTable dataTable = new DS_App.BinsDataTable();
this.Adapter.Fill(dataTable);
return dataTable;
+3 -4
View File
@@ -1135,15 +1135,14 @@ FROM v_BinDetail</CommandText>
</DbCommand>
</SelectCommand>
</DbSource>
<DbSource ConnectionRef="Sauder_NKCConnectionString (Settings)" DbObjectName="Sauder_NKC.dbo.stp_BIN_update" DbObjectType="StoredProcedure" GenerateMethods="Get" GenerateShortCommands="true" GeneratorGetMethodName="updateQuery" GetMethodModifier="Public" GetMethodName="updateQuery" QueryType="Rowset" ScalarCallRetval="System.Object, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" UseOptimisticConcurrency="true" UserGetMethodName="updateQuery" UserSourceName="updateQuery">
<DbSource ConnectionRef="Sauder_NKCConnectionString (Settings)" DbObjectName="Sauder_NKC.dbo.stp_BIN_updatePainted" DbObjectType="StoredProcedure" GenerateMethods="Get" GenerateShortCommands="true" GeneratorGetMethodName="updatePainted" GetMethodModifier="Public" GetMethodName="updatePainted" QueryType="Rowset" ScalarCallRetval="System.Object, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" UseOptimisticConcurrency="true" UserGetMethodName="updatePainted" UserSourceName="updatePainted">
<SelectCommand>
<DbCommand CommandType="StoredProcedure" ModifiedByUser="false">
<CommandText>dbo.stp_BIN_update</CommandText>
<CommandText>dbo.stp_BIN_updatePainted</CommandText>
<Parameters>
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DataTypeServer="int" DbType="Int32" Direction="ReturnValue" ParameterName="@RETURN_VALUE" Precision="10" ProviderType="Int" Scale="0" Size="4" SourceColumnNullMapping="false" SourceVersion="Current" />
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DataTypeServer="int" DbType="Int32" Direction="Input" ParameterName="@Original_BinID" Precision="10" ProviderType="Int" Scale="0" Size="4" SourceColumnNullMapping="false" SourceVersion="Current" />
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DataTypeServer="datetime" DbType="DateTime" Direction="Input" ParameterName="@FillDate" Precision="23" ProviderType="DateTime" Scale="3" Size="8" SourceColumnNullMapping="false" SourceVersion="Current" />
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DataTypeServer="datetime" DbType="DateTime" Direction="Input" ParameterName="@PrintDate" Precision="23" ProviderType="DateTime" Scale="3" Size="8" SourceColumnNullMapping="false" SourceVersion="Current" />
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DataTypeServer="datetime" DbType="DateTime" Direction="Input" ParameterName="@PaintDate" Precision="23" ProviderType="DateTime" Scale="3" Size="8" SourceColumnNullMapping="false" SourceVersion="Current" />
</Parameters>
</DbCommand>
</SelectCommand>
+2
View File
@@ -13,6 +13,8 @@
<uc1:cmp_barcode runat="server" ID="cmp_barcode" />
<asp:HiddenField runat="server" ID="hfLastBCode" />
<asp:HiddenField runat="server" ID="hfLastValidBCode" />
<asp:LinkButton runat="server" ID="lbtConfirmPaint" CssClass="btn btn-block btn-warning text-uppercase" OnClick="lbtConfirmPaint_Click"><i class="fa fa-paint-brush" aria-hidden="true"></i> <%: traduci("ConfirmPaint") %></asp:LinkButton>
</div>
<div class="col-4">
<uc1:cmp_paint_bins runat="server" ID="cmp_paint_binsOUT" titleText="BINS OUT" titleClass="text-warning" ShowComplete="true" ShowPainted="true" />
+38 -1
View File
@@ -51,8 +51,15 @@ namespace NKC_WF.WebUserControls
/// <param name="e"></param>
protected void Page_Load(object sender, EventArgs e)
{
fixButtons();
cmp_barcode.eh_doRefresh += Cmp_barcode_eh_doRefresh;
}
private void fixButtons()
{
lbtConfirmPaint.Visible = false;
}
private void doUpdate()
{
cmp_paint_binsIN.doUpdate();
@@ -65,7 +72,6 @@ namespace NKC_WF.WebUserControls
// processo evento..
lastCmd = cmp_barcode.inputAcquired.ToUpper();
doRaiseEv = processLastCmd(doRaiseEv);
// reset comando
cmp_barcode.inputAcquired = "";
// aggiorno...
@@ -113,8 +119,28 @@ namespace NKC_WF.WebUserControls
doRaiseEv = true;
break;
case codeType.Bin:
var tabBin = DataLayer.man.taBN.getByKey(decoData.codeInt);
bool allOk = false;
// se ne trovo 1 --> OK verde
if (tabBin.Count == 1)
{
// se NON E' PAINTED ma è COMPLETE
var riga = tabBin[0];
allOk = (riga.Complete == 1 && riga.Painted == 0);
}
if (allOk)
{
cmp_barcode.showOutput("badge badge-success", $"Valid BN Code: {decoData.description}");
}
else
{
cmp_barcode.showOutput("badge badge-danger", $"{decoData.description} --> no valid action");
}
lbtConfirmPaint.Visible = allOk;
break;
case codeType.BinProcessed:
cmp_barcode.showOutput("text-danger", $"BinProcessed - ignored: {decoData.rawData} --> no action");
doRaiseEv = true;
break;
case codeType.SecScreen:
cmp_barcode.showOutput("badge badge-warning", $"SecScreen - ignored: {decoData.description}");
@@ -127,5 +153,16 @@ namespace NKC_WF.WebUserControls
}
return doRaiseEv;
}
protected void lbtConfirmPaint_Click(object sender, EventArgs e)
{
// processiamo barcode letto
decodedData decoData = DataLayer.man.decodeBcode(lastValidCmd);
// lo indico come painted (update dtPainted)
DataLayer.man.taBN.updatePainted(decoData.codeInt, DateTime.Now);
// udpate tabelle!
doUpdate();
}
}
}
+9
View File
@@ -50,6 +50,15 @@ namespace NKC_WF.WebUserControls
/// </remarks>
protected global::System.Web.UI.WebControls.HiddenField hfLastValidBCode;
/// <summary>
/// Controllo lbtConfirmPaint.
/// </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 lbtConfirmPaint;
/// <summary>
/// Controllo cmp_paint_binsOUT.
/// </summary>