diff --git a/MP-ADM/DataImport.aspx b/MP-ADM/DataImport.aspx new file mode 100644 index 00000000..e06224de --- /dev/null +++ b/MP-ADM/DataImport.aspx @@ -0,0 +1,14 @@ +<%@ Page Title="" Language="C#" MasterPageFile="~/WebMasterPages/MoonPro.master" AutoEventWireup="true" CodeBehind="DataImport.aspx.cs" Inherits="MP_ADM.DataImport" %> + + + + + + + + Esegui Import + Allineamento Dati + + + + + diff --git a/MP-ADM/DataImport.aspx.cs b/MP-ADM/DataImport.aspx.cs new file mode 100644 index 00000000..f4cd983a --- /dev/null +++ b/MP-ADM/DataImport.aspx.cs @@ -0,0 +1,27 @@ +using MapoDb; +using SteamWare; +using System; + +namespace MP_ADM +{ + public partial class DataImport : System.Web.UI.Page + { + protected void Page_Load(object sender, EventArgs e) + { + + } + /// + /// Esegue import dati + /// + /// + /// + protected void lbtProImportIS_Click(object sender, EventArgs e) + { + // se abilitato... + if (memLayer.ML.CRB("DB_IS_EnabFileImp")) + { + DataLayer.obj.taWKS.All_ImportFile_Process(memLayer.ML.CRS("DB_IS_filePath"), memLayer.ML.CRS("DB_IS_FIELDTERMINATOR"), memLayer.ML.CRS("DB_IS_ROWTERMINATOR"), memLayer.ML.CRS("DB_IS_FIRSTROW "), 0, 0); + } + } + } +} \ No newline at end of file diff --git a/MP-ADM/DataImport.aspx.designer.cs b/MP-ADM/DataImport.aspx.designer.cs new file mode 100644 index 00000000..2d057dff --- /dev/null +++ b/MP-ADM/DataImport.aspx.designer.cs @@ -0,0 +1,24 @@ +//------------------------------------------------------------------------------ +// +// Codice generato da uno strumento. +// +// Le modifiche a questo file possono causare un comportamento non corretto e verranno perse se +// il codice viene rigenerato. +// +//------------------------------------------------------------------------------ + +namespace MP_ADM { + + + public partial class DataImport { + + /// + /// Controllo lbtProImportIS. + /// + /// + /// Campo generato automaticamente. + /// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind. + /// + protected global::System.Web.UI.WebControls.LinkButton lbtProImportIS; + } +} diff --git a/MP-ADM/MP-ADM.csproj b/MP-ADM/MP-ADM.csproj index 42e3ed2b..cbbe8b36 100644 --- a/MP-ADM/MP-ADM.csproj +++ b/MP-ADM/MP-ADM.csproj @@ -184,6 +184,7 @@ + @@ -514,6 +515,13 @@ calendChiusura.aspx + + DataImport.aspx + ASPXCodeBehind + + + DataImport.aspx + Default.aspx ASPXCodeBehind diff --git a/MP-ADM/WebUserControls/mod_main_help.ascx b/MP-ADM/WebUserControls/mod_main_help.ascx index 2da85db9..7063cdcf 100644 --- a/MP-ADM/WebUserControls/mod_main_help.ascx +++ b/MP-ADM/WebUserControls/mod_main_help.ascx @@ -64,4 +64,12 @@ + + + + + <%: traduci("btnDataImport") %> + + + diff --git a/MP-ADM/WebUserControls/mod_main_help.ascx.cs b/MP-ADM/WebUserControls/mod_main_help.ascx.cs index caee42a4..d24f7d4a 100644 --- a/MP-ADM/WebUserControls/mod_main_help.ascx.cs +++ b/MP-ADM/WebUserControls/mod_main_help.ascx.cs @@ -45,4 +45,9 @@ public partial class mod_main_help : ApplicationUserControl { Response.Redirect("~/GestKIT"); } + + protected void lbtDataImport_Click(object sender, EventArgs e) + { + Response.Redirect("~/DataImport"); + } } diff --git a/MP-ADM/WebUserControls/mod_main_help.ascx.designer.cs b/MP-ADM/WebUserControls/mod_main_help.ascx.designer.cs index 4ea55d8a..b30d0f03 100644 --- a/MP-ADM/WebUserControls/mod_main_help.ascx.designer.cs +++ b/MP-ADM/WebUserControls/mod_main_help.ascx.designer.cs @@ -82,4 +82,13 @@ public partial class mod_main_help { /// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind. /// protected global::System.Web.UI.WebControls.LinkButton lbtGestKIT; + + /// + /// Controllo lbtDataImport. + /// + /// + /// Campo generato automaticamente. + /// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind. + /// + protected global::System.Web.UI.WebControls.LinkButton lbtDataImport; } diff --git a/MapoDb/DS_IntServ.Designer.cs b/MapoDb/DS_IntServ.Designer.cs index eeffce5c..df2abd9e 100644 --- a/MapoDb/DS_IntServ.Designer.cs +++ b/MapoDb/DS_IntServ.Designer.cs @@ -4355,33 +4355,44 @@ SELECT KeyFilt, CodOrd, CodArt, DescArt, Qta, DataIns FROM WipSetupKit WHERE (Co [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")] private void InitCommandCollection() { - this._commandCollection = new global::System.Data.SqlClient.SqlCommand[4]; + this._commandCollection = new global::System.Data.SqlClient.SqlCommand[5]; this._commandCollection[0] = new global::System.Data.SqlClient.SqlCommand(); this._commandCollection[0].Connection = this.Connection; this._commandCollection[0].CommandText = "SELECT * FROM dbo.WipSetupKit"; 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_WSK_delete"; + this._commandCollection[1].CommandText = "tmp.stp_All_ImportFile_Process"; 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("@KeyFilt", global::System.Data.SqlDbType.NVarChar, 50, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + this._commandCollection[1].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@filePath", global::System.Data.SqlDbType.NVarChar, 4000, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + this._commandCollection[1].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@FIELDTERMINATOR", global::System.Data.SqlDbType.NVarChar, 10, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + this._commandCollection[1].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@ROWTERMINATOR", global::System.Data.SqlDbType.NVarChar, 10, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + this._commandCollection[1].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@FIRSTROW", global::System.Data.SqlDbType.NVarChar, 100, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + this._commandCollection[1].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@NumTicket", global::System.Data.SqlDbType.Int, 4, global::System.Data.ParameterDirection.Input, 10, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + this._commandCollection[1].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@PrecNumTicket", global::System.Data.SqlDbType.Int, 4, global::System.Data.ParameterDirection.Input, 10, 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_WSK_byFilt"; + this._commandCollection[2].CommandText = "dbo.stp_WSK_delete"; 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[2].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@KeyFilt", global::System.Data.SqlDbType.NVarChar, 50, global::System.Data.ParameterDirection.Input, 0, 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_WSK_insert"; + this._commandCollection[3].CommandText = "dbo.stp_WSK_byFilt"; 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("@KeyFilt", 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("@CodOrd", 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("@CodArt", 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("@DescArt", 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("@Qta", global::System.Data.SqlDbType.Int, 4, global::System.Data.ParameterDirection.Input, 10, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + this._commandCollection[4] = new global::System.Data.SqlClient.SqlCommand(); + this._commandCollection[4].Connection = this.Connection; + this._commandCollection[4].CommandText = "dbo.stp_WSK_insert"; + this._commandCollection[4].CommandType = global::System.Data.CommandType.StoredProcedure; + this._commandCollection[4].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[4].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@KeyFilt", global::System.Data.SqlDbType.NVarChar, 50, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + this._commandCollection[4].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@CodOrd", global::System.Data.SqlDbType.NVarChar, 50, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + this._commandCollection[4].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@CodArt", global::System.Data.SqlDbType.NVarChar, 50, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + this._commandCollection[4].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@DescArt", global::System.Data.SqlDbType.NVarChar, 50, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + this._commandCollection[4].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Qta", 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()] @@ -4413,7 +4424,7 @@ SELECT KeyFilt, CodOrd, CodArt, DescArt, Qta, DataIns FROM WipSetupKit WHERE (Co [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")] [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Select, false)] public virtual DS_IntServ.WipSetupKitDataTable getByFilt(string KeyFilt) { - this.Adapter.SelectCommand = this.CommandCollection[2]; + this.Adapter.SelectCommand = this.CommandCollection[3]; if ((KeyFilt == null)) { this.Adapter.SelectCommand.Parameters[1].Value = global::System.DBNull.Value; } @@ -4632,8 +4643,66 @@ SELECT KeyFilt, CodOrd, CodArt, DescArt, Qta, DataIns FROM WipSetupKit WHERE (Co [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")] [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")] - public virtual int deleteQuery(string KeyFilt) { + public virtual int All_ImportFile_Process(string filePath, string FIELDTERMINATOR, string ROWTERMINATOR, string FIRSTROW, global::System.Nullable NumTicket, global::System.Nullable PrecNumTicket) { global::System.Data.SqlClient.SqlCommand command = this.CommandCollection[1]; + if ((filePath == null)) { + command.Parameters[1].Value = global::System.DBNull.Value; + } + else { + command.Parameters[1].Value = ((string)(filePath)); + } + if ((FIELDTERMINATOR == null)) { + command.Parameters[2].Value = global::System.DBNull.Value; + } + else { + command.Parameters[2].Value = ((string)(FIELDTERMINATOR)); + } + if ((ROWTERMINATOR == null)) { + command.Parameters[3].Value = global::System.DBNull.Value; + } + else { + command.Parameters[3].Value = ((string)(ROWTERMINATOR)); + } + if ((FIRSTROW == null)) { + command.Parameters[4].Value = global::System.DBNull.Value; + } + else { + command.Parameters[4].Value = ((string)(FIRSTROW)); + } + if ((NumTicket.HasValue == true)) { + command.Parameters[5].Value = ((int)(NumTicket.Value)); + } + else { + command.Parameters[5].Value = global::System.DBNull.Value; + } + if ((PrecNumTicket.HasValue == true)) { + command.Parameters[6].Value = ((int)(PrecNumTicket.Value)); + } + else { + command.Parameters[6].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; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")] + [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")] + public virtual int deleteQuery(string KeyFilt) { + global::System.Data.SqlClient.SqlCommand command = this.CommandCollection[2]; if ((KeyFilt == null)) { command.Parameters[1].Value = global::System.DBNull.Value; } @@ -4661,7 +4730,7 @@ SELECT KeyFilt, CodOrd, CodArt, DescArt, Qta, DataIns FROM WipSetupKit WHERE (Co [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")] [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")] public virtual int insertQuery(string KeyFilt, string CodOrd, string CodArt, string DescArt, global::System.Nullable Qta) { - global::System.Data.SqlClient.SqlCommand command = this.CommandCollection[3]; + global::System.Data.SqlClient.SqlCommand command = this.CommandCollection[4]; if ((KeyFilt == null)) { command.Parameters[1].Value = global::System.DBNull.Value; } diff --git a/MapoDb/DS_IntServ.xsd b/MapoDb/DS_IntServ.xsd index 37a22d77..5802bf0b 100644 --- a/MapoDb/DS_IntServ.xsd +++ b/MapoDb/DS_IntServ.xsd @@ -257,7 +257,7 @@ SELECT KeyKit, KeyExtOrd, CodArtParent, CodArtChild, QtyKIT, QtyART FROM Istanze - + dbo.stp_IstKit_insertByWKS @@ -270,7 +270,7 @@ SELECT KeyKit, KeyExtOrd, CodArtParent, CodArtChild, QtyKIT, QtyART FROM Istanze - + dbo.stp_IstKit_insert @@ -378,6 +378,22 @@ SELECT KeyFilt, CodOrd, CodArt, DescArt, Qta, DataIns FROM WipSetupKit WHERE (Co + + + + tmp.stp_All_ImportFile_Process + + + + + + + + + + + + @@ -425,7 +441,7 @@ SELECT KeyFilt, CodOrd, CodArt, DescArt, Qta, DataIns FROM WipSetupKit WHERE (Co - + @@ -454,7 +470,7 @@ SELECT KeyFilt, CodOrd, CodArt, DescArt, Qta, DataIns FROM WipSetupKit WHERE (Co - + @@ -475,7 +491,7 @@ SELECT KeyFilt, CodOrd, CodArt, DescArt, Qta, DataIns FROM WipSetupKit WHERE (Co - + @@ -511,7 +527,7 @@ SELECT KeyFilt, CodOrd, CodArt, DescArt, Qta, DataIns FROM WipSetupKit WHERE (Co - + @@ -527,7 +543,7 @@ SELECT KeyFilt, CodOrd, CodArt, DescArt, Qta, DataIns FROM WipSetupKit WHERE (Co - + diff --git a/MapoDb/DS_IntServ.xss b/MapoDb/DS_IntServ.xss index d3d12448..61165317 100644 --- a/MapoDb/DS_IntServ.xss +++ b/MapoDb/DS_IntServ.xss @@ -8,9 +8,9 @@ - + - + \ No newline at end of file