diff --git a/MP-IO/Controllers/IOBController.cs b/MP-IO/Controllers/IOBController.cs index c969c703..5d044f4b 100644 --- a/MP-IO/Controllers/IOBController.cs +++ b/MP-IO/Controllers/IOBController.cs @@ -96,5 +96,29 @@ namespace MP_IO.Controllers } return answ; } + // GET: IOB/flog/5?flux=PROG&valore=P0001&dtEve=20161223180600000&dtCurr=20161223180600000&cnt=999 + public string flog(string id, string flux, string valore, string dtEve, string dtCurr, string cnt) + { + string answ = ""; + // formato yyyymmddHHMMSSnnn ovvero da anno a millisecondi + if (cnt == null) cnt = "0"; + DateTime dataOraEvento = DateTime.Now; + if (memLayer.ML.CRI("_logLevel") > 6) + { + logger.lg.scriviLog(string.Format("Valori letti:{0}idxMacchina: {1}{0}flux: {6}{0}valore: {2}{0}dtEve: {3}{0}dtCurr: {4}{0}cnt: {5}", Environment.NewLine, id, valore, dtEve, dtCurr, cnt, flux), tipoLog.INFO); + } + try + { + int count = 0; + Int32.TryParse(cnt, out count); + answ = DataLayer.processFluxLog(id, flux, valore, dtEve, dtCurr, count); + } + catch (Exception exc) + { + logger.lg.scriviLog(string.Format("Errore in flog{0}{1}", Environment.NewLine, exc)); + answ = "NO"; + } + return answ; + } } } \ No newline at end of file diff --git a/MapoDb/DS_applicazione.Designer.cs b/MapoDb/DS_applicazione.Designer.cs index 84e1ee28..d0003c05 100644 --- a/MapoDb/DS_applicazione.Designer.cs +++ b/MapoDb/DS_applicazione.Designer.cs @@ -72,6 +72,8 @@ namespace MapoDb { private MSFDDataTable tableMSFD; + private FluxLogDataTable tableFluxLog; + private global::System.Data.DataRelation relationFK_Macchine2FamiglieMacchine_FamiglieMacchine; private global::System.Data.DataRelation relationFK_Macchine2FamiglieMacchine_Macchine; @@ -212,6 +214,9 @@ namespace MapoDb { if ((ds.Tables["MSFD"] != null)) { base.Tables.Add(new MSFDDataTable(ds.Tables["MSFD"])); } + if ((ds.Tables["FluxLog"] != null)) { + base.Tables.Add(new FluxLogDataTable(ds.Tables["FluxLog"])); + } this.DataSetName = ds.DataSetName; this.Prefix = ds.Prefix; this.Namespace = ds.Namespace; @@ -470,6 +475,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 FluxLogDataTable FluxLog { + get { + return this.tableFluxLog; + } + } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")] [global::System.ComponentModel.BrowsableAttribute(true)] @@ -609,6 +624,9 @@ namespace MapoDb { if ((ds.Tables["MSFD"] != null)) { base.Tables.Add(new MSFDDataTable(ds.Tables["MSFD"])); } + if ((ds.Tables["FluxLog"] != null)) { + base.Tables.Add(new FluxLogDataTable(ds.Tables["FluxLog"])); + } this.DataSetName = ds.DataSetName; this.Prefix = ds.Prefix; this.Namespace = ds.Namespace; @@ -786,6 +804,12 @@ namespace MapoDb { this.tableMSFD.InitVars(); } } + this.tableFluxLog = ((FluxLogDataTable)(base.Tables["FluxLog"])); + if ((initTable == true)) { + if ((this.tableFluxLog != null)) { + this.tableFluxLog.InitVars(); + } + } this.relationFK_Macchine2FamiglieMacchine_FamiglieMacchine = this.Relations["FK_Macchine2FamiglieMacchine_FamiglieMacchine"]; this.relationFK_Macchine2FamiglieMacchine_Macchine = this.Relations["FK_Macchine2FamiglieMacchine_Macchine"]; this.relationFK_TransizioneStati_FamiglieMacchine = this.Relations["FK_TransizioneStati_FamiglieMacchine"]; @@ -864,6 +888,8 @@ namespace MapoDb { base.Tables.Add(this.tableAnagArticoli); this.tableMSFD = new MSFDDataTable(); base.Tables.Add(this.tableMSFD); + this.tableFluxLog = new FluxLogDataTable(); + base.Tables.Add(this.tableFluxLog); this.relationFK_Macchine2FamiglieMacchine_FamiglieMacchine = new global::System.Data.DataRelation("FK_Macchine2FamiglieMacchine_FamiglieMacchine", new global::System.Data.DataColumn[] { this.tableFamiglieMacchine.IdxFamigliaColumn}, new global::System.Data.DataColumn[] { this.tableMacchine2FamiglieMacchine.IdxFamigliaColumn}, false); @@ -1090,6 +1116,12 @@ namespace MapoDb { return false; } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")] + private bool ShouldSerializeFluxLog() { + 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) { @@ -1217,6 +1249,9 @@ namespace MapoDb { [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")] public delegate void MSFDRowChangeEventHandler(object sender, MSFDRowChangeEvent e); + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")] + public delegate void FluxLogRowChangeEventHandler(object sender, FluxLogRowChangeEvent e); + /// ///Represents the strongly named DataTable class. /// @@ -9259,6 +9294,330 @@ namespace MapoDb { } } + /// + ///Represents the strongly named DataTable class. + /// + [global::System.Serializable()] + [global::System.Xml.Serialization.XmlSchemaProviderAttribute("GetTypedTableSchema")] + public partial class FluxLogDataTable : global::System.Data.TypedTableBase { + + private global::System.Data.DataColumn columnIdxMacchina; + + private global::System.Data.DataColumn columndtEvento; + + private global::System.Data.DataColumn columnCodFlux; + + private global::System.Data.DataColumn columnValore; + + private global::System.Data.DataColumn columnCnt; + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")] + public FluxLogDataTable() { + this.TableName = "FluxLog"; + this.BeginInit(); + this.InitClass(); + this.EndInit(); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")] + internal FluxLogDataTable(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 FluxLogDataTable(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 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 dtEventoColumn { + get { + return this.columndtEvento; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")] + public global::System.Data.DataColumn CodFluxColumn { + get { + return this.columnCodFlux; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.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", "15.0.0.0")] + public global::System.Data.DataColumn CntColumn { + get { + return this.columnCnt; + } + } + + [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 FluxLogRow this[int index] { + get { + return ((FluxLogRow)(this.Rows[index])); + } + } + + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")] + public event FluxLogRowChangeEventHandler FluxLogRowChanging; + + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")] + public event FluxLogRowChangeEventHandler FluxLogRowChanged; + + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")] + public event FluxLogRowChangeEventHandler FluxLogRowDeleting; + + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")] + public event FluxLogRowChangeEventHandler FluxLogRowDeleted; + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")] + public void AddFluxLogRow(FluxLogRow row) { + this.Rows.Add(row); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")] + public FluxLogRow AddFluxLogRow(string IdxMacchina, System.DateTime dtEvento, string CodFlux, string Valore, int Cnt) { + FluxLogRow rowFluxLogRow = ((FluxLogRow)(this.NewRow())); + object[] columnValuesArray = new object[] { + IdxMacchina, + dtEvento, + CodFlux, + Valore, + Cnt}; + rowFluxLogRow.ItemArray = columnValuesArray; + this.Rows.Add(rowFluxLogRow); + return rowFluxLogRow; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")] + public FluxLogRow FindByIdxMacchinadtEventoCodFlux(string IdxMacchina, System.DateTime dtEvento, string CodFlux) { + return ((FluxLogRow)(this.Rows.Find(new object[] { + IdxMacchina, + dtEvento, + CodFlux}))); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")] + public override global::System.Data.DataTable Clone() { + FluxLogDataTable cln = ((FluxLogDataTable)(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 FluxLogDataTable(); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")] + internal void InitVars() { + this.columnIdxMacchina = base.Columns["IdxMacchina"]; + this.columndtEvento = base.Columns["dtEvento"]; + this.columnCodFlux = base.Columns["CodFlux"]; + this.columnValore = base.Columns["Valore"]; + this.columnCnt = base.Columns["Cnt"]; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")] + private void InitClass() { + this.columnIdxMacchina = new global::System.Data.DataColumn("IdxMacchina", typeof(string), null, global::System.Data.MappingType.Element); + base.Columns.Add(this.columnIdxMacchina); + this.columndtEvento = new global::System.Data.DataColumn("dtEvento", typeof(global::System.DateTime), null, global::System.Data.MappingType.Element); + base.Columns.Add(this.columndtEvento); + this.columnCodFlux = new global::System.Data.DataColumn("CodFlux", typeof(string), null, global::System.Data.MappingType.Element); + base.Columns.Add(this.columnCodFlux); + this.columnValore = new global::System.Data.DataColumn("Valore", typeof(string), null, global::System.Data.MappingType.Element); + base.Columns.Add(this.columnValore); + this.columnCnt = new global::System.Data.DataColumn("Cnt", typeof(int), null, global::System.Data.MappingType.Element); + base.Columns.Add(this.columnCnt); + this.Constraints.Add(new global::System.Data.UniqueConstraint("Constraint1", new global::System.Data.DataColumn[] { + this.columnIdxMacchina, + this.columndtEvento, + this.columnCodFlux}, true)); + this.columnIdxMacchina.AllowDBNull = false; + this.columnIdxMacchina.MaxLength = 50; + this.columndtEvento.AllowDBNull = false; + this.columnCodFlux.AllowDBNull = false; + this.columnCodFlux.MaxLength = 50; + this.columnValore.AllowDBNull = false; + this.columnValore.MaxLength = 250; + this.columnCnt.AllowDBNull = false; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")] + public FluxLogRow NewFluxLogRow() { + return ((FluxLogRow)(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 FluxLogRow(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(FluxLogRow); + } + + [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.FluxLogRowChanged != null)) { + this.FluxLogRowChanged(this, new FluxLogRowChangeEvent(((FluxLogRow)(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.FluxLogRowChanging != null)) { + this.FluxLogRowChanging(this, new FluxLogRowChangeEvent(((FluxLogRow)(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.FluxLogRowDeleted != null)) { + this.FluxLogRowDeleted(this, new FluxLogRowChangeEvent(((FluxLogRow)(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.FluxLogRowDeleting != null)) { + this.FluxLogRowDeleting(this, new FluxLogRowChangeEvent(((FluxLogRow)(e.Row)), e.Action)); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")] + public void RemoveFluxLogRow(FluxLogRow 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_applicazione ds = new DS_applicazione(); + 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 = "FluxLogDataTable"; + 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. /// @@ -13135,6 +13494,76 @@ namespace MapoDb { } } + /// + ///Represents strongly named DataRow class. + /// + public partial class FluxLogRow : global::System.Data.DataRow { + + private FluxLogDataTable tableFluxLog; + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")] + internal FluxLogRow(global::System.Data.DataRowBuilder rb) : + base(rb) { + this.tableFluxLog = ((FluxLogDataTable)(this.Table)); + } + + [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.tableFluxLog.IdxMacchinaColumn])); + } + set { + this[this.tableFluxLog.IdxMacchinaColumn] = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")] + public System.DateTime dtEvento { + get { + return ((global::System.DateTime)(this[this.tableFluxLog.dtEventoColumn])); + } + set { + this[this.tableFluxLog.dtEventoColumn] = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")] + public string CodFlux { + get { + return ((string)(this[this.tableFluxLog.CodFluxColumn])); + } + set { + this[this.tableFluxLog.CodFluxColumn] = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")] + public string Valore { + get { + return ((string)(this[this.tableFluxLog.ValoreColumn])); + } + set { + this[this.tableFluxLog.ValoreColumn] = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")] + public int Cnt { + get { + return ((int)(this[this.tableFluxLog.CntColumn])); + } + set { + this[this.tableFluxLog.CntColumn] = value; + } + } + } + /// ///Row event argument class /// @@ -13950,6 +14379,40 @@ namespace MapoDb { } } } + + /// + ///Row event argument class + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")] + public class FluxLogRowChangeEvent : global::System.EventArgs { + + private FluxLogRow 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 FluxLogRowChangeEvent(FluxLogRow 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 FluxLogRow 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_applicazioneTableAdapters { @@ -25062,6 +25525,427 @@ SELECT CodArticolo, DescArticolo, CurrRev, ProdRev, FlagIsNew FROM AnagArticoli return dataTable; } } + + /// + ///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 FluxLogTableAdapter : global::System.ComponentModel.Component { + + private global::System.Data.SqlClient.SqlDataAdapter _adapter; + + private global::System.Data.SqlClient.SqlConnection _connection; + + 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 FluxLogTableAdapter() { + this.ClearBeforeFill = true; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")] + private 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")] + 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 = "FluxLog"; + tableMapping.ColumnMappings.Add("IdxMacchina", "IdxMacchina"); + tableMapping.ColumnMappings.Add("dtEvento", "dtEvento"); + tableMapping.ColumnMappings.Add("CodFlux", "CodFlux"); + tableMapping.ColumnMappings.Add("Valore", "Valore"); + tableMapping.ColumnMappings.Add("Cnt", "Cnt"); + 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].[FluxLog] WHERE (([IdxMacchina] = @Original_IdxMacchina) AND ([" + + "dtEvento] = @Original_dtEvento) AND ([CodFlux] = @Original_CodFlux) AND ([Valore" + + "] = @Original_Valore) AND ([Cnt] = @Original_Cnt))"; + this._adapter.DeleteCommand.CommandType = global::System.Data.CommandType.Text; + 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_dtEvento", global::System.Data.SqlDbType.DateTime, 0, global::System.Data.ParameterDirection.Input, 0, 0, "dtEvento", global::System.Data.DataRowVersion.Original, false, null, "", "", "")); + this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_CodFlux", global::System.Data.SqlDbType.NVarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "CodFlux", global::System.Data.DataRowVersion.Original, false, null, "", "", "")); + this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_Valore", global::System.Data.SqlDbType.NVarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "Valore", global::System.Data.DataRowVersion.Original, false, null, "", "", "")); + this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_Cnt", global::System.Data.SqlDbType.Int, 0, global::System.Data.ParameterDirection.Input, 0, 0, "Cnt", 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].[FluxLog] ([IdxMacchina], [dtEvento], [CodFlux], [Valore], [Cnt]) VALUES (@IdxMacchina, @dtEvento, @CodFlux, @Valore, @Cnt); +SELECT IdxMacchina, dtEvento, CodFlux, Valore, Cnt FROM FluxLog WHERE (CodFlux = @CodFlux) AND (IdxMacchina = @IdxMacchina) AND (dtEvento = @dtEvento)"; + this._adapter.InsertCommand.CommandType = global::System.Data.CommandType.Text; + 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("@dtEvento", global::System.Data.SqlDbType.DateTime, 0, global::System.Data.ParameterDirection.Input, 0, 0, "dtEvento", global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + this._adapter.InsertCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@CodFlux", global::System.Data.SqlDbType.NVarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "CodFlux", global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + this._adapter.InsertCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Valore", global::System.Data.SqlDbType.NVarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "Valore", global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + this._adapter.InsertCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Cnt", global::System.Data.SqlDbType.Int, 0, global::System.Data.ParameterDirection.Input, 0, 0, "Cnt", 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].[FluxLog] SET [IdxMacchina] = @IdxMacchina, [dtEvento] = @dtEvento, [CodFlux] = @CodFlux, [Valore] = @Valore, [Cnt] = @Cnt WHERE (([IdxMacchina] = @Original_IdxMacchina) AND ([dtEvento] = @Original_dtEvento) AND ([CodFlux] = @Original_CodFlux) AND ([Valore] = @Original_Valore) AND ([Cnt] = @Original_Cnt)); +SELECT IdxMacchina, dtEvento, CodFlux, Valore, Cnt FROM FluxLog WHERE (CodFlux = @CodFlux) AND (IdxMacchina = @IdxMacchina) AND (dtEvento = @dtEvento)"; + this._adapter.UpdateCommand.CommandType = global::System.Data.CommandType.Text; + 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("@dtEvento", global::System.Data.SqlDbType.DateTime, 0, global::System.Data.ParameterDirection.Input, 0, 0, "dtEvento", global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@CodFlux", global::System.Data.SqlDbType.NVarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "CodFlux", global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Valore", global::System.Data.SqlDbType.NVarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "Valore", global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Cnt", global::System.Data.SqlDbType.Int, 0, global::System.Data.ParameterDirection.Input, 0, 0, "Cnt", global::System.Data.DataRowVersion.Current, 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_dtEvento", global::System.Data.SqlDbType.DateTime, 0, global::System.Data.ParameterDirection.Input, 0, 0, "dtEvento", global::System.Data.DataRowVersion.Original, false, null, "", "", "")); + this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_CodFlux", global::System.Data.SqlDbType.NVarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "CodFlux", global::System.Data.DataRowVersion.Original, false, null, "", "", "")); + this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_Valore", global::System.Data.SqlDbType.NVarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "Valore", global::System.Data.DataRowVersion.Original, false, null, "", "", "")); + this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_Cnt", global::System.Data.SqlDbType.Int, 0, global::System.Data.ParameterDirection.Input, 0, 0, "Cnt", global::System.Data.DataRowVersion.Original, 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 * FROM dbo.FluxLog"; + 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_FL_InsNew"; + this._commandCollection[1].CommandType = global::System.Data.CommandType.StoredProcedure; + this._commandCollection[1].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@RETURN_VALUE", global::System.Data.SqlDbType.Int, 4, global::System.Data.ParameterDirection.ReturnValue, 10, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + this._commandCollection[1].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@IdxMacchina", global::System.Data.SqlDbType.NVarChar, 50, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + this._commandCollection[1].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@dtEvento", global::System.Data.SqlDbType.DateTime, 8, global::System.Data.ParameterDirection.Input, 23, 3, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + this._commandCollection[1].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@CodFlux", 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("@Count", 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_applicazione.FluxLogDataTable 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_applicazione.FluxLogDataTable GetData() { + this.Adapter.SelectCommand = this.CommandCollection[0]; + DS_applicazione.FluxLogDataTable dataTable = new DS_applicazione.FluxLogDataTable(); + 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_applicazione.FluxLogDataTable 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_applicazione dataSet) { + return this.Adapter.Update(dataSet, "FluxLog"); + } + + [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(string Original_IdxMacchina, System.DateTime Original_dtEvento, string Original_CodFlux, string Original_Valore, int Original_Cnt) { + if ((Original_IdxMacchina == null)) { + throw new global::System.ArgumentNullException("Original_IdxMacchina"); + } + else { + this.Adapter.DeleteCommand.Parameters[0].Value = ((string)(Original_IdxMacchina)); + } + this.Adapter.DeleteCommand.Parameters[1].Value = ((System.DateTime)(Original_dtEvento)); + if ((Original_CodFlux == null)) { + throw new global::System.ArgumentNullException("Original_CodFlux"); + } + else { + this.Adapter.DeleteCommand.Parameters[2].Value = ((string)(Original_CodFlux)); + } + if ((Original_Valore == null)) { + throw new global::System.ArgumentNullException("Original_Valore"); + } + else { + this.Adapter.DeleteCommand.Parameters[3].Value = ((string)(Original_Valore)); + } + this.Adapter.DeleteCommand.Parameters[4].Value = ((int)(Original_Cnt)); + 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 IdxMacchina, System.DateTime dtEvento, string CodFlux, string Valore, int Cnt) { + if ((IdxMacchina == null)) { + throw new global::System.ArgumentNullException("IdxMacchina"); + } + else { + this.Adapter.InsertCommand.Parameters[0].Value = ((string)(IdxMacchina)); + } + this.Adapter.InsertCommand.Parameters[1].Value = ((System.DateTime)(dtEvento)); + if ((CodFlux == null)) { + throw new global::System.ArgumentNullException("CodFlux"); + } + else { + this.Adapter.InsertCommand.Parameters[2].Value = ((string)(CodFlux)); + } + if ((Valore == null)) { + throw new global::System.ArgumentNullException("Valore"); + } + else { + this.Adapter.InsertCommand.Parameters[3].Value = ((string)(Valore)); + } + this.Adapter.InsertCommand.Parameters[4].Value = ((int)(Cnt)); + 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 IdxMacchina, System.DateTime dtEvento, string CodFlux, string Valore, int Cnt, string Original_IdxMacchina, System.DateTime Original_dtEvento, string Original_CodFlux, string Original_Valore, int Original_Cnt) { + if ((IdxMacchina == null)) { + throw new global::System.ArgumentNullException("IdxMacchina"); + } + else { + this.Adapter.UpdateCommand.Parameters[0].Value = ((string)(IdxMacchina)); + } + this.Adapter.UpdateCommand.Parameters[1].Value = ((System.DateTime)(dtEvento)); + if ((CodFlux == null)) { + throw new global::System.ArgumentNullException("CodFlux"); + } + else { + this.Adapter.UpdateCommand.Parameters[2].Value = ((string)(CodFlux)); + } + if ((Valore == null)) { + throw new global::System.ArgumentNullException("Valore"); + } + else { + this.Adapter.UpdateCommand.Parameters[3].Value = ((string)(Valore)); + } + this.Adapter.UpdateCommand.Parameters[4].Value = ((int)(Cnt)); + if ((Original_IdxMacchina == null)) { + throw new global::System.ArgumentNullException("Original_IdxMacchina"); + } + else { + this.Adapter.UpdateCommand.Parameters[5].Value = ((string)(Original_IdxMacchina)); + } + this.Adapter.UpdateCommand.Parameters[6].Value = ((System.DateTime)(Original_dtEvento)); + if ((Original_CodFlux == null)) { + throw new global::System.ArgumentNullException("Original_CodFlux"); + } + else { + this.Adapter.UpdateCommand.Parameters[7].Value = ((string)(Original_CodFlux)); + } + if ((Original_Valore == null)) { + throw new global::System.ArgumentNullException("Original_Valore"); + } + else { + this.Adapter.UpdateCommand.Parameters[8].Value = ((string)(Original_Valore)); + } + this.Adapter.UpdateCommand.Parameters[9].Value = ((int)(Original_Cnt)); + 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 Valore, int Cnt, string Original_IdxMacchina, System.DateTime Original_dtEvento, string Original_CodFlux, string Original_Valore, int Original_Cnt) { + return this.Update(Original_IdxMacchina, Original_dtEvento, Original_CodFlux, Valore, Cnt, Original_IdxMacchina, Original_dtEvento, Original_CodFlux, Original_Valore, Original_Cnt); + } + + [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 InsNew(string IdxMacchina, global::System.Nullable dtEvento, string CodFlux, string Valore, global::System.Nullable Count) { + global::System.Data.SqlClient.SqlCommand command = this.CommandCollection[1]; + if ((IdxMacchina == null)) { + command.Parameters[1].Value = global::System.DBNull.Value; + } + else { + command.Parameters[1].Value = ((string)(IdxMacchina)); + } + if ((dtEvento.HasValue == true)) { + command.Parameters[2].Value = ((System.DateTime)(dtEvento.Value)); + } + else { + command.Parameters[2].Value = global::System.DBNull.Value; + } + if ((CodFlux == null)) { + command.Parameters[3].Value = global::System.DBNull.Value; + } + else { + command.Parameters[3].Value = ((string)(CodFlux)); + } + if ((Valore == null)) { + command.Parameters[4].Value = global::System.DBNull.Value; + } + else { + command.Parameters[4].Value = ((string)(Valore)); + } + if ((Count.HasValue == true)) { + command.Parameters[5].Value = ((int)(Count.Value)); + } + else { + command.Parameters[5].Value = global::System.DBNull.Value; + } + global::System.Data.ConnectionState previousConnectionState = command.Connection.State; + if (((command.Connection.State & global::System.Data.ConnectionState.Open) + != global::System.Data.ConnectionState.Open)) { + command.Connection.Open(); + } + int returnValue; + try { + returnValue = command.ExecuteNonQuery(); + } + finally { + if ((previousConnectionState == global::System.Data.ConnectionState.Closed)) { + command.Connection.Close(); + } + } + return returnValue; + } + } } #pragma warning restore 1591 \ No newline at end of file diff --git a/MapoDb/DS_applicazione.xsd b/MapoDb/DS_applicazione.xsd index 59f5bf4a..fe9936e0 100644 --- a/MapoDb/DS_applicazione.xsd +++ b/MapoDb/DS_applicazione.xsd @@ -2399,6 +2399,85 @@ SELECT CodArticolo, DescArticolo, CurrRev, ProdRev, FlagIsNew FROM AnagArticoli + + + + + + DELETE FROM [dbo].[FluxLog] WHERE (([IdxMacchina] = @Original_IdxMacchina) AND ([dtEvento] = @Original_dtEvento) AND ([CodFlux] = @Original_CodFlux) AND ([Valore] = @Original_Valore) AND ([Cnt] = @Original_Cnt)) + + + + + + + + + + + + INSERT INTO [dbo].[FluxLog] ([IdxMacchina], [dtEvento], [CodFlux], [Valore], [Cnt]) VALUES (@IdxMacchina, @dtEvento, @CodFlux, @Valore, @Cnt); +SELECT IdxMacchina, dtEvento, CodFlux, Valore, Cnt FROM FluxLog WHERE (CodFlux = @CodFlux) AND (IdxMacchina = @IdxMacchina) AND (dtEvento = @dtEvento) + + + + + + + + + + + + SELECT * FROM dbo.FluxLog + + + + + + UPDATE [dbo].[FluxLog] SET [IdxMacchina] = @IdxMacchina, [dtEvento] = @dtEvento, [CodFlux] = @CodFlux, [Valore] = @Valore, [Cnt] = @Cnt WHERE (([IdxMacchina] = @Original_IdxMacchina) AND ([dtEvento] = @Original_dtEvento) AND ([CodFlux] = @Original_CodFlux) AND ([Valore] = @Original_Valore) AND ([Cnt] = @Original_Cnt)); +SELECT IdxMacchina, dtEvento, CodFlux, Valore, Cnt FROM FluxLog WHERE (CodFlux = @CodFlux) AND (IdxMacchina = @IdxMacchina) AND (dtEvento = @dtEvento) + + + + + + + + + + + + + + + + + + + + + + + + + + + + dbo.stp_FL_InsNew + + + + + + + + + + + + + @@ -2826,7 +2905,7 @@ SELECT CodArticolo, DescArticolo, CurrRev, ProdRev, FlagIsNew FROM AnagArticoli - + @@ -2848,7 +2927,7 @@ SELECT CodArticolo, DescArticolo, CurrRev, ProdRev, FlagIsNew FROM AnagArticoli - + @@ -2884,7 +2963,7 @@ SELECT CodArticolo, DescArticolo, CurrRev, ProdRev, FlagIsNew FROM AnagArticoli - + @@ -2920,7 +2999,7 @@ SELECT CodArticolo, DescArticolo, CurrRev, ProdRev, FlagIsNew FROM AnagArticoli - + @@ -2937,7 +3016,7 @@ SELECT CodArticolo, DescArticolo, CurrRev, ProdRev, FlagIsNew FROM AnagArticoli - + @@ -2961,7 +3040,7 @@ SELECT CodArticolo, DescArticolo, CurrRev, ProdRev, FlagIsNew FROM AnagArticoli - + @@ -2996,10 +3075,10 @@ SELECT CodArticolo, DescArticolo, CurrRev, ProdRev, FlagIsNew FROM AnagArticoli - + - + @@ -3075,6 +3154,35 @@ SELECT CodArticolo, DescArticolo, CurrRev, ProdRev, FlagIsNew FROM AnagArticoli + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -3186,29 +3294,35 @@ SELECT CodArticolo, DescArticolo, CurrRev, ProdRev, FlagIsNew FROM AnagArticoli + + + + + + - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/MapoDb/DS_applicazione.xss b/MapoDb/DS_applicazione.xss index fc7ee2e7..999bd2b1 100644 --- a/MapoDb/DS_applicazione.xss +++ b/MapoDb/DS_applicazione.xss @@ -4,35 +4,36 @@ Changes to this file may cause incorrect behavior and will be lost if the code is regenerated. --> - + - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + - + 667 @@ -44,7 +45,7 @@ - + 699 @@ -56,7 +57,7 @@ - + 815 @@ -68,7 +69,7 @@ - + 636 @@ -84,7 +85,7 @@ - + 386 @@ -100,7 +101,7 @@ - + 336 @@ -112,7 +113,7 @@ - + 853 @@ -124,7 +125,7 @@ - + 1285 @@ -148,7 +149,7 @@ - + 1285 @@ -160,7 +161,7 @@ - + 298 @@ -172,7 +173,7 @@ - + 619 @@ -184,7 +185,7 @@ - + 1444 @@ -196,7 +197,7 @@ - + 716 @@ -208,7 +209,7 @@ - + 943 @@ -220,7 +221,7 @@ - + 1285 @@ -240,7 +241,7 @@ - + 943 @@ -252,7 +253,7 @@ - + 965 @@ -268,7 +269,7 @@ - + 1108 @@ -280,7 +281,7 @@ - + 982 @@ -296,7 +297,7 @@ - + 627 diff --git a/MapoDb/DataLayer.cs b/MapoDb/DataLayer.cs index 39030ca6..5cf37160 100644 --- a/MapoDb/DataLayer.cs +++ b/MapoDb/DataLayer.cs @@ -28,6 +28,7 @@ namespace MapoDb public DS_applicazioneTableAdapters.TransizioneIngressiTableAdapter taTranIngr; public DS_applicazioneTableAdapters.RemoteRebootLogTableAdapter taRemReb; public DS_applicazioneTableAdapters.SignalLogTableAdapter taSigLog; + public DS_applicazioneTableAdapters.FluxLogTableAdapter taFL; // Table adapter x DS_ProdTempi public DS_ProdTempiTableAdapters.AnagArticoliTableAdapter taAnagArt; public DS_ProdTempiTableAdapters.ODLTableAdapter taODL; @@ -69,6 +70,7 @@ namespace MapoDb taTranIngr = new DS_applicazioneTableAdapters.TransizioneIngressiTableAdapter(); taRemReb = new DS_applicazioneTableAdapters.RemoteRebootLogTableAdapter(); taSigLog = new DS_applicazioneTableAdapters.SignalLogTableAdapter(); + taFL = new DS_applicazioneTableAdapters.FluxLogTableAdapter(); taAnagArt = new DS_ProdTempiTableAdapters.AnagArticoliTableAdapter(); taODL = new DS_ProdTempiTableAdapters.ODLTableAdapter(); taDatiMacchine = new DS_ProdTempiTableAdapters.DatiMacchineTableAdapter(); @@ -108,6 +110,7 @@ namespace MapoDb taTranIngr.Connection.ConnectionString = connectionString; taRemReb.Connection.ConnectionString = connectionString; taSigLog.Connection.ConnectionString = connectionString; + taFL.Connection.ConnectionString = connectionString; taAnagArt.Connection.ConnectionString = connectionString; taODL.Connection.ConnectionString = connectionString; taDatiMacchine.Connection.ConnectionString = connectionString; @@ -610,6 +613,95 @@ namespace MapoDb return newVal; } + /// + /// Processa registrazione FL da IOB + /// + /// + /// + /// + /// + /// + /// + /// + public static string processFluxLog(string idxMacchina, string flux, string valore, string dtEve, string dtCurr, int contatore) + { + // 2017.09.14 trimmo eventualmente lo zero finale dalle date SE supera i millisecondi... + dtEve = dtEve.Length > 17 ? dtEve.Substring(0, 17) : dtEve; + dtCurr = dtCurr.Length > 17 ? dtCurr.Substring(0, 17) : dtCurr; + // registro conteggio impiego chiamate REDIS + if (memLayer.ML.CRB("IOB_RedEnab")) + { + // conto la richiesta nel contatore REDIS + long nCall = memLayer.ML.setRCntI(mHash("COUNT:processFluxLog")); + //... se == nCall2Log scrivo su log e resetto + long nCall2Log = memLayer.ML.cdvi("nCall2Log"); + if (nCall >= nCall2Log) + { + // loggo + logger.lg.scriviLog(string.Format("processFluxLog: effettuate {0} call", nCall), tipoLog.INFO); + // resetto! + memLayer.ML.resetRCnt(mHash("COUNT:processFluxLog")); + } + } + string answ = ""; + DateTime dataOraEvento = DateTime.Now; + DateTime dtEvento, dtCorrente; + // controllo: se ho valori dt x evento e orario DIVERSI per acquisitore IOB calcolo dataOraEvento corretto + if (dtEve != dtCurr) + { + Int64 delta = 0; + try + { + // se ho meno decimali x evento rispetto dtCorrente... + if (dtEve.Length < dtCurr.Length) + { + dtEve = dtEve.PadRight(dtCurr.Length, '0'); + } + delta = Convert.ToInt64(dtCurr) - Convert.ToInt64(dtEve); + // se meno di 60'000 ms ... + if (delta < 59999) + { + dataOraEvento = dataOraEvento.AddMilliseconds(-delta); + } + else + { + // in questo caso elimino i MS dalle stringhe e converto i datetime.... + CultureInfo provider = CultureInfo.InvariantCulture; + string format = "yyyyMMddHHmmssfff"; + dtEvento = DateTime.ParseExact(dtEve, format, provider); + dtCorrente = DateTime.ParseExact(dtCurr, format, provider); + Int64 tiks = dtCorrente.Ticks - dtEvento.Ticks; + dataOraEvento = dataOraEvento.AddTicks(-tiks); + } + } + catch (Exception exc) + { + logger.lg.scriviLog(string.Format("Errore calcolo ms evento/ora corrente da device remoto:{0}dtEve : {1}{0}dtCurr: {2}{0}{3}", Environment.NewLine, dtEve, dtCurr, exc), tipoLog.EXCEPTION); + } + } + // inizio processing vero e proprio INPUT... + if (idxMacchina != null && valore != null) + { + if (idxMacchina != "" && valore != "") + { + DataLayer.obj.taFL.InsNew(idxMacchina, dataOraEvento, flux, valore, contatore); + } + else + { + string errore = "Errore: parametri macchina/valore vuoti"; + logger.lg.scriviLog(errore, tipoLog.ERROR); + answ = errore; + } + } + else + { + string errore = "Errore: mancano parametri macchina/valore"; + logger.lg.scriviLog(errore, tipoLog.ERROR); + answ = errore; + } + return answ; + } + #region definizioni hash x REDIS /// diff --git a/MapoDb/app.config b/MapoDb/app.config index 046c7a64..c115376d 100644 --- a/MapoDb/app.config +++ b/MapoDb/app.config @@ -2,22 +2,10 @@ - - - + - - - - - - + + + +