Update x gestione selezione singola macchina/tutte x ODL

This commit is contained in:
Samuele E. Locatelli
2018-03-15 17:49:04 +01:00
parent 665a8af41d
commit b24fa4a94a
8 changed files with 126 additions and 35 deletions
-18
View File
@@ -419,14 +419,6 @@
<Content Include="Scripts\esm\popper-utils.min.js" />
<Content Include="Scripts\esm\popper.js" />
<Content Include="Scripts\esm\popper.min.js" />
<Content Include="Scripts\esm\popper.min.js.map" />
<Content Include="Scripts\esm\popper.js.map" />
<Content Include="Scripts\esm\popper-utils.min.js.map" />
<Content Include="Scripts\esm\popper-utils.js.map" />
<Content Include="Scripts\bootstrap.min.js.map" />
<Content Include="Scripts\bootstrap.js.map" />
<Content Include="Scripts\bootstrap.bundle.min.js.map" />
<Content Include="Scripts\bootstrap.bundle.js.map" />
<Content Include="Resources\_variables.scss" />
<None Include="Scripts\jquery-3.3.1.intellisense.js" />
<Content Include="Scripts\jquery-3.3.1.js" />
@@ -511,17 +503,7 @@
<Content Include="Web-SQL2012.config">
<SubType>Designer</SubType>
</Content>
<Content Include="Scripts\umd\popper.min.js.map" />
<Content Include="Scripts\umd\popper.js.map" />
<Content Include="Scripts\umd\popper-utils.min.js.map" />
<Content Include="Scripts\umd\popper-utils.js.map" />
<Content Include="Scripts\README.md" />
<Content Include="Scripts\popper.min.js.map" />
<Content Include="Scripts\popper.js.map" />
<Content Include="Scripts\popper-utils.min.js.map" />
<Content Include="Scripts\popper-utils.js.map" />
<Content Include="Scripts\jquery-3.3.1.slim.min.map" />
<Content Include="Scripts\jquery-3.3.1.min.map" />
<None Include="Web.IIS01.config">
<DependentUpon>Web.config</DependentUpon>
</None>
+16 -3
View File
@@ -17,9 +17,22 @@
</div>
<div class="row pb-3">
<div class="col-sm-6">
<asp:DropDownList runat="server" ID="ddlODL" DataSourceID="odsODL" DataTextField="label" DataValueField="value" CssClass="form-control form-control-lg btn-dark" OnSelectedIndexChanged="ddlODL_SelectedIndexChanged" AutoPostBack="True">
</asp:DropDownList>
<asp:ObjectDataSource runat="server" ID="odsODL" OldValuesParameterFormatString="original_{0}" SelectMethod="getUnused" TypeName="MapoDb.DS_UtilityTableAdapters.v_selODLTableAdapter"></asp:ObjectDataSource>
<div class="col-auto px-0">
<label class="sr-only" for="inlineFormInputGroup">Username</label>
<div class="input-group mb-2">
<asp:DropDownList runat="server" ID="ddlODL" DataSourceID="odsODL" DataTextField="label" DataValueField="value" CssClass="form-control btn-default textCondens" OnSelectedIndexChanged="ddlODL_SelectedIndexChanged" AutoPostBack="True">
</asp:DropDownList>
<asp:HiddenField runat="server" ID="hfIdxMacchina" />
<asp:ObjectDataSource runat="server" ID="odsODL" OldValuesParameterFormatString="original_{0}" SelectMethod="getUnused" TypeName="MapoDb.DS_UtilityTableAdapters.v_selODLTableAdapter">
<SelectParameters>
<asp:ControlParameter ControlID="hfIdxMacchina" DefaultValue="0" Name="IdxMacchina" PropertyName="Value" Type="String" />
</SelectParameters>
</asp:ObjectDataSource>
<div class="input-group-append">
<asp:CheckBox runat="server" ID="chkTutti" Text="TUTTI" CssClass="btn btn-secondary btn-sm" AutoPostBack="true" OnCheckedChanged="chkTutti_CheckedChanged" />
</div>
</div>
</div>
<div runat="server" id="divNote" visible="false" class="pt-2">
<asp:TextBox runat="server" ID="txtNote" TextMode="MultiLine" Height="4em" CssClass="form-control" placeholder="Note attrezzaggio" />
</div>
+22 -2
View File
@@ -37,6 +37,7 @@ namespace MoonProTablet.WebUserControls
set
{
memLayer.ML.setSessionVal(string.Format("idxMacchina-{0}", uid), value);
hfIdxMacchina.Value = value;
}
}
/// <summary>
@@ -170,7 +171,7 @@ namespace MoonProTablet.WebUserControls
{
logger.lg.scriviLog(string.Format("Eccezione in recupero dati currHasOdl! {0}{1}", Environment.NewLine, exc), tipoLog.EXCEPTION);
}
bool hasNewOdl = DataLayer.obj.taSelOdlFree.getUnused().Rows.Count > 1;
bool hasNewOdl = DataLayer.obj.taSelOdlFree.getUnused(idxMacchina).Rows.Count > 1;
// sistemo buttons!
lbtStartAttr.Enabled = (isEnabled && (!inAttr && hasNewOdl));
lbtStartProd.Enabled = (isEnabled && inAttr);
@@ -493,6 +494,11 @@ namespace MoonProTablet.WebUserControls
/// <param name="sender"></param>
/// <param name="e"></param>
protected void ddlODL_SelectedIndexChanged(object sender, EventArgs e)
{
checkDDL();
}
private void checkDDL()
{
if (ddlODL.SelectedIndex > 0)
{
@@ -505,6 +511,7 @@ namespace MoonProTablet.WebUserControls
showNoteTC(false);
}
}
/// <summary>
/// mostra/nasconde note
/// </summary>
@@ -562,6 +569,19 @@ namespace MoonProTablet.WebUserControls
checkBtnStatus();
}
protected void chkTutti_CheckedChanged(object sender, EventArgs e)
{
// SE selezionato tutti cambio valore idxMacchina...
if(chkTutti.Checked)
{
hfIdxMacchina.Value = "0";
}
else
{
hfIdxMacchina.Value = idxMacchina;
}
ddlODL.DataBind();
checkDDL();
}
}
}
+18
View File
@@ -39,6 +39,15 @@ namespace MoonProTablet.WebUserControls {
/// </remarks>
protected global::System.Web.UI.WebControls.DropDownList ddlODL;
/// <summary>
/// Controllo hfIdxMacchina.
/// </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.HiddenField hfIdxMacchina;
/// <summary>
/// Controllo odsODL.
/// </summary>
@@ -48,6 +57,15 @@ namespace MoonProTablet.WebUserControls {
/// </remarks>
protected global::System.Web.UI.WebControls.ObjectDataSource odsODL;
/// <summary>
/// Controllo chkTutti.
/// </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.CheckBox chkTutti;
/// <summary>
/// Controllo divNote.
/// </summary>
+9 -2
View File
@@ -6582,13 +6582,14 @@ SELECT IdxMacchina, IdxStato, InizioStato, Value, CodArticolo, TempoCicloBase, P
this._commandCollection = new global::System.Data.SqlClient.SqlCommand[2];
this._commandCollection[0] = new global::System.Data.SqlClient.SqlCommand();
this._commandCollection[0].Connection = this.Connection;
this._commandCollection[0].CommandText = "SELECT value, label, conditio FROM dbo.v_selODL";
this._commandCollection[0].CommandText = "SELECT * FROM v_selODL";
this._commandCollection[0].CommandType = global::System.Data.CommandType.Text;
this._commandCollection[1] = new global::System.Data.SqlClient.SqlCommand();
this._commandCollection[1].Connection = this.Connection;
this._commandCollection[1].CommandText = "dbo.stp_vsODL_getUnused";
this._commandCollection[1].CommandType = global::System.Data.CommandType.StoredProcedure;
this._commandCollection[1].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[1].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, "", "", ""));
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
@@ -6619,8 +6620,14 @@ SELECT IdxMacchina, IdxStato, InizioStato, Value, CodArticolo, TempoCicloBase, P
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")]
[global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
[global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Select, false)]
public virtual DS_Utility.v_selODLDataTable getUnused() {
public virtual DS_Utility.v_selODLDataTable getUnused(string IdxMacchina) {
this.Adapter.SelectCommand = this.CommandCollection[1];
if ((IdxMacchina == null)) {
this.Adapter.SelectCommand.Parameters[1].Value = global::System.DBNull.Value;
}
else {
this.Adapter.SelectCommand.Parameters[1].Value = ((string)(IdxMacchina));
}
DS_Utility.v_selODLDataTable dataTable = new DS_Utility.v_selODLDataTable();
this.Adapter.Fill(dataTable);
return dataTable;
+4 -3
View File
@@ -165,10 +165,10 @@ ORDER BY label</CommandText>
</TableAdapter>
<TableAdapter BaseClass="System.ComponentModel.Component" DataAccessorModifier="AutoLayout, AnsiClass, Class, Public" DataAccessorName="v_selODLTableAdapter" GeneratorDataComponentClassName="v_selODLTableAdapter" Name="v_selODL" UserDataComponentName="v_selODLTableAdapter">
<MainSource>
<DbSource ConnectionRef="MoonProConnectionString (Settings)" DbObjectName="MoonPro.dbo.v_selODL" DbObjectType="View" FillMethodModifier="Public" FillMethodName="Fill" GenerateMethods="Both" GenerateShortCommands="false" GeneratorGetMethodName="GetData" GeneratorSourceName="Fill" GetMethodModifier="Public" GetMethodName="GetData" QueryType="Rowset" ScalarCallRetval="System.Object, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" UseOptimisticConcurrency="true" UserGetMethodName="GetData" UserSourceName="Fill">
<DbSource ConnectionRef="MoonProConnectionString (Settings)" DbObjectName="MoonPro.dbo.v_selODL" DbObjectType="View" FillMethodModifier="Public" FillMethodName="Fill" GenerateMethods="Both" GenerateShortCommands="false" GeneratorGetMethodName="GetData" GeneratorSourceName="Fill" GetMethodModifier="Public" GetMethodName="GetData" QueryType="Rowset" ScalarCallRetval="System.Object, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" UseOptimisticConcurrency="false" UserGetMethodName="GetData" UserSourceName="Fill">
<SelectCommand>
<DbCommand CommandType="Text" ModifiedByUser="false">
<CommandText>SELECT value, label, conditio FROM dbo.v_selODL</CommandText>
<DbCommand CommandType="Text" ModifiedByUser="true">
<CommandText>SELECT * FROM v_selODL</CommandText>
<Parameters />
</DbCommand>
</SelectCommand>
@@ -186,6 +186,7 @@ ORDER BY label</CommandText>
<CommandText>dbo.stp_vsODL_getUnused</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="nvarchar" DbType="String" Direction="Input" ParameterName="@IdxMacchina" Precision="0" ProviderType="NVarChar" Scale="0" Size="50" SourceColumnNullMapping="false" SourceVersion="Current" />
</Parameters>
</DbCommand>
</SelectCommand>
+7 -7
View File
@@ -9,13 +9,13 @@
<Shape ID="DesignTable:StatoMacchine" ZOrder="10" X="472" Y="274" Height="267" Width="231" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="197" />
<Shape ID="DesignTable:v_selArticoli" ZOrder="9" X="941" Y="372" Height="134" Width="214" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="64" />
<Shape ID="DesignTable:v_selOperatori" ZOrder="8" X="443" Y="654" Height="115" Width="228" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="64" />
<Shape ID="DesignTable:v_selODL" ZOrder="7" X="812" Y="635" Height="134" Width="197" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="83" />
<Shape ID="DesignTable:v_selEventiBCode" ZOrder="6" X="181" Y="554" Height="115" Width="245" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="64" />
<Shape ID="DesignTable:v_selMacchine" ZOrder="3" X="637" Y="787" Height="169" Width="227" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="97" />
<Shape ID="DesignTable:stp_statusCorrente" ZOrder="5" X="265" Y="848" Height="305" Width="253" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="254" />
<Shape ID="DesignTable:Commenti" ZOrder="1" X="591" Y="984" Height="314" Width="300" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="188" />
<Shape ID="DesignTable:FermiNonQual" ZOrder="4" X="978" Y="925" Height="248" Width="280" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="197" />
<Shape ID="DesignTable:v_selTally" ZOrder="2" X="751" Y="263" Height="153" Width="158" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="64" />
<Shape ID="DesignTable:v_selODL" ZOrder="1" X="908" Y="559" Height="181" Width="230" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="99" />
<Shape ID="DesignTable:v_selEventiBCode" ZOrder="7" X="181" Y="554" Height="115" Width="245" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="64" />
<Shape ID="DesignTable:v_selMacchine" ZOrder="4" X="637" Y="787" Height="169" Width="227" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="97" />
<Shape ID="DesignTable:stp_statusCorrente" ZOrder="6" X="265" Y="848" Height="305" Width="253" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="254" />
<Shape ID="DesignTable:Commenti" ZOrder="2" X="591" Y="984" Height="314" Width="300" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="188" />
<Shape ID="DesignTable:FermiNonQual" ZOrder="5" X="978" Y="925" Height="248" Width="280" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="197" />
<Shape ID="DesignTable:v_selTally" ZOrder="3" X="751" Y="263" Height="153" Width="158" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="64" />
</Shapes>
<Connectors />
</DiagramLayout>
+50
View File
@@ -126,3 +126,53 @@ BEGIN
END
GO
/****** Object: StoredProcedure [dbo].[stp_vsODL_getUnused] Script Date: 15/03/2018 17:07:08 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
/*************************************
* STORED PROCEDURE stp_vsODL_getUnused
* ottiene elenco ODL non ancora impiegati per macchina (se IdxMacchina <> 0)
** modif.: S.E.L. - 2018.03.15
**************************************/
ALTER PROCEDURE [dbo].[stp_vsODL_getUnused]
(
@IdxMacchina NVARCHAR(50) = '0'
)
AS
WITH cteODL AS (
SELECT dbo.ODL.IdxODL AS value
,CASE WHEN @IdxMacchina <> '0' THEN '' ELSE m.Nome + ' | ' END
+ 'ODL ' + CAST(dbo.ODL.IdxODL AS NVARCHAR(50))
+ ' - art.' + dbo.ODL.CodArticolo + ' ' + aa.DescArticolo
+ ' | ' + CAST(dbo.ODL.NumPezzi AS NVARCHAR(10))
+ ' pz | TC: ' + CAST(CAST(dbo.f_TC_100_60(dbo.ODL.TCAssegnato) AS DECIMAL(9, 2)) AS NVARCHAR(10))
+ ' (min.sec) | ' + CAST(CAST(dbo.ODL.TCAssegnato AS DECIMAL(9, 3)) AS NVARCHAR(10))
+ ' (min.cent)' AS label
,dbo.ODL.DataInizio AS conditio
,ODL.IdxMacchina
FROM dbo.ODL
INNER JOIN dbo.Macchine m ON dbo.ODL.IdxMacchina = m.IdxMacchina
INNER JOIN dbo.AnagArticoli aa ON dbo.ODL.CodArticolo = aa.CodArticolo
)
SELECT 0 as value, 'Selezionare ODL' as label, NULL as conditio
UNION
SELECT value, label, conditio
FROM cteODL
WHERE conditio IS NULL
AND IdxMacchina = CASE WHEN @IdxMacchina <> '0' THEN @IdxMacchina ELSE IdxMacchina END
RETURN
GO