From 56a701aedf2ea7345aa9b960f24035bf85ad8104 Mon Sep 17 00:00:00 2001 From: "Samuele E. Locatelli" Date: Tue, 24 Jul 2018 21:02:34 +0200 Subject: [PATCH] Ancora qualche update, MA DA TESTARE... non va... --- MP-TAB/WebUserControls/mod_ODL.ascx.cs | 41 +- MapoDb/DS_ProdTempi.Designer.cs | 1211 ++++++++++++++++++++++++ MapoDb/DS_ProdTempi.xsd | 149 +++ MapoDb/DS_ProdTempi.xss | 47 +- MapoDb/DataLayer.cs | 3 + 5 files changed, 1419 insertions(+), 32 deletions(-) diff --git a/MP-TAB/WebUserControls/mod_ODL.ascx.cs b/MP-TAB/WebUserControls/mod_ODL.ascx.cs index 5405938a..de5e89e0 100644 --- a/MP-TAB/WebUserControls/mod_ODL.ascx.cs +++ b/MP-TAB/WebUserControls/mod_ODL.ascx.cs @@ -300,9 +300,19 @@ namespace MoonProTablet.WebUserControls protected decimal TCAssegnato(int idxODL) { decimal answ = 0; - // leggo idxOdl da ultimo odl attivo x macchina - DS_ProdTempi.ODLRow rigaOdl = DataLayer.obj.taODL.getByIdx(idxODL, false)[0]; - answ = rigaOdl.TCAssegnato; + + if (EnableRPO) + { + // leggo info da promessa... + var rigaProm = DataLayer.obj.taPODL.getByKey(idxODL)[0]; + answ = rigaProm.TCAssegnato; + } + else + { + // leggo idxOdl da ultimo odl attivo x macchina + DS_ProdTempi.ODLRow rigaOdl = DataLayer.obj.taODL.getByIdx(idxODL, false)[0]; + answ = rigaOdl.TCAssegnato; + } return answ; } /// @@ -312,6 +322,7 @@ namespace MoonProTablet.WebUserControls /// protected void lbtStartAttr_Click(object sender, EventArgs e) { + int idxODL_curr = 0; confermaProdOdl(false); if (idxODLSel > 0) { // se vedesse TCRich a zero lo reimposta a quello assegnato... @@ -333,20 +344,24 @@ namespace MoonProTablet.WebUserControls { // creo nuovo ODL da promessa ed associo DataLayer.obj.taODL.inizioSetupPromessa(idxODLSel, idxMacchina, TCRichAttr, txtNote.Text); + // salvo ODL attrezzato + idxODL_curr = DataLayer.obj.taODL.getByMacchina(idxMacchina)[0].IdxODL; } // ODL classico else { // avvio NUOVO ODL DataLayer.obj.taODL.inizioSetup(idxODLSel, idxMacchina, TCRichAttr, txtNote.Text); + // salvo ODL Current + idxODL_curr = idxODLSel; } // process evento int idxEvento = 2; // !!!HARD CODED - processaEvento(idxEvento, String.Format("Registrata inizio attrezzaggio per ODL {0}", idxODLSel), idxODLSel); + processaEvento(idxEvento, String.Format("Registrata inizio attrezzaggio per ODL {0}", idxODL_curr), idxODL_curr); // resetto contapezzi redis... DataLayer.saveCounter(idxMacchina, "0"); // imposto ODL su redis... - DataLayer.saveCurrODL(idxMacchina, idxODLSel.ToString()); + DataLayer.saveCurrODL(idxMacchina, idxODL_curr.ToString()); // ricarico... Response.Redirect("~/ODL"); } @@ -584,15 +599,23 @@ namespace MoonProTablet.WebUserControls private void updateTempoTc(int idxOdl) { // riporta TC - DS_ProdTempi.ODLRow rigaOdl = DataLayer.obj.taODL.getByIdx(idxOdl, false)[0]; decimal TCRichAttr = 0; - if (rigaOdl.TCRichAttr > 0) + if (EnableRPO) { - TCRichAttr = rigaOdl.TCRichAttr; + var rigaProm = DataLayer.obj.taPODL.getByKey(idxOdl)[0]; + TCRichAttr = rigaProm.TCAssegnato; } else { - TCRichAttr = rigaOdl.TCAssegnato; + DS_ProdTempi.ODLRow rigaOdl = DataLayer.obj.taODL.getByIdx(idxOdl, false)[0]; + if (rigaOdl.TCRichAttr > 0) + { + TCRichAttr = rigaOdl.TCRichAttr; + } + else + { + TCRichAttr = rigaOdl.TCAssegnato; + } } // mostro! mod_tempoMSMC.tempoMC = TCRichAttr; diff --git a/MapoDb/DS_ProdTempi.Designer.cs b/MapoDb/DS_ProdTempi.Designer.cs index d490c7a4..7942eb7d 100644 --- a/MapoDb/DS_ProdTempi.Designer.cs +++ b/MapoDb/DS_ProdTempi.Designer.cs @@ -68,6 +68,8 @@ namespace MapoDb { private StatoProdDataTable tableStatoProd; + private PromesseODLDataTable tablePromesseODL; + private global::System.Data.SchemaSerializationMode _schemaSerializationMode = global::System.Data.SchemaSerializationMode.IncludeSchema; [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] @@ -162,6 +164,9 @@ namespace MapoDb { if ((ds.Tables["StatoProd"] != null)) { base.Tables.Add(new StatoProdDataTable(ds.Tables["StatoProd"])); } + if ((ds.Tables["PromesseODL"] != null)) { + base.Tables.Add(new PromesseODLDataTable(ds.Tables["PromesseODL"])); + } this.DataSetName = ds.DataSetName; this.Prefix = ds.Prefix; this.Namespace = ds.Namespace; @@ -400,6 +405,16 @@ namespace MapoDb { } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")] + [global::System.ComponentModel.Browsable(false)] + [global::System.ComponentModel.DesignerSerializationVisibility(global::System.ComponentModel.DesignerSerializationVisibility.Content)] + public PromesseODLDataTable PromesseODL { + get { + return this.tablePromesseODL; + } + } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")] [global::System.ComponentModel.BrowsableAttribute(true)] @@ -533,6 +548,9 @@ namespace MapoDb { if ((ds.Tables["StatoProd"] != null)) { base.Tables.Add(new StatoProdDataTable(ds.Tables["StatoProd"])); } + if ((ds.Tables["PromesseODL"] != null)) { + base.Tables.Add(new PromesseODLDataTable(ds.Tables["PromesseODL"])); + } this.DataSetName = ds.DataSetName; this.Prefix = ds.Prefix; this.Namespace = ds.Namespace; @@ -698,6 +716,12 @@ namespace MapoDb { this.tableStatoProd.InitVars(); } } + this.tablePromesseODL = ((PromesseODLDataTable)(base.Tables["PromesseODL"])); + if ((initTable == true)) { + if ((this.tablePromesseODL != null)) { + this.tablePromesseODL.InitVars(); + } + } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] @@ -752,6 +776,8 @@ namespace MapoDb { base.Tables.Add(this.tableRegistroScarti); this.tableStatoProd = new StatoProdDataTable(); base.Tables.Add(this.tableStatoProd); + this.tablePromesseODL = new PromesseODLDataTable(); + base.Tables.Add(this.tablePromesseODL); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] @@ -886,6 +912,12 @@ namespace MapoDb { return false; } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")] + private bool ShouldSerializePromesseODL() { + return false; + } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")] private void SchemaChanged(object sender, global::System.ComponentModel.CollectionChangeEventArgs e) { @@ -1007,6 +1039,9 @@ namespace MapoDb { [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")] public delegate void StatoProdRowChangeEventHandler(object sender, StatoProdRowChangeEvent e); + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")] + public delegate void PromesseODLRowChangeEventHandler(object sender, PromesseODLRowChangeEvent e); + /// ///Represents the strongly named DataTable class. /// @@ -9333,6 +9368,422 @@ namespace MapoDb { } } + /// + ///Represents the strongly named DataTable class. + /// + [global::System.Serializable()] + [global::System.Xml.Serialization.XmlSchemaProviderAttribute("GetTypedTableSchema")] + public partial class PromesseODLDataTable : global::System.Data.TypedTableBase { + + private global::System.Data.DataColumn columnidxPromessa; + + private global::System.Data.DataColumn columnKeyRichiesta; + + private global::System.Data.DataColumn columnAttivabile; + + private global::System.Data.DataColumn columnIdxODL; + + private global::System.Data.DataColumn columnCodArticolo; + + private global::System.Data.DataColumn columnCodGruppo; + + private global::System.Data.DataColumn columnIdxMacchina; + + private global::System.Data.DataColumn columnNumPezzi; + + private global::System.Data.DataColumn columnTCAssegnato; + + private global::System.Data.DataColumn columnDueDate; + + private global::System.Data.DataColumn columnPriorita; + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")] + public PromesseODLDataTable() { + this.TableName = "PromesseODL"; + this.BeginInit(); + this.InitClass(); + this.EndInit(); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")] + internal PromesseODLDataTable(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", "15.0.0.0")] + protected PromesseODLDataTable(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", "15.0.0.0")] + public global::System.Data.DataColumn idxPromessaColumn { + get { + return this.columnidxPromessa; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")] + public global::System.Data.DataColumn KeyRichiestaColumn { + get { + return this.columnKeyRichiesta; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")] + public global::System.Data.DataColumn AttivabileColumn { + get { + return this.columnAttivabile; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")] + public global::System.Data.DataColumn IdxODLColumn { + get { + return this.columnIdxODL; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")] + public global::System.Data.DataColumn CodArticoloColumn { + get { + return this.columnCodArticolo; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")] + public global::System.Data.DataColumn CodGruppoColumn { + get { + return this.columnCodGruppo; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")] + public global::System.Data.DataColumn IdxMacchinaColumn { + get { + return this.columnIdxMacchina; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")] + public global::System.Data.DataColumn NumPezziColumn { + get { + return this.columnNumPezzi; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")] + public global::System.Data.DataColumn TCAssegnatoColumn { + get { + return this.columnTCAssegnato; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")] + public global::System.Data.DataColumn DueDateColumn { + get { + return this.columnDueDate; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")] + public global::System.Data.DataColumn PrioritaColumn { + get { + return this.columnPriorita; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.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", "15.0.0.0")] + public PromesseODLRow this[int index] { + get { + return ((PromesseODLRow)(this.Rows[index])); + } + } + + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")] + public event PromesseODLRowChangeEventHandler PromesseODLRowChanging; + + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")] + public event PromesseODLRowChangeEventHandler PromesseODLRowChanged; + + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")] + public event PromesseODLRowChangeEventHandler PromesseODLRowDeleting; + + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")] + public event PromesseODLRowChangeEventHandler PromesseODLRowDeleted; + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")] + public void AddPromesseODLRow(PromesseODLRow row) { + this.Rows.Add(row); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")] + public PromesseODLRow AddPromesseODLRow(string KeyRichiesta, bool Attivabile, int IdxODL, string CodArticolo, string CodGruppo, string IdxMacchina, int NumPezzi, decimal TCAssegnato, System.DateTime DueDate, int Priorita) { + PromesseODLRow rowPromesseODLRow = ((PromesseODLRow)(this.NewRow())); + object[] columnValuesArray = new object[] { + null, + KeyRichiesta, + Attivabile, + IdxODL, + CodArticolo, + CodGruppo, + IdxMacchina, + NumPezzi, + TCAssegnato, + DueDate, + Priorita}; + rowPromesseODLRow.ItemArray = columnValuesArray; + this.Rows.Add(rowPromesseODLRow); + return rowPromesseODLRow; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")] + public PromesseODLRow FindByidxPromessa(int idxPromessa) { + return ((PromesseODLRow)(this.Rows.Find(new object[] { + idxPromessa}))); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")] + public override global::System.Data.DataTable Clone() { + PromesseODLDataTable cln = ((PromesseODLDataTable)(base.Clone())); + cln.InitVars(); + return cln; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")] + protected override global::System.Data.DataTable CreateInstance() { + return new PromesseODLDataTable(); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")] + internal void InitVars() { + this.columnidxPromessa = base.Columns["idxPromessa"]; + this.columnKeyRichiesta = base.Columns["KeyRichiesta"]; + this.columnAttivabile = base.Columns["Attivabile"]; + this.columnIdxODL = base.Columns["IdxODL"]; + this.columnCodArticolo = base.Columns["CodArticolo"]; + this.columnCodGruppo = base.Columns["CodGruppo"]; + this.columnIdxMacchina = base.Columns["IdxMacchina"]; + this.columnNumPezzi = base.Columns["NumPezzi"]; + this.columnTCAssegnato = base.Columns["TCAssegnato"]; + this.columnDueDate = base.Columns["DueDate"]; + this.columnPriorita = base.Columns["Priorita"]; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")] + private void InitClass() { + this.columnidxPromessa = new global::System.Data.DataColumn("idxPromessa", typeof(int), null, global::System.Data.MappingType.Element); + base.Columns.Add(this.columnidxPromessa); + this.columnKeyRichiesta = new global::System.Data.DataColumn("KeyRichiesta", typeof(string), null, global::System.Data.MappingType.Element); + base.Columns.Add(this.columnKeyRichiesta); + this.columnAttivabile = new global::System.Data.DataColumn("Attivabile", typeof(bool), null, global::System.Data.MappingType.Element); + base.Columns.Add(this.columnAttivabile); + this.columnIdxODL = new global::System.Data.DataColumn("IdxODL", typeof(int), null, global::System.Data.MappingType.Element); + base.Columns.Add(this.columnIdxODL); + this.columnCodArticolo = new global::System.Data.DataColumn("CodArticolo", typeof(string), null, global::System.Data.MappingType.Element); + base.Columns.Add(this.columnCodArticolo); + this.columnCodGruppo = new global::System.Data.DataColumn("CodGruppo", typeof(string), null, global::System.Data.MappingType.Element); + base.Columns.Add(this.columnCodGruppo); + this.columnIdxMacchina = new global::System.Data.DataColumn("IdxMacchina", typeof(string), null, global::System.Data.MappingType.Element); + base.Columns.Add(this.columnIdxMacchina); + this.columnNumPezzi = new global::System.Data.DataColumn("NumPezzi", typeof(int), null, global::System.Data.MappingType.Element); + base.Columns.Add(this.columnNumPezzi); + this.columnTCAssegnato = new global::System.Data.DataColumn("TCAssegnato", typeof(decimal), null, global::System.Data.MappingType.Element); + base.Columns.Add(this.columnTCAssegnato); + this.columnDueDate = new global::System.Data.DataColumn("DueDate", typeof(global::System.DateTime), null, global::System.Data.MappingType.Element); + base.Columns.Add(this.columnDueDate); + this.columnPriorita = new global::System.Data.DataColumn("Priorita", typeof(int), null, global::System.Data.MappingType.Element); + base.Columns.Add(this.columnPriorita); + this.Constraints.Add(new global::System.Data.UniqueConstraint("Constraint1", new global::System.Data.DataColumn[] { + this.columnidxPromessa}, true)); + this.columnidxPromessa.AutoIncrement = true; + this.columnidxPromessa.AutoIncrementSeed = -1; + this.columnidxPromessa.AutoIncrementStep = -1; + this.columnidxPromessa.AllowDBNull = false; + this.columnidxPromessa.ReadOnly = true; + this.columnidxPromessa.Unique = true; + this.columnKeyRichiesta.AllowDBNull = false; + this.columnKeyRichiesta.MaxLength = 50; + this.columnAttivabile.AllowDBNull = false; + this.columnIdxODL.AllowDBNull = false; + this.columnCodArticolo.AllowDBNull = false; + this.columnCodArticolo.MaxLength = 50; + this.columnCodGruppo.AllowDBNull = false; + this.columnCodGruppo.MaxLength = 50; + this.columnIdxMacchina.AllowDBNull = false; + this.columnIdxMacchina.MaxLength = 50; + this.columnNumPezzi.AllowDBNull = false; + this.columnTCAssegnato.AllowDBNull = false; + this.columnDueDate.AllowDBNull = false; + this.columnPriorita.AllowDBNull = false; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")] + public PromesseODLRow NewPromesseODLRow() { + return ((PromesseODLRow)(this.NewRow())); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")] + protected override global::System.Data.DataRow NewRowFromBuilder(global::System.Data.DataRowBuilder builder) { + return new PromesseODLRow(builder); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")] + protected override global::System.Type GetRowType() { + return typeof(PromesseODLRow); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")] + protected override void OnRowChanged(global::System.Data.DataRowChangeEventArgs e) { + base.OnRowChanged(e); + if ((this.PromesseODLRowChanged != null)) { + this.PromesseODLRowChanged(this, new PromesseODLRowChangeEvent(((PromesseODLRow)(e.Row)), e.Action)); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")] + protected override void OnRowChanging(global::System.Data.DataRowChangeEventArgs e) { + base.OnRowChanging(e); + if ((this.PromesseODLRowChanging != null)) { + this.PromesseODLRowChanging(this, new PromesseODLRowChangeEvent(((PromesseODLRow)(e.Row)), e.Action)); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")] + protected override void OnRowDeleted(global::System.Data.DataRowChangeEventArgs e) { + base.OnRowDeleted(e); + if ((this.PromesseODLRowDeleted != null)) { + this.PromesseODLRowDeleted(this, new PromesseODLRowChangeEvent(((PromesseODLRow)(e.Row)), e.Action)); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")] + protected override void OnRowDeleting(global::System.Data.DataRowChangeEventArgs e) { + base.OnRowDeleting(e); + if ((this.PromesseODLRowDeleting != null)) { + this.PromesseODLRowDeleting(this, new PromesseODLRowChangeEvent(((PromesseODLRow)(e.Row)), e.Action)); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")] + public void RemovePromesseODLRow(PromesseODLRow row) { + this.Rows.Remove(row); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.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_ProdTempi ds = new DS_ProdTempi(); + 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 = "PromesseODLDataTable"; + 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. /// @@ -14134,6 +14585,142 @@ namespace MapoDb { } } + /// + ///Represents strongly named DataRow class. + /// + public partial class PromesseODLRow : global::System.Data.DataRow { + + private PromesseODLDataTable tablePromesseODL; + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")] + internal PromesseODLRow(global::System.Data.DataRowBuilder rb) : + base(rb) { + this.tablePromesseODL = ((PromesseODLDataTable)(this.Table)); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")] + public int idxPromessa { + get { + return ((int)(this[this.tablePromesseODL.idxPromessaColumn])); + } + set { + this[this.tablePromesseODL.idxPromessaColumn] = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")] + public string KeyRichiesta { + get { + return ((string)(this[this.tablePromesseODL.KeyRichiestaColumn])); + } + set { + this[this.tablePromesseODL.KeyRichiestaColumn] = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")] + public bool Attivabile { + get { + return ((bool)(this[this.tablePromesseODL.AttivabileColumn])); + } + set { + this[this.tablePromesseODL.AttivabileColumn] = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")] + public int IdxODL { + get { + return ((int)(this[this.tablePromesseODL.IdxODLColumn])); + } + set { + this[this.tablePromesseODL.IdxODLColumn] = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")] + public string CodArticolo { + get { + return ((string)(this[this.tablePromesseODL.CodArticoloColumn])); + } + set { + this[this.tablePromesseODL.CodArticoloColumn] = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")] + public string CodGruppo { + get { + return ((string)(this[this.tablePromesseODL.CodGruppoColumn])); + } + set { + this[this.tablePromesseODL.CodGruppoColumn] = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")] + public string IdxMacchina { + get { + return ((string)(this[this.tablePromesseODL.IdxMacchinaColumn])); + } + set { + this[this.tablePromesseODL.IdxMacchinaColumn] = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")] + public int NumPezzi { + get { + return ((int)(this[this.tablePromesseODL.NumPezziColumn])); + } + set { + this[this.tablePromesseODL.NumPezziColumn] = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")] + public decimal TCAssegnato { + get { + return ((decimal)(this[this.tablePromesseODL.TCAssegnatoColumn])); + } + set { + this[this.tablePromesseODL.TCAssegnatoColumn] = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")] + public System.DateTime DueDate { + get { + return ((global::System.DateTime)(this[this.tablePromesseODL.DueDateColumn])); + } + set { + this[this.tablePromesseODL.DueDateColumn] = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")] + public int Priorita { + get { + return ((int)(this[this.tablePromesseODL.PrioritaColumn])); + } + set { + this[this.tablePromesseODL.PrioritaColumn] = value; + } + } + } + /// ///Row event argument class /// @@ -14881,6 +15468,40 @@ namespace MapoDb { } } } + + /// + ///Row event argument class + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")] + public class PromesseODLRowChangeEvent : global::System.EventArgs { + + private PromesseODLRow eventRow; + + private global::System.Data.DataRowAction eventAction; + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")] + public PromesseODLRowChangeEvent(PromesseODLRow 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", "15.0.0.0")] + public PromesseODLRow Row { + get { + return this.eventRow; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")] + public global::System.Data.DataRowAction Action { + get { + return this.eventAction; + } + } + } } } namespace MapoDb.DS_ProdTempiTableAdapters { @@ -25734,6 +26355,530 @@ FROM MappaStatoExpl"; } } + /// + ///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 PromesseODLTableAdapter : 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", "15.0.0.0")] + public PromesseODLTableAdapter() { + this.ClearBeforeFill = true; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.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", "15.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", "15.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", "15.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", "15.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", "15.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 = "PromesseODL"; + tableMapping.ColumnMappings.Add("idxPromessa", "idxPromessa"); + tableMapping.ColumnMappings.Add("KeyRichiesta", "KeyRichiesta"); + tableMapping.ColumnMappings.Add("Attivabile", "Attivabile"); + tableMapping.ColumnMappings.Add("IdxODL", "IdxODL"); + tableMapping.ColumnMappings.Add("CodArticolo", "CodArticolo"); + tableMapping.ColumnMappings.Add("CodGruppo", "CodGruppo"); + tableMapping.ColumnMappings.Add("IdxMacchina", "IdxMacchina"); + tableMapping.ColumnMappings.Add("NumPezzi", "NumPezzi"); + tableMapping.ColumnMappings.Add("TCAssegnato", "TCAssegnato"); + tableMapping.ColumnMappings.Add("DueDate", "DueDate"); + tableMapping.ColumnMappings.Add("Priorita", "Priorita"); + 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 [dbo].[PromesseODL] WHERE (([idxPromessa] = @Original_idxPromessa) AND ([KeyRichiesta] = @Original_KeyRichiesta) AND ([Attivabile] = @Original_Attivabile) AND ([IdxODL] = @Original_IdxODL) AND ([CodArticolo] = @Original_CodArticolo) AND ([CodGruppo] = @Original_CodGruppo) AND ([IdxMacchina] = @Original_IdxMacchina) AND ([NumPezzi] = @Original_NumPezzi) AND ([TCAssegnato] = @Original_TCAssegnato) AND ([DueDate] = @Original_DueDate) AND ([Priorita] = @Original_Priorita))"; + this._adapter.DeleteCommand.CommandType = global::System.Data.CommandType.Text; + this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_idxPromessa", global::System.Data.SqlDbType.Int, 0, global::System.Data.ParameterDirection.Input, 0, 0, "idxPromessa", global::System.Data.DataRowVersion.Original, false, null, "", "", "")); + this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_KeyRichiesta", global::System.Data.SqlDbType.NVarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "KeyRichiesta", global::System.Data.DataRowVersion.Original, false, null, "", "", "")); + this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_Attivabile", global::System.Data.SqlDbType.Bit, 0, global::System.Data.ParameterDirection.Input, 0, 0, "Attivabile", global::System.Data.DataRowVersion.Original, false, null, "", "", "")); + this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_IdxODL", global::System.Data.SqlDbType.Int, 0, global::System.Data.ParameterDirection.Input, 0, 0, "IdxODL", global::System.Data.DataRowVersion.Original, false, null, "", "", "")); + 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_CodGruppo", global::System.Data.SqlDbType.NVarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "CodGruppo", global::System.Data.DataRowVersion.Original, false, null, "", "", "")); + this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_IdxMacchina", global::System.Data.SqlDbType.NVarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "IdxMacchina", global::System.Data.DataRowVersion.Original, false, null, "", "", "")); + this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_NumPezzi", global::System.Data.SqlDbType.Int, 0, global::System.Data.ParameterDirection.Input, 0, 0, "NumPezzi", global::System.Data.DataRowVersion.Original, false, null, "", "", "")); + this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_TCAssegnato", global::System.Data.SqlDbType.Decimal, 0, global::System.Data.ParameterDirection.Input, 18, 8, "TCAssegnato", global::System.Data.DataRowVersion.Original, false, null, "", "", "")); + this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_DueDate", global::System.Data.SqlDbType.DateTime, 0, global::System.Data.ParameterDirection.Input, 0, 0, "DueDate", global::System.Data.DataRowVersion.Original, false, null, "", "", "")); + this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_Priorita", global::System.Data.SqlDbType.Int, 0, global::System.Data.ParameterDirection.Input, 0, 0, "Priorita", 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 [dbo].[PromesseODL] ([KeyRichiesta], [Attivabile], [IdxODL], [CodArticolo], [CodGruppo], [IdxMacchina], [NumPezzi], [TCAssegnato], [DueDate], [Priorita]) VALUES (@KeyRichiesta, @Attivabile, @IdxODL, @CodArticolo, @CodGruppo, @IdxMacchina, @NumPezzi, @TCAssegnato, @DueDate, @Priorita); +SELECT idxPromessa, KeyRichiesta, Attivabile, IdxODL, CodArticolo, CodGruppo, IdxMacchina, NumPezzi, TCAssegnato, DueDate, Priorita FROM PromesseODL WHERE (idxPromessa = SCOPE_IDENTITY())"; + this._adapter.InsertCommand.CommandType = global::System.Data.CommandType.Text; + this._adapter.InsertCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@KeyRichiesta", global::System.Data.SqlDbType.NVarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "KeyRichiesta", global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + this._adapter.InsertCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Attivabile", global::System.Data.SqlDbType.Bit, 0, global::System.Data.ParameterDirection.Input, 0, 0, "Attivabile", global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + this._adapter.InsertCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@IdxODL", global::System.Data.SqlDbType.Int, 0, global::System.Data.ParameterDirection.Input, 0, 0, "IdxODL", global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + 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("@CodGruppo", global::System.Data.SqlDbType.NVarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "CodGruppo", global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + this._adapter.InsertCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@IdxMacchina", global::System.Data.SqlDbType.NVarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "IdxMacchina", global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + this._adapter.InsertCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@NumPezzi", global::System.Data.SqlDbType.Int, 0, global::System.Data.ParameterDirection.Input, 0, 0, "NumPezzi", global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + this._adapter.InsertCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@TCAssegnato", global::System.Data.SqlDbType.Decimal, 0, global::System.Data.ParameterDirection.Input, 18, 8, "TCAssegnato", global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + this._adapter.InsertCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@DueDate", global::System.Data.SqlDbType.DateTime, 0, global::System.Data.ParameterDirection.Input, 0, 0, "DueDate", global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + this._adapter.InsertCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Priorita", global::System.Data.SqlDbType.Int, 0, global::System.Data.ParameterDirection.Input, 0, 0, "Priorita", 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 [dbo].[PromesseODL] SET [KeyRichiesta] = @KeyRichiesta, [Attivabile] = @Attivabile, [IdxODL] = @IdxODL, [CodArticolo] = @CodArticolo, [CodGruppo] = @CodGruppo, [IdxMacchina] = @IdxMacchina, [NumPezzi] = @NumPezzi, [TCAssegnato] = @TCAssegnato, [DueDate] = @DueDate, [Priorita] = @Priorita WHERE (([idxPromessa] = @Original_idxPromessa) AND ([KeyRichiesta] = @Original_KeyRichiesta) AND ([Attivabile] = @Original_Attivabile) AND ([IdxODL] = @Original_IdxODL) AND ([CodArticolo] = @Original_CodArticolo) AND ([CodGruppo] = @Original_CodGruppo) AND ([IdxMacchina] = @Original_IdxMacchina) AND ([NumPezzi] = @Original_NumPezzi) AND ([TCAssegnato] = @Original_TCAssegnato) AND ([DueDate] = @Original_DueDate) AND ([Priorita] = @Original_Priorita)); +SELECT idxPromessa, KeyRichiesta, Attivabile, IdxODL, CodArticolo, CodGruppo, IdxMacchina, NumPezzi, TCAssegnato, DueDate, Priorita FROM PromesseODL WHERE (idxPromessa = @idxPromessa)"; + this._adapter.UpdateCommand.CommandType = global::System.Data.CommandType.Text; + this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@KeyRichiesta", global::System.Data.SqlDbType.NVarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "KeyRichiesta", global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Attivabile", global::System.Data.SqlDbType.Bit, 0, global::System.Data.ParameterDirection.Input, 0, 0, "Attivabile", global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@IdxODL", global::System.Data.SqlDbType.Int, 0, global::System.Data.ParameterDirection.Input, 0, 0, "IdxODL", global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + 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("@CodGruppo", global::System.Data.SqlDbType.NVarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "CodGruppo", global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@IdxMacchina", global::System.Data.SqlDbType.NVarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "IdxMacchina", global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@NumPezzi", global::System.Data.SqlDbType.Int, 0, global::System.Data.ParameterDirection.Input, 0, 0, "NumPezzi", global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@TCAssegnato", global::System.Data.SqlDbType.Decimal, 0, global::System.Data.ParameterDirection.Input, 18, 8, "TCAssegnato", global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@DueDate", global::System.Data.SqlDbType.DateTime, 0, global::System.Data.ParameterDirection.Input, 0, 0, "DueDate", global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Priorita", global::System.Data.SqlDbType.Int, 0, global::System.Data.ParameterDirection.Input, 0, 0, "Priorita", global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_idxPromessa", global::System.Data.SqlDbType.Int, 0, global::System.Data.ParameterDirection.Input, 0, 0, "idxPromessa", global::System.Data.DataRowVersion.Original, false, null, "", "", "")); + this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_KeyRichiesta", global::System.Data.SqlDbType.NVarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "KeyRichiesta", global::System.Data.DataRowVersion.Original, false, null, "", "", "")); + this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_Attivabile", global::System.Data.SqlDbType.Bit, 0, global::System.Data.ParameterDirection.Input, 0, 0, "Attivabile", global::System.Data.DataRowVersion.Original, false, null, "", "", "")); + this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_IdxODL", global::System.Data.SqlDbType.Int, 0, global::System.Data.ParameterDirection.Input, 0, 0, "IdxODL", global::System.Data.DataRowVersion.Original, 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_CodGruppo", global::System.Data.SqlDbType.NVarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "CodGruppo", global::System.Data.DataRowVersion.Original, false, null, "", "", "")); + this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_IdxMacchina", global::System.Data.SqlDbType.NVarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "IdxMacchina", global::System.Data.DataRowVersion.Original, false, null, "", "", "")); + this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_NumPezzi", global::System.Data.SqlDbType.Int, 0, global::System.Data.ParameterDirection.Input, 0, 0, "NumPezzi", global::System.Data.DataRowVersion.Original, false, null, "", "", "")); + this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_TCAssegnato", global::System.Data.SqlDbType.Decimal, 0, global::System.Data.ParameterDirection.Input, 18, 8, "TCAssegnato", global::System.Data.DataRowVersion.Original, false, null, "", "", "")); + this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_DueDate", global::System.Data.SqlDbType.DateTime, 0, global::System.Data.ParameterDirection.Input, 0, 0, "DueDate", global::System.Data.DataRowVersion.Original, false, null, "", "", "")); + this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_Priorita", global::System.Data.SqlDbType.Int, 0, global::System.Data.ParameterDirection.Input, 0, 0, "Priorita", global::System.Data.DataRowVersion.Original, false, null, "", "", "")); + this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@idxPromessa", global::System.Data.SqlDbType.Int, 4, global::System.Data.ParameterDirection.Input, 0, 0, "idxPromessa", global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.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", "15.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 idxPromessa, KeyRichiesta, Attivabile, IdxODL, CodArticolo, CodGruppo, Idx" + + "Macchina, NumPezzi, TCAssegnato, DueDate, Priorita FROM dbo.PromesseODL"; + 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_PODL_getByIdx"; + 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("@IdxPromessa", global::System.Data.SqlDbType.Int, 4, global::System.Data.ParameterDirection.Input, 10, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")] + [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")] + [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Fill, true)] + public virtual int Fill(DS_ProdTempi.PromesseODLDataTable 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", "15.0.0.0")] + [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")] + [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Select, true)] + public virtual DS_ProdTempi.PromesseODLDataTable GetData() { + this.Adapter.SelectCommand = this.CommandCollection[0]; + DS_ProdTempi.PromesseODLDataTable dataTable = new DS_ProdTempi.PromesseODLDataTable(); + this.Adapter.Fill(dataTable); + return dataTable; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")] + [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")] + [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Select, false)] + public virtual DS_ProdTempi.PromesseODLDataTable getByKey(global::System.Nullable IdxPromessa) { + this.Adapter.SelectCommand = this.CommandCollection[1]; + if ((IdxPromessa.HasValue == true)) { + this.Adapter.SelectCommand.Parameters[1].Value = ((int)(IdxPromessa.Value)); + } + else { + this.Adapter.SelectCommand.Parameters[1].Value = global::System.DBNull.Value; + } + DS_ProdTempi.PromesseODLDataTable dataTable = new DS_ProdTempi.PromesseODLDataTable(); + this.Adapter.Fill(dataTable); + return dataTable; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")] + [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")] + public virtual int Update(DS_ProdTempi.PromesseODLDataTable dataTable) { + return this.Adapter.Update(dataTable); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")] + [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")] + public virtual int Update(DS_ProdTempi dataSet) { + return this.Adapter.Update(dataSet, "PromesseODL"); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")] + [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")] + public virtual int 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", "15.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", "15.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(int Original_idxPromessa, string Original_KeyRichiesta, bool Original_Attivabile, int Original_IdxODL, string Original_CodArticolo, string Original_CodGruppo, string Original_IdxMacchina, int Original_NumPezzi, decimal Original_TCAssegnato, System.DateTime Original_DueDate, int Original_Priorita) { + this.Adapter.DeleteCommand.Parameters[0].Value = ((int)(Original_idxPromessa)); + if ((Original_KeyRichiesta == null)) { + throw new global::System.ArgumentNullException("Original_KeyRichiesta"); + } + else { + this.Adapter.DeleteCommand.Parameters[1].Value = ((string)(Original_KeyRichiesta)); + } + this.Adapter.DeleteCommand.Parameters[2].Value = ((bool)(Original_Attivabile)); + this.Adapter.DeleteCommand.Parameters[3].Value = ((int)(Original_IdxODL)); + if ((Original_CodArticolo == null)) { + throw new global::System.ArgumentNullException("Original_CodArticolo"); + } + else { + this.Adapter.DeleteCommand.Parameters[4].Value = ((string)(Original_CodArticolo)); + } + if ((Original_CodGruppo == null)) { + throw new global::System.ArgumentNullException("Original_CodGruppo"); + } + else { + this.Adapter.DeleteCommand.Parameters[5].Value = ((string)(Original_CodGruppo)); + } + if ((Original_IdxMacchina == null)) { + throw new global::System.ArgumentNullException("Original_IdxMacchina"); + } + else { + this.Adapter.DeleteCommand.Parameters[6].Value = ((string)(Original_IdxMacchina)); + } + this.Adapter.DeleteCommand.Parameters[7].Value = ((int)(Original_NumPezzi)); + this.Adapter.DeleteCommand.Parameters[8].Value = ((decimal)(Original_TCAssegnato)); + this.Adapter.DeleteCommand.Parameters[9].Value = ((System.DateTime)(Original_DueDate)); + this.Adapter.DeleteCommand.Parameters[10].Value = ((int)(Original_Priorita)); + 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", "15.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 KeyRichiesta, bool Attivabile, int IdxODL, string CodArticolo, string CodGruppo, string IdxMacchina, int NumPezzi, decimal TCAssegnato, System.DateTime DueDate, int Priorita) { + if ((KeyRichiesta == null)) { + throw new global::System.ArgumentNullException("KeyRichiesta"); + } + else { + this.Adapter.InsertCommand.Parameters[0].Value = ((string)(KeyRichiesta)); + } + this.Adapter.InsertCommand.Parameters[1].Value = ((bool)(Attivabile)); + this.Adapter.InsertCommand.Parameters[2].Value = ((int)(IdxODL)); + if ((CodArticolo == null)) { + throw new global::System.ArgumentNullException("CodArticolo"); + } + else { + this.Adapter.InsertCommand.Parameters[3].Value = ((string)(CodArticolo)); + } + if ((CodGruppo == null)) { + throw new global::System.ArgumentNullException("CodGruppo"); + } + else { + this.Adapter.InsertCommand.Parameters[4].Value = ((string)(CodGruppo)); + } + if ((IdxMacchina == null)) { + throw new global::System.ArgumentNullException("IdxMacchina"); + } + else { + this.Adapter.InsertCommand.Parameters[5].Value = ((string)(IdxMacchina)); + } + this.Adapter.InsertCommand.Parameters[6].Value = ((int)(NumPezzi)); + this.Adapter.InsertCommand.Parameters[7].Value = ((decimal)(TCAssegnato)); + this.Adapter.InsertCommand.Parameters[8].Value = ((System.DateTime)(DueDate)); + this.Adapter.InsertCommand.Parameters[9].Value = ((int)(Priorita)); + 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", "15.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 KeyRichiesta, + bool Attivabile, + int IdxODL, + string CodArticolo, + string CodGruppo, + string IdxMacchina, + int NumPezzi, + decimal TCAssegnato, + System.DateTime DueDate, + int Priorita, + int Original_idxPromessa, + string Original_KeyRichiesta, + bool Original_Attivabile, + int Original_IdxODL, + string Original_CodArticolo, + string Original_CodGruppo, + string Original_IdxMacchina, + int Original_NumPezzi, + decimal Original_TCAssegnato, + System.DateTime Original_DueDate, + int Original_Priorita, + int idxPromessa) { + if ((KeyRichiesta == null)) { + throw new global::System.ArgumentNullException("KeyRichiesta"); + } + else { + this.Adapter.UpdateCommand.Parameters[0].Value = ((string)(KeyRichiesta)); + } + this.Adapter.UpdateCommand.Parameters[1].Value = ((bool)(Attivabile)); + this.Adapter.UpdateCommand.Parameters[2].Value = ((int)(IdxODL)); + if ((CodArticolo == null)) { + throw new global::System.ArgumentNullException("CodArticolo"); + } + else { + this.Adapter.UpdateCommand.Parameters[3].Value = ((string)(CodArticolo)); + } + if ((CodGruppo == null)) { + throw new global::System.ArgumentNullException("CodGruppo"); + } + else { + this.Adapter.UpdateCommand.Parameters[4].Value = ((string)(CodGruppo)); + } + if ((IdxMacchina == null)) { + throw new global::System.ArgumentNullException("IdxMacchina"); + } + else { + this.Adapter.UpdateCommand.Parameters[5].Value = ((string)(IdxMacchina)); + } + this.Adapter.UpdateCommand.Parameters[6].Value = ((int)(NumPezzi)); + this.Adapter.UpdateCommand.Parameters[7].Value = ((decimal)(TCAssegnato)); + this.Adapter.UpdateCommand.Parameters[8].Value = ((System.DateTime)(DueDate)); + this.Adapter.UpdateCommand.Parameters[9].Value = ((int)(Priorita)); + this.Adapter.UpdateCommand.Parameters[10].Value = ((int)(Original_idxPromessa)); + if ((Original_KeyRichiesta == null)) { + throw new global::System.ArgumentNullException("Original_KeyRichiesta"); + } + else { + this.Adapter.UpdateCommand.Parameters[11].Value = ((string)(Original_KeyRichiesta)); + } + this.Adapter.UpdateCommand.Parameters[12].Value = ((bool)(Original_Attivabile)); + this.Adapter.UpdateCommand.Parameters[13].Value = ((int)(Original_IdxODL)); + if ((Original_CodArticolo == null)) { + throw new global::System.ArgumentNullException("Original_CodArticolo"); + } + else { + this.Adapter.UpdateCommand.Parameters[14].Value = ((string)(Original_CodArticolo)); + } + if ((Original_CodGruppo == null)) { + throw new global::System.ArgumentNullException("Original_CodGruppo"); + } + else { + this.Adapter.UpdateCommand.Parameters[15].Value = ((string)(Original_CodGruppo)); + } + if ((Original_IdxMacchina == null)) { + throw new global::System.ArgumentNullException("Original_IdxMacchina"); + } + else { + this.Adapter.UpdateCommand.Parameters[16].Value = ((string)(Original_IdxMacchina)); + } + this.Adapter.UpdateCommand.Parameters[17].Value = ((int)(Original_NumPezzi)); + this.Adapter.UpdateCommand.Parameters[18].Value = ((decimal)(Original_TCAssegnato)); + this.Adapter.UpdateCommand.Parameters[19].Value = ((System.DateTime)(Original_DueDate)); + this.Adapter.UpdateCommand.Parameters[20].Value = ((int)(Original_Priorita)); + this.Adapter.UpdateCommand.Parameters[21].Value = ((int)(idxPromessa)); + 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", "15.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 KeyRichiesta, + bool Attivabile, + int IdxODL, + string CodArticolo, + string CodGruppo, + string IdxMacchina, + int NumPezzi, + decimal TCAssegnato, + System.DateTime DueDate, + int Priorita, + int Original_idxPromessa, + string Original_KeyRichiesta, + bool Original_Attivabile, + int Original_IdxODL, + string Original_CodArticolo, + string Original_CodGruppo, + string Original_IdxMacchina, + int Original_NumPezzi, + decimal Original_TCAssegnato, + System.DateTime Original_DueDate, + int Original_Priorita) { + return this.Update(KeyRichiesta, Attivabile, IdxODL, CodArticolo, CodGruppo, IdxMacchina, NumPezzi, TCAssegnato, DueDate, Priorita, Original_idxPromessa, Original_KeyRichiesta, Original_Attivabile, Original_IdxODL, Original_CodArticolo, Original_CodGruppo, Original_IdxMacchina, Original_NumPezzi, Original_TCAssegnato, Original_DueDate, Original_Priorita, Original_idxPromessa); + } + } + /// ///TableAdapterManager is used to coordinate TableAdapters in the dataset to enable Hierarchical Update scenarios /// @@ -25762,6 +26907,8 @@ FROM MappaStatoExpl"; private MappaStatoExplTableAdapter _mappaStatoExplTableAdapter; + private PromesseODLTableAdapter _promesseODLTableAdapter; + private bool _backupDataSetBeforeUpdate; private global::System.Data.IDbConnection _connection; @@ -25889,6 +27036,20 @@ FROM MappaStatoExpl"; } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.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 PromesseODLTableAdapter PromesseODLTableAdapter { + get { + return this._promesseODLTableAdapter; + } + set { + this._promesseODLTableAdapter = value; + } + } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")] public bool BackupDataSetBeforeUpdate { @@ -25940,6 +27101,10 @@ FROM MappaStatoExpl"; && (this._mappaStatoExplTableAdapter.Connection != null))) { return this._mappaStatoExplTableAdapter.Connection; } + if (((this._promesseODLTableAdapter != null) + && (this._promesseODLTableAdapter.Connection != null))) { + return this._promesseODLTableAdapter.Connection; + } return null; } set { @@ -25977,6 +27142,9 @@ FROM MappaStatoExpl"; if ((this._mappaStatoExplTableAdapter != null)) { count = (count + 1); } + if ((this._promesseODLTableAdapter != null)) { + count = (count + 1); + } return count; } } @@ -26060,6 +27228,15 @@ FROM MappaStatoExpl"; allChangedRows.AddRange(updatedRows); } } + if ((this._promesseODLTableAdapter != null)) { + global::System.Data.DataRow[] updatedRows = dataSet.PromesseODL.Select(null, null, global::System.Data.DataViewRowState.ModifiedCurrent); + updatedRows = this.GetRealUpdatedRows(updatedRows, allAddedRows); + if (((updatedRows != null) + && (0 < updatedRows.Length))) { + result = (result + this._promesseODLTableAdapter.Update(updatedRows)); + allChangedRows.AddRange(updatedRows); + } + } return result; } @@ -26134,6 +27311,14 @@ FROM MappaStatoExpl"; allAddedRows.AddRange(addedRows); } } + if ((this._promesseODLTableAdapter != null)) { + global::System.Data.DataRow[] addedRows = dataSet.PromesseODL.Select(null, null, global::System.Data.DataViewRowState.Added); + if (((addedRows != null) + && (0 < addedRows.Length))) { + result = (result + this._promesseODLTableAdapter.Update(addedRows)); + allAddedRows.AddRange(addedRows); + } + } return result; } @@ -26144,6 +27329,14 @@ FROM MappaStatoExpl"; [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")] private int UpdateDeletedRows(DS_ProdTempi dataSet, global::System.Collections.Generic.List allChangedRows) { int result = 0; + if ((this._promesseODLTableAdapter != null)) { + global::System.Data.DataRow[] deletedRows = dataSet.PromesseODL.Select(null, null, global::System.Data.DataViewRowState.Deleted); + if (((deletedRows != null) + && (0 < deletedRows.Length))) { + result = (result + this._promesseODLTableAdapter.Update(deletedRows)); + 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) @@ -26287,6 +27480,11 @@ FROM MappaStatoExpl"; throw new global::System.ArgumentException("Tutti gli oggetti TableAdapter gestiti da TableAdapterManager devono utilizzare l" + "a stessa stringa di connessione."); } + if (((this._promesseODLTableAdapter != null) + && (this.MatchTableAdapterConnection(this._promesseODLTableAdapter.Connection) == false))) { + throw new global::System.ArgumentException("Tutti gli oggetti TableAdapter gestiti da TableAdapterManager devono utilizzare l" + + "a stessa stringa di connessione."); + } global::System.Data.IDbConnection workConnection = this.Connection; if ((workConnection == null)) { throw new global::System.ApplicationException("TableAdapterManager non contiene informazioni di connessione. Impostare la propri" + @@ -26392,6 +27590,15 @@ FROM MappaStatoExpl"; adaptersWithAcceptChangesDuringUpdate.Add(this._mappaStatoExplTableAdapter.Adapter); } } + if ((this._promesseODLTableAdapter != null)) { + revertConnections.Add(this._promesseODLTableAdapter, this._promesseODLTableAdapter.Connection); + this._promesseODLTableAdapter.Connection = ((global::System.Data.SqlClient.SqlConnection)(workConnection)); + this._promesseODLTableAdapter.Transaction = ((global::System.Data.SqlClient.SqlTransaction)(workTransaction)); + if (this._promesseODLTableAdapter.Adapter.AcceptChangesDuringUpdate) { + this._promesseODLTableAdapter.Adapter.AcceptChangesDuringUpdate = false; + adaptersWithAcceptChangesDuringUpdate.Add(this._promesseODLTableAdapter.Adapter); + } + } // //---- Perform updates ----------- // @@ -26482,6 +27689,10 @@ FROM MappaStatoExpl"; this._mappaStatoExplTableAdapter.Connection = ((global::System.Data.SqlClient.SqlConnection)(revertConnections[this._mappaStatoExplTableAdapter])); this._mappaStatoExplTableAdapter.Transaction = null; } + if ((this._promesseODLTableAdapter != null)) { + this._promesseODLTableAdapter.Connection = ((global::System.Data.SqlClient.SqlConnection)(revertConnections[this._promesseODLTableAdapter])); + this._promesseODLTableAdapter.Transaction = null; + } if ((0 < adaptersWithAcceptChangesDuringUpdate.Count)) { global::System.Data.Common.DataAdapter[] adapters = new System.Data.Common.DataAdapter[adaptersWithAcceptChangesDuringUpdate.Count]; adaptersWithAcceptChangesDuringUpdate.CopyTo(adapters); diff --git a/MapoDb/DS_ProdTempi.xsd b/MapoDb/DS_ProdTempi.xsd index 58f12241..d1a1f0d6 100644 --- a/MapoDb/DS_ProdTempi.xsd +++ b/MapoDb/DS_ProdTempi.xsd @@ -2044,6 +2044,110 @@ FROM dbo.v_RegistroScarti + + + + + + DELETE FROM [dbo].[PromesseODL] WHERE (([idxPromessa] = @Original_idxPromessa) AND ([KeyRichiesta] = @Original_KeyRichiesta) AND ([Attivabile] = @Original_Attivabile) AND ([IdxODL] = @Original_IdxODL) AND ([CodArticolo] = @Original_CodArticolo) AND ([CodGruppo] = @Original_CodGruppo) AND ([IdxMacchina] = @Original_IdxMacchina) AND ([NumPezzi] = @Original_NumPezzi) AND ([TCAssegnato] = @Original_TCAssegnato) AND ([DueDate] = @Original_DueDate) AND ([Priorita] = @Original_Priorita)) + + + + + + + + + + + + + + + + + + INSERT INTO [dbo].[PromesseODL] ([KeyRichiesta], [Attivabile], [IdxODL], [CodArticolo], [CodGruppo], [IdxMacchina], [NumPezzi], [TCAssegnato], [DueDate], [Priorita]) VALUES (@KeyRichiesta, @Attivabile, @IdxODL, @CodArticolo, @CodGruppo, @IdxMacchina, @NumPezzi, @TCAssegnato, @DueDate, @Priorita); +SELECT idxPromessa, KeyRichiesta, Attivabile, IdxODL, CodArticolo, CodGruppo, IdxMacchina, NumPezzi, TCAssegnato, DueDate, Priorita FROM PromesseODL WHERE (idxPromessa = SCOPE_IDENTITY()) + + + + + + + + + + + + + + + + + SELECT idxPromessa, KeyRichiesta, Attivabile, IdxODL, CodArticolo, CodGruppo, IdxMacchina, NumPezzi, TCAssegnato, DueDate, Priorita FROM dbo.PromesseODL + + + + + + UPDATE [dbo].[PromesseODL] SET [KeyRichiesta] = @KeyRichiesta, [Attivabile] = @Attivabile, [IdxODL] = @IdxODL, [CodArticolo] = @CodArticolo, [CodGruppo] = @CodGruppo, [IdxMacchina] = @IdxMacchina, [NumPezzi] = @NumPezzi, [TCAssegnato] = @TCAssegnato, [DueDate] = @DueDate, [Priorita] = @Priorita WHERE (([idxPromessa] = @Original_idxPromessa) AND ([KeyRichiesta] = @Original_KeyRichiesta) AND ([Attivabile] = @Original_Attivabile) AND ([IdxODL] = @Original_IdxODL) AND ([CodArticolo] = @Original_CodArticolo) AND ([CodGruppo] = @Original_CodGruppo) AND ([IdxMacchina] = @Original_IdxMacchina) AND ([NumPezzi] = @Original_NumPezzi) AND ([TCAssegnato] = @Original_TCAssegnato) AND ([DueDate] = @Original_DueDate) AND ([Priorita] = @Original_Priorita)); +SELECT idxPromessa, KeyRichiesta, Attivabile, IdxODL, CodArticolo, CodGruppo, IdxMacchina, NumPezzi, TCAssegnato, DueDate, Priorita FROM PromesseODL WHERE (idxPromessa = @idxPromessa) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + dbo.stp_PODL_getByIdx + + + + + + + + + @@ -2760,6 +2864,47 @@ FROM dbo.v_RegistroScarti + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -2836,5 +2981,9 @@ FROM dbo.v_RegistroScarti + + + + \ No newline at end of file diff --git a/MapoDb/DS_ProdTempi.xss b/MapoDb/DS_ProdTempi.xss index fcdab61a..21a3cc02 100644 --- a/MapoDb/DS_ProdTempi.xss +++ b/MapoDb/DS_ProdTempi.xss @@ -4,30 +4,31 @@ Changes to this file may cause incorrect behavior and will be lost if the code is regenerated. --> - + - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/MapoDb/DataLayer.cs b/MapoDb/DataLayer.cs index a167ac3a..a7fb5a52 100644 --- a/MapoDb/DataLayer.cs +++ b/MapoDb/DataLayer.cs @@ -46,6 +46,7 @@ namespace MapoDb public DS_ProdTempiTableAdapters.CalendFesteFerieTableAdapter taCalFF; public DS_ProdTempiTableAdapters.MappaStatoExplTableAdapter taMSE; public DS_ProdTempiTableAdapters.ProduzioneAs400TableAdapter taAs400; + public DS_ProdTempiTableAdapters.PromesseODLTableAdapter taPODL; public DS_ProdTempiTableAdapters.RegistroControlliTableAdapter taRC; public DS_ProdTempiTableAdapters.RegistroScartiTableAdapter taRS; public DS_ProdTempiTableAdapters.StatoProdTableAdapter taStatoProd; @@ -91,6 +92,7 @@ namespace MapoDb taCalFF = new DS_ProdTempiTableAdapters.CalendFesteFerieTableAdapter(); taMSE = new DS_ProdTempiTableAdapters.MappaStatoExplTableAdapter(); taAs400 = new DS_ProdTempiTableAdapters.ProduzioneAs400TableAdapter(); + taPODL = new DS_ProdTempiTableAdapters.PromesseODLTableAdapter(); taRC = new DS_ProdTempiTableAdapters.RegistroControlliTableAdapter(); taRS = new DS_ProdTempiTableAdapters.RegistroScartiTableAdapter(); taStatoProd = new DS_ProdTempiTableAdapters.StatoProdTableAdapter(); @@ -134,6 +136,7 @@ namespace MapoDb taTempoByClass.Connection.ConnectionString = connectionString; taCalFF.Connection.ConnectionString = connectionString; taMSE.Connection.ConnectionString = connectionString; + taPODL.Connection.ConnectionString = connectionString; taAs400.Connection.ConnectionString = connectionString; taRC.Connection.ConnectionString = connectionString; taRS.Connection.ConnectionString = connectionString;