From 70717189db5387ed75e180a67016ccf2902e2b74 Mon Sep 17 00:00:00 2001 From: Samuele Locatelli Date: Tue, 23 Jul 2013 19:59:22 +0200 Subject: [PATCH] inserita - nuova tabella print job queue - nuova classe gestioen con 3 stored - nuovo metodo chiamata stampa cartellino ceh si ferma in base a valore semaforico tabella queue --- GMW_data/DS_cartellini.Designer.cs | 1133 +++++++++++++++++++++++++++- GMW_data/DS_cartellini.xsd | 149 +++- GMW_data/DS_cartellini.xss | 15 +- GMW_data/DataProxy.cs | 3 + GMW_data/reportPrinter.cs | 35 + 5 files changed, 1325 insertions(+), 10 deletions(-) diff --git a/GMW_data/DS_cartellini.Designer.cs b/GMW_data/DS_cartellini.Designer.cs index 55c94275..aa6d2c6a 100644 --- a/GMW_data/DS_cartellini.Designer.cs +++ b/GMW_data/DS_cartellini.Designer.cs @@ -1,7 +1,7 @@ //------------------------------------------------------------------------------ // // This code was generated by a tool. -// Runtime Version:4.0.30319.18033 +// Runtime Version:4.0.30319.18051 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. @@ -38,6 +38,8 @@ namespace GMW_data { private stp_prtCartFinitiByUDCDataTable tablestp_prtCartFinitiByUDC; + private PrintJobQueueDataTable tablePrintJobQueue; + private global::System.Data.SchemaSerializationMode _schemaSerializationMode = global::System.Data.SchemaSerializationMode.IncludeSchema; [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] @@ -87,6 +89,9 @@ namespace GMW_data { if ((ds.Tables["stp_prtCartFinitiByUDC"] != null)) { base.Tables.Add(new stp_prtCartFinitiByUDCDataTable(ds.Tables["stp_prtCartFinitiByUDC"])); } + if ((ds.Tables["PrintJobQueue"] != null)) { + base.Tables.Add(new PrintJobQueueDataTable(ds.Tables["PrintJobQueue"])); + } this.DataSetName = ds.DataSetName; this.Prefix = ds.Prefix; this.Namespace = ds.Namespace; @@ -175,6 +180,16 @@ namespace GMW_data { } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + [global::System.ComponentModel.Browsable(false)] + [global::System.ComponentModel.DesignerSerializationVisibility(global::System.ComponentModel.DesignerSerializationVisibility.Content)] + public PrintJobQueueDataTable PrintJobQueue { + get { + return this.tablePrintJobQueue; + } + } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] [global::System.ComponentModel.BrowsableAttribute(true)] @@ -263,6 +278,9 @@ namespace GMW_data { if ((ds.Tables["stp_prtCartFinitiByUDC"] != null)) { base.Tables.Add(new stp_prtCartFinitiByUDCDataTable(ds.Tables["stp_prtCartFinitiByUDC"])); } + if ((ds.Tables["PrintJobQueue"] != null)) { + base.Tables.Add(new PrintJobQueueDataTable(ds.Tables["PrintJobQueue"])); + } this.DataSetName = ds.DataSetName; this.Prefix = ds.Prefix; this.Namespace = ds.Namespace; @@ -338,6 +356,12 @@ namespace GMW_data { this.tablestp_prtCartFinitiByUDC.InitVars(); } } + this.tablePrintJobQueue = ((PrintJobQueueDataTable)(base.Tables["PrintJobQueue"])); + if ((initTable == true)) { + if ((this.tablePrintJobQueue != null)) { + this.tablePrintJobQueue.InitVars(); + } + } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] @@ -362,6 +386,8 @@ namespace GMW_data { base.Tables.Add(this.tablestp_prtCartFusiByUDC); this.tablestp_prtCartFinitiByUDC = new stp_prtCartFinitiByUDCDataTable(); base.Tables.Add(this.tablestp_prtCartFinitiByUDC); + this.tablePrintJobQueue = new PrintJobQueueDataTable(); + base.Tables.Add(this.tablePrintJobQueue); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] @@ -406,6 +432,12 @@ namespace GMW_data { return false; } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + private bool ShouldSerializePrintJobQueue() { + return false; + } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] private void SchemaChanged(object sender, global::System.ComponentModel.CollectionChangeEventArgs e) { @@ -482,6 +514,9 @@ namespace GMW_data { [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public delegate void stp_prtCartFinitiByUDCRowChangeEventHandler(object sender, stp_prtCartFinitiByUDCRowChangeEvent e); + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public delegate void PrintJobQueueRowChangeEventHandler(object sender, PrintJobQueueRowChangeEvent e); + /// ///Represents the strongly named DataTable class. /// @@ -5715,6 +5750,360 @@ namespace GMW_data { } } + /// + ///Represents the strongly named DataTable class. + /// + [global::System.Serializable()] + [global::System.Xml.Serialization.XmlSchemaProviderAttribute("GetTypedTableSchema")] + public partial class PrintJobQueueDataTable : global::System.Data.TypedTableBase { + + private global::System.Data.DataColumn columnIdxPrintJob; + + private global::System.Data.DataColumn columnTipoCart; + + private global::System.Data.DataColumn columnUDC; + + private global::System.Data.DataColumn columnprtName; + + private global::System.Data.DataColumn columndtStart; + + private global::System.Data.DataColumn columndtEnd; + + private global::System.Data.DataColumn columnstato; + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public PrintJobQueueDataTable() { + this.TableName = "PrintJobQueue"; + this.BeginInit(); + this.InitClass(); + this.EndInit(); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + internal PrintJobQueueDataTable(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", "4.0.0.0")] + protected PrintJobQueueDataTable(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", "4.0.0.0")] + public global::System.Data.DataColumn IdxPrintJobColumn { + get { + return this.columnIdxPrintJob; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public global::System.Data.DataColumn TipoCartColumn { + get { + return this.columnTipoCart; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public global::System.Data.DataColumn UDCColumn { + get { + return this.columnUDC; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public global::System.Data.DataColumn prtNameColumn { + get { + return this.columnprtName; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public global::System.Data.DataColumn dtStartColumn { + get { + return this.columndtStart; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public global::System.Data.DataColumn dtEndColumn { + get { + return this.columndtEnd; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public global::System.Data.DataColumn statoColumn { + get { + return this.columnstato; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.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", "4.0.0.0")] + public PrintJobQueueRow this[int index] { + get { + return ((PrintJobQueueRow)(this.Rows[index])); + } + } + + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public event PrintJobQueueRowChangeEventHandler PrintJobQueueRowChanging; + + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public event PrintJobQueueRowChangeEventHandler PrintJobQueueRowChanged; + + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public event PrintJobQueueRowChangeEventHandler PrintJobQueueRowDeleting; + + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public event PrintJobQueueRowChangeEventHandler PrintJobQueueRowDeleted; + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public void AddPrintJobQueueRow(PrintJobQueueRow row) { + this.Rows.Add(row); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public PrintJobQueueRow AddPrintJobQueueRow(string TipoCart, string UDC, string prtName, System.DateTime dtStart, System.DateTime dtEnd, int stato) { + PrintJobQueueRow rowPrintJobQueueRow = ((PrintJobQueueRow)(this.NewRow())); + object[] columnValuesArray = new object[] { + null, + TipoCart, + UDC, + prtName, + dtStart, + dtEnd, + stato}; + rowPrintJobQueueRow.ItemArray = columnValuesArray; + this.Rows.Add(rowPrintJobQueueRow); + return rowPrintJobQueueRow; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public PrintJobQueueRow FindByIdxPrintJob(int IdxPrintJob) { + return ((PrintJobQueueRow)(this.Rows.Find(new object[] { + IdxPrintJob}))); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public override global::System.Data.DataTable Clone() { + PrintJobQueueDataTable cln = ((PrintJobQueueDataTable)(base.Clone())); + cln.InitVars(); + return cln; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + protected override global::System.Data.DataTable CreateInstance() { + return new PrintJobQueueDataTable(); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + internal void InitVars() { + this.columnIdxPrintJob = base.Columns["IdxPrintJob"]; + this.columnTipoCart = base.Columns["TipoCart"]; + this.columnUDC = base.Columns["UDC"]; + this.columnprtName = base.Columns["prtName"]; + this.columndtStart = base.Columns["dtStart"]; + this.columndtEnd = base.Columns["dtEnd"]; + this.columnstato = base.Columns["stato"]; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + private void InitClass() { + this.columnIdxPrintJob = new global::System.Data.DataColumn("IdxPrintJob", typeof(int), null, global::System.Data.MappingType.Element); + base.Columns.Add(this.columnIdxPrintJob); + this.columnTipoCart = new global::System.Data.DataColumn("TipoCart", typeof(string), null, global::System.Data.MappingType.Element); + base.Columns.Add(this.columnTipoCart); + this.columnUDC = new global::System.Data.DataColumn("UDC", typeof(string), null, global::System.Data.MappingType.Element); + base.Columns.Add(this.columnUDC); + this.columnprtName = new global::System.Data.DataColumn("prtName", typeof(string), null, global::System.Data.MappingType.Element); + base.Columns.Add(this.columnprtName); + this.columndtStart = new global::System.Data.DataColumn("dtStart", typeof(global::System.DateTime), null, global::System.Data.MappingType.Element); + base.Columns.Add(this.columndtStart); + this.columndtEnd = new global::System.Data.DataColumn("dtEnd", typeof(global::System.DateTime), null, global::System.Data.MappingType.Element); + base.Columns.Add(this.columndtEnd); + this.columnstato = new global::System.Data.DataColumn("stato", typeof(int), null, global::System.Data.MappingType.Element); + base.Columns.Add(this.columnstato); + this.Constraints.Add(new global::System.Data.UniqueConstraint("Constraint1", new global::System.Data.DataColumn[] { + this.columnIdxPrintJob}, true)); + this.columnIdxPrintJob.AutoIncrement = true; + this.columnIdxPrintJob.AutoIncrementSeed = -1; + this.columnIdxPrintJob.AutoIncrementStep = -1; + this.columnIdxPrintJob.AllowDBNull = false; + this.columnIdxPrintJob.ReadOnly = true; + this.columnIdxPrintJob.Unique = true; + this.columnTipoCart.AllowDBNull = false; + this.columnTipoCart.MaxLength = 250; + this.columnUDC.AllowDBNull = false; + this.columnUDC.MaxLength = 50; + this.columnprtName.AllowDBNull = false; + this.columnprtName.MaxLength = 500; + this.columndtStart.AllowDBNull = false; + this.columnstato.AllowDBNull = false; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public PrintJobQueueRow NewPrintJobQueueRow() { + return ((PrintJobQueueRow)(this.NewRow())); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + protected override global::System.Data.DataRow NewRowFromBuilder(global::System.Data.DataRowBuilder builder) { + return new PrintJobQueueRow(builder); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + protected override global::System.Type GetRowType() { + return typeof(PrintJobQueueRow); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + protected override void OnRowChanged(global::System.Data.DataRowChangeEventArgs e) { + base.OnRowChanged(e); + if ((this.PrintJobQueueRowChanged != null)) { + this.PrintJobQueueRowChanged(this, new PrintJobQueueRowChangeEvent(((PrintJobQueueRow)(e.Row)), e.Action)); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + protected override void OnRowChanging(global::System.Data.DataRowChangeEventArgs e) { + base.OnRowChanging(e); + if ((this.PrintJobQueueRowChanging != null)) { + this.PrintJobQueueRowChanging(this, new PrintJobQueueRowChangeEvent(((PrintJobQueueRow)(e.Row)), e.Action)); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + protected override void OnRowDeleted(global::System.Data.DataRowChangeEventArgs e) { + base.OnRowDeleted(e); + if ((this.PrintJobQueueRowDeleted != null)) { + this.PrintJobQueueRowDeleted(this, new PrintJobQueueRowChangeEvent(((PrintJobQueueRow)(e.Row)), e.Action)); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + protected override void OnRowDeleting(global::System.Data.DataRowChangeEventArgs e) { + base.OnRowDeleting(e); + if ((this.PrintJobQueueRowDeleting != null)) { + this.PrintJobQueueRowDeleting(this, new PrintJobQueueRowChangeEvent(((PrintJobQueueRow)(e.Row)), e.Action)); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public void RemovePrintJobQueueRow(PrintJobQueueRow row) { + this.Rows.Remove(row); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.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_cartellini ds = new DS_cartellini(); + 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 = "PrintJobQueueDataTable"; + 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. /// @@ -11781,6 +12170,115 @@ namespace GMW_data { } } + /// + ///Represents strongly named DataRow class. + /// + public partial class PrintJobQueueRow : global::System.Data.DataRow { + + private PrintJobQueueDataTable tablePrintJobQueue; + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + internal PrintJobQueueRow(global::System.Data.DataRowBuilder rb) : + base(rb) { + this.tablePrintJobQueue = ((PrintJobQueueDataTable)(this.Table)); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public int IdxPrintJob { + get { + return ((int)(this[this.tablePrintJobQueue.IdxPrintJobColumn])); + } + set { + this[this.tablePrintJobQueue.IdxPrintJobColumn] = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public string TipoCart { + get { + return ((string)(this[this.tablePrintJobQueue.TipoCartColumn])); + } + set { + this[this.tablePrintJobQueue.TipoCartColumn] = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public string UDC { + get { + return ((string)(this[this.tablePrintJobQueue.UDCColumn])); + } + set { + this[this.tablePrintJobQueue.UDCColumn] = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public string prtName { + get { + return ((string)(this[this.tablePrintJobQueue.prtNameColumn])); + } + set { + this[this.tablePrintJobQueue.prtNameColumn] = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public System.DateTime dtStart { + get { + return ((global::System.DateTime)(this[this.tablePrintJobQueue.dtStartColumn])); + } + set { + this[this.tablePrintJobQueue.dtStartColumn] = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public System.DateTime dtEnd { + get { + try { + return ((global::System.DateTime)(this[this.tablePrintJobQueue.dtEndColumn])); + } + catch (global::System.InvalidCastException e) { + throw new global::System.Data.StrongTypingException("The value for column \'dtEnd\' in table \'PrintJobQueue\' is DBNull.", e); + } + } + set { + this[this.tablePrintJobQueue.dtEndColumn] = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public int stato { + get { + return ((int)(this[this.tablePrintJobQueue.statoColumn])); + } + set { + this[this.tablePrintJobQueue.statoColumn] = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public bool IsdtEndNull() { + return this.IsNull(this.tablePrintJobQueue.dtEndColumn); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public void SetdtEndNull() { + this[this.tablePrintJobQueue.dtEndColumn] = global::System.Convert.DBNull; + } + } + /// ///Row event argument class /// @@ -12018,6 +12516,40 @@ namespace GMW_data { } } } + + /// + ///Row event argument class + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public class PrintJobQueueRowChangeEvent : global::System.EventArgs { + + private PrintJobQueueRow eventRow; + + private global::System.Data.DataRowAction eventAction; + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public PrintJobQueueRowChangeEvent(PrintJobQueueRow 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", "4.0.0.0")] + public PrintJobQueueRow Row { + get { + return this.eventRow; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + public global::System.Data.DataRowAction Action { + get { + return this.eventAction; + } + } + } } } namespace GMW_data.DS_cartelliniTableAdapters { @@ -13499,6 +14031,539 @@ namespace GMW_data.DS_cartelliniTableAdapters { } } + /// + ///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 PrintJobQueueTableAdapter : 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", "4.0.0.0")] + public PrintJobQueueTableAdapter() { + this.ClearBeforeFill = true; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.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", "4.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", "4.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", "4.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", "4.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", "4.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 = "PrintJobQueue"; + tableMapping.ColumnMappings.Add("IdxPrintJob", "IdxPrintJob"); + tableMapping.ColumnMappings.Add("TipoCart", "TipoCart"); + tableMapping.ColumnMappings.Add("UDC", "UDC"); + tableMapping.ColumnMappings.Add("prtName", "prtName"); + tableMapping.ColumnMappings.Add("dtStart", "dtStart"); + tableMapping.ColumnMappings.Add("dtEnd", "dtEnd"); + tableMapping.ColumnMappings.Add("stato", "stato"); + 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].[PrintJobQueue] WHERE (([IdxPrintJob] = @Original_IdxPrintJob) AND ([TipoCart] = @Original_TipoCart) AND ([UDC] = @Original_UDC) AND ([prtName] = @Original_prtName) AND ([dtStart] = @Original_dtStart) AND ((@IsNull_dtEnd = 1 AND [dtEnd] IS NULL) OR ([dtEnd] = @Original_dtEnd)) AND ([stato] = @Original_stato))"; + this._adapter.DeleteCommand.CommandType = global::System.Data.CommandType.Text; + this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_IdxPrintJob", global::System.Data.SqlDbType.Int, 0, global::System.Data.ParameterDirection.Input, 0, 0, "IdxPrintJob", global::System.Data.DataRowVersion.Original, false, null, "", "", "")); + this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_TipoCart", global::System.Data.SqlDbType.NVarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "TipoCart", global::System.Data.DataRowVersion.Original, false, null, "", "", "")); + this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_UDC", global::System.Data.SqlDbType.NVarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "UDC", global::System.Data.DataRowVersion.Original, false, null, "", "", "")); + this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_prtName", global::System.Data.SqlDbType.NVarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "prtName", global::System.Data.DataRowVersion.Original, false, null, "", "", "")); + this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_dtStart", global::System.Data.SqlDbType.DateTime, 0, global::System.Data.ParameterDirection.Input, 0, 0, "dtStart", global::System.Data.DataRowVersion.Original, false, null, "", "", "")); + this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@IsNull_dtEnd", global::System.Data.SqlDbType.Int, 0, global::System.Data.ParameterDirection.Input, 0, 0, "dtEnd", global::System.Data.DataRowVersion.Original, true, null, "", "", "")); + this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_dtEnd", global::System.Data.SqlDbType.DateTime, 0, global::System.Data.ParameterDirection.Input, 0, 0, "dtEnd", global::System.Data.DataRowVersion.Original, false, null, "", "", "")); + this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_stato", global::System.Data.SqlDbType.Int, 0, global::System.Data.ParameterDirection.Input, 0, 0, "stato", 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].[PrintJobQueue] ([TipoCart], [UDC], [prtName], [dtStart], [dtEnd], [stato]) VALUES (@TipoCart, @UDC, @prtName, @dtStart, @dtEnd, @stato); +SELECT IdxPrintJob, TipoCart, UDC, prtName, dtStart, dtEnd, stato FROM PrintJobQueue WHERE (IdxPrintJob = SCOPE_IDENTITY())"; + this._adapter.InsertCommand.CommandType = global::System.Data.CommandType.Text; + this._adapter.InsertCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@TipoCart", global::System.Data.SqlDbType.NVarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "TipoCart", global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + this._adapter.InsertCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@UDC", global::System.Data.SqlDbType.NVarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "UDC", global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + this._adapter.InsertCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@prtName", global::System.Data.SqlDbType.NVarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "prtName", global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + this._adapter.InsertCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@dtStart", global::System.Data.SqlDbType.DateTime, 0, global::System.Data.ParameterDirection.Input, 0, 0, "dtStart", global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + this._adapter.InsertCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@dtEnd", global::System.Data.SqlDbType.DateTime, 0, global::System.Data.ParameterDirection.Input, 0, 0, "dtEnd", global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + this._adapter.InsertCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@stato", global::System.Data.SqlDbType.Int, 0, global::System.Data.ParameterDirection.Input, 0, 0, "stato", 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].[PrintJobQueue] SET [TipoCart] = @TipoCart, [UDC] = @UDC, [prtName] = @prtName, [dtStart] = @dtStart, [dtEnd] = @dtEnd, [stato] = @stato WHERE (([IdxPrintJob] = @Original_IdxPrintJob) AND ([TipoCart] = @Original_TipoCart) AND ([UDC] = @Original_UDC) AND ([prtName] = @Original_prtName) AND ([dtStart] = @Original_dtStart) AND ((@IsNull_dtEnd = 1 AND [dtEnd] IS NULL) OR ([dtEnd] = @Original_dtEnd)) AND ([stato] = @Original_stato)); +SELECT IdxPrintJob, TipoCart, UDC, prtName, dtStart, dtEnd, stato FROM PrintJobQueue WHERE (IdxPrintJob = @IdxPrintJob)"; + this._adapter.UpdateCommand.CommandType = global::System.Data.CommandType.Text; + this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@TipoCart", global::System.Data.SqlDbType.NVarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "TipoCart", global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@UDC", global::System.Data.SqlDbType.NVarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "UDC", global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@prtName", global::System.Data.SqlDbType.NVarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "prtName", global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@dtStart", global::System.Data.SqlDbType.DateTime, 0, global::System.Data.ParameterDirection.Input, 0, 0, "dtStart", global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@dtEnd", global::System.Data.SqlDbType.DateTime, 0, global::System.Data.ParameterDirection.Input, 0, 0, "dtEnd", global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@stato", global::System.Data.SqlDbType.Int, 0, global::System.Data.ParameterDirection.Input, 0, 0, "stato", global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_IdxPrintJob", global::System.Data.SqlDbType.Int, 0, global::System.Data.ParameterDirection.Input, 0, 0, "IdxPrintJob", global::System.Data.DataRowVersion.Original, false, null, "", "", "")); + this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_TipoCart", global::System.Data.SqlDbType.NVarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "TipoCart", global::System.Data.DataRowVersion.Original, false, null, "", "", "")); + this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_UDC", global::System.Data.SqlDbType.NVarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "UDC", global::System.Data.DataRowVersion.Original, false, null, "", "", "")); + this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_prtName", global::System.Data.SqlDbType.NVarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "prtName", global::System.Data.DataRowVersion.Original, false, null, "", "", "")); + this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_dtStart", global::System.Data.SqlDbType.DateTime, 0, global::System.Data.ParameterDirection.Input, 0, 0, "dtStart", global::System.Data.DataRowVersion.Original, false, null, "", "", "")); + this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@IsNull_dtEnd", global::System.Data.SqlDbType.Int, 0, global::System.Data.ParameterDirection.Input, 0, 0, "dtEnd", global::System.Data.DataRowVersion.Original, true, null, "", "", "")); + this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_dtEnd", global::System.Data.SqlDbType.DateTime, 0, global::System.Data.ParameterDirection.Input, 0, 0, "dtEnd", global::System.Data.DataRowVersion.Original, false, null, "", "", "")); + this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_stato", global::System.Data.SqlDbType.Int, 0, global::System.Data.ParameterDirection.Input, 0, 0, "stato", global::System.Data.DataRowVersion.Original, false, null, "", "", "")); + this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@IdxPrintJob", global::System.Data.SqlDbType.Int, 4, global::System.Data.ParameterDirection.Input, 0, 0, "IdxPrintJob", global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + private void InitConnection() { + this._connection = new global::System.Data.SqlClient.SqlConnection(); + this._connection.ConnectionString = global::GMW_data.Properties.Settings.Default.GMWConnectionString; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + private void InitCommandCollection() { + this._commandCollection = new global::System.Data.SqlClient.SqlCommand[4]; + this._commandCollection[0] = new global::System.Data.SqlClient.SqlCommand(); + this._commandCollection[0].Connection = this.Connection; + this._commandCollection[0].CommandText = "SELECT IdxPrintJob, TipoCart, UDC, prtName, dtStart, dtEnd, stato FROM dbo.PrintJ" + + "obQueue"; + 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_PJQ_getNext"; + 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[2] = new global::System.Data.SqlClient.SqlCommand(); + this._commandCollection[2].Connection = this.Connection; + this._commandCollection[2].CommandText = "dbo.stp_PJQ_insert"; + this._commandCollection[2].CommandType = global::System.Data.CommandType.StoredProcedure; + this._commandCollection[2].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@RETURN_VALUE", global::System.Data.SqlDbType.Int, 4, global::System.Data.ParameterDirection.ReturnValue, 10, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + this._commandCollection[2].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@TipoCart", global::System.Data.SqlDbType.VarChar, 250, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + this._commandCollection[2].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@UDC", global::System.Data.SqlDbType.VarChar, 50, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + this._commandCollection[2].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@prtName", global::System.Data.SqlDbType.VarChar, 500, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + this._commandCollection[3] = new global::System.Data.SqlClient.SqlCommand(); + this._commandCollection[3].Connection = this.Connection; + this._commandCollection[3].CommandText = "dbo.stp_PJQ_updateStato"; + this._commandCollection[3].CommandType = global::System.Data.CommandType.StoredProcedure; + this._commandCollection[3].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@RETURN_VALUE", global::System.Data.SqlDbType.Int, 4, global::System.Data.ParameterDirection.ReturnValue, 10, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + this._commandCollection[3].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@IdxPrintJob", global::System.Data.SqlDbType.Int, 4, global::System.Data.ParameterDirection.Input, 10, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + this._commandCollection[3].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@stato", 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", "4.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_cartellini.PrintJobQueueDataTable 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", "4.0.0.0")] + [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")] + [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Select, true)] + public virtual DS_cartellini.PrintJobQueueDataTable GetData() { + this.Adapter.SelectCommand = this.CommandCollection[0]; + DS_cartellini.PrintJobQueueDataTable dataTable = new DS_cartellini.PrintJobQueueDataTable(); + this.Adapter.Fill(dataTable); + return dataTable; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")] + [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Select, false)] + public virtual DS_cartellini.PrintJobQueueDataTable getNext() { + this.Adapter.SelectCommand = this.CommandCollection[1]; + DS_cartellini.PrintJobQueueDataTable dataTable = new DS_cartellini.PrintJobQueueDataTable(); + this.Adapter.Fill(dataTable); + return dataTable; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")] + public virtual int Update(DS_cartellini.PrintJobQueueDataTable dataTable) { + return this.Adapter.Update(dataTable); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")] + public virtual int Update(DS_cartellini dataSet) { + return this.Adapter.Update(dataSet, "PrintJobQueue"); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.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", "4.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", "4.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_IdxPrintJob, string Original_TipoCart, string Original_UDC, string Original_prtName, System.DateTime Original_dtStart, global::System.Nullable Original_dtEnd, int Original_stato) { + this.Adapter.DeleteCommand.Parameters[0].Value = ((int)(Original_IdxPrintJob)); + if ((Original_TipoCart == null)) { + throw new global::System.ArgumentNullException("Original_TipoCart"); + } + else { + this.Adapter.DeleteCommand.Parameters[1].Value = ((string)(Original_TipoCart)); + } + if ((Original_UDC == null)) { + throw new global::System.ArgumentNullException("Original_UDC"); + } + else { + this.Adapter.DeleteCommand.Parameters[2].Value = ((string)(Original_UDC)); + } + if ((Original_prtName == null)) { + throw new global::System.ArgumentNullException("Original_prtName"); + } + else { + this.Adapter.DeleteCommand.Parameters[3].Value = ((string)(Original_prtName)); + } + this.Adapter.DeleteCommand.Parameters[4].Value = ((System.DateTime)(Original_dtStart)); + if ((Original_dtEnd.HasValue == true)) { + this.Adapter.DeleteCommand.Parameters[5].Value = ((object)(0)); + this.Adapter.DeleteCommand.Parameters[6].Value = ((System.DateTime)(Original_dtEnd.Value)); + } + else { + this.Adapter.DeleteCommand.Parameters[5].Value = ((object)(1)); + this.Adapter.DeleteCommand.Parameters[6].Value = global::System.DBNull.Value; + } + this.Adapter.DeleteCommand.Parameters[7].Value = ((int)(Original_stato)); + 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", "4.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 TipoCart, string UDC, string prtName, System.DateTime dtStart, global::System.Nullable dtEnd, int stato) { + if ((TipoCart == null)) { + throw new global::System.ArgumentNullException("TipoCart"); + } + else { + this.Adapter.InsertCommand.Parameters[0].Value = ((string)(TipoCart)); + } + if ((UDC == null)) { + throw new global::System.ArgumentNullException("UDC"); + } + else { + this.Adapter.InsertCommand.Parameters[1].Value = ((string)(UDC)); + } + if ((prtName == null)) { + throw new global::System.ArgumentNullException("prtName"); + } + else { + this.Adapter.InsertCommand.Parameters[2].Value = ((string)(prtName)); + } + this.Adapter.InsertCommand.Parameters[3].Value = ((System.DateTime)(dtStart)); + if ((dtEnd.HasValue == true)) { + this.Adapter.InsertCommand.Parameters[4].Value = ((System.DateTime)(dtEnd.Value)); + } + else { + this.Adapter.InsertCommand.Parameters[4].Value = global::System.DBNull.Value; + } + this.Adapter.InsertCommand.Parameters[5].Value = ((int)(stato)); + 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", "4.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 TipoCart, string UDC, string prtName, System.DateTime dtStart, global::System.Nullable dtEnd, int stato, int Original_IdxPrintJob, string Original_TipoCart, string Original_UDC, string Original_prtName, System.DateTime Original_dtStart, global::System.Nullable Original_dtEnd, int Original_stato, int IdxPrintJob) { + if ((TipoCart == null)) { + throw new global::System.ArgumentNullException("TipoCart"); + } + else { + this.Adapter.UpdateCommand.Parameters[0].Value = ((string)(TipoCart)); + } + if ((UDC == null)) { + throw new global::System.ArgumentNullException("UDC"); + } + else { + this.Adapter.UpdateCommand.Parameters[1].Value = ((string)(UDC)); + } + if ((prtName == null)) { + throw new global::System.ArgumentNullException("prtName"); + } + else { + this.Adapter.UpdateCommand.Parameters[2].Value = ((string)(prtName)); + } + this.Adapter.UpdateCommand.Parameters[3].Value = ((System.DateTime)(dtStart)); + if ((dtEnd.HasValue == true)) { + this.Adapter.UpdateCommand.Parameters[4].Value = ((System.DateTime)(dtEnd.Value)); + } + else { + this.Adapter.UpdateCommand.Parameters[4].Value = global::System.DBNull.Value; + } + this.Adapter.UpdateCommand.Parameters[5].Value = ((int)(stato)); + this.Adapter.UpdateCommand.Parameters[6].Value = ((int)(Original_IdxPrintJob)); + if ((Original_TipoCart == null)) { + throw new global::System.ArgumentNullException("Original_TipoCart"); + } + else { + this.Adapter.UpdateCommand.Parameters[7].Value = ((string)(Original_TipoCart)); + } + if ((Original_UDC == null)) { + throw new global::System.ArgumentNullException("Original_UDC"); + } + else { + this.Adapter.UpdateCommand.Parameters[8].Value = ((string)(Original_UDC)); + } + if ((Original_prtName == null)) { + throw new global::System.ArgumentNullException("Original_prtName"); + } + else { + this.Adapter.UpdateCommand.Parameters[9].Value = ((string)(Original_prtName)); + } + this.Adapter.UpdateCommand.Parameters[10].Value = ((System.DateTime)(Original_dtStart)); + if ((Original_dtEnd.HasValue == true)) { + this.Adapter.UpdateCommand.Parameters[11].Value = ((object)(0)); + this.Adapter.UpdateCommand.Parameters[12].Value = ((System.DateTime)(Original_dtEnd.Value)); + } + else { + this.Adapter.UpdateCommand.Parameters[11].Value = ((object)(1)); + this.Adapter.UpdateCommand.Parameters[12].Value = global::System.DBNull.Value; + } + this.Adapter.UpdateCommand.Parameters[13].Value = ((int)(Original_stato)); + this.Adapter.UpdateCommand.Parameters[14].Value = ((int)(IdxPrintJob)); + 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", "4.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 TipoCart, string UDC, string prtName, System.DateTime dtStart, global::System.Nullable dtEnd, int stato, int Original_IdxPrintJob, string Original_TipoCart, string Original_UDC, string Original_prtName, System.DateTime Original_dtStart, global::System.Nullable Original_dtEnd, int Original_stato) { + return this.Update(TipoCart, UDC, prtName, dtStart, dtEnd, stato, Original_IdxPrintJob, Original_TipoCart, Original_UDC, Original_prtName, Original_dtStart, Original_dtEnd, Original_stato, Original_IdxPrintJob); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")] + public virtual int insertQuery(string TipoCart, string UDC, string prtName) { + global::System.Data.SqlClient.SqlCommand command = this.CommandCollection[2]; + if ((TipoCart == null)) { + command.Parameters[1].Value = global::System.DBNull.Value; + } + else { + command.Parameters[1].Value = ((string)(TipoCart)); + } + if ((UDC == null)) { + command.Parameters[2].Value = global::System.DBNull.Value; + } + else { + command.Parameters[2].Value = ((string)(UDC)); + } + if ((prtName == null)) { + command.Parameters[3].Value = global::System.DBNull.Value; + } + else { + command.Parameters[3].Value = ((string)(prtName)); + } + global::System.Data.ConnectionState previousConnectionState = command.Connection.State; + if (((command.Connection.State & global::System.Data.ConnectionState.Open) + != global::System.Data.ConnectionState.Open)) { + command.Connection.Open(); + } + int returnValue; + try { + returnValue = command.ExecuteNonQuery(); + } + finally { + if ((previousConnectionState == global::System.Data.ConnectionState.Closed)) { + command.Connection.Close(); + } + } + return returnValue; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] + [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")] + public virtual int updateStato(global::System.Nullable IdxPrintJob, global::System.Nullable stato) { + global::System.Data.SqlClient.SqlCommand command = this.CommandCollection[3]; + if ((IdxPrintJob.HasValue == true)) { + command.Parameters[1].Value = ((int)(IdxPrintJob.Value)); + } + else { + command.Parameters[1].Value = global::System.DBNull.Value; + } + if ((stato.HasValue == true)) { + command.Parameters[2].Value = ((int)(stato.Value)); + } + else { + command.Parameters[2].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; + } + } + /// ///TableAdapterManager is used to coordinate TableAdapters in the dataset to enable Hierarchical Update scenarios /// @@ -13511,6 +14576,8 @@ namespace GMW_data.DS_cartelliniTableAdapters { private UpdateOrderOption _updateOrder; + private PrintJobQueueTableAdapter _printJobQueueTableAdapter; + private bool _backupDataSetBeforeUpdate; private global::System.Data.IDbConnection _connection; @@ -13526,6 +14593,20 @@ namespace GMW_data.DS_cartelliniTableAdapters { } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.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 PrintJobQueueTableAdapter PrintJobQueueTableAdapter { + get { + return this._printJobQueueTableAdapter; + } + set { + this._printJobQueueTableAdapter = value; + } + } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public bool BackupDataSetBeforeUpdate { @@ -13545,6 +14626,10 @@ namespace GMW_data.DS_cartelliniTableAdapters { if ((this._connection != null)) { return this._connection; } + if (((this._printJobQueueTableAdapter != null) + && (this._printJobQueueTableAdapter.Connection != null))) { + return this._printJobQueueTableAdapter.Connection; + } return null; } set { @@ -13558,6 +14643,9 @@ namespace GMW_data.DS_cartelliniTableAdapters { public int TableAdapterInstanceCount { get { int count = 0; + if ((this._printJobQueueTableAdapter != null)) { + count = (count + 1); + } return count; } } @@ -13569,6 +14657,15 @@ namespace GMW_data.DS_cartelliniTableAdapters { [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] private int UpdateUpdatedRows(DS_cartellini dataSet, global::System.Collections.Generic.List allChangedRows, global::System.Collections.Generic.List allAddedRows) { int result = 0; + if ((this._printJobQueueTableAdapter != null)) { + global::System.Data.DataRow[] updatedRows = dataSet.PrintJobQueue.Select(null, null, global::System.Data.DataViewRowState.ModifiedCurrent); + updatedRows = this.GetRealUpdatedRows(updatedRows, allAddedRows); + if (((updatedRows != null) + && (0 < updatedRows.Length))) { + result = (result + this._printJobQueueTableAdapter.Update(updatedRows)); + allChangedRows.AddRange(updatedRows); + } + } return result; } @@ -13579,6 +14676,14 @@ namespace GMW_data.DS_cartelliniTableAdapters { [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] private int UpdateInsertedRows(DS_cartellini dataSet, global::System.Collections.Generic.List allAddedRows) { int result = 0; + if ((this._printJobQueueTableAdapter != null)) { + global::System.Data.DataRow[] addedRows = dataSet.PrintJobQueue.Select(null, null, global::System.Data.DataViewRowState.Added); + if (((addedRows != null) + && (0 < addedRows.Length))) { + result = (result + this._printJobQueueTableAdapter.Update(addedRows)); + allAddedRows.AddRange(addedRows); + } + } return result; } @@ -13589,6 +14694,14 @@ namespace GMW_data.DS_cartelliniTableAdapters { [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] private int UpdateDeletedRows(DS_cartellini dataSet, global::System.Collections.Generic.List allChangedRows) { int result = 0; + if ((this._printJobQueueTableAdapter != null)) { + global::System.Data.DataRow[] deletedRows = dataSet.PrintJobQueue.Select(null, null, global::System.Data.DataViewRowState.Deleted); + if (((deletedRows != null) + && (0 < deletedRows.Length))) { + result = (result + this._printJobQueueTableAdapter.Update(deletedRows)); + allChangedRows.AddRange(deletedRows); + } + } return result; } @@ -13628,6 +14741,11 @@ namespace GMW_data.DS_cartelliniTableAdapters { if ((dataSet.HasChanges() == false)) { return 0; } + if (((this._printJobQueueTableAdapter != null) + && (this.MatchTableAdapterConnection(this._printJobQueueTableAdapter.Connection) == false))) { + throw new global::System.ArgumentException("All TableAdapters managed by a TableAdapterManager must use the same connection s" + + "tring."); + } global::System.Data.IDbConnection workConnection = this.Connection; if ((workConnection == null)) { throw new global::System.ApplicationException("TableAdapterManager contains no connection information. Set each TableAdapterMana" + @@ -13660,6 +14778,15 @@ namespace GMW_data.DS_cartelliniTableAdapters { try { // ---- Prepare for update ----------- // + if ((this._printJobQueueTableAdapter != null)) { + revertConnections.Add(this._printJobQueueTableAdapter, this._printJobQueueTableAdapter.Connection); + this._printJobQueueTableAdapter.Connection = ((global::System.Data.SqlClient.SqlConnection)(workConnection)); + this._printJobQueueTableAdapter.Transaction = ((global::System.Data.SqlClient.SqlTransaction)(workTransaction)); + if (this._printJobQueueTableAdapter.Adapter.AcceptChangesDuringUpdate) { + this._printJobQueueTableAdapter.Adapter.AcceptChangesDuringUpdate = false; + adaptersWithAcceptChangesDuringUpdate.Add(this._printJobQueueTableAdapter.Adapter); + } + } // //---- Perform updates ----------- // @@ -13718,6 +14845,10 @@ namespace GMW_data.DS_cartelliniTableAdapters { if (workConnOpened) { workConnection.Close(); } + if ((this._printJobQueueTableAdapter != null)) { + this._printJobQueueTableAdapter.Connection = ((global::System.Data.SqlClient.SqlConnection)(revertConnections[this._printJobQueueTableAdapter])); + this._printJobQueueTableAdapter.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/GMW_data/DS_cartellini.xsd b/GMW_data/DS_cartellini.xsd index 5ba6bb75..bcff6642 100644 --- a/GMW_data/DS_cartellini.xsd +++ b/GMW_data/DS_cartellini.xsd @@ -350,6 +350,116 @@ + + + + + + DELETE FROM [dbo].[PrintJobQueue] WHERE (([IdxPrintJob] = @Original_IdxPrintJob) AND ([TipoCart] = @Original_TipoCart) AND ([UDC] = @Original_UDC) AND ([prtName] = @Original_prtName) AND ([dtStart] = @Original_dtStart) AND ((@IsNull_dtEnd = 1 AND [dtEnd] IS NULL) OR ([dtEnd] = @Original_dtEnd)) AND ([stato] = @Original_stato)) + + + + + + + + + + + + + + + INSERT INTO [dbo].[PrintJobQueue] ([TipoCart], [UDC], [prtName], [dtStart], [dtEnd], [stato]) VALUES (@TipoCart, @UDC, @prtName, @dtStart, @dtEnd, @stato); +SELECT IdxPrintJob, TipoCart, UDC, prtName, dtStart, dtEnd, stato FROM PrintJobQueue WHERE (IdxPrintJob = SCOPE_IDENTITY()) + + + + + + + + + + + + + SELECT IdxPrintJob, TipoCart, UDC, prtName, dtStart, dtEnd, stato FROM dbo.PrintJobQueue + + + + + + UPDATE [dbo].[PrintJobQueue] SET [TipoCart] = @TipoCart, [UDC] = @UDC, [prtName] = @prtName, [dtStart] = @dtStart, [dtEnd] = @dtEnd, [stato] = @stato WHERE (([IdxPrintJob] = @Original_IdxPrintJob) AND ([TipoCart] = @Original_TipoCart) AND ([UDC] = @Original_UDC) AND ([prtName] = @Original_prtName) AND ([dtStart] = @Original_dtStart) AND ((@IsNull_dtEnd = 1 AND [dtEnd] IS NULL) OR ([dtEnd] = @Original_dtEnd)) AND ([stato] = @Original_stato)); +SELECT IdxPrintJob, TipoCart, UDC, prtName, dtStart, dtEnd, stato FROM PrintJobQueue WHERE (IdxPrintJob = @IdxPrintJob) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + dbo.stp_PJQ_getNext + + + + + + + + + + dbo.stp_PJQ_insert + + + + + + + + + + + + + dbo.stp_PJQ_updateStato + + + + + + + + + + @@ -1174,7 +1284,7 @@ - + @@ -1351,7 +1461,7 @@ - + @@ -1528,6 +1638,37 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -1546,5 +1687,9 @@ + + + + \ No newline at end of file diff --git a/GMW_data/DS_cartellini.xss b/GMW_data/DS_cartellini.xss index abc59003..43a051aa 100644 --- a/GMW_data/DS_cartellini.xss +++ b/GMW_data/DS_cartellini.xss @@ -6,13 +6,14 @@ --> - - - - - - - + + + + + + + + \ No newline at end of file diff --git a/GMW_data/DataProxy.cs b/GMW_data/DataProxy.cs index 0d14aaae..5275f8f8 100644 --- a/GMW_data/DataProxy.cs +++ b/GMW_data/DataProxy.cs @@ -38,6 +38,7 @@ namespace GMW_data public DS_cartelliniTableAdapters.stp_prtCartMatPrimaByUDCTableAdapter taPrtCartMP; public DS_cartelliniTableAdapters.stp_prtCartLiquidi_F10ByUDCTableAdapter taPrtCartLiqF10; public DS_cartelliniTableAdapters.stp_prtCartLiquidi_F18ByUDCTableAdapter taPrtCartLiqF18; + public DS_cartelliniTableAdapters.PrintJobQueueTableAdapter taPJQ; /// @@ -70,6 +71,7 @@ namespace GMW_data taPrtCartMP = new GMW_data.DS_cartelliniTableAdapters.stp_prtCartMatPrimaByUDCTableAdapter(); taPrtCartLiqF10 = new GMW_data.DS_cartelliniTableAdapters.stp_prtCartLiquidi_F10ByUDCTableAdapter(); taPrtCartLiqF18 = new GMW_data.DS_cartelliniTableAdapters.stp_prtCartLiquidi_F18ByUDCTableAdapter(); + taPJQ = new DS_cartelliniTableAdapters.PrintJobQueueTableAdapter(); } /// /// effettua setup dei connection strings da web.config delal singola applicazione @@ -103,6 +105,7 @@ namespace GMW_data taPrtCartMP.Connection.ConnectionString = connString; taPrtCartLiqF10.Connection.ConnectionString = connString; taPrtCartLiqF18.Connection.ConnectionString = connString; + taPJQ.Connection.ConnectionString = connString; } #endregion diff --git a/GMW_data/reportPrinter.cs b/GMW_data/reportPrinter.cs index 3b59ab2f..715341ce 100644 --- a/GMW_data/reportPrinter.cs +++ b/GMW_data/reportPrinter.cs @@ -276,6 +276,31 @@ public class reportPrinter public bool stampaCartellino(tipoCartellino cartellino, string UDC, string printerName) { bool answ = false; + // incomincio con gestioen della coda di stampa... inserisco in tab la richiesta di stampa... + DataProxy.obj.taPJQ.insertQuery(cartellino.ToString(), UDC, printerName); + // faccio un ciclo while... finchè non sono "in testa" alla coda delel esecuzioni aspetto... + string nextUdc = "ND"; + try + { + nextUdc = DataProxy.obj.taPJQ.getNext()[0].UDC; + } + catch + { + nextUdc = "ND"; + } + Random rand = new Random(); + int msWait = 200; + int idxPrintJob = 0; + while (nextUdc != UDC) + { + // aspetto... + msWait = rand.Next(100, 300); + System.Threading.Thread.Sleep(msWait); + // leggo prox record da coda + nextUdc = DataProxy.obj.taPJQ.getNext()[0].UDC; + } + // salvo idx job... + idxPrintJob = DataProxy.obj.taPJQ.getNext()[0].idx; string outForm = ""; string pagWidth = ""; string pagHeigth = ""; @@ -335,6 +360,16 @@ public class reportPrinter // compongo parametri stampa devInfoParam deviceInfo = new devInfoParam(outForm, pagHeigth, pagWidth, margin, margin, margin, margin); answ = printAndLog(UDC, printerName, answ, report, deviceInfo); + if (answ) + { + // registro stampa in tabella queue... + DataProxy.obj.taPJQ.updateStato(idxPrintJob, 1); + } + else + { + // registro annullato in tab queue... + DataProxy.obj.taPJQ.updateStato(idxPrintJob, -1); + } return answ; } ///