Ok delete MachineParams

This commit is contained in:
Samuele E. Locatelli
2020-01-03 09:39:19 +01:00
parent 94de878b3a
commit 7be4962656
5 changed files with 152 additions and 32 deletions
+32 -17
View File
@@ -1,14 +1,8 @@
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="cmp_machParams.ascx.cs" Inherits="ES3.WebUserControls.cmp_machParams" %>
<div class="row">
<div class="col-8">
aggiungere select + edit
</div>
<div class="col-4">
<asp:LinkButton runat="server" ID="lbtAddNew" CssClass="btn btn-sm btn-block btn-success" OnClick="lbtAddNew_Click"><i class="fa fa-plus-square" aria-hidden="true"></i> Mancanti</asp:LinkButton>
</div>
<div class="col-12">
<asp:GridView ID="grView" runat="server" AutoGenerateColumns="False" DataKeyNames="IdxMacchina" DataSourceID="ods" CssClass="table table-sm table-striped" AllowPaging="True">
<asp:GridView ID="grView" runat="server" AutoGenerateColumns="False" DataKeyNames="IdxMacchina" DataSourceID="ods" CssClass="table table-sm table-striped" AllowPaging="True" AllowSorting="true">
<HeaderStyle CssClass="table-primary" />
<PagerStyle CssClass="active GridPager" />
<PagerSettings Mode="NumericFirstLast" />
@@ -26,23 +20,44 @@
<asp:LinkButton ID="lbtEdit" runat="server" CausesValidation="False" CommandName="Edit" CssClass="btn btn-sm btn-info"><i class="fa fa-pencil" aria-hidden="true"></i></asp:LinkButton>
</ItemTemplate>
<EditItemTemplate>
<asp:LinkButton ID="lbtSave" runat="server" CausesValidation="False" CommandName="Update" CssClass="btn btn-sm btn-success"><i class="fa fa-check" aria-hidden="true"></i></asp:LinkButton>
<asp:LinkButton ID="lbtCancel" runat="server" CausesValidation="False" CommandName="Cancel" CssClass="btn btn-sm btn-danger"><i class="fa fa-ban" aria-hidden="true"></i></asp:LinkButton>
</EditItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="IdxMacchina" HeaderText="impianto" ReadOnly="True" SortExpression="IdxMacchina" />
<asp:BoundField DataField="CodConfAper" HeaderText="Apertura" SortExpression="CodConfAper" />
<asp:BoundField DataField="OEE" HeaderText="OEE" SortExpression="OEE" DataFormatString="{0:P1}" ItemStyle-HorizontalAlign="Right" HeaderStyle-HorizontalAlign="Right" >
<HeaderStyle HorizontalAlign="Right"></HeaderStyle>
<ItemStyle HorizontalAlign="Right"></ItemStyle>
<asp:BoundField DataField="OEE" HeaderText="OEE" SortExpression="OEE" DataFormatString="{0:P1}" ItemStyle-HorizontalAlign="Right" HeaderStyle-HorizontalAlign="Right">
<HeaderStyle HorizontalAlign="Right"></HeaderStyle>
<ItemStyle HorizontalAlign="Right"></ItemStyle>
</asp:BoundField>
<asp:BoundField DataField="SetupTime" HeaderText="Setup (min)" SortExpression="SetupTime" ItemStyle-HorizontalAlign="Right" HeaderStyle-HorizontalAlign="Right" >
<HeaderStyle HorizontalAlign="Right"></HeaderStyle>
<ItemStyle HorizontalAlign="Right"></ItemStyle>
<asp:BoundField DataField="SetupTime" HeaderText="Setup (min)" SortExpression="SetupTime" ItemStyle-HorizontalAlign="Right" HeaderStyle-HorizontalAlign="Right">
<HeaderStyle HorizontalAlign="Right"></HeaderStyle>
<ItemStyle HorizontalAlign="Right"></ItemStyle>
</asp:BoundField>
<asp:TemplateField ShowHeader="False">
<HeaderTemplate>
<asp:LinkButton runat="server" ID="lbtAddNew" CssClass="btn btn-sm btn-block btn-success" OnClick="lbtAddNew_Click" ToolTip="Aggiunta mancanti"><i class="fa fa-plus-square" aria-hidden="true"></i></asp:LinkButton>
</HeaderTemplate>
<ItemTemplate>
<asp:LinkButton ID="lbtDelete" runat="server" CausesValidation="False" CommandName="Delete" CssClass="btn btn-sm btn-danger" OnClientClick="return confirm('Sicuro di voler procedere con eliminazione?');"><i class="fa fa-trash" aria-hidden="true"></i></asp:LinkButton>
</ItemTemplate>
<EditItemTemplate>
<asp:LinkButton ID="lbtSave2" runat="server" CausesValidation="False" CommandName="Update" CssClass="btn btn-sm btn-success"><i class="fa fa-check" aria-hidden="true"></i></asp:LinkButton>
<asp:LinkButton ID="lbtCancel2" runat="server" CausesValidation="False" CommandName="Cancel" CssClass="btn btn-sm btn-danger"><i class="fa fa-ban" aria-hidden="true"></i></asp:LinkButton>
</EditItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
<asp:ObjectDataSource ID="ods" runat="server" OldValuesParameterFormatString="original_{0}" SelectMethod="GetData" TypeName="MapoDb.DS_PlanTableAdapters.MachineParamsTableAdapter"></asp:ObjectDataSource>
<asp:ObjectDataSource ID="ods" runat="server" OldValuesParameterFormatString="Original_{0}" SelectMethod="GetData" TypeName="MapoDb.DS_PlanTableAdapters.MachineParamsTableAdapter" DeleteMethod="DeleteQuery" UpdateMethod="UpdateQuery">
<DeleteParameters>
<asp:Parameter Name="Original_IdxMacchina" Type="String" />
</DeleteParameters>
<UpdateParameters>
<asp:Parameter Name="Original_IdxMacchina" Type="String" />
<asp:Parameter Name="CodConfAper" Type="String" />
<asp:Parameter Name="OEE" Type="Double" />
<asp:Parameter Name="SetupTime" Type="Int32" />
</UpdateParameters>
</asp:ObjectDataSource>
</div>
</div>
-9
View File
@@ -14,15 +14,6 @@ namespace ES3.WebUserControls
public partial class cmp_machParams
{
/// <summary>
/// Controllo lbtAddNew.
/// </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 lbtAddNew;
/// <summary>
/// Controllo grView.
/// </summary>
+92 -3
View File
@@ -11085,16 +11085,31 @@ SELECT idxPromessa, KeyRichiesta, KeyBCode, Attivabile, IdxODL, CodArticolo, Cod
[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[2];
this._commandCollection = new global::System.Data.SqlClient.SqlCommand[4];
this._commandCollection[0] = new global::System.Data.SqlClient.SqlCommand();
this._commandCollection[0].Connection = this.Connection;
this._commandCollection[0].CommandText = "SELECT *\r\nFROM MachineParams";
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_MacPar_insMissing";
this._commandCollection[1].CommandText = "dbo.stp_MacPar_DeleteQuery";
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("@Original_IdxMacchina", global::System.Data.SqlDbType.NVarChar, 50, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
this._commandCollection[2] = new global::System.Data.SqlClient.SqlCommand();
this._commandCollection[2].Connection = this.Connection;
this._commandCollection[2].CommandText = "dbo.stp_MacPar_insMissing";
this._commandCollection[2].CommandType = global::System.Data.CommandType.StoredProcedure;
this._commandCollection[2].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[3] = new global::System.Data.SqlClient.SqlCommand();
this._commandCollection[3].Connection = this.Connection;
this._commandCollection[3].CommandText = "dbo.stp_MacPar_UpdateQuery";
this._commandCollection[3].CommandType = global::System.Data.CommandType.StoredProcedure;
this._commandCollection[3].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[3].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_IdxMacchina", global::System.Data.SqlDbType.NVarChar, 50, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
this._commandCollection[3].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@CodConfAper", global::System.Data.SqlDbType.NVarChar, 50, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
this._commandCollection[3].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@OEE", global::System.Data.SqlDbType.Float, 8, global::System.Data.ParameterDirection.Input, 53, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
this._commandCollection[3].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@SetupTime", 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()]
@@ -11124,8 +11139,82 @@ SELECT idxPromessa, KeyRichiesta, KeyBCode, Attivabile, IdxODL, CodArticolo, Cod
[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 insMissing() {
public virtual int DeleteQuery(string Original_IdxMacchina) {
global::System.Data.SqlClient.SqlCommand command = this.CommandCollection[1];
if ((Original_IdxMacchina == null)) {
command.Parameters[1].Value = global::System.DBNull.Value;
}
else {
command.Parameters[1].Value = ((string)(Original_IdxMacchina));
}
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;
}
[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 insMissing() {
global::System.Data.SqlClient.SqlCommand command = this.CommandCollection[2];
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;
}
[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 UpdateQuery(string Original_IdxMacchina, string CodConfAper, global::System.Nullable<double> OEE, global::System.Nullable<int> SetupTime) {
global::System.Data.SqlClient.SqlCommand command = this.CommandCollection[3];
if ((Original_IdxMacchina == null)) {
command.Parameters[1].Value = global::System.DBNull.Value;
}
else {
command.Parameters[1].Value = ((string)(Original_IdxMacchina));
}
if ((CodConfAper == null)) {
command.Parameters[2].Value = global::System.DBNull.Value;
}
else {
command.Parameters[2].Value = ((string)(CodConfAper));
}
if ((OEE.HasValue == true)) {
command.Parameters[3].Value = ((double)(OEE.Value));
}
else {
command.Parameters[3].Value = global::System.DBNull.Value;
}
if ((SetupTime.HasValue == true)) {
command.Parameters[4].Value = ((int)(SetupTime.Value));
}
else {
command.Parameters[4].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)) {
+25
View File
@@ -678,6 +678,17 @@ FROM MachineParams</CommandText>
<Mapping SourceColumn="SetupTime" DataSetColumn="SetupTime" />
</Mappings>
<Sources>
<DbSource ConnectionRef="MoonPro_ES3ConnectionString (Settings)" DbObjectName="MoonPro_ES3.dbo.stp_MacPar_DeleteQuery" DbObjectType="StoredProcedure" GenerateShortCommands="true" GeneratorSourceName="DeleteQuery" Modifier="Public" Name="DeleteQuery" QueryType="NoData" ScalarCallRetval="System.Object, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" UseOptimisticConcurrency="true" UserGetMethodName="GetDataBy1" UserSourceName="DeleteQuery">
<SelectCommand>
<DbCommand CommandType="StoredProcedure" ModifiedByUser="false">
<CommandText>dbo.stp_MacPar_DeleteQuery</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="@Original_IdxMacchina" Precision="0" ProviderType="NVarChar" Scale="0" Size="50" SourceColumnNullMapping="false" SourceVersion="Current" />
</Parameters>
</DbCommand>
</SelectCommand>
</DbSource>
<DbSource ConnectionRef="MoonPro_ES3ConnectionString (Settings)" DbObjectName="MoonPro_ES3.dbo.stp_MacPar_insMissing" DbObjectType="StoredProcedure" GenerateShortCommands="true" GeneratorSourceName="insMissing" Modifier="Public" Name="insMissing" QueryType="NoData" ScalarCallRetval="System.Object, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" UseOptimisticConcurrency="true" UserGetMethodName="GetDataBy" UserSourceName="insMissing">
<SelectCommand>
<DbCommand CommandType="StoredProcedure" ModifiedByUser="false">
@@ -688,6 +699,20 @@ FROM MachineParams</CommandText>
</DbCommand>
</SelectCommand>
</DbSource>
<DbSource ConnectionRef="MoonPro_ES3ConnectionString (Settings)" DbObjectName="MoonPro_ES3.dbo.stp_MacPar_UpdateQuery" DbObjectType="StoredProcedure" GenerateShortCommands="true" GeneratorSourceName="UpdateQuery" Modifier="Public" Name="UpdateQuery" QueryType="NoData" ScalarCallRetval="System.Object, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" UseOptimisticConcurrency="true" UserGetMethodName="GetDataBy2" UserSourceName="UpdateQuery">
<SelectCommand>
<DbCommand CommandType="StoredProcedure" ModifiedByUser="false">
<CommandText>dbo.stp_MacPar_UpdateQuery</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="@Original_IdxMacchina" Precision="0" ProviderType="NVarChar" Scale="0" Size="50" SourceColumnNullMapping="false" SourceVersion="Current" />
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DataTypeServer="nvarchar" DbType="String" Direction="Input" ParameterName="@CodConfAper" Precision="0" ProviderType="NVarChar" Scale="0" Size="50" SourceColumnNullMapping="false" SourceVersion="Current" />
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DataTypeServer="float" DbType="Double" Direction="Input" ParameterName="@OEE" Precision="53" ProviderType="Float" Scale="0" Size="8" SourceColumnNullMapping="false" SourceVersion="Current" />
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DataTypeServer="int" DbType="Int32" Direction="Input" ParameterName="@SetupTime" Precision="10" ProviderType="Int" Scale="0" Size="4" SourceColumnNullMapping="false" SourceVersion="Current" />
</Parameters>
</DbCommand>
</SelectCommand>
</DbSource>
</Sources>
</TableAdapter>
</Tables>
+3 -3
View File
@@ -4,7 +4,7 @@
Changes to this file may cause incorrect behavior and will be lost if
the code is regenerated.
</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="-47" xmlns:ex="urn:schemas-microsoft-com:xml-msdatasource-layout-extended" xmlns="urn:schemas-microsoft-com:xml-msdatasource-layout">
<DiagramLayout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" ex:showrelationlabel="False" ViewPortX="10" ViewPortY="-47" xmlns:ex="urn:schemas-microsoft-com:xml-msdatasource-layout-extended" xmlns="urn:schemas-microsoft-com:xml-msdatasource-layout">
<Shapes>
<Shape ID="DesignTable:planStatsGlobal" ZOrder="11" X="108" Y="55" Height="227" Width="300" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="145" />
<Shape ID="DesignTable:planStatsArt" ZOrder="13" X="448" Y="61" Height="250" Width="255" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="168" />
@@ -17,7 +17,7 @@
<Shape ID="DesignTable:CalStop" ZOrder="6" X="950" Y="61" Height="215" Width="223" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="89" />
<Shape ID="DesignTable:CalDisp" ZOrder="1" X="1169" Y="630" Height="191" Width="248" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="102" />
<Shape ID="DesignTable:ConfWeek1" ZOrder="5" X="1207" Y="71" Height="319" Width="249" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="260" />
<Shape ID="DesignTable:MachineParams" ZOrder="4" X="899" Y="342" Height="192" Width="236" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="122" />
<Shape ID="DesignTable:MachineParams" ZOrder="4" X="899" Y="342" Height="230" Width="221" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="122" />
</Shapes>
<Connectors>
<Connector ID="DesignRelation:FK_MachineParams_ConfWeek" ZOrder="3" LineWidth="11">
@@ -47,7 +47,7 @@
<Y>482</Y>
</Point>
<Point>
<X>1135</X>
<X>1120</X>
<Y>482</Y>
</Point>
</RoutePoints>