update gestione ricalcolo al passato x TC / numPzPallet ove permesso

This commit is contained in:
Samuele E. Locatelli
2020-09-07 18:34:06 +02:00
parent 41b90bc2d6
commit ae7f5f1cde
4 changed files with 105 additions and 31 deletions
+35 -14
View File
@@ -360,6 +360,19 @@ namespace MoonPro_site.WebUserControls
if (idxOdlSel > 0)
{
DataLayerObj.taODL.updateQta(numPz, pzPallet, idxOdlSel);
// se abilitata modifica numPzPallet --> chiamo stored update!
if (numPzEditable)
{
// recupero da config il max...
int numPzMaxFix = 50;
try
{
numPzMaxFix = memLayer.ML.cdvi("numPzMaxFix");
}
catch
{ }
DataLayerObj.taTempiCicloRilevati.TC_fixFromODL(idxOdlSel, numPzMaxFix);
}
}
updateCtrl();
}
@@ -369,6 +382,7 @@ namespace MoonPro_site.WebUserControls
divEditQta.Visible = false;
grView.SelectedIndex = -1;
grView.DataBind();
idxMaccEdit = "";
}
/// <summary>
/// idxOdl selezionato
@@ -408,6 +422,25 @@ namespace MoonPro_site.WebUserControls
txtNewQta.Text = value.ToString();
}
}
protected bool numPzEditable
{
get
{
bool answ = false;
try
{
DS_ProdTempi.DatiMacchineDataTable tabDatiMacc = DataLayerObj.taDatiMacchine.getByIdx(idxMaccEdit);
if (tabDatiMacc != null && tabDatiMacc.Count > 0)
{
DS_ProdTempi.DatiMacchineRow rigaMacc = tabDatiMacc[0];
answ = !rigaMacc.hasCounter;
}
}
catch
{ }
return answ;
}
}
/// <summary>
/// Nuovo num pz per pallet
/// </summary>
@@ -433,20 +466,8 @@ namespace MoonPro_site.WebUserControls
set
{
txtNewPzPallet.Text = value.ToString();
// verifico SE sia editabile...
bool nPzEnab = false;
try
{
DS_ProdTempi.DatiMacchineDataTable tabDatiMacc = DataLayerObj.taDatiMacchine.getByIdx(idxMaccEdit);
if (tabDatiMacc != null && tabDatiMacc.Count > 0)
{
DS_ProdTempi.DatiMacchineRow rigaMacc = tabDatiMacc[0];
nPzEnab = !rigaMacc.hasCounter;
}
}
catch
{ }
txtNewPzPallet.Enabled = nPzEnab;
// verifico SE sia editabile... e visualizzo di conseguenza
txtNewPzPallet.Enabled = numPzEditable;
}
}
protected void btnCancel_Click(object sender, EventArgs e)
+12
View File
@@ -192,6 +192,18 @@ SELECT IdxMacchina, CodArticolo, DataOraRif, TCMedio, PzProd FROM TempiCicloRile
</DbCommand>
</SelectCommand>
</DbSource>
<DbSource ConnectionRef="MoonProConnectionString (Settings)" DbObjectName="MoonPro.dbo.stp_TC_fixFromODL" DbObjectType="StoredProcedure" GenerateShortCommands="true" GeneratorSourceName="TC_fixFromODL" Modifier="Public" Name="TC_fixFromODL" QueryType="NoData" ScalarCallRetval="System.Object, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" UseOptimisticConcurrency="true" UserGetMethodName="GetDataBy1" UserSourceName="TC_fixFromODL">
<SelectCommand>
<DbCommand CommandType="StoredProcedure" ModifiedByUser="false">
<CommandText>dbo.stp_TC_fixFromODL</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="@IdxODL" Precision="10" ProviderType="Int" Scale="0" Size="4" SourceColumnNullMapping="false" SourceVersion="Current" />
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DataTypeServer="int" DbType="Int32" Direction="Input" ParameterName="@PzMaxFix" Precision="10" ProviderType="Int" Scale="0" Size="4" SourceColumnNullMapping="false" SourceVersion="Current" />
</Parameters>
</DbCommand>
</SelectCommand>
</DbSource>
</Sources>
</TableAdapter>
<TableAdapter BaseClass="System.ComponentModel.Component" DataAccessorModifier="AutoLayout, AnsiClass, Class, Public" DataAccessorName="ODLTableAdapter" GeneratorDataComponentClassName="ODLTableAdapter" Name="ODL" UserDataComponentName="ODLTableAdapter">
+16 -16
View File
@@ -6,29 +6,29 @@
</autogenerated>-->
<DiagramLayout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" ex:showrelationlabel="False" ViewPortX="-10" ViewPortY="29" xmlns:ex="urn:schemas-microsoft-com:xml-msdatasource-layout-extended" xmlns="urn:schemas-microsoft-com:xml-msdatasource-layout">
<Shapes>
<Shape ID="DesignTable:TempiCicloRilevati" ZOrder="13" X="20" Y="81" Height="296" Width="300" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="145" />
<Shape ID="DesignTable:ODL" ZOrder="2" X="590" Y="407" Height="457" Width="300" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="306" />
<Shape ID="DesignTable:AnagArticoli" ZOrder="12" X="20" Y="388" Height="342" Width="300" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="191" />
<Shape ID="DesignTable:TempiCicloRilevati" ZOrder="14" X="20" Y="81" Height="296" Width="300" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="145" />
<Shape ID="DesignTable:ODL" ZOrder="3" X="588" Y="452" Height="457" Width="300" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="306" />
<Shape ID="DesignTable:AnagArticoli" ZOrder="13" X="20" Y="388" Height="342" Width="300" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="191" />
<Shape ID="DesignTable:DatiMacchine" ZOrder="20" X="949" Y="353" Height="286" Width="300" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="197" />
<Shape ID="DesignTable:PostazioniMapo" ZOrder="23" X="950" Y="39" Height="296" Width="300" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="168" />
<Shape ID="DesignTable:stp_PzProd_getByMacchina" ZOrder="1" X="23" Y="754" Height="273" Width="300" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="122" />
<Shape ID="DesignTable:stp_PzProd_getByMacchina" ZOrder="2" X="23" Y="754" Height="273" Width="300" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="122" />
<Shape ID="DesignTable:DatiConfermati" ZOrder="22" X="585" Y="50" Height="411" Width="300" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="306" />
<Shape ID="DesignTable:CalendFesteFerie" ZOrder="8" X="346" Y="364" Height="135" Width="287" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="76" />
<Shape ID="DesignTable:stp_TempoByIdxMaccPeriodClass" ZOrder="7" X="25" Y="997" Height="113" Width="300" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="54" />
<Shape ID="DesignTable:CalendFesteFerie" ZOrder="9" X="346" Y="364" Height="135" Width="287" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="76" />
<Shape ID="DesignTable:stp_TempoByIdxMaccPeriodClass" ZOrder="8" X="25" Y="997" Height="113" Width="300" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="54" />
<Shape ID="DesignTable:DatiProduzione" ZOrder="19" X="554" Y="922" Height="457" Width="300" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="306" />
<Shape ID="DesignTable:stp_repDonati_getDatiProdMacchina" ZOrder="5" X="949" Y="688" Height="365" Width="300" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="306" />
<Shape ID="DesignTable:stp_repDonati_getDatiProdMacchina" ZOrder="6" X="949" Y="688" Height="365" Width="300" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="306" />
<Shape ID="DesignTable:stp_repDonati_getLastStatoDurataMacchina" ZOrder="21" X="957" Y="1072" Height="135" Width="300" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="76" />
<Shape ID="DesignTable:stp_repDonati_getDatiProdMacchinaPeriodo" ZOrder="6" X="26" Y="1152" Height="204" Width="300" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="145" />
<Shape ID="DesignTable:TurniMacchina" ZOrder="14" X="363" Y="94" Height="227" Width="300" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="122" />
<Shape ID="DesignTable:MappaStatoExpl" ZOrder="4" X="946" Y="1217" Height="457" Width="300" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="306" />
<Shape ID="DesignTable:ResProdDett_splitODL" ZOrder="16" X="944" Y="2171" Height="227" Width="300" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="168" />
<Shape ID="DesignTable:ResProdDett_splitGG" ZOrder="15" X="27" Y="2218" Height="250" Width="300" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="191" />
<Shape ID="DesignTable:stp_repDonati_getDatiProdMacchinaPeriodo" ZOrder="7" X="26" Y="1152" Height="204" Width="300" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="145" />
<Shape ID="DesignTable:TurniMacchina" ZOrder="15" X="363" Y="94" Height="227" Width="300" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="122" />
<Shape ID="DesignTable:MappaStatoExpl" ZOrder="5" X="946" Y="1217" Height="457" Width="300" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="306" />
<Shape ID="DesignTable:ResProdDett_splitODL" ZOrder="1" X="940" Y="2192" Height="227" Width="300" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="168" />
<Shape ID="DesignTable:ResProdDett_splitGG" ZOrder="16" X="27" Y="2218" Height="250" Width="300" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="191" />
<Shape ID="DesignTable:ResProdTot" ZOrder="17" X="544" Y="2122" Height="273" Width="300" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="214" />
<Shape ID="DesignTable:RegistroControlli" ZOrder="10" X="536" Y="1403" Height="365" Width="300" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="237" />
<Shape ID="DesignTable:RegistroScarti" ZOrder="9" X="25" Y="1371" Height="457" Width="300" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="306" />
<Shape ID="DesignTable:PromesseODL" ZOrder="3" X="946" Y="1728" Height="457" Width="300" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="306" />
<Shape ID="DesignTable:RegistroControlli" ZOrder="11" X="536" Y="1403" Height="365" Width="300" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="237" />
<Shape ID="DesignTable:RegistroScarti" ZOrder="10" X="25" Y="1371" Height="457" Width="300" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="306" />
<Shape ID="DesignTable:PromesseODL" ZOrder="4" X="946" Y="1728" Height="457" Width="300" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="306" />
<Shape ID="DesignTable:ElencoConfermeProd" ZOrder="18" X="26" Y="1839" Height="365" Width="300" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="283" />
<Shape ID="DesignTable:StatoProd" ZOrder="11" X="541" Y="1777" Height="319" Width="295" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="260" />
<Shape ID="DesignTable:StatoProd" ZOrder="12" X="541" Y="1777" Height="319" Width="295" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="260" />
</Shapes>
<Connectors />
</DiagramLayout>
+42 -1
View File
@@ -16284,7 +16284,7 @@ SELECT IdxMacchina, CodArticolo, DataOraRif, TCMedio, PzProd FROM TempiCicloRile
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")]
private void InitCommandCollection() {
this._commandCollection = new global::System.Data.SqlClient.SqlCommand[10];
this._commandCollection = new global::System.Data.SqlClient.SqlCommand[11];
this._commandCollection[0] = new global::System.Data.SqlClient.SqlCommand();
this._commandCollection[0].Connection = this.Connection;
this._commandCollection[0].CommandText = "SELECT IdxMacchina, CodArticolo, DataOraRif, TCMedio, PzProd FROM dbo.TempiCicloR" +
@@ -16368,6 +16368,13 @@ SELECT IdxMacchina, CodArticolo, DataOraRif, TCMedio, PzProd FROM TempiCicloRile
this._commandCollection[9].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@IdxMacchina", global::System.Data.SqlDbType.NVarChar, 50, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
this._commandCollection[9].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Inizio", global::System.Data.SqlDbType.DateTime, 8, global::System.Data.ParameterDirection.Input, 23, 3, null, global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
this._commandCollection[9].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Fine", global::System.Data.SqlDbType.DateTime, 8, global::System.Data.ParameterDirection.Input, 23, 3, null, global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
this._commandCollection[10] = new global::System.Data.SqlClient.SqlCommand();
this._commandCollection[10].Connection = this.Connection;
this._commandCollection[10].CommandText = "dbo.stp_TC_fixFromODL";
this._commandCollection[10].CommandType = global::System.Data.CommandType.StoredProcedure;
this._commandCollection[10].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[10].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@IdxODL", global::System.Data.SqlDbType.Int, 4, global::System.Data.ParameterDirection.Input, 10, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
this._commandCollection[10].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@PzMaxFix", global::System.Data.SqlDbType.Int, 4, global::System.Data.ParameterDirection.Input, 10, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
@@ -16867,6 +16874,40 @@ SELECT IdxMacchina, CodArticolo, DataOraRif, TCMedio, PzProd FROM TempiCicloRile
return ((object)(returnValue));
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")]
[global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
public virtual int TC_fixFromODL(global::System.Nullable<int> IdxODL, global::System.Nullable<int> PzMaxFix) {
global::System.Data.SqlClient.SqlCommand command = this.CommandCollection[10];
if ((IdxODL.HasValue == true)) {
command.Parameters[1].Value = ((int)(IdxODL.Value));
}
else {
command.Parameters[1].Value = global::System.DBNull.Value;
}
if ((PzMaxFix.HasValue == true)) {
command.Parameters[2].Value = ((int)(PzMaxFix.Value));
}
else {
command.Parameters[2].Value = global::System.DBNull.Value;
}
global::System.Data.ConnectionState previousConnectionState = command.Connection.State;
if (((command.Connection.State & global::System.Data.ConnectionState.Open)
!= global::System.Data.ConnectionState.Open)) {
command.Connection.Open();
}
int returnValue;
try {
returnValue = command.ExecuteNonQuery();
}
finally {
if ((previousConnectionState == global::System.Data.ConnectionState.Closed)) {
command.Connection.Close();
}
}
return returnValue;
}
}
/// <summary>