diff --git a/MP-IO/Controllers/IOBController.cs b/MP-IO/Controllers/IOBController.cs index d7bb788a..23ffec6e 100644 --- a/MP-IO/Controllers/IOBController.cs +++ b/MP-IO/Controllers/IOBController.cs @@ -110,6 +110,7 @@ namespace MP_IO.Controllers return answ; } +#if false /// /// Chiude ODL x macchina: /// @@ -133,6 +134,39 @@ namespace MP_IO.Controllers catch { } return answ; + } +#endif + + /// + /// Chiude ODL x macchina: + /// + /// GET: IOB/closeODL/SIMUL_03?idxOdl=123&dtEve=20230323151100000&dtCurr=20230323221100000 + /// + /// id macchina + /// idx dell'ODL da chiudere + /// DataOra evento + /// DataOra corrente x fix + /// bool esecuzione + public bool closeODL(string id, int idxOdl, string dtEve = "", string dtCurr = "") + { + bool answ = false; + // init obj DataLayer + DataLayer DataLayerObj = new DataLayer(); + try + {// chiamata diretta sul DB... + DateTime dtEvento = DateTime.Now; + //se ho una data-ora chiusura la calcolo... + bool rtimeProc = string.IsNullOrEmpty(dtEve); + if (!rtimeProc) + { + dtEvento = DataLayerObj.GetSrvDtEvent(dtEve, dtCurr); + } + DataLayerObj.taODL.forceClose(idxOdl, id, dtEvento); + answ = true; + } + catch + { } + return answ; } /// @@ -141,7 +175,9 @@ namespace MP_IO.Controllers /// GET: IOB/closePODL/SIMUL_03?idxPOdl=123&dtEve=20230323151100000&dtCurr=20230323221100000 /// /// id macchina - /// idx dell'ODL da chiudere + /// idx del POdl da chiudere + /// DataOra evento + /// DataOra corrente x fix /// bool esecuzione public bool closePODL(string id, int idxPOdl, string dtEve = "", string dtCurr = "") { @@ -570,15 +606,19 @@ namespace MP_IO.Controllers return DataLayerObj.AutoStartOdl(id, doConfirm, qtyFromLast, (int)roundStep, keyRichiesta); } - /// Avvia PODL indicato + /// + /// Avvia PODL indicato /// - se esistesse un ODL da altro PODL --> chiude /// - se fosse già in essere ODL collegato --> lascia aperto /// - se fosse chiuso ODL collegato --> duplica PODL e poi avvia nuovo ODL. /// /// GET: IOB/forceStartPOdl/SIMUL_03?idxPODL=123&dtEve=20230323151100000&dtCurr=20230323221100000 - /// idx del PDL da - /// avviare data-ora di avvio (opzionale) data-ora attuale (opzionale) Esito chiamata (OK/vuoto) + /// + /// + /// idx del PDL da avviare + /// data-ora di avvio (opzionale) + /// data-ora attuale (opzionale) + /// Esito chiamata (OK/vuoto) public string forceStartPOdl(string id, int idxPODL, string dtEve = "", string dtCurr = "") { // attenzione! poiché nell'URL il carattere "#" viene filtrato ci aspettiamo il @@ -589,6 +629,26 @@ namespace MP_IO.Controllers return answ; } + /// + /// Creazione nuovo ODL dato CodArt + numPz + /// GET: IOB/forceCreatePOdl/SIMUL_03?CodArt=ABCD_1234&numPz=5 + /// + /// + /// + /// + /// + /// IdxODL creato + public int forceCreatePOdl(string id, string CodArt, string CodGruppo, int numPz) + { + int answ = 0; + // attenzione! poiché nell'URL il carattere "#" viene filtrato ci aspettiamo il + // carattere "|" che poi trasformiamo ora in "#" + id = id.Replace("|", "#"); + DataLayer DataLayerObj = new DataLayer(); + answ = DataLayerObj.ForceCreatePOdl(id, CodArt, numPz, CodGruppo); + return answ; + } + /// /// Recupera elenco articoli dei PODL correnti: /// @@ -604,8 +664,7 @@ namespace MP_IO.Controllers try { // recupero dati macchina... - var elencoArt = DataLayerObj.taAnagArt.getByCurrPODL(); - + DS_ProdTempi.AnagArticoliDataTable elencoArt = DataLayerObj.taAnagArt.getByCurrPODL(); answ = JsonConvert.SerializeObject(elencoArt); } catch diff --git a/MP-TAB/ODL.aspx b/MP-TAB/ODL.aspx index 5bc4fcfb..5f0d1d43 100644 --- a/MP-TAB/ODL.aspx +++ b/MP-TAB/ODL.aspx @@ -21,7 +21,7 @@
- +

diff --git a/MapoDb/DS_ProdTempi.xsd b/MapoDb/DS_ProdTempi.xsd index 315b1913..7d02082e 100644 --- a/MapoDb/DS_ProdTempi.xsd +++ b/MapoDb/DS_ProdTempi.xsd @@ -640,74 +640,24 @@ FROM v_ODL_exp ORDER BY IdxODL DESC - - - - DELETE FROM [AnagArticoli] WHERE (([CodArticolo] = @Original_CodArticolo) AND ([Disegno] = @Original_Disegno) AND ([DescArticolo] = @Original_DescArticolo) AND ([CurrRev] = @Original_CurrRev) AND ([ProdRev] = @Original_ProdRev) AND ((@IsNull_FlagIsNew = 1 AND [FlagIsNew] IS NULL) OR ([FlagIsNew] = @Original_FlagIsNew)) AND ([Tipo] = @Original_Tipo)) - - - - - - - - - - - - - - - INSERT INTO [AnagArticoli] ([CodArticolo], [Disegno], [DescArticolo], [CurrRev], [ProdRev], [Tipo]) VALUES (@CodArticolo, @Disegno, @DescArticolo, @CurrRev, @ProdRev, @Tipo); -SELECT CodArticolo, Disegno, DescArticolo, CurrRev, ProdRev, FlagIsNew, Tipo FROM AnagArticoli WHERE (CodArticolo = @CodArticolo) - - - - - - - - - - + - + SELECT * FROM v_AnagArticoli - - - UPDATE [AnagArticoli] SET [CodArticolo] = @CodArticolo, [Disegno] = @Disegno, [DescArticolo] = @DescArticolo, [CurrRev] = @CurrRev, [ProdRev] = @ProdRev, [Tipo] = @Tipo WHERE (([CodArticolo] = @Original_CodArticolo) AND ([Disegno] = @Original_Disegno) AND ([DescArticolo] = @Original_DescArticolo) AND ([CurrRev] = @Original_CurrRev) AND ([ProdRev] = @Original_ProdRev) AND ((@IsNull_FlagIsNew = 1 AND [FlagIsNew] IS NULL) OR ([FlagIsNew] = @Original_FlagIsNew)) AND ([Tipo] = @Original_Tipo)); -SELECT CodArticolo, Disegno, DescArticolo, CurrRev, ProdRev, FlagIsNew, Tipo FROM AnagArticoli WHERE (CodArticolo = @CodArticolo) - - - - - - - - - - - - - - - - - - + - + @@ -790,6 +740,22 @@ SELECT CodArticolo, Disegno, DescArticolo, CurrRev, ProdRev, FlagIsNew, Tipo FRO + + + + dbo.stp_ART_insert + + + + + + + + + + + + @@ -2752,36 +2718,43 @@ SELECT IdxMacchina, IdxMacchinaSlave FROM Macchine2Slave WHERE (IdxMacchina = @I - + + + + + + + + - + - + - - + + - + @@ -3057,82 +3030,82 @@ SELECT IdxMacchina, IdxMacchinaSlave FROM Macchine2Slave WHERE (IdxMacchina = @I - - - + + + - + - + - + - - - + + + - + - - - - + + + + - - + + - - - - - - - - - - - - + + + + + + + + + + + + @@ -3390,15 +3363,15 @@ SELECT IdxMacchina, IdxMacchinaSlave FROM Macchine2Slave WHERE (IdxMacchina = @I - + - - + + diff --git a/MapoDb/DS_ProdTempi.xss b/MapoDb/DS_ProdTempi.xss index c5f4b901..f56cc58a 100644 --- a/MapoDb/DS_ProdTempi.xss +++ b/MapoDb/DS_ProdTempi.xss @@ -4,17 +4,17 @@ Changes to this file may cause incorrect behavior and will be lost if the code is regenerated. --> - + - - + + - + diff --git a/MapoDb/DS_ProdTempi1.Designer.cs b/MapoDb/DS_ProdTempi1.Designer.cs index 04f74a41..08f1b375 100644 --- a/MapoDb/DS_ProdTempi1.Designer.cs +++ b/MapoDb/DS_ProdTempi1.Designer.cs @@ -1978,6 +1978,8 @@ namespace MapoDb { private global::System.Data.DataColumn columnCodArticolo; + private global::System.Data.DataColumn columnDisegno; + private global::System.Data.DataColumn columnDescArticolo; private global::System.Data.DataColumn columnCurrRev; @@ -1986,10 +1988,10 @@ namespace MapoDb { private global::System.Data.DataColumn columnFlagIsNew; - private global::System.Data.DataColumn columnDisegno; - private global::System.Data.DataColumn columnTipo; + private global::System.Data.DataColumn columnAzienda; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")] public AnagArticoliDataTable() { @@ -2031,6 +2033,14 @@ namespace MapoDb { } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")] + public global::System.Data.DataColumn DisegnoColumn { + get { + return this.columnDisegno; + } + } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")] public global::System.Data.DataColumn DescArticoloColumn { @@ -2065,17 +2075,17 @@ namespace MapoDb { [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")] - public global::System.Data.DataColumn DisegnoColumn { + public global::System.Data.DataColumn TipoColumn { get { - return this.columnDisegno; + return this.columnTipo; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")] - public global::System.Data.DataColumn TipoColumn { + public global::System.Data.DataColumn AziendaColumn { get { - return this.columnTipo; + return this.columnAzienda; } } @@ -2116,16 +2126,17 @@ namespace MapoDb { [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")] - public AnagArticoliRow AddAnagArticoliRow(string CodArticolo, string DescArticolo, string CurrRev, string ProdRev, bool FlagIsNew, string Disegno, string Tipo) { + public AnagArticoliRow AddAnagArticoliRow(string CodArticolo, string Disegno, string DescArticolo, string CurrRev, string ProdRev, bool FlagIsNew, string Tipo, string Azienda) { AnagArticoliRow rowAnagArticoliRow = ((AnagArticoliRow)(this.NewRow())); object[] columnValuesArray = new object[] { CodArticolo, + Disegno, DescArticolo, CurrRev, ProdRev, FlagIsNew, - Disegno, - Tipo}; + Tipo, + Azienda}; rowAnagArticoliRow.ItemArray = columnValuesArray; this.Rows.Add(rowAnagArticoliRow); return rowAnagArticoliRow; @@ -2156,12 +2167,13 @@ namespace MapoDb { [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")] internal void InitVars() { this.columnCodArticolo = base.Columns["CodArticolo"]; + this.columnDisegno = base.Columns["Disegno"]; this.columnDescArticolo = base.Columns["DescArticolo"]; this.columnCurrRev = base.Columns["CurrRev"]; this.columnProdRev = base.Columns["ProdRev"]; this.columnFlagIsNew = base.Columns["FlagIsNew"]; - this.columnDisegno = base.Columns["Disegno"]; this.columnTipo = base.Columns["Tipo"]; + this.columnAzienda = base.Columns["Azienda"]; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] @@ -2169,6 +2181,8 @@ namespace MapoDb { private void InitClass() { this.columnCodArticolo = new global::System.Data.DataColumn("CodArticolo", typeof(string), null, global::System.Data.MappingType.Element); base.Columns.Add(this.columnCodArticolo); + this.columnDisegno = new global::System.Data.DataColumn("Disegno", typeof(string), null, global::System.Data.MappingType.Element); + base.Columns.Add(this.columnDisegno); this.columnDescArticolo = new global::System.Data.DataColumn("DescArticolo", typeof(string), null, global::System.Data.MappingType.Element); base.Columns.Add(this.columnDescArticolo); this.columnCurrRev = new global::System.Data.DataColumn("CurrRev", typeof(string), null, global::System.Data.MappingType.Element); @@ -2177,15 +2191,17 @@ namespace MapoDb { base.Columns.Add(this.columnProdRev); this.columnFlagIsNew = new global::System.Data.DataColumn("FlagIsNew", typeof(bool), null, global::System.Data.MappingType.Element); base.Columns.Add(this.columnFlagIsNew); - this.columnDisegno = new global::System.Data.DataColumn("Disegno", typeof(string), null, global::System.Data.MappingType.Element); - base.Columns.Add(this.columnDisegno); this.columnTipo = new global::System.Data.DataColumn("Tipo", typeof(string), null, global::System.Data.MappingType.Element); base.Columns.Add(this.columnTipo); + this.columnAzienda = new global::System.Data.DataColumn("Azienda", typeof(string), null, global::System.Data.MappingType.Element); + base.Columns.Add(this.columnAzienda); this.Constraints.Add(new global::System.Data.UniqueConstraint("Constraint1", new global::System.Data.DataColumn[] { this.columnCodArticolo}, true)); this.columnCodArticolo.AllowDBNull = false; this.columnCodArticolo.Unique = true; this.columnCodArticolo.MaxLength = 50; + this.columnDisegno.AllowDBNull = false; + this.columnDisegno.MaxLength = 50; this.columnDescArticolo.AllowDBNull = false; this.columnDescArticolo.MaxLength = 250; this.columnCurrRev.AllowDBNull = false; @@ -2193,10 +2209,10 @@ namespace MapoDb { this.columnProdRev.AllowDBNull = false; this.columnProdRev.MaxLength = 50; this.columnFlagIsNew.ReadOnly = true; - this.columnDisegno.AllowDBNull = false; - this.columnDisegno.MaxLength = 50; this.columnTipo.AllowDBNull = false; this.columnTipo.MaxLength = 50; + this.columnAzienda.AllowDBNull = false; + this.columnAzienda.MaxLength = 50; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] @@ -11049,6 +11065,17 @@ namespace MapoDb { } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")] + public string Disegno { + get { + return ((string)(this[this.tableAnagArticoli.DisegnoColumn])); + } + set { + this[this.tableAnagArticoli.DisegnoColumn] = value; + } + } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")] public string DescArticolo { @@ -11098,17 +11125,6 @@ namespace MapoDb { } } - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")] - public string Disegno { - get { - return ((string)(this[this.tableAnagArticoli.DisegnoColumn])); - } - set { - this[this.tableAnagArticoli.DisegnoColumn] = value; - } - } - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")] public string Tipo { @@ -11120,6 +11136,17 @@ namespace MapoDb { } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")] + public string Azienda { + get { + return ((string)(this[this.tableAnagArticoli.AziendaColumn])); + } + set { + this[this.tableAnagArticoli.AziendaColumn] = value; + } + } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")] public bool IsFlagIsNewNull() { @@ -19228,55 +19255,14 @@ SELECT IdxMacchina, CodArticolo, DataOraRif, TCMedio, PzProd FROM TempiCicloRile tableMapping.SourceTable = "Table"; tableMapping.DataSetTable = "AnagArticoli"; tableMapping.ColumnMappings.Add("CodArticolo", "CodArticolo"); + tableMapping.ColumnMappings.Add("Disegno", "Disegno"); tableMapping.ColumnMappings.Add("DescArticolo", "DescArticolo"); tableMapping.ColumnMappings.Add("CurrRev", "CurrRev"); tableMapping.ColumnMappings.Add("ProdRev", "ProdRev"); tableMapping.ColumnMappings.Add("FlagIsNew", "FlagIsNew"); - tableMapping.ColumnMappings.Add("Disegno", "Disegno"); tableMapping.ColumnMappings.Add("Tipo", "Tipo"); + tableMapping.ColumnMappings.Add("Azienda", "Azienda"); this._adapter.TableMappings.Add(tableMapping); - this._adapter.DeleteCommand = new global::System.Data.SqlClient.SqlCommand(); - this._adapter.DeleteCommand.Connection = this.Connection; - this._adapter.DeleteCommand.CommandText = @"DELETE FROM [AnagArticoli] WHERE (([CodArticolo] = @Original_CodArticolo) AND ([Disegno] = @Original_Disegno) AND ([DescArticolo] = @Original_DescArticolo) AND ([CurrRev] = @Original_CurrRev) AND ([ProdRev] = @Original_ProdRev) AND ((@IsNull_FlagIsNew = 1 AND [FlagIsNew] IS NULL) OR ([FlagIsNew] = @Original_FlagIsNew)) AND ([Tipo] = @Original_Tipo))"; - this._adapter.DeleteCommand.CommandType = global::System.Data.CommandType.Text; - this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_CodArticolo", global::System.Data.SqlDbType.NVarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "CodArticolo", global::System.Data.DataRowVersion.Original, false, null, "", "", "")); - this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_Disegno", global::System.Data.SqlDbType.NVarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "Disegno", global::System.Data.DataRowVersion.Original, false, null, "", "", "")); - this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_DescArticolo", global::System.Data.SqlDbType.NVarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "DescArticolo", global::System.Data.DataRowVersion.Original, false, null, "", "", "")); - this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_CurrRev", global::System.Data.SqlDbType.NVarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "CurrRev", global::System.Data.DataRowVersion.Original, false, null, "", "", "")); - this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_ProdRev", global::System.Data.SqlDbType.NVarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "ProdRev", global::System.Data.DataRowVersion.Original, false, null, "", "", "")); - this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@IsNull_FlagIsNew", global::System.Data.SqlDbType.Int, 0, global::System.Data.ParameterDirection.Input, 0, 0, "FlagIsNew", global::System.Data.DataRowVersion.Original, true, null, "", "", "")); - this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_FlagIsNew", global::System.Data.SqlDbType.Bit, 0, global::System.Data.ParameterDirection.Input, 0, 0, "FlagIsNew", global::System.Data.DataRowVersion.Original, false, null, "", "", "")); - this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_Tipo", global::System.Data.SqlDbType.NVarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "Tipo", global::System.Data.DataRowVersion.Original, false, null, "", "", "")); - this._adapter.InsertCommand = new global::System.Data.SqlClient.SqlCommand(); - this._adapter.InsertCommand.Connection = this.Connection; - this._adapter.InsertCommand.CommandText = @"INSERT INTO [AnagArticoli] ([CodArticolo], [Disegno], [DescArticolo], [CurrRev], [ProdRev], [Tipo]) VALUES (@CodArticolo, @Disegno, @DescArticolo, @CurrRev, @ProdRev, @Tipo); -SELECT CodArticolo, Disegno, DescArticolo, CurrRev, ProdRev, FlagIsNew, Tipo FROM AnagArticoli WHERE (CodArticolo = @CodArticolo)"; - this._adapter.InsertCommand.CommandType = global::System.Data.CommandType.Text; - this._adapter.InsertCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@CodArticolo", global::System.Data.SqlDbType.NVarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "CodArticolo", global::System.Data.DataRowVersion.Current, false, null, "", "", "")); - this._adapter.InsertCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Disegno", global::System.Data.SqlDbType.NVarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "Disegno", global::System.Data.DataRowVersion.Current, false, null, "", "", "")); - this._adapter.InsertCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@DescArticolo", global::System.Data.SqlDbType.NVarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "DescArticolo", global::System.Data.DataRowVersion.Current, false, null, "", "", "")); - this._adapter.InsertCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@CurrRev", global::System.Data.SqlDbType.NVarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "CurrRev", global::System.Data.DataRowVersion.Current, false, null, "", "", "")); - this._adapter.InsertCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@ProdRev", global::System.Data.SqlDbType.NVarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "ProdRev", global::System.Data.DataRowVersion.Current, false, null, "", "", "")); - this._adapter.InsertCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Tipo", global::System.Data.SqlDbType.NVarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "Tipo", global::System.Data.DataRowVersion.Current, false, null, "", "", "")); - this._adapter.UpdateCommand = new global::System.Data.SqlClient.SqlCommand(); - this._adapter.UpdateCommand.Connection = this.Connection; - this._adapter.UpdateCommand.CommandText = @"UPDATE [AnagArticoli] SET [CodArticolo] = @CodArticolo, [Disegno] = @Disegno, [DescArticolo] = @DescArticolo, [CurrRev] = @CurrRev, [ProdRev] = @ProdRev, [Tipo] = @Tipo WHERE (([CodArticolo] = @Original_CodArticolo) AND ([Disegno] = @Original_Disegno) AND ([DescArticolo] = @Original_DescArticolo) AND ([CurrRev] = @Original_CurrRev) AND ([ProdRev] = @Original_ProdRev) AND ((@IsNull_FlagIsNew = 1 AND [FlagIsNew] IS NULL) OR ([FlagIsNew] = @Original_FlagIsNew)) AND ([Tipo] = @Original_Tipo)); -SELECT CodArticolo, Disegno, DescArticolo, CurrRev, ProdRev, FlagIsNew, Tipo FROM AnagArticoli WHERE (CodArticolo = @CodArticolo)"; - this._adapter.UpdateCommand.CommandType = global::System.Data.CommandType.Text; - this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@CodArticolo", global::System.Data.SqlDbType.NVarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "CodArticolo", global::System.Data.DataRowVersion.Current, false, null, "", "", "")); - this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Disegno", global::System.Data.SqlDbType.NVarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "Disegno", global::System.Data.DataRowVersion.Current, false, null, "", "", "")); - this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@DescArticolo", global::System.Data.SqlDbType.NVarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "DescArticolo", global::System.Data.DataRowVersion.Current, false, null, "", "", "")); - this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@CurrRev", global::System.Data.SqlDbType.NVarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "CurrRev", global::System.Data.DataRowVersion.Current, false, null, "", "", "")); - this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@ProdRev", global::System.Data.SqlDbType.NVarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "ProdRev", global::System.Data.DataRowVersion.Current, false, null, "", "", "")); - this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Tipo", global::System.Data.SqlDbType.NVarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "Tipo", global::System.Data.DataRowVersion.Current, false, null, "", "", "")); - this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_CodArticolo", global::System.Data.SqlDbType.NVarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "CodArticolo", global::System.Data.DataRowVersion.Original, false, null, "", "", "")); - this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_Disegno", global::System.Data.SqlDbType.NVarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "Disegno", global::System.Data.DataRowVersion.Original, false, null, "", "", "")); - this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_DescArticolo", global::System.Data.SqlDbType.NVarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "DescArticolo", global::System.Data.DataRowVersion.Original, false, null, "", "", "")); - this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_CurrRev", global::System.Data.SqlDbType.NVarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "CurrRev", global::System.Data.DataRowVersion.Original, false, null, "", "", "")); - this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_ProdRev", global::System.Data.SqlDbType.NVarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "ProdRev", global::System.Data.DataRowVersion.Original, false, null, "", "", "")); - this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@IsNull_FlagIsNew", global::System.Data.SqlDbType.Int, 0, global::System.Data.ParameterDirection.Input, 0, 0, "FlagIsNew", global::System.Data.DataRowVersion.Original, true, null, "", "", "")); - this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_FlagIsNew", global::System.Data.SqlDbType.Bit, 0, global::System.Data.ParameterDirection.Input, 0, 0, "FlagIsNew", global::System.Data.DataRowVersion.Original, false, null, "", "", "")); - this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_Tipo", global::System.Data.SqlDbType.NVarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "Tipo", global::System.Data.DataRowVersion.Original, false, null, "", "", "")); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] @@ -19289,7 +19275,7 @@ SELECT CodArticolo, Disegno, DescArticolo, CurrRev, ProdRev, FlagIsNew, Tipo FRO [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")] private void InitCommandCollection() { - this._commandCollection = new global::System.Data.SqlClient.SqlCommand[11]; + this._commandCollection = new global::System.Data.SqlClient.SqlCommand[12]; this._commandCollection[0] = new global::System.Data.SqlClient.SqlCommand(); this._commandCollection[0].Connection = this.Connection; this._commandCollection[0].CommandText = "SELECT * FROM v_AnagArticoli"; @@ -19341,28 +19327,39 @@ SELECT CodArticolo, Disegno, DescArticolo, CurrRev, ProdRev, FlagIsNew, Tipo FRO this._commandCollection[7].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[8] = new global::System.Data.SqlClient.SqlCommand(); this._commandCollection[8].Connection = this.Connection; - this._commandCollection[8].CommandText = "dbo.stp_ART_rowCount"; + this._commandCollection[8].CommandText = "dbo.stp_ART_insert"; this._commandCollection[8].CommandType = global::System.Data.CommandType.StoredProcedure; this._commandCollection[8].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[8].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@searchVal", global::System.Data.SqlDbType.NVarChar, 50, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); - this._commandCollection[8].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@tipo", global::System.Data.SqlDbType.NVarChar, 50, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + this._commandCollection[8].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@CodArticolo", global::System.Data.SqlDbType.NVarChar, 50, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + this._commandCollection[8].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@DescArticolo", global::System.Data.SqlDbType.NVarChar, 250, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + this._commandCollection[8].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@CurrRev", global::System.Data.SqlDbType.NVarChar, 50, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + this._commandCollection[8].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Disegno", global::System.Data.SqlDbType.NVarChar, 50, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + this._commandCollection[8].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Tipo", global::System.Data.SqlDbType.NVarChar, 50, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + this._commandCollection[8].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Azienda", global::System.Data.SqlDbType.NVarChar, 50, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); this._commandCollection[9] = new global::System.Data.SqlClient.SqlCommand(); this._commandCollection[9].Connection = this.Connection; - this._commandCollection[9].CommandText = "dbo.stp_ART_setNewRev"; + this._commandCollection[9].CommandText = "dbo.stp_ART_rowCount"; this._commandCollection[9].CommandType = global::System.Data.CommandType.StoredProcedure; this._commandCollection[9].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[9].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_CodArticolo", 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("@searchVal", 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("@tipo", global::System.Data.SqlDbType.NVarChar, 50, global::System.Data.ParameterDirection.Input, 0, 0, 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_ART_update"; + this._commandCollection[10].CommandText = "dbo.stp_ART_setNewRev"; 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("@Original_CodArticolo", global::System.Data.SqlDbType.NVarChar, 50, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); - this._commandCollection[10].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@DescArticolo", global::System.Data.SqlDbType.NVarChar, 250, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); - this._commandCollection[10].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@CurrRev", global::System.Data.SqlDbType.NVarChar, 50, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); - this._commandCollection[10].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@CodArticolo", global::System.Data.SqlDbType.NVarChar, 50, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); - this._commandCollection[10].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Disegno", global::System.Data.SqlDbType.NVarChar, 50, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); - this._commandCollection[10].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Tipo", global::System.Data.SqlDbType.NVarChar, 50, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + this._commandCollection[11] = new global::System.Data.SqlClient.SqlCommand(); + this._commandCollection[11].Connection = this.Connection; + this._commandCollection[11].CommandText = "dbo.stp_ART_update"; + this._commandCollection[11].CommandType = global::System.Data.CommandType.StoredProcedure; + this._commandCollection[11].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[11].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_CodArticolo", global::System.Data.SqlDbType.NVarChar, 50, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + this._commandCollection[11].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@DescArticolo", global::System.Data.SqlDbType.NVarChar, 250, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + this._commandCollection[11].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@CurrRev", global::System.Data.SqlDbType.NVarChar, 50, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + this._commandCollection[11].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@CodArticolo", global::System.Data.SqlDbType.NVarChar, 50, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + this._commandCollection[11].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Disegno", global::System.Data.SqlDbType.NVarChar, 50, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + this._commandCollection[11].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Tipo", 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()] @@ -19486,266 +19483,6 @@ SELECT CodArticolo, Disegno, DescArticolo, CurrRev, ProdRev, FlagIsNew, Tipo FRO return dataTable; } - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")] - [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")] - public virtual int Update(DS_ProdTempi.AnagArticoliDataTable dataTable) { - return this.Adapter.Update(dataTable); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")] - [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")] - public virtual int Update(DS_ProdTempi dataSet) { - return this.Adapter.Update(dataSet, "AnagArticoli"); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")] - [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")] - public virtual int Update(global::System.Data.DataRow dataRow) { - return this.Adapter.Update(new global::System.Data.DataRow[] { - dataRow}); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")] - [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")] - public virtual int Update(global::System.Data.DataRow[] dataRows) { - return this.Adapter.Update(dataRows); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")] - [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")] - [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Delete, true)] - public virtual int Delete(string Original_CodArticolo, string Original_Disegno, string Original_DescArticolo, string Original_CurrRev, string Original_ProdRev, global::System.Nullable Original_FlagIsNew, string Original_Tipo) { - if ((Original_CodArticolo == null)) { - throw new global::System.ArgumentNullException("Original_CodArticolo"); - } - else { - this.Adapter.DeleteCommand.Parameters[0].Value = ((string)(Original_CodArticolo)); - } - if ((Original_Disegno == null)) { - throw new global::System.ArgumentNullException("Original_Disegno"); - } - else { - this.Adapter.DeleteCommand.Parameters[1].Value = ((string)(Original_Disegno)); - } - if ((Original_DescArticolo == null)) { - throw new global::System.ArgumentNullException("Original_DescArticolo"); - } - else { - this.Adapter.DeleteCommand.Parameters[2].Value = ((string)(Original_DescArticolo)); - } - if ((Original_CurrRev == null)) { - throw new global::System.ArgumentNullException("Original_CurrRev"); - } - else { - this.Adapter.DeleteCommand.Parameters[3].Value = ((string)(Original_CurrRev)); - } - if ((Original_ProdRev == null)) { - throw new global::System.ArgumentNullException("Original_ProdRev"); - } - else { - this.Adapter.DeleteCommand.Parameters[4].Value = ((string)(Original_ProdRev)); - } - if ((Original_FlagIsNew.HasValue == true)) { - this.Adapter.DeleteCommand.Parameters[5].Value = ((object)(0)); - this.Adapter.DeleteCommand.Parameters[6].Value = ((bool)(Original_FlagIsNew.Value)); - } - else { - this.Adapter.DeleteCommand.Parameters[5].Value = ((object)(1)); - this.Adapter.DeleteCommand.Parameters[6].Value = global::System.DBNull.Value; - } - if ((Original_Tipo == null)) { - throw new global::System.ArgumentNullException("Original_Tipo"); - } - else { - this.Adapter.DeleteCommand.Parameters[7].Value = ((string)(Original_Tipo)); - } - global::System.Data.ConnectionState previousConnectionState = this.Adapter.DeleteCommand.Connection.State; - if (((this.Adapter.DeleteCommand.Connection.State & global::System.Data.ConnectionState.Open) - != global::System.Data.ConnectionState.Open)) { - this.Adapter.DeleteCommand.Connection.Open(); - } - try { - int returnValue = this.Adapter.DeleteCommand.ExecuteNonQuery(); - return returnValue; - } - finally { - if ((previousConnectionState == global::System.Data.ConnectionState.Closed)) { - this.Adapter.DeleteCommand.Connection.Close(); - } - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")] - [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")] - [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Insert, true)] - public virtual int Insert(string CodArticolo, string Disegno, string DescArticolo, string CurrRev, string ProdRev, string Tipo) { - if ((CodArticolo == null)) { - throw new global::System.ArgumentNullException("CodArticolo"); - } - else { - this.Adapter.InsertCommand.Parameters[0].Value = ((string)(CodArticolo)); - } - if ((Disegno == null)) { - throw new global::System.ArgumentNullException("Disegno"); - } - else { - this.Adapter.InsertCommand.Parameters[1].Value = ((string)(Disegno)); - } - if ((DescArticolo == null)) { - throw new global::System.ArgumentNullException("DescArticolo"); - } - else { - this.Adapter.InsertCommand.Parameters[2].Value = ((string)(DescArticolo)); - } - if ((CurrRev == null)) { - throw new global::System.ArgumentNullException("CurrRev"); - } - else { - this.Adapter.InsertCommand.Parameters[3].Value = ((string)(CurrRev)); - } - if ((ProdRev == null)) { - throw new global::System.ArgumentNullException("ProdRev"); - } - else { - this.Adapter.InsertCommand.Parameters[4].Value = ((string)(ProdRev)); - } - if ((Tipo == null)) { - throw new global::System.ArgumentNullException("Tipo"); - } - else { - this.Adapter.InsertCommand.Parameters[5].Value = ((string)(Tipo)); - } - global::System.Data.ConnectionState previousConnectionState = this.Adapter.InsertCommand.Connection.State; - if (((this.Adapter.InsertCommand.Connection.State & global::System.Data.ConnectionState.Open) - != global::System.Data.ConnectionState.Open)) { - this.Adapter.InsertCommand.Connection.Open(); - } - try { - int returnValue = this.Adapter.InsertCommand.ExecuteNonQuery(); - return returnValue; - } - finally { - if ((previousConnectionState == global::System.Data.ConnectionState.Closed)) { - this.Adapter.InsertCommand.Connection.Close(); - } - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")] - [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")] - [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Update, true)] - public virtual int Update(string CodArticolo, string Disegno, string DescArticolo, string CurrRev, string ProdRev, string Tipo, string Original_CodArticolo, string Original_Disegno, string Original_DescArticolo, string Original_CurrRev, string Original_ProdRev, global::System.Nullable Original_FlagIsNew, string Original_Tipo) { - if ((CodArticolo == null)) { - throw new global::System.ArgumentNullException("CodArticolo"); - } - else { - this.Adapter.UpdateCommand.Parameters[0].Value = ((string)(CodArticolo)); - } - if ((Disegno == null)) { - throw new global::System.ArgumentNullException("Disegno"); - } - else { - this.Adapter.UpdateCommand.Parameters[1].Value = ((string)(Disegno)); - } - if ((DescArticolo == null)) { - throw new global::System.ArgumentNullException("DescArticolo"); - } - else { - this.Adapter.UpdateCommand.Parameters[2].Value = ((string)(DescArticolo)); - } - if ((CurrRev == null)) { - throw new global::System.ArgumentNullException("CurrRev"); - } - else { - this.Adapter.UpdateCommand.Parameters[3].Value = ((string)(CurrRev)); - } - if ((ProdRev == null)) { - throw new global::System.ArgumentNullException("ProdRev"); - } - else { - this.Adapter.UpdateCommand.Parameters[4].Value = ((string)(ProdRev)); - } - if ((Tipo == null)) { - throw new global::System.ArgumentNullException("Tipo"); - } - else { - this.Adapter.UpdateCommand.Parameters[5].Value = ((string)(Tipo)); - } - if ((Original_CodArticolo == null)) { - throw new global::System.ArgumentNullException("Original_CodArticolo"); - } - else { - this.Adapter.UpdateCommand.Parameters[6].Value = ((string)(Original_CodArticolo)); - } - if ((Original_Disegno == null)) { - throw new global::System.ArgumentNullException("Original_Disegno"); - } - else { - this.Adapter.UpdateCommand.Parameters[7].Value = ((string)(Original_Disegno)); - } - if ((Original_DescArticolo == null)) { - throw new global::System.ArgumentNullException("Original_DescArticolo"); - } - else { - this.Adapter.UpdateCommand.Parameters[8].Value = ((string)(Original_DescArticolo)); - } - if ((Original_CurrRev == null)) { - throw new global::System.ArgumentNullException("Original_CurrRev"); - } - else { - this.Adapter.UpdateCommand.Parameters[9].Value = ((string)(Original_CurrRev)); - } - if ((Original_ProdRev == null)) { - throw new global::System.ArgumentNullException("Original_ProdRev"); - } - else { - this.Adapter.UpdateCommand.Parameters[10].Value = ((string)(Original_ProdRev)); - } - if ((Original_FlagIsNew.HasValue == true)) { - this.Adapter.UpdateCommand.Parameters[11].Value = ((object)(0)); - this.Adapter.UpdateCommand.Parameters[12].Value = ((bool)(Original_FlagIsNew.Value)); - } - else { - this.Adapter.UpdateCommand.Parameters[11].Value = ((object)(1)); - this.Adapter.UpdateCommand.Parameters[12].Value = global::System.DBNull.Value; - } - if ((Original_Tipo == null)) { - throw new global::System.ArgumentNullException("Original_Tipo"); - } - else { - this.Adapter.UpdateCommand.Parameters[13].Value = ((string)(Original_Tipo)); - } - global::System.Data.ConnectionState previousConnectionState = this.Adapter.UpdateCommand.Connection.State; - if (((this.Adapter.UpdateCommand.Connection.State & global::System.Data.ConnectionState.Open) - != global::System.Data.ConnectionState.Open)) { - this.Adapter.UpdateCommand.Connection.Open(); - } - try { - int returnValue = this.Adapter.UpdateCommand.ExecuteNonQuery(); - return returnValue; - } - finally { - if ((previousConnectionState == global::System.Data.ConnectionState.Closed)) { - this.Adapter.UpdateCommand.Connection.Close(); - } - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")] - [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")] - [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Update, true)] - public virtual int Update(string Disegno, string DescArticolo, string CurrRev, string ProdRev, string Tipo, string Original_CodArticolo, string Original_Disegno, string Original_DescArticolo, string Original_CurrRev, string Original_ProdRev, global::System.Nullable Original_FlagIsNew, string Original_Tipo) { - return this.Update(Original_CodArticolo, Disegno, DescArticolo, CurrRev, ProdRev, Tipo, Original_CodArticolo, Original_Disegno, Original_DescArticolo, Original_CurrRev, Original_ProdRev, Original_FlagIsNew, Original_Tipo); - } - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")] [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")] @@ -19824,8 +19561,66 @@ SELECT CodArticolo, Disegno, DescArticolo, CurrRev, ProdRev, FlagIsNew, Tipo FRO [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")] [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")] - public virtual object rowCount(string searchVal, string tipo) { + public virtual int insert(string CodArticolo, string DescArticolo, string CurrRev, string Disegno, string Tipo, string Azienda) { global::System.Data.SqlClient.SqlCommand command = this.CommandCollection[8]; + if ((CodArticolo == null)) { + command.Parameters[1].Value = global::System.DBNull.Value; + } + else { + command.Parameters[1].Value = ((string)(CodArticolo)); + } + if ((DescArticolo == null)) { + command.Parameters[2].Value = global::System.DBNull.Value; + } + else { + command.Parameters[2].Value = ((string)(DescArticolo)); + } + if ((CurrRev == null)) { + command.Parameters[3].Value = global::System.DBNull.Value; + } + else { + command.Parameters[3].Value = ((string)(CurrRev)); + } + if ((Disegno == null)) { + command.Parameters[4].Value = global::System.DBNull.Value; + } + else { + command.Parameters[4].Value = ((string)(Disegno)); + } + if ((Tipo == null)) { + command.Parameters[5].Value = global::System.DBNull.Value; + } + else { + command.Parameters[5].Value = ((string)(Tipo)); + } + if ((Azienda == null)) { + command.Parameters[6].Value = global::System.DBNull.Value; + } + else { + command.Parameters[6].Value = ((string)(Azienda)); + } + 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", "17.0.0.0")] + [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")] + public virtual object rowCount(string searchVal, string tipo) { + global::System.Data.SqlClient.SqlCommand command = this.CommandCollection[9]; if ((searchVal == null)) { command.Parameters[1].Value = global::System.DBNull.Value; } @@ -19865,7 +19660,7 @@ SELECT CodArticolo, Disegno, DescArticolo, CurrRev, ProdRev, FlagIsNew, Tipo FRO [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")] [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")] public virtual int setNewRev(string Original_CodArticolo) { - global::System.Data.SqlClient.SqlCommand command = this.CommandCollection[9]; + global::System.Data.SqlClient.SqlCommand command = this.CommandCollection[10]; if ((Original_CodArticolo == null)) { command.Parameters[1].Value = global::System.DBNull.Value; } @@ -19893,7 +19688,7 @@ SELECT CodArticolo, Disegno, DescArticolo, CurrRev, ProdRev, FlagIsNew, Tipo FRO [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")] [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")] public virtual int updateQry(string Original_CodArticolo, string DescArticolo, string CurrRev, string CodArticolo, string Disegno, string Tipo) { - global::System.Data.SqlClient.SqlCommand command = this.CommandCollection[10]; + global::System.Data.SqlClient.SqlCommand command = this.CommandCollection[11]; if ((Original_CodArticolo == null)) { command.Parameters[1].Value = global::System.DBNull.Value; } @@ -29811,8 +29606,6 @@ SELECT IdxMacchina, IdxMacchinaSlave FROM Macchine2Slave WHERE (IdxMacchina = @I private TempiCicloRilevatiTableAdapter _tempiCicloRilevatiTableAdapter; - private AnagArticoliTableAdapter _anagArticoliTableAdapter; - private PostazioniMapoTableAdapter _postazioniMapoTableAdapter; private DatiConfermatiTableAdapter _datiConfermatiTableAdapter; @@ -29856,20 +29649,6 @@ SELECT IdxMacchina, IdxMacchinaSlave FROM Macchine2Slave WHERE (IdxMacchina = @I } } - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")] - [global::System.ComponentModel.EditorAttribute("Microsoft.VSDesigner.DataSource.Design.TableAdapterManagerPropertyEditor, Microso" + - "ft.VSDesigner, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3" + - "a", "System.Drawing.Design.UITypeEditor")] - public AnagArticoliTableAdapter AnagArticoliTableAdapter { - get { - return this._anagArticoliTableAdapter; - } - set { - this._anagArticoliTableAdapter = value; - } - } - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")] [global::System.ComponentModel.EditorAttribute("Microsoft.VSDesigner.DataSource.Design.TableAdapterManagerPropertyEditor, Microso" + @@ -29991,10 +29770,6 @@ SELECT IdxMacchina, IdxMacchinaSlave FROM Macchine2Slave WHERE (IdxMacchina = @I && (this._tempiCicloRilevatiTableAdapter.Connection != null))) { return this._tempiCicloRilevatiTableAdapter.Connection; } - if (((this._anagArticoliTableAdapter != null) - && (this._anagArticoliTableAdapter.Connection != null))) { - return this._anagArticoliTableAdapter.Connection; - } if (((this._postazioniMapoTableAdapter != null) && (this._postazioniMapoTableAdapter.Connection != null))) { return this._postazioniMapoTableAdapter.Connection; @@ -30039,9 +29814,6 @@ SELECT IdxMacchina, IdxMacchinaSlave FROM Macchine2Slave WHERE (IdxMacchina = @I if ((this._tempiCicloRilevatiTableAdapter != null)) { count = (count + 1); } - if ((this._anagArticoliTableAdapter != null)) { - count = (count + 1); - } if ((this._postazioniMapoTableAdapter != null)) { count = (count + 1); } @@ -30137,15 +29909,6 @@ SELECT IdxMacchina, IdxMacchinaSlave FROM Macchine2Slave WHERE (IdxMacchina = @I allChangedRows.AddRange(updatedRows); } } - if ((this._anagArticoliTableAdapter != null)) { - global::System.Data.DataRow[] updatedRows = dataSet.AnagArticoli.Select(null, null, global::System.Data.DataViewRowState.ModifiedCurrent); - updatedRows = this.GetRealUpdatedRows(updatedRows, allAddedRows); - if (((updatedRows != null) - && (0 < updatedRows.Length))) { - result = (result + this._anagArticoliTableAdapter.Update(updatedRows)); - allChangedRows.AddRange(updatedRows); - } - } if ((this._macchine2SlaveTableAdapter != null)) { global::System.Data.DataRow[] updatedRows = dataSet.Macchine2Slave.Select(null, null, global::System.Data.DataViewRowState.ModifiedCurrent); updatedRows = this.GetRealUpdatedRows(updatedRows, allAddedRows); @@ -30221,14 +29984,6 @@ SELECT IdxMacchina, IdxMacchinaSlave FROM Macchine2Slave WHERE (IdxMacchina = @I allAddedRows.AddRange(addedRows); } } - if ((this._anagArticoliTableAdapter != null)) { - global::System.Data.DataRow[] addedRows = dataSet.AnagArticoli.Select(null, null, global::System.Data.DataViewRowState.Added); - if (((addedRows != null) - && (0 < addedRows.Length))) { - result = (result + this._anagArticoliTableAdapter.Update(addedRows)); - allAddedRows.AddRange(addedRows); - } - } if ((this._macchine2SlaveTableAdapter != null)) { global::System.Data.DataRow[] addedRows = dataSet.Macchine2Slave.Select(null, null, global::System.Data.DataViewRowState.Added); if (((addedRows != null) @@ -30255,14 +30010,6 @@ SELECT IdxMacchina, IdxMacchinaSlave FROM Macchine2Slave WHERE (IdxMacchina = @I allChangedRows.AddRange(deletedRows); } } - if ((this._anagArticoliTableAdapter != null)) { - global::System.Data.DataRow[] deletedRows = dataSet.AnagArticoli.Select(null, null, global::System.Data.DataViewRowState.Deleted); - if (((deletedRows != null) - && (0 < deletedRows.Length))) { - result = (result + this._anagArticoliTableAdapter.Update(deletedRows)); - allChangedRows.AddRange(deletedRows); - } - } if ((this._postazioniMapoTableAdapter != null)) { global::System.Data.DataRow[] deletedRows = dataSet.PostazioniMapo.Select(null, null, global::System.Data.DataViewRowState.Deleted); if (((deletedRows != null) @@ -30363,11 +30110,6 @@ SELECT IdxMacchina, IdxMacchinaSlave FROM Macchine2Slave WHERE (IdxMacchina = @I throw new global::System.ArgumentException("All TableAdapters managed by a TableAdapterManager must use the same connection s" + "tring."); } - if (((this._anagArticoliTableAdapter != null) - && (this.MatchTableAdapterConnection(this._anagArticoliTableAdapter.Connection) == false))) { - throw new global::System.ArgumentException("All TableAdapters managed by a TableAdapterManager must use the same connection s" + - "tring."); - } if (((this._postazioniMapoTableAdapter != null) && (this.MatchTableAdapterConnection(this._postazioniMapoTableAdapter.Connection) == false))) { throw new global::System.ArgumentException("All TableAdapters managed by a TableAdapterManager must use the same connection s" + @@ -30444,15 +30186,6 @@ SELECT IdxMacchina, IdxMacchinaSlave FROM Macchine2Slave WHERE (IdxMacchina = @I adaptersWithAcceptChangesDuringUpdate.Add(this._tempiCicloRilevatiTableAdapter.Adapter); } } - if ((this._anagArticoliTableAdapter != null)) { - revertConnections.Add(this._anagArticoliTableAdapter, this._anagArticoliTableAdapter.Connection); - this._anagArticoliTableAdapter.Connection = ((global::System.Data.SqlClient.SqlConnection)(workConnection)); - this._anagArticoliTableAdapter.Transaction = ((global::System.Data.SqlClient.SqlTransaction)(workTransaction)); - if (this._anagArticoliTableAdapter.Adapter.AcceptChangesDuringUpdate) { - this._anagArticoliTableAdapter.Adapter.AcceptChangesDuringUpdate = false; - adaptersWithAcceptChangesDuringUpdate.Add(this._anagArticoliTableAdapter.Adapter); - } - } if ((this._postazioniMapoTableAdapter != null)) { revertConnections.Add(this._postazioniMapoTableAdapter, this._postazioniMapoTableAdapter.Connection); this._postazioniMapoTableAdapter.Connection = ((global::System.Data.SqlClient.SqlConnection)(workConnection)); @@ -30578,10 +30311,6 @@ SELECT IdxMacchina, IdxMacchinaSlave FROM Macchine2Slave WHERE (IdxMacchina = @I this._tempiCicloRilevatiTableAdapter.Connection = ((global::System.Data.SqlClient.SqlConnection)(revertConnections[this._tempiCicloRilevatiTableAdapter])); this._tempiCicloRilevatiTableAdapter.Transaction = null; } - if ((this._anagArticoliTableAdapter != null)) { - this._anagArticoliTableAdapter.Connection = ((global::System.Data.SqlClient.SqlConnection)(revertConnections[this._anagArticoliTableAdapter])); - this._anagArticoliTableAdapter.Transaction = null; - } if ((this._postazioniMapoTableAdapter != null)) { this._postazioniMapoTableAdapter.Connection = ((global::System.Data.SqlClient.SqlConnection)(revertConnections[this._postazioniMapoTableAdapter])); this._postazioniMapoTableAdapter.Transaction = null; diff --git a/MapoDb/DS_Utility.Designer.cs b/MapoDb/DS_Utility.Designer.cs index 5df0729a..ace6d9fb 100644 --- a/MapoDb/DS_Utility.Designer.cs +++ b/MapoDb/DS_Utility.Designer.cs @@ -52,6 +52,8 @@ namespace MapoDb { private v_selTipoArticoliDataTable tablev_selTipoArticoli; + private ConfigDataTable tableConfig; + private global::System.Data.SchemaSerializationMode _schemaSerializationMode = global::System.Data.SchemaSerializationMode.IncludeSchema; [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] @@ -122,6 +124,9 @@ namespace MapoDb { if ((ds.Tables["v_selTipoArticoli"] != null)) { base.Tables.Add(new v_selTipoArticoliDataTable(ds.Tables["v_selTipoArticoli"])); } + if ((ds.Tables["Config"] != null)) { + base.Tables.Add(new ConfigDataTable(ds.Tables["Config"])); + } this.DataSetName = ds.DataSetName; this.Prefix = ds.Prefix; this.Namespace = ds.Namespace; @@ -280,6 +285,16 @@ namespace MapoDb { } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")] + [global::System.ComponentModel.Browsable(false)] + [global::System.ComponentModel.DesignerSerializationVisibility(global::System.ComponentModel.DesignerSerializationVisibility.Content)] + public ConfigDataTable Config { + get { + return this.tableConfig; + } + } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")] [global::System.ComponentModel.BrowsableAttribute(true)] @@ -389,6 +404,9 @@ namespace MapoDb { if ((ds.Tables["v_selTipoArticoli"] != null)) { base.Tables.Add(new v_selTipoArticoliDataTable(ds.Tables["v_selTipoArticoli"])); } + if ((ds.Tables["Config"] != null)) { + base.Tables.Add(new ConfigDataTable(ds.Tables["Config"])); + } this.DataSetName = ds.DataSetName; this.Prefix = ds.Prefix; this.Namespace = ds.Namespace; @@ -506,6 +524,12 @@ namespace MapoDb { this.tablev_selTipoArticoli.InitVars(); } } + this.tableConfig = ((ConfigDataTable)(base.Tables["Config"])); + if ((initTable == true)) { + if ((this.tableConfig != null)) { + this.tableConfig.InitVars(); + } + } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] @@ -544,6 +568,8 @@ namespace MapoDb { base.Tables.Add(this.tablev_selListVal); this.tablev_selTipoArticoli = new v_selTipoArticoliDataTable(); base.Tables.Add(this.tablev_selTipoArticoli); + this.tableConfig = new ConfigDataTable(); + base.Tables.Add(this.tableConfig); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] @@ -630,6 +656,12 @@ namespace MapoDb { return false; } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")] + private bool ShouldSerializeConfig() { + return false; + } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")] private void SchemaChanged(object sender, global::System.ComponentModel.CollectionChangeEventArgs e) { @@ -727,6 +759,9 @@ namespace MapoDb { [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")] public delegate void v_selTipoArticoliRowChangeEventHandler(object sender, v_selTipoArticoliRowChangeEvent e); + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")] + public delegate void ConfigRowChangeEventHandler(object sender, ConfigRowChangeEvent e); + /// ///Represents the strongly named DataTable class. /// @@ -5040,6 +5075,310 @@ namespace MapoDb { } } + /// + ///Represents the strongly named DataTable class. + /// + [global::System.Serializable()] + [global::System.Xml.Serialization.XmlSchemaProviderAttribute("GetTypedTableSchema")] + public partial class ConfigDataTable : global::System.Data.TypedTableBase { + + private global::System.Data.DataColumn columnchiave; + + private global::System.Data.DataColumn columnvalore; + + private global::System.Data.DataColumn columnvaloreStd; + + private global::System.Data.DataColumn columnnote; + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")] + public ConfigDataTable() { + this.TableName = "Config"; + this.BeginInit(); + this.InitClass(); + this.EndInit(); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")] + internal ConfigDataTable(global::System.Data.DataTable table) { + this.TableName = table.TableName; + if ((table.CaseSensitive != table.DataSet.CaseSensitive)) { + this.CaseSensitive = table.CaseSensitive; + } + if ((table.Locale.ToString() != table.DataSet.Locale.ToString())) { + this.Locale = table.Locale; + } + if ((table.Namespace != table.DataSet.Namespace)) { + this.Namespace = table.Namespace; + } + this.Prefix = table.Prefix; + this.MinimumCapacity = table.MinimumCapacity; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")] + protected ConfigDataTable(global::System.Runtime.Serialization.SerializationInfo info, global::System.Runtime.Serialization.StreamingContext context) : + base(info, context) { + this.InitVars(); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")] + public global::System.Data.DataColumn chiaveColumn { + get { + return this.columnchiave; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")] + public global::System.Data.DataColumn valoreColumn { + get { + return this.columnvalore; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")] + public global::System.Data.DataColumn valoreStdColumn { + get { + return this.columnvaloreStd; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")] + public global::System.Data.DataColumn noteColumn { + get { + return this.columnnote; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")] + [global::System.ComponentModel.Browsable(false)] + public int Count { + get { + return this.Rows.Count; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")] + public ConfigRow this[int index] { + get { + return ((ConfigRow)(this.Rows[index])); + } + } + + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")] + public event ConfigRowChangeEventHandler ConfigRowChanging; + + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")] + public event ConfigRowChangeEventHandler ConfigRowChanged; + + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")] + public event ConfigRowChangeEventHandler ConfigRowDeleting; + + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")] + public event ConfigRowChangeEventHandler ConfigRowDeleted; + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")] + public void AddConfigRow(ConfigRow row) { + this.Rows.Add(row); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")] + public ConfigRow AddConfigRow(string chiave, string valore, string valoreStd, string note) { + ConfigRow rowConfigRow = ((ConfigRow)(this.NewRow())); + object[] columnValuesArray = new object[] { + chiave, + valore, + valoreStd, + note}; + rowConfigRow.ItemArray = columnValuesArray; + this.Rows.Add(rowConfigRow); + return rowConfigRow; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")] + public ConfigRow FindBychiave(string chiave) { + return ((ConfigRow)(this.Rows.Find(new object[] { + chiave}))); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")] + public override global::System.Data.DataTable Clone() { + ConfigDataTable cln = ((ConfigDataTable)(base.Clone())); + cln.InitVars(); + return cln; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")] + protected override global::System.Data.DataTable CreateInstance() { + return new ConfigDataTable(); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")] + internal void InitVars() { + this.columnchiave = base.Columns["chiave"]; + this.columnvalore = base.Columns["valore"]; + this.columnvaloreStd = base.Columns["valoreStd"]; + this.columnnote = base.Columns["note"]; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")] + private void InitClass() { + this.columnchiave = new global::System.Data.DataColumn("chiave", typeof(string), null, global::System.Data.MappingType.Element); + base.Columns.Add(this.columnchiave); + this.columnvalore = new global::System.Data.DataColumn("valore", typeof(string), null, global::System.Data.MappingType.Element); + base.Columns.Add(this.columnvalore); + this.columnvaloreStd = new global::System.Data.DataColumn("valoreStd", typeof(string), null, global::System.Data.MappingType.Element); + base.Columns.Add(this.columnvaloreStd); + this.columnnote = new global::System.Data.DataColumn("note", typeof(string), null, global::System.Data.MappingType.Element); + base.Columns.Add(this.columnnote); + this.Constraints.Add(new global::System.Data.UniqueConstraint("Constraint1", new global::System.Data.DataColumn[] { + this.columnchiave}, true)); + this.columnchiave.AllowDBNull = false; + this.columnchiave.Unique = true; + this.columnchiave.MaxLength = 50; + this.columnvalore.MaxLength = 2147483647; + this.columnvaloreStd.MaxLength = 2147483647; + this.columnnote.MaxLength = 2147483647; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")] + public ConfigRow NewConfigRow() { + return ((ConfigRow)(this.NewRow())); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")] + protected override global::System.Data.DataRow NewRowFromBuilder(global::System.Data.DataRowBuilder builder) { + return new ConfigRow(builder); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")] + protected override global::System.Type GetRowType() { + return typeof(ConfigRow); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")] + protected override void OnRowChanged(global::System.Data.DataRowChangeEventArgs e) { + base.OnRowChanged(e); + if ((this.ConfigRowChanged != null)) { + this.ConfigRowChanged(this, new ConfigRowChangeEvent(((ConfigRow)(e.Row)), e.Action)); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")] + protected override void OnRowChanging(global::System.Data.DataRowChangeEventArgs e) { + base.OnRowChanging(e); + if ((this.ConfigRowChanging != null)) { + this.ConfigRowChanging(this, new ConfigRowChangeEvent(((ConfigRow)(e.Row)), e.Action)); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")] + protected override void OnRowDeleted(global::System.Data.DataRowChangeEventArgs e) { + base.OnRowDeleted(e); + if ((this.ConfigRowDeleted != null)) { + this.ConfigRowDeleted(this, new ConfigRowChangeEvent(((ConfigRow)(e.Row)), e.Action)); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")] + protected override void OnRowDeleting(global::System.Data.DataRowChangeEventArgs e) { + base.OnRowDeleting(e); + if ((this.ConfigRowDeleting != null)) { + this.ConfigRowDeleting(this, new ConfigRowChangeEvent(((ConfigRow)(e.Row)), e.Action)); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")] + public void RemoveConfigRow(ConfigRow row) { + this.Rows.Remove(row); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")] + public static global::System.Xml.Schema.XmlSchemaComplexType GetTypedTableSchema(global::System.Xml.Schema.XmlSchemaSet xs) { + global::System.Xml.Schema.XmlSchemaComplexType type = new global::System.Xml.Schema.XmlSchemaComplexType(); + global::System.Xml.Schema.XmlSchemaSequence sequence = new global::System.Xml.Schema.XmlSchemaSequence(); + DS_Utility ds = new DS_Utility(); + global::System.Xml.Schema.XmlSchemaAny any1 = new global::System.Xml.Schema.XmlSchemaAny(); + any1.Namespace = "http://www.w3.org/2001/XMLSchema"; + any1.MinOccurs = new decimal(0); + any1.MaxOccurs = decimal.MaxValue; + any1.ProcessContents = global::System.Xml.Schema.XmlSchemaContentProcessing.Lax; + sequence.Items.Add(any1); + global::System.Xml.Schema.XmlSchemaAny any2 = new global::System.Xml.Schema.XmlSchemaAny(); + any2.Namespace = "urn:schemas-microsoft-com:xml-diffgram-v1"; + any2.MinOccurs = new decimal(1); + any2.ProcessContents = global::System.Xml.Schema.XmlSchemaContentProcessing.Lax; + sequence.Items.Add(any2); + global::System.Xml.Schema.XmlSchemaAttribute attribute1 = new global::System.Xml.Schema.XmlSchemaAttribute(); + attribute1.Name = "namespace"; + attribute1.FixedValue = ds.Namespace; + type.Attributes.Add(attribute1); + global::System.Xml.Schema.XmlSchemaAttribute attribute2 = new global::System.Xml.Schema.XmlSchemaAttribute(); + attribute2.Name = "tableTypeName"; + attribute2.FixedValue = "ConfigDataTable"; + type.Attributes.Add(attribute2); + type.Particle = sequence; + global::System.Xml.Schema.XmlSchema dsSchema = ds.GetSchemaSerializable(); + if (xs.Contains(dsSchema.TargetNamespace)) { + global::System.IO.MemoryStream s1 = new global::System.IO.MemoryStream(); + global::System.IO.MemoryStream s2 = new global::System.IO.MemoryStream(); + try { + global::System.Xml.Schema.XmlSchema schema = null; + dsSchema.Write(s1); + for (global::System.Collections.IEnumerator schemas = xs.Schemas(dsSchema.TargetNamespace).GetEnumerator(); schemas.MoveNext(); ) { + schema = ((global::System.Xml.Schema.XmlSchema)(schemas.Current)); + s2.SetLength(0); + schema.Write(s2); + if ((s1.Length == s2.Length)) { + s1.Position = 0; + s2.Position = 0; + for (; ((s1.Position != s1.Length) + && (s1.ReadByte() == s2.ReadByte())); ) { + ; + } + if ((s1.Position == s1.Length)) { + return type; + } + } + } + } + finally { + if ((s1 != null)) { + s1.Close(); + } + if ((s2 != null)) { + s2.Close(); + } + } + } + xs.Add(dsSchema); + return type; + } + } + /// ///Represents strongly named DataRow class. /// @@ -6589,6 +6928,116 @@ namespace MapoDb { } } + /// + ///Represents strongly named DataRow class. + /// + public partial class ConfigRow : global::System.Data.DataRow { + + private ConfigDataTable tableConfig; + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")] + internal ConfigRow(global::System.Data.DataRowBuilder rb) : + base(rb) { + this.tableConfig = ((ConfigDataTable)(this.Table)); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")] + public string chiave { + get { + return ((string)(this[this.tableConfig.chiaveColumn])); + } + set { + this[this.tableConfig.chiaveColumn] = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")] + public string valore { + get { + try { + return ((string)(this[this.tableConfig.valoreColumn])); + } + catch (global::System.InvalidCastException e) { + throw new global::System.Data.StrongTypingException("The value for column \'valore\' in table \'Config\' is DBNull.", e); + } + } + set { + this[this.tableConfig.valoreColumn] = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")] + public string valoreStd { + get { + try { + return ((string)(this[this.tableConfig.valoreStdColumn])); + } + catch (global::System.InvalidCastException e) { + throw new global::System.Data.StrongTypingException("The value for column \'valoreStd\' in table \'Config\' is DBNull.", e); + } + } + set { + this[this.tableConfig.valoreStdColumn] = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")] + public string note { + get { + try { + return ((string)(this[this.tableConfig.noteColumn])); + } + catch (global::System.InvalidCastException e) { + throw new global::System.Data.StrongTypingException("The value for column \'note\' in table \'Config\' is DBNull.", e); + } + } + set { + this[this.tableConfig.noteColumn] = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")] + public bool IsvaloreNull() { + return this.IsNull(this.tableConfig.valoreColumn); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")] + public void SetvaloreNull() { + this[this.tableConfig.valoreColumn] = global::System.Convert.DBNull; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")] + public bool IsvaloreStdNull() { + return this.IsNull(this.tableConfig.valoreStdColumn); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")] + public void SetvaloreStdNull() { + this[this.tableConfig.valoreStdColumn] = global::System.Convert.DBNull; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")] + public bool IsnoteNull() { + return this.IsNull(this.tableConfig.noteColumn); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")] + public void SetnoteNull() { + this[this.tableConfig.noteColumn] = global::System.Convert.DBNull; + } + } + /// ///Row event argument class /// @@ -7064,6 +7513,40 @@ namespace MapoDb { } } } + + /// + ///Row event argument class + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")] + public class ConfigRowChangeEvent : global::System.EventArgs { + + private ConfigRow eventRow; + + private global::System.Data.DataRowAction eventAction; + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")] + public ConfigRowChangeEvent(ConfigRow row, global::System.Data.DataRowAction action) { + this.eventRow = row; + this.eventAction = action; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")] + public ConfigRow Row { + get { + return this.eventRow; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")] + public global::System.Data.DataRowAction Action { + get { + return this.eventAction; + } + } + } } } namespace MapoDb.DS_UtilityTableAdapters { @@ -10381,6 +10864,224 @@ SELECT IdxMacchina, IdxStato, InizioStato, Value, CodArticolo, TempoCicloBase, P } } + /// + ///Represents the connection and commands used to retrieve and save data. + /// + [global::System.ComponentModel.DesignerCategoryAttribute("code")] + [global::System.ComponentModel.ToolboxItem(true)] + [global::System.ComponentModel.DataObjectAttribute(true)] + [global::System.ComponentModel.DesignerAttribute("Microsoft.VSDesigner.DataSource.Design.TableAdapterDesigner, Microsoft.VSDesigner" + + ", Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")] + [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")] + public partial class ConfigTableAdapter : global::System.ComponentModel.Component { + + private global::System.Data.SqlClient.SqlDataAdapter _adapter; + + private global::System.Data.SqlClient.SqlConnection _connection; + + private global::System.Data.SqlClient.SqlTransaction _transaction; + + private global::System.Data.SqlClient.SqlCommand[] _commandCollection; + + private bool _clearBeforeFill; + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")] + public ConfigTableAdapter() { + this.ClearBeforeFill = true; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")] + protected internal global::System.Data.SqlClient.SqlDataAdapter Adapter { + get { + if ((this._adapter == null)) { + this.InitAdapter(); + } + return this._adapter; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")] + internal global::System.Data.SqlClient.SqlConnection Connection { + get { + if ((this._connection == null)) { + this.InitConnection(); + } + return this._connection; + } + set { + this._connection = value; + if ((this.Adapter.InsertCommand != null)) { + this.Adapter.InsertCommand.Connection = value; + } + if ((this.Adapter.DeleteCommand != null)) { + this.Adapter.DeleteCommand.Connection = value; + } + if ((this.Adapter.UpdateCommand != null)) { + this.Adapter.UpdateCommand.Connection = value; + } + for (int i = 0; (i < this.CommandCollection.Length); i = (i + 1)) { + if ((this.CommandCollection[i] != null)) { + ((global::System.Data.SqlClient.SqlCommand)(this.CommandCollection[i])).Connection = value; + } + } + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")] + internal global::System.Data.SqlClient.SqlTransaction Transaction { + get { + return this._transaction; + } + set { + this._transaction = value; + for (int i = 0; (i < this.CommandCollection.Length); i = (i + 1)) { + this.CommandCollection[i].Transaction = this._transaction; + } + if (((this.Adapter != null) + && (this.Adapter.DeleteCommand != null))) { + this.Adapter.DeleteCommand.Transaction = this._transaction; + } + if (((this.Adapter != null) + && (this.Adapter.InsertCommand != null))) { + this.Adapter.InsertCommand.Transaction = this._transaction; + } + if (((this.Adapter != null) + && (this.Adapter.UpdateCommand != null))) { + this.Adapter.UpdateCommand.Transaction = this._transaction; + } + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")] + protected global::System.Data.SqlClient.SqlCommand[] CommandCollection { + get { + if ((this._commandCollection == null)) { + this.InitCommandCollection(); + } + return this._commandCollection; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")] + public bool ClearBeforeFill { + get { + return this._clearBeforeFill; + } + set { + this._clearBeforeFill = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")] + private void InitAdapter() { + this._adapter = new global::System.Data.SqlClient.SqlDataAdapter(); + global::System.Data.Common.DataTableMapping tableMapping = new global::System.Data.Common.DataTableMapping(); + tableMapping.SourceTable = "Table"; + tableMapping.DataSetTable = "Config"; + tableMapping.ColumnMappings.Add("chiave", "chiave"); + tableMapping.ColumnMappings.Add("valore", "valore"); + tableMapping.ColumnMappings.Add("valoreStd", "valoreStd"); + tableMapping.ColumnMappings.Add("note", "note"); + this._adapter.TableMappings.Add(tableMapping); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")] + private void InitConnection() { + this._connection = new global::System.Data.SqlClient.SqlConnection(); + this._connection.ConnectionString = global::MapoDb.Properties.Settings.Default.MoonProConnectionString; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")] + private void InitCommandCollection() { + 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 * FROM COnfig"; + 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_config_insertQuery"; + 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("@chiave", 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("@valore", global::System.Data.SqlDbType.NVarChar, 250, 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("@note", global::System.Data.SqlDbType.NVarChar, 250, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")] + [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")] + [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Fill, true)] + public virtual int Fill(DS_Utility.ConfigDataTable dataTable) { + this.Adapter.SelectCommand = this.CommandCollection[0]; + if ((this.ClearBeforeFill == true)) { + dataTable.Clear(); + } + int returnValue = this.Adapter.Fill(dataTable); + return returnValue; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")] + [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")] + [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Select, true)] + public virtual DS_Utility.ConfigDataTable GetData() { + this.Adapter.SelectCommand = this.CommandCollection[0]; + DS_Utility.ConfigDataTable dataTable = new DS_Utility.ConfigDataTable(); + this.Adapter.Fill(dataTable); + return dataTable; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")] + [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")] + public virtual int insertQuery(string chiave, string valore, string note) { + global::System.Data.SqlClient.SqlCommand command = this.CommandCollection[1]; + if ((chiave == null)) { + command.Parameters[1].Value = global::System.DBNull.Value; + } + else { + command.Parameters[1].Value = ((string)(chiave)); + } + if ((valore == null)) { + command.Parameters[2].Value = global::System.DBNull.Value; + } + else { + command.Parameters[2].Value = ((string)(valore)); + } + if ((note == null)) { + command.Parameters[3].Value = global::System.DBNull.Value; + } + else { + command.Parameters[3].Value = ((string)(note)); + } + 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; + } + } + /// ///TableAdapterManager is used to coordinate TableAdapters in the dataset to enable Hierarchical Update scenarios /// diff --git a/MapoDb/DS_Utility.xsd b/MapoDb/DS_Utility.xsd index c25ce8d1..14ce1a7e 100644 --- a/MapoDb/DS_Utility.xsd +++ b/MapoDb/DS_Utility.xsd @@ -546,44 +546,77 @@ FROM dbo.v_selTipoArticoli + + + + + + SELECT * FROM COnfig + + + + + + + + + + + + + + + + dbo.stp_config_insertQuery + + + + + + + + + + + - + - + - + - - - + + + - - - - + + + + - + @@ -593,17 +626,17 @@ FROM dbo.v_selTipoArticoli - + - + - + @@ -613,11 +646,11 @@ FROM dbo.v_selTipoArticoli - + - - + + @@ -627,26 +660,26 @@ FROM dbo.v_selTipoArticoli - + - - + + - + - + - - + + @@ -656,17 +689,17 @@ FROM dbo.v_selTipoArticoli - + - + - + @@ -676,102 +709,102 @@ FROM dbo.v_selTipoArticoli - + - + - + - - + + - + - + - + - - - - + + + + - - + + - - + + - + - - + + - + - - + + - + @@ -781,48 +814,48 @@ FROM dbo.v_selTipoArticoli - + - + - - + + - - + + - + - - + + - + @@ -832,39 +865,39 @@ FROM dbo.v_selTipoArticoli - + - - + + - + - + - + - + - + @@ -874,24 +907,24 @@ FROM dbo.v_selTipoArticoli - + - + - + - + @@ -901,17 +934,17 @@ FROM dbo.v_selTipoArticoli - + - + - + @@ -921,17 +954,17 @@ FROM dbo.v_selTipoArticoli - + - + - + @@ -941,6 +974,40 @@ FROM dbo.v_selTipoArticoli + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -985,5 +1052,9 @@ FROM dbo.v_selTipoArticoli + + + + \ No newline at end of file diff --git a/MapoDb/DS_Utility.xss b/MapoDb/DS_Utility.xss index 4c169062..5cd73317 100644 --- a/MapoDb/DS_Utility.xss +++ b/MapoDb/DS_Utility.xss @@ -6,20 +6,21 @@ --> - - - - - - - - - - - - - - + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/MapoDb/DataLayer.cs b/MapoDb/DataLayer.cs index 0556d106..a927c3f0 100644 --- a/MapoDb/DataLayer.cs +++ b/MapoDb/DataLayer.cs @@ -40,6 +40,7 @@ namespace MapoDb public DS_ProdTempiTableAdapters.CalendFesteFerieTableAdapter taCalFF; public DS_UtilityTableAdapters.CommentiTableAdapter taComm; public DS_DossParTableAdapters.ConfFluxTableAdapter taConfFlux; + public DS_UtilityTableAdapters.ConfigTableAdapter taConfig; public DS_ProdTempiTableAdapters.DatiConfermatiTableAdapter taDatiConf; public DS_ProdTempiTableAdapters.DatiMacchineTableAdapter taDatiMacchine; public DS_ProdTempiTableAdapters.DatiProduzioneTableAdapter taDatiProd; @@ -1643,6 +1644,50 @@ namespace MapoDb return resultList; } + /// + /// Effettua force Start PODL [CurrProdStatus = 1] se fosse già in essere ODL collegato + /// --> lascia aperto [CurrProdStatus = 2] se esistesse un ODL da altro PODL x diverso + /// articolo/fase --> chiude vecchio x poi far partire nuovo [CurrProdStatus = 3] se + /// fosse chiuso ODL collegato --> duplica PODL e poi avvia nuovo ODL [CurrProdStatus = + /// 4] se fosse già in essere ODL non collegato --> lascia aperto e collego + /// + /// macchina + /// Codice articolo x PODL da creare + /// Qty assegnata + /// Codice Gruppo opzionale, default = ND-00 + /// TCiclo assegnato opzionale, default = 1 + /// + public int ForceCreatePOdl(string idxMacchina, string CodArt, int NumPz, string CodGruppo = "ND-00", decimal TCiclo = 1) + { + int answ = 0; + DateTime adesso = DateTime.Now; + // creazione record articolo SE non ci fosse... + var listArt = taAnagArt.getByCod(CodArt); + if (listArt == null || listArt.Count == 0) + { + // recupero conf azienda... + string CodAzienda = "*"; + var listConf = taConfig.GetData(); + var recAzienda = listConf.Where(x => x.chiave == "Azienda").FirstOrDefault(); + if (recAzienda != null) + { + CodAzienda = recAzienda.valore != "*" ? recAzienda.valore : recAzienda.valoreStd; + } + taAnagArt.insert(CodArt, CodArt, "", CodArt, "ART", CodAzienda); + } + // creazione richiesta + string keyRich = $"{idxMacchina}-{adesso:yyyyMMdd-HHmmss}"; + taPODL.insertQuery(keyRich, keyRich, true, CodArt, CodGruppo, idxMacchina, NumPz, TCiclo, adesso, 1, 1, ""); + // cerco PODL da chiave... + var listPOdl = taPODL.getByCodArt(CodArt, true); + var thisPodl = listPOdl.Where(x => x.KeyRichiesta == keyRich).FirstOrDefault(); + if (thisPodl != null) + { + answ = thisPodl.idxPromessa; + } + return answ; + } + /// /// Effettua force Start PODL [CurrProdStatus = 1] se fosse già in essere ODL collegato /// --> lascia aperto [CurrProdStatus = 2] se esistesse un ODL da altro PODL x diverso @@ -4147,6 +4192,7 @@ namespace MapoDb taCalFF = new DS_ProdTempiTableAdapters.CalendFesteFerieTableAdapter(); taComm = new DS_UtilityTableAdapters.CommentiTableAdapter(); taConfFlux = new DS_DossParTableAdapters.ConfFluxTableAdapter(); + taConfig = new DS_UtilityTableAdapters.ConfigTableAdapter(); taDatiConf = new DS_ProdTempiTableAdapters.DatiConfermatiTableAdapter(); taDatiMacchine = new DS_ProdTempiTableAdapters.DatiMacchineTableAdapter(); taDatiProd = new DS_ProdTempiTableAdapters.DatiProduzioneTableAdapter(); @@ -4218,6 +4264,7 @@ namespace MapoDb taAs400.Connection.ConnectionString = connectionStringIS; taArcaGiac.Connection.ConnectionString = connectionStringArca; taCalFF.Connection.ConnectionString = connectionString; + taConfig.Connection.ConnectionString = connectionString; taComm.Connection.ConnectionString = connectionString; taConfFlux.Connection.ConnectionString = connectionString; taDatiConf.Connection.ConnectionString = connectionString;