public override global::System.Data.DataSet Clone() { PickupDS cln = ((PickupDS)(base.Clone())); cln.InitVars(); cln.SchemaSerializationMode = this.SchemaSerializationMode; return(cln); }
public static bool CanLoadPickups(DateTime pickupDate, string routeClass) { bool ret = false; if (DateTime.Compare(pickupDate, DateTime.Today) <= 0) { PickupDS pickups = GetPickups(pickupDate, routeClass); ret = pickups.PickupTable.Rows.Count == 0; } return(ret); }
public static global::System.Xml.Schema.XmlSchemaComplexType GetTypedDataSetSchema(global::System.Xml.Schema.XmlSchemaSet xs) { PickupDS ds = new PickupDS(); global::System.Xml.Schema.XmlSchemaComplexType type = new global::System.Xml.Schema.XmlSchemaComplexType(); global::System.Xml.Schema.XmlSchemaSequence sequence = new global::System.Xml.Schema.XmlSchemaSequence(); global::System.Xml.Schema.XmlSchemaAny any = new global::System.Xml.Schema.XmlSchemaAny(); any.Namespace = ds.Namespace; sequence.Items.Add(any); 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); }
public static PickupDS GetPickups(DateTime pickupDate, string routeClass) { // PickupDS pickups = null; try { pickups = new PickupDS(); DataSet ds = App.Mediator.FillDataset(USP_PICKUPS, TBL_PICKUPS, new object[] { pickupDate, routeClass }); if (ds != null) { pickups.Merge(ds); } } catch (Exception ex) { throw new ApplicationException("Unexpected error while reading pickups.", ex); } return(pickups); }
public static bool UpdatePickups(PickupDS pickups) { // bool ret = false; if (pickups.HasChanges()) { PickupDS _pickups = (PickupDS)pickups.GetChanges(DataRowState.Modified); for (int i = 0; i < _pickups.PickupTable.Rows.Count; i++) { PickupDS.PickupTableRow pickup = _pickups.PickupTable[i]; bool changed = UpdatePickup(pickup); } pickups.AcceptChanges(); } ret = true; return(ret); }
public Argix.Freight.Pickups GetPickups(DateTime pickupDate) { //Get a collection of all pickups for the terminal on the local LAN database Argix.Freight.Pickups pickups = null; try { pickups = new Argix.Freight.Pickups(); DataSet ds = fillDataset(USP_PICKUPS, TBL_PICKUPS, new object[] { pickupDate }); if (ds.Tables[TBL_PICKUPS].Rows.Count > 0) { PickupDS _pickups = new PickupDS(); _pickups.Merge(ds); for (int i = 0; i < _pickups.PickupTable.Rows.Count; i++) { Argix.Freight.Pickup pickup = new Argix.Freight.Pickup(_pickups.PickupTable[i]); pickups.Add(pickup); } } } catch (Exception ex) { throw new ApplicationException("Unexpected error while reading pickups.", ex); } return(pickups); }
public PickupDS GetPickups(string client, string division, DateTime startDate, DateTime endDate, string vendor) { //Get a list of pickups PickupDS pickups = null; try { pickups = new PickupDS(); DataSet ds = FillDataset(USP_PICKUPS, TBL_PICKUPS, new object[] { client, division, startDate.ToString("yyyy-MM-dd"), endDate.ToString("yyyy-MM-dd"), vendor }); if (ds.Tables[TBL_PICKUPS].Rows.Count != 0) { pickups.Merge(ds); } for (int i = 0; i < pickups.PickupViewTable.Rows.Count; i++) { pickups.PickupViewTable[i].ManifestNumbers = pickups.PickupViewTable[i].ManifestNumbers.Replace(",", ", "); pickups.PickupViewTable[i].TrailerNumbers = pickups.PickupViewTable[i].TrailerNumbers.Replace(",", ", "); } } catch (ApplicationException ex) { throw ex; } catch (Exception ex) { throw new ApplicationException("Unexpected exception creating pickup list.", ex); } return(pickups); }
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(); PickupDS ds = new PickupDS(); 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 = "PickupTableDataTable"; 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); }