From 4e2ad7727f364f12665ba6e710845b59b6d1c120 Mon Sep 17 00:00:00 2001 From: Bobbie Hodgetts Date: Tue, 18 Feb 2020 11:49:19 +0000 Subject: [PATCH] Feature: Purchase order add/edit & export to Xero invoice --- .../BealeEngDataSet.Designer.cs | 7879 ----------------- .../BealeEngDataSet.xsc | 1 - .../BealeEngDataSet.xsd | 791 -- .../BealeEngDataSet.xss | 1 - .../BealeEngineering.Accounts.csproj | 31 +- .../ContactSelect.Designer.cs | 101 + .../ContactSelect.cs | 43 + .../ContactSelect.resx | 123 + .../Helper/FormDirtyTracker.cs | 69 + ...ring.Core.Model.Contact.Address.datasource | 10 + ...ring.Core.Model.Contact.Contact.datasource | 10 + ...ring.Core.Model.Project.Project.datasource | 10 + ...ect.ProjectWork+ProjectWorkItem.datasource | 10 + ....Core.Model.Project.ProjectWork.datasource | 10 + ...e.Model.Project.ProjectWorkItem.datasource | 10 + .../frmClientPurchaseOrder.Designer.cs | 373 +- .../frmClientPurchaseOrder.cs | 154 +- .../frmClientPurchaseOrder.resx | 8 +- .../frmMain.Designer.cs | 1373 ++- .../BealeEngineering.Accounts/frmMain.cs | 207 +- .../BealeEngineering.Accounts/frmMain.resx | 57 +- .../frmSaleInvoice.Designer.cs | 53 +- .../frmSaleInvoice.resx | 7 +- .../BealeEngineering.Core.csproj | 21 +- .../Data/CurrencyFormat.cs | 61 + .../Database/Client/CreatePurchaseOrder.cs | 131 + .../Client/CreatePurchaseOrderAllocation.cs | 47 +- .../Data/Database/Client/ReadPurchaseOrder.cs | 54 +- .../Client/ReadPurchaseOrderAllocation.cs | 25 +- .../Client/ReadPurchaseOrderHeader.cs | 19 +- .../Database/Client/UpdatePurchaseOrder.cs | 254 + .../Data/Database/Connection.cs | 8 +- .../Data/Database/Contact/ReadContactList.cs | 50 + .../Data/Database/Log/ReadDateTime.cs | 46 + .../Data/Database/Log/UpdateDateTime.cs | 44 + .../Data/Database/Project/ReadProject.cs | 113 + .../Data/Database/Project/ReadProjectWork.cs | 82 + .../Database/Project/ReadProjectWorkItem.cs | 86 + .../Data/Database/Sale/ReadInvoiceHeader.cs | 18 + .../Database/Sale/ReadNextInvoiceNumber.cs | 4 +- ...ceNumberFormat.cs => SaleInvoiceFormat.cs} | 12 +- .../Data/Xero/ReadXeroInvoiceFlatFile.cs | 2 +- .../Adapter/ExportXeroInvoiceFlatFileDTO.cs | 82 + ...atFile.cs => ImportXeroInvoiceFlatFile.cs} | 4 +- ...DTO.cs => ImportXeroInvoiceFlatFileDTO.cs} | 4 +- .../Logic/Client/PurchaseOrderAutoAllocate.cs | 4 +- .../Logic/Export/ExcelInvoiceFlatFile.cs | 53 + .../Logic/Export/XeroInvoiceFlatFile.cs | 26 +- .../Logic/Import/XeroInvoiceFlatFile.cs | 40 + .../Logic/Sale/SaleInvoiceAssign.cs | 31 +- .../Logic/Validate/CientPurchaseOrder.cs | 36 + .../Model/Client/PurchaseOrder.cs | 40 +- .../Model/Client/PurchaseOrderAllocation.cs | 6 +- .../Model/Client/PurchaseOrderHeader.cs | 17 +- .../Model/Contact/Contact.cs | 41 +- .../Model/Export/XeroInvoiceFlatFileDTO.cs | 78 + .../Model/Project/Project.cs | 36 + .../Model/Project/ProjectWork.cs | 50 + .../Model/Project/ProjectWorkItem.cs | 18 + .../Model/Project/ProjectWorkItemDetail.cs | 31 + .../Model/Sale/InvoiceHeader.cs | 2 +- .../Test/Export/FlatFile.cs | 2 +- 62 files changed, 3469 insertions(+), 9540 deletions(-) delete mode 100644 BealeEngineering/BealeEngineering.Accounts/BealeEngDataSet.Designer.cs delete mode 100644 BealeEngineering/BealeEngineering.Accounts/BealeEngDataSet.xsc delete mode 100644 BealeEngineering/BealeEngineering.Accounts/BealeEngDataSet.xsd delete mode 100644 BealeEngineering/BealeEngineering.Accounts/BealeEngDataSet.xss create mode 100644 BealeEngineering/BealeEngineering.Accounts/ContactSelect.Designer.cs create mode 100644 BealeEngineering/BealeEngineering.Accounts/ContactSelect.cs create mode 100644 BealeEngineering/BealeEngineering.Accounts/ContactSelect.resx create mode 100644 BealeEngineering/BealeEngineering.Accounts/Helper/FormDirtyTracker.cs create mode 100644 BealeEngineering/BealeEngineering.Accounts/Properties/DataSources/BealeEngineering.Core.Model.Contact.Address.datasource create mode 100644 BealeEngineering/BealeEngineering.Accounts/Properties/DataSources/BealeEngineering.Core.Model.Contact.Contact.datasource create mode 100644 BealeEngineering/BealeEngineering.Accounts/Properties/DataSources/BealeEngineering.Core.Model.Project.Project.datasource create mode 100644 BealeEngineering/BealeEngineering.Accounts/Properties/DataSources/BealeEngineering.Core.Model.Project.ProjectWork+ProjectWorkItem.datasource create mode 100644 BealeEngineering/BealeEngineering.Accounts/Properties/DataSources/BealeEngineering.Core.Model.Project.ProjectWork.datasource create mode 100644 BealeEngineering/BealeEngineering.Accounts/Properties/DataSources/BealeEngineering.Core.Model.Project.ProjectWorkItem.datasource create mode 100644 BealeEngineering/BealeEngineering.Core/Data/CurrencyFormat.cs create mode 100644 BealeEngineering/BealeEngineering.Core/Data/Database/Client/CreatePurchaseOrder.cs create mode 100644 BealeEngineering/BealeEngineering.Core/Data/Database/Client/UpdatePurchaseOrder.cs create mode 100644 BealeEngineering/BealeEngineering.Core/Data/Database/Contact/ReadContactList.cs create mode 100644 BealeEngineering/BealeEngineering.Core/Data/Database/Log/ReadDateTime.cs create mode 100644 BealeEngineering/BealeEngineering.Core/Data/Database/Log/UpdateDateTime.cs create mode 100644 BealeEngineering/BealeEngineering.Core/Data/Database/Project/ReadProject.cs create mode 100644 BealeEngineering/BealeEngineering.Core/Data/Database/Project/ReadProjectWork.cs create mode 100644 BealeEngineering/BealeEngineering.Core/Data/Database/Project/ReadProjectWorkItem.cs rename BealeEngineering/BealeEngineering.Core/Data/{SaleInvoiceNumberFormat.cs => SaleInvoiceFormat.cs} (69%) create mode 100644 BealeEngineering/BealeEngineering.Core/Logic/Adapter/ExportXeroInvoiceFlatFileDTO.cs rename BealeEngineering/BealeEngineering.Core/Logic/Adapter/{XeroInvoiceFlatFile.cs => ImportXeroInvoiceFlatFile.cs} (98%) rename BealeEngineering/BealeEngineering.Core/Logic/Adapter/{XeroInvoiceFlatFileDTO.cs => ImportXeroInvoiceFlatFileDTO.cs} (98%) create mode 100644 BealeEngineering/BealeEngineering.Core/Logic/Export/ExcelInvoiceFlatFile.cs create mode 100644 BealeEngineering/BealeEngineering.Core/Logic/Validate/CientPurchaseOrder.cs create mode 100644 BealeEngineering/BealeEngineering.Core/Model/Export/XeroInvoiceFlatFileDTO.cs create mode 100644 BealeEngineering/BealeEngineering.Core/Model/Project/Project.cs create mode 100644 BealeEngineering/BealeEngineering.Core/Model/Project/ProjectWork.cs create mode 100644 BealeEngineering/BealeEngineering.Core/Model/Project/ProjectWorkItem.cs create mode 100644 BealeEngineering/BealeEngineering.Core/Model/Project/ProjectWorkItemDetail.cs diff --git a/BealeEngineering/BealeEngineering.Accounts/BealeEngDataSet.Designer.cs b/BealeEngineering/BealeEngineering.Accounts/BealeEngDataSet.Designer.cs deleted file mode 100644 index 6a69add..0000000 --- a/BealeEngineering/BealeEngineering.Accounts/BealeEngDataSet.Designer.cs +++ /dev/null @@ -1,7879 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// Runtime Version:4.0.30319.42000 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -#pragma warning disable 1591 - -namespace BealeEngineering.Accounts { - - - /// - ///Represents a strongly typed in-memory cache of data. - /// - [global::System.Serializable()] - [global::System.ComponentModel.DesignerCategoryAttribute("code")] - [global::System.ComponentModel.ToolboxItem(true)] - [global::System.Xml.Serialization.XmlSchemaProviderAttribute("GetTypedDataSetSchema")] - [global::System.Xml.Serialization.XmlRootAttribute("BealeEngDataSet")] - [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.DataSet")] - public partial class BealeEngDataSet : global::System.Data.DataSet { - - private ClientPurchaseOrderDataTable tableClientPurchaseOrder; - - private ClientPurchaseOrderLineDataTable tableClientPurchaseOrderLine; - - private ClientPurchaseOrderLineSalesInvoiceDataTable tableClientPurchaseOrderLineSalesInvoice; - - private ContactDataTable tableContact; - - private ProjectDataTable tableProject; - - private ProjectJobDataTable tableProjectJob; - - private global::System.Data.DataRelation relationFK_ClientPurchaseOrder_Contact; - - private global::System.Data.DataRelation relationFK_ClientPurchaseOrderLine_ClientPurchaseOrder; - - private global::System.Data.DataRelation relationFK_ClientPurchaseOrderLineSalesInvoice_ClientPurchaseOrderLine; - - private global::System.Data.DataRelation relationFK_Project_Contact; - - private global::System.Data.DataRelation relationFK_ProjectJob_Contact; - - private global::System.Data.DataRelation relationFK_ProjectJob_Project; - - private global::System.Data.SchemaSerializationMode _schemaSerializationMode = global::System.Data.SchemaSerializationMode.IncludeSchema; - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - public BealeEngDataSet() { - this.BeginInit(); - this.InitClass(); - global::System.ComponentModel.CollectionChangeEventHandler schemaChangedHandler = new global::System.ComponentModel.CollectionChangeEventHandler(this.SchemaChanged); - base.Tables.CollectionChanged += schemaChangedHandler; - base.Relations.CollectionChanged += schemaChangedHandler; - this.EndInit(); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - protected BealeEngDataSet(global::System.Runtime.Serialization.SerializationInfo info, global::System.Runtime.Serialization.StreamingContext context) : - base(info, context, false) { - if ((this.IsBinarySerialized(info, context) == true)) { - this.InitVars(false); - global::System.ComponentModel.CollectionChangeEventHandler schemaChangedHandler1 = new global::System.ComponentModel.CollectionChangeEventHandler(this.SchemaChanged); - this.Tables.CollectionChanged += schemaChangedHandler1; - this.Relations.CollectionChanged += schemaChangedHandler1; - return; - } - string strSchema = ((string)(info.GetValue("XmlSchema", typeof(string)))); - if ((this.DetermineSchemaSerializationMode(info, context) == global::System.Data.SchemaSerializationMode.IncludeSchema)) { - global::System.Data.DataSet ds = new global::System.Data.DataSet(); - ds.ReadXmlSchema(new global::System.Xml.XmlTextReader(new global::System.IO.StringReader(strSchema))); - if ((ds.Tables["ClientPurchaseOrder"] != null)) { - base.Tables.Add(new ClientPurchaseOrderDataTable(ds.Tables["ClientPurchaseOrder"])); - } - if ((ds.Tables["ClientPurchaseOrderLine"] != null)) { - base.Tables.Add(new ClientPurchaseOrderLineDataTable(ds.Tables["ClientPurchaseOrderLine"])); - } - if ((ds.Tables["ClientPurchaseOrderLineSalesInvoice"] != null)) { - base.Tables.Add(new ClientPurchaseOrderLineSalesInvoiceDataTable(ds.Tables["ClientPurchaseOrderLineSalesInvoice"])); - } - if ((ds.Tables["Contact"] != null)) { - base.Tables.Add(new ContactDataTable(ds.Tables["Contact"])); - } - if ((ds.Tables["Project"] != null)) { - base.Tables.Add(new ProjectDataTable(ds.Tables["Project"])); - } - if ((ds.Tables["ProjectJob"] != null)) { - base.Tables.Add(new ProjectJobDataTable(ds.Tables["ProjectJob"])); - } - this.DataSetName = ds.DataSetName; - this.Prefix = ds.Prefix; - this.Namespace = ds.Namespace; - this.Locale = ds.Locale; - this.CaseSensitive = ds.CaseSensitive; - this.EnforceConstraints = ds.EnforceConstraints; - this.Merge(ds, false, global::System.Data.MissingSchemaAction.Add); - this.InitVars(); - } - else { - this.ReadXmlSchema(new global::System.Xml.XmlTextReader(new global::System.IO.StringReader(strSchema))); - } - this.GetSerializationData(info, context); - global::System.ComponentModel.CollectionChangeEventHandler schemaChangedHandler = new global::System.ComponentModel.CollectionChangeEventHandler(this.SchemaChanged); - base.Tables.CollectionChanged += schemaChangedHandler; - this.Relations.CollectionChanged += schemaChangedHandler; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - [global::System.ComponentModel.Browsable(false)] - [global::System.ComponentModel.DesignerSerializationVisibility(global::System.ComponentModel.DesignerSerializationVisibility.Content)] - public ClientPurchaseOrderDataTable ClientPurchaseOrder { - get { - return this.tableClientPurchaseOrder; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - [global::System.ComponentModel.Browsable(false)] - [global::System.ComponentModel.DesignerSerializationVisibility(global::System.ComponentModel.DesignerSerializationVisibility.Content)] - public ClientPurchaseOrderLineDataTable ClientPurchaseOrderLine { - get { - return this.tableClientPurchaseOrderLine; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - [global::System.ComponentModel.Browsable(false)] - [global::System.ComponentModel.DesignerSerializationVisibility(global::System.ComponentModel.DesignerSerializationVisibility.Content)] - public ClientPurchaseOrderLineSalesInvoiceDataTable ClientPurchaseOrderLineSalesInvoice { - get { - return this.tableClientPurchaseOrderLineSalesInvoice; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - [global::System.ComponentModel.Browsable(false)] - [global::System.ComponentModel.DesignerSerializationVisibility(global::System.ComponentModel.DesignerSerializationVisibility.Content)] - public ContactDataTable Contact { - get { - return this.tableContact; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - [global::System.ComponentModel.Browsable(false)] - [global::System.ComponentModel.DesignerSerializationVisibility(global::System.ComponentModel.DesignerSerializationVisibility.Content)] - public ProjectDataTable Project { - get { - return this.tableProject; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - [global::System.ComponentModel.Browsable(false)] - [global::System.ComponentModel.DesignerSerializationVisibility(global::System.ComponentModel.DesignerSerializationVisibility.Content)] - public ProjectJobDataTable ProjectJob { - get { - return this.tableProjectJob; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - [global::System.ComponentModel.BrowsableAttribute(true)] - [global::System.ComponentModel.DesignerSerializationVisibilityAttribute(global::System.ComponentModel.DesignerSerializationVisibility.Visible)] - public override global::System.Data.SchemaSerializationMode SchemaSerializationMode { - get { - return this._schemaSerializationMode; - } - set { - this._schemaSerializationMode = value; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - [global::System.ComponentModel.DesignerSerializationVisibilityAttribute(global::System.ComponentModel.DesignerSerializationVisibility.Hidden)] - public new global::System.Data.DataTableCollection Tables { - get { - return base.Tables; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - [global::System.ComponentModel.DesignerSerializationVisibilityAttribute(global::System.ComponentModel.DesignerSerializationVisibility.Hidden)] - public new global::System.Data.DataRelationCollection Relations { - get { - return base.Relations; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - protected override void InitializeDerivedDataSet() { - this.BeginInit(); - this.InitClass(); - this.EndInit(); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - public override global::System.Data.DataSet Clone() { - BealeEngDataSet cln = ((BealeEngDataSet)(base.Clone())); - cln.InitVars(); - cln.SchemaSerializationMode = this.SchemaSerializationMode; - return cln; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - protected override bool ShouldSerializeTables() { - return false; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - protected override bool ShouldSerializeRelations() { - return false; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - protected override void ReadXmlSerializable(global::System.Xml.XmlReader reader) { - if ((this.DetermineSchemaSerializationMode(reader) == global::System.Data.SchemaSerializationMode.IncludeSchema)) { - this.Reset(); - global::System.Data.DataSet ds = new global::System.Data.DataSet(); - ds.ReadXml(reader); - if ((ds.Tables["ClientPurchaseOrder"] != null)) { - base.Tables.Add(new ClientPurchaseOrderDataTable(ds.Tables["ClientPurchaseOrder"])); - } - if ((ds.Tables["ClientPurchaseOrderLine"] != null)) { - base.Tables.Add(new ClientPurchaseOrderLineDataTable(ds.Tables["ClientPurchaseOrderLine"])); - } - if ((ds.Tables["ClientPurchaseOrderLineSalesInvoice"] != null)) { - base.Tables.Add(new ClientPurchaseOrderLineSalesInvoiceDataTable(ds.Tables["ClientPurchaseOrderLineSalesInvoice"])); - } - if ((ds.Tables["Contact"] != null)) { - base.Tables.Add(new ContactDataTable(ds.Tables["Contact"])); - } - if ((ds.Tables["Project"] != null)) { - base.Tables.Add(new ProjectDataTable(ds.Tables["Project"])); - } - if ((ds.Tables["ProjectJob"] != null)) { - base.Tables.Add(new ProjectJobDataTable(ds.Tables["ProjectJob"])); - } - this.DataSetName = ds.DataSetName; - this.Prefix = ds.Prefix; - this.Namespace = ds.Namespace; - this.Locale = ds.Locale; - this.CaseSensitive = ds.CaseSensitive; - this.EnforceConstraints = ds.EnforceConstraints; - this.Merge(ds, false, global::System.Data.MissingSchemaAction.Add); - this.InitVars(); - } - else { - this.ReadXml(reader); - this.InitVars(); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - protected override global::System.Xml.Schema.XmlSchema GetSchemaSerializable() { - global::System.IO.MemoryStream stream = new global::System.IO.MemoryStream(); - this.WriteXmlSchema(new global::System.Xml.XmlTextWriter(stream, null)); - stream.Position = 0; - return global::System.Xml.Schema.XmlSchema.Read(new global::System.Xml.XmlTextReader(stream), null); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - internal void InitVars() { - this.InitVars(true); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - internal void InitVars(bool initTable) { - this.tableClientPurchaseOrder = ((ClientPurchaseOrderDataTable)(base.Tables["ClientPurchaseOrder"])); - if ((initTable == true)) { - if ((this.tableClientPurchaseOrder != null)) { - this.tableClientPurchaseOrder.InitVars(); - } - } - this.tableClientPurchaseOrderLine = ((ClientPurchaseOrderLineDataTable)(base.Tables["ClientPurchaseOrderLine"])); - if ((initTable == true)) { - if ((this.tableClientPurchaseOrderLine != null)) { - this.tableClientPurchaseOrderLine.InitVars(); - } - } - this.tableClientPurchaseOrderLineSalesInvoice = ((ClientPurchaseOrderLineSalesInvoiceDataTable)(base.Tables["ClientPurchaseOrderLineSalesInvoice"])); - if ((initTable == true)) { - if ((this.tableClientPurchaseOrderLineSalesInvoice != null)) { - this.tableClientPurchaseOrderLineSalesInvoice.InitVars(); - } - } - this.tableContact = ((ContactDataTable)(base.Tables["Contact"])); - if ((initTable == true)) { - if ((this.tableContact != null)) { - this.tableContact.InitVars(); - } - } - this.tableProject = ((ProjectDataTable)(base.Tables["Project"])); - if ((initTable == true)) { - if ((this.tableProject != null)) { - this.tableProject.InitVars(); - } - } - this.tableProjectJob = ((ProjectJobDataTable)(base.Tables["ProjectJob"])); - if ((initTable == true)) { - if ((this.tableProjectJob != null)) { - this.tableProjectJob.InitVars(); - } - } - this.relationFK_ClientPurchaseOrder_Contact = this.Relations["FK_ClientPurchaseOrder_Contact"]; - this.relationFK_ClientPurchaseOrderLine_ClientPurchaseOrder = this.Relations["FK_ClientPurchaseOrderLine_ClientPurchaseOrder"]; - this.relationFK_ClientPurchaseOrderLineSalesInvoice_ClientPurchaseOrderLine = this.Relations["FK_ClientPurchaseOrderLineSalesInvoice_ClientPurchaseOrderLine"]; - this.relationFK_Project_Contact = this.Relations["FK_Project_Contact"]; - this.relationFK_ProjectJob_Contact = this.Relations["FK_ProjectJob_Contact"]; - this.relationFK_ProjectJob_Project = this.Relations["FK_ProjectJob_Project"]; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - private void InitClass() { - this.DataSetName = "BealeEngDataSet"; - this.Prefix = ""; - this.Namespace = "http://tempuri.org/BealeEngDataSet.xsd"; - this.EnforceConstraints = true; - this.SchemaSerializationMode = global::System.Data.SchemaSerializationMode.IncludeSchema; - this.tableClientPurchaseOrder = new ClientPurchaseOrderDataTable(); - base.Tables.Add(this.tableClientPurchaseOrder); - this.tableClientPurchaseOrderLine = new ClientPurchaseOrderLineDataTable(); - base.Tables.Add(this.tableClientPurchaseOrderLine); - this.tableClientPurchaseOrderLineSalesInvoice = new ClientPurchaseOrderLineSalesInvoiceDataTable(); - base.Tables.Add(this.tableClientPurchaseOrderLineSalesInvoice); - this.tableContact = new ContactDataTable(); - base.Tables.Add(this.tableContact); - this.tableProject = new ProjectDataTable(); - base.Tables.Add(this.tableProject); - this.tableProjectJob = new ProjectJobDataTable(); - base.Tables.Add(this.tableProjectJob); - this.relationFK_ClientPurchaseOrder_Contact = new global::System.Data.DataRelation("FK_ClientPurchaseOrder_Contact", new global::System.Data.DataColumn[] { - this.tableContact.ContactIDColumn}, new global::System.Data.DataColumn[] { - this.tableClientPurchaseOrder.ContactIDColumn}, false); - this.Relations.Add(this.relationFK_ClientPurchaseOrder_Contact); - this.relationFK_ClientPurchaseOrderLine_ClientPurchaseOrder = new global::System.Data.DataRelation("FK_ClientPurchaseOrderLine_ClientPurchaseOrder", new global::System.Data.DataColumn[] { - this.tableClientPurchaseOrder.ClientPurchaseOrderIDColumn}, new global::System.Data.DataColumn[] { - this.tableClientPurchaseOrderLine.ClientPurchaseOrderIDColumn}, false); - this.Relations.Add(this.relationFK_ClientPurchaseOrderLine_ClientPurchaseOrder); - this.relationFK_ClientPurchaseOrderLineSalesInvoice_ClientPurchaseOrderLine = new global::System.Data.DataRelation("FK_ClientPurchaseOrderLineSalesInvoice_ClientPurchaseOrderLine", new global::System.Data.DataColumn[] { - this.tableClientPurchaseOrderLine.ClientPurchaseOrderLineIDColumn}, new global::System.Data.DataColumn[] { - this.tableClientPurchaseOrderLineSalesInvoice.ClientPurchaseOrderLineIDColumn}, false); - this.Relations.Add(this.relationFK_ClientPurchaseOrderLineSalesInvoice_ClientPurchaseOrderLine); - this.relationFK_Project_Contact = new global::System.Data.DataRelation("FK_Project_Contact", new global::System.Data.DataColumn[] { - this.tableContact.ContactIDColumn}, new global::System.Data.DataColumn[] { - this.tableProject.ContactIDColumn}, false); - this.Relations.Add(this.relationFK_Project_Contact); - this.relationFK_ProjectJob_Contact = new global::System.Data.DataRelation("FK_ProjectJob_Contact", new global::System.Data.DataColumn[] { - this.tableContact.ContactIDColumn}, new global::System.Data.DataColumn[] { - this.tableProjectJob.ContactIDColumn}, false); - this.Relations.Add(this.relationFK_ProjectJob_Contact); - this.relationFK_ProjectJob_Project = new global::System.Data.DataRelation("FK_ProjectJob_Project", new global::System.Data.DataColumn[] { - this.tableProject.ProjectIDColumn}, new global::System.Data.DataColumn[] { - this.tableProjectJob.ProjectIDColumn}, false); - this.Relations.Add(this.relationFK_ProjectJob_Project); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - private bool ShouldSerializeClientPurchaseOrder() { - return false; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - private bool ShouldSerializeClientPurchaseOrderLine() { - return false; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - private bool ShouldSerializeClientPurchaseOrderLineSalesInvoice() { - return false; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - private bool ShouldSerializeContact() { - return false; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - private bool ShouldSerializeProject() { - return false; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - private bool ShouldSerializeProjectJob() { - return false; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - private void SchemaChanged(object sender, global::System.ComponentModel.CollectionChangeEventArgs e) { - if ((e.Action == global::System.ComponentModel.CollectionChangeAction.Remove)) { - this.InitVars(); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - public static global::System.Xml.Schema.XmlSchemaComplexType GetTypedDataSetSchema(global::System.Xml.Schema.XmlSchemaSet xs) { - BealeEngDataSet ds = new BealeEngDataSet(); - 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; - } - - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - public delegate void ClientPurchaseOrderRowChangeEventHandler(object sender, ClientPurchaseOrderRowChangeEvent e); - - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - public delegate void ClientPurchaseOrderLineRowChangeEventHandler(object sender, ClientPurchaseOrderLineRowChangeEvent e); - - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - public delegate void ClientPurchaseOrderLineSalesInvoiceRowChangeEventHandler(object sender, ClientPurchaseOrderLineSalesInvoiceRowChangeEvent e); - - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - public delegate void ContactRowChangeEventHandler(object sender, ContactRowChangeEvent e); - - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - public delegate void ProjectRowChangeEventHandler(object sender, ProjectRowChangeEvent e); - - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - public delegate void ProjectJobRowChangeEventHandler(object sender, ProjectJobRowChangeEvent e); - - /// - ///Represents the strongly named DataTable class. - /// - [global::System.Serializable()] - [global::System.Xml.Serialization.XmlSchemaProviderAttribute("GetTypedTableSchema")] - public partial class ClientPurchaseOrderDataTable : global::System.Data.TypedTableBase { - - private global::System.Data.DataColumn columnClientPurchaseOrderID; - - private global::System.Data.DataColumn columnPurchaseOrderDate; - - private global::System.Data.DataColumn columnContactID; - - private global::System.Data.DataColumn columnClientReference; - - private global::System.Data.DataColumn columnRequestorEmail; - - private global::System.Data.DataColumn columnOrderTotal; - - private global::System.Data.DataColumn columnIsClosed; - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - public ClientPurchaseOrderDataTable() { - this.TableName = "ClientPurchaseOrder"; - this.BeginInit(); - this.InitClass(); - this.EndInit(); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - internal ClientPurchaseOrderDataTable(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", "16.0.0.0")] - protected ClientPurchaseOrderDataTable(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", "16.0.0.0")] - public global::System.Data.DataColumn ClientPurchaseOrderIDColumn { - get { - return this.columnClientPurchaseOrderID; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - public global::System.Data.DataColumn PurchaseOrderDateColumn { - get { - return this.columnPurchaseOrderDate; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - public global::System.Data.DataColumn ContactIDColumn { - get { - return this.columnContactID; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - public global::System.Data.DataColumn ClientReferenceColumn { - get { - return this.columnClientReference; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - public global::System.Data.DataColumn RequestorEmailColumn { - get { - return this.columnRequestorEmail; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - public global::System.Data.DataColumn OrderTotalColumn { - get { - return this.columnOrderTotal; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - public global::System.Data.DataColumn IsClosedColumn { - get { - return this.columnIsClosed; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.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", "16.0.0.0")] - public ClientPurchaseOrderRow this[int index] { - get { - return ((ClientPurchaseOrderRow)(this.Rows[index])); - } - } - - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - public event ClientPurchaseOrderRowChangeEventHandler ClientPurchaseOrderRowChanging; - - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - public event ClientPurchaseOrderRowChangeEventHandler ClientPurchaseOrderRowChanged; - - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - public event ClientPurchaseOrderRowChangeEventHandler ClientPurchaseOrderRowDeleting; - - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - public event ClientPurchaseOrderRowChangeEventHandler ClientPurchaseOrderRowDeleted; - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - public void AddClientPurchaseOrderRow(ClientPurchaseOrderRow row) { - this.Rows.Add(row); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - public ClientPurchaseOrderRow AddClientPurchaseOrderRow(System.DateTime PurchaseOrderDate, ContactRow parentContactRowByFK_ClientPurchaseOrder_Contact, string ClientReference, string RequestorEmail, decimal OrderTotal, bool IsClosed) { - ClientPurchaseOrderRow rowClientPurchaseOrderRow = ((ClientPurchaseOrderRow)(this.NewRow())); - object[] columnValuesArray = new object[] { - null, - PurchaseOrderDate, - null, - ClientReference, - RequestorEmail, - OrderTotal, - IsClosed}; - if ((parentContactRowByFK_ClientPurchaseOrder_Contact != null)) { - columnValuesArray[2] = parentContactRowByFK_ClientPurchaseOrder_Contact[0]; - } - rowClientPurchaseOrderRow.ItemArray = columnValuesArray; - this.Rows.Add(rowClientPurchaseOrderRow); - return rowClientPurchaseOrderRow; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - public ClientPurchaseOrderRow FindByClientPurchaseOrderID(int ClientPurchaseOrderID) { - return ((ClientPurchaseOrderRow)(this.Rows.Find(new object[] { - ClientPurchaseOrderID}))); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - public override global::System.Data.DataTable Clone() { - ClientPurchaseOrderDataTable cln = ((ClientPurchaseOrderDataTable)(base.Clone())); - cln.InitVars(); - return cln; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - protected override global::System.Data.DataTable CreateInstance() { - return new ClientPurchaseOrderDataTable(); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - internal void InitVars() { - this.columnClientPurchaseOrderID = base.Columns["ClientPurchaseOrderID"]; - this.columnPurchaseOrderDate = base.Columns["PurchaseOrderDate"]; - this.columnContactID = base.Columns["ContactID"]; - this.columnClientReference = base.Columns["ClientReference"]; - this.columnRequestorEmail = base.Columns["RequestorEmail"]; - this.columnOrderTotal = base.Columns["OrderTotal"]; - this.columnIsClosed = base.Columns["IsClosed"]; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - private void InitClass() { - this.columnClientPurchaseOrderID = new global::System.Data.DataColumn("ClientPurchaseOrderID", typeof(int), null, global::System.Data.MappingType.Element); - base.Columns.Add(this.columnClientPurchaseOrderID); - this.columnPurchaseOrderDate = new global::System.Data.DataColumn("PurchaseOrderDate", typeof(global::System.DateTime), null, global::System.Data.MappingType.Element); - base.Columns.Add(this.columnPurchaseOrderDate); - this.columnContactID = new global::System.Data.DataColumn("ContactID", typeof(int), null, global::System.Data.MappingType.Element); - base.Columns.Add(this.columnContactID); - this.columnClientReference = new global::System.Data.DataColumn("ClientReference", typeof(string), null, global::System.Data.MappingType.Element); - base.Columns.Add(this.columnClientReference); - this.columnRequestorEmail = new global::System.Data.DataColumn("RequestorEmail", typeof(string), null, global::System.Data.MappingType.Element); - base.Columns.Add(this.columnRequestorEmail); - this.columnOrderTotal = new global::System.Data.DataColumn("OrderTotal", typeof(decimal), null, global::System.Data.MappingType.Element); - base.Columns.Add(this.columnOrderTotal); - this.columnIsClosed = new global::System.Data.DataColumn("IsClosed", typeof(bool), null, global::System.Data.MappingType.Element); - base.Columns.Add(this.columnIsClosed); - this.Constraints.Add(new global::System.Data.UniqueConstraint("Constraint1", new global::System.Data.DataColumn[] { - this.columnClientPurchaseOrderID}, true)); - this.columnClientPurchaseOrderID.AutoIncrement = true; - this.columnClientPurchaseOrderID.AutoIncrementSeed = -1; - this.columnClientPurchaseOrderID.AutoIncrementStep = -1; - this.columnClientPurchaseOrderID.AllowDBNull = false; - this.columnClientPurchaseOrderID.ReadOnly = true; - this.columnClientPurchaseOrderID.Unique = true; - this.columnPurchaseOrderDate.AllowDBNull = false; - this.columnContactID.AllowDBNull = false; - this.columnClientReference.AllowDBNull = false; - this.columnClientReference.MaxLength = 50; - this.columnRequestorEmail.MaxLength = 150; - this.columnIsClosed.AllowDBNull = false; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - public ClientPurchaseOrderRow NewClientPurchaseOrderRow() { - return ((ClientPurchaseOrderRow)(this.NewRow())); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - protected override global::System.Data.DataRow NewRowFromBuilder(global::System.Data.DataRowBuilder builder) { - return new ClientPurchaseOrderRow(builder); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - protected override global::System.Type GetRowType() { - return typeof(ClientPurchaseOrderRow); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - protected override void OnRowChanged(global::System.Data.DataRowChangeEventArgs e) { - base.OnRowChanged(e); - if ((this.ClientPurchaseOrderRowChanged != null)) { - this.ClientPurchaseOrderRowChanged(this, new ClientPurchaseOrderRowChangeEvent(((ClientPurchaseOrderRow)(e.Row)), e.Action)); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - protected override void OnRowChanging(global::System.Data.DataRowChangeEventArgs e) { - base.OnRowChanging(e); - if ((this.ClientPurchaseOrderRowChanging != null)) { - this.ClientPurchaseOrderRowChanging(this, new ClientPurchaseOrderRowChangeEvent(((ClientPurchaseOrderRow)(e.Row)), e.Action)); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - protected override void OnRowDeleted(global::System.Data.DataRowChangeEventArgs e) { - base.OnRowDeleted(e); - if ((this.ClientPurchaseOrderRowDeleted != null)) { - this.ClientPurchaseOrderRowDeleted(this, new ClientPurchaseOrderRowChangeEvent(((ClientPurchaseOrderRow)(e.Row)), e.Action)); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - protected override void OnRowDeleting(global::System.Data.DataRowChangeEventArgs e) { - base.OnRowDeleting(e); - if ((this.ClientPurchaseOrderRowDeleting != null)) { - this.ClientPurchaseOrderRowDeleting(this, new ClientPurchaseOrderRowChangeEvent(((ClientPurchaseOrderRow)(e.Row)), e.Action)); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - public void RemoveClientPurchaseOrderRow(ClientPurchaseOrderRow row) { - this.Rows.Remove(row); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.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(); - BealeEngDataSet ds = new BealeEngDataSet(); - 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 = "ClientPurchaseOrderDataTable"; - 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 the strongly named DataTable class. - /// - [global::System.Serializable()] - [global::System.Xml.Serialization.XmlSchemaProviderAttribute("GetTypedTableSchema")] - public partial class ClientPurchaseOrderLineDataTable : global::System.Data.TypedTableBase { - - private global::System.Data.DataColumn columnClientPurchaseOrderLineID; - - private global::System.Data.DataColumn columnClientPurchaseOrderID; - - private global::System.Data.DataColumn columnLineNumber; - - private global::System.Data.DataColumn columnProjectJobID; - - private global::System.Data.DataColumn columnDescription; - - private global::System.Data.DataColumn columnLineNetAmount; - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - public ClientPurchaseOrderLineDataTable() { - this.TableName = "ClientPurchaseOrderLine"; - this.BeginInit(); - this.InitClass(); - this.EndInit(); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - internal ClientPurchaseOrderLineDataTable(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", "16.0.0.0")] - protected ClientPurchaseOrderLineDataTable(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", "16.0.0.0")] - public global::System.Data.DataColumn ClientPurchaseOrderLineIDColumn { - get { - return this.columnClientPurchaseOrderLineID; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - public global::System.Data.DataColumn ClientPurchaseOrderIDColumn { - get { - return this.columnClientPurchaseOrderID; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - public global::System.Data.DataColumn LineNumberColumn { - get { - return this.columnLineNumber; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - public global::System.Data.DataColumn ProjectJobIDColumn { - get { - return this.columnProjectJobID; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - public global::System.Data.DataColumn DescriptionColumn { - get { - return this.columnDescription; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - public global::System.Data.DataColumn LineNetAmountColumn { - get { - return this.columnLineNetAmount; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.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", "16.0.0.0")] - public ClientPurchaseOrderLineRow this[int index] { - get { - return ((ClientPurchaseOrderLineRow)(this.Rows[index])); - } - } - - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - public event ClientPurchaseOrderLineRowChangeEventHandler ClientPurchaseOrderLineRowChanging; - - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - public event ClientPurchaseOrderLineRowChangeEventHandler ClientPurchaseOrderLineRowChanged; - - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - public event ClientPurchaseOrderLineRowChangeEventHandler ClientPurchaseOrderLineRowDeleting; - - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - public event ClientPurchaseOrderLineRowChangeEventHandler ClientPurchaseOrderLineRowDeleted; - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - public void AddClientPurchaseOrderLineRow(ClientPurchaseOrderLineRow row) { - this.Rows.Add(row); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - public ClientPurchaseOrderLineRow AddClientPurchaseOrderLineRow(ClientPurchaseOrderRow parentClientPurchaseOrderRowByFK_ClientPurchaseOrderLine_ClientPurchaseOrder, int LineNumber, int ProjectJobID, string Description, decimal LineNetAmount) { - ClientPurchaseOrderLineRow rowClientPurchaseOrderLineRow = ((ClientPurchaseOrderLineRow)(this.NewRow())); - object[] columnValuesArray = new object[] { - null, - null, - LineNumber, - ProjectJobID, - Description, - LineNetAmount}; - if ((parentClientPurchaseOrderRowByFK_ClientPurchaseOrderLine_ClientPurchaseOrder != null)) { - columnValuesArray[1] = parentClientPurchaseOrderRowByFK_ClientPurchaseOrderLine_ClientPurchaseOrder[0]; - } - rowClientPurchaseOrderLineRow.ItemArray = columnValuesArray; - this.Rows.Add(rowClientPurchaseOrderLineRow); - return rowClientPurchaseOrderLineRow; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - public ClientPurchaseOrderLineRow FindByClientPurchaseOrderLineID(int ClientPurchaseOrderLineID) { - return ((ClientPurchaseOrderLineRow)(this.Rows.Find(new object[] { - ClientPurchaseOrderLineID}))); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - public override global::System.Data.DataTable Clone() { - ClientPurchaseOrderLineDataTable cln = ((ClientPurchaseOrderLineDataTable)(base.Clone())); - cln.InitVars(); - return cln; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - protected override global::System.Data.DataTable CreateInstance() { - return new ClientPurchaseOrderLineDataTable(); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - internal void InitVars() { - this.columnClientPurchaseOrderLineID = base.Columns["ClientPurchaseOrderLineID"]; - this.columnClientPurchaseOrderID = base.Columns["ClientPurchaseOrderID"]; - this.columnLineNumber = base.Columns["LineNumber"]; - this.columnProjectJobID = base.Columns["ProjectJobID"]; - this.columnDescription = base.Columns["Description"]; - this.columnLineNetAmount = base.Columns["LineNetAmount"]; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - private void InitClass() { - this.columnClientPurchaseOrderLineID = new global::System.Data.DataColumn("ClientPurchaseOrderLineID", typeof(int), null, global::System.Data.MappingType.Element); - base.Columns.Add(this.columnClientPurchaseOrderLineID); - this.columnClientPurchaseOrderID = new global::System.Data.DataColumn("ClientPurchaseOrderID", typeof(int), null, global::System.Data.MappingType.Element); - base.Columns.Add(this.columnClientPurchaseOrderID); - this.columnLineNumber = new global::System.Data.DataColumn("LineNumber", typeof(int), null, global::System.Data.MappingType.Element); - base.Columns.Add(this.columnLineNumber); - this.columnProjectJobID = new global::System.Data.DataColumn("ProjectJobID", typeof(int), null, global::System.Data.MappingType.Element); - base.Columns.Add(this.columnProjectJobID); - this.columnDescription = new global::System.Data.DataColumn("Description", typeof(string), null, global::System.Data.MappingType.Element); - base.Columns.Add(this.columnDescription); - this.columnLineNetAmount = new global::System.Data.DataColumn("LineNetAmount", typeof(decimal), null, global::System.Data.MappingType.Element); - base.Columns.Add(this.columnLineNetAmount); - this.Constraints.Add(new global::System.Data.UniqueConstraint("Constraint1", new global::System.Data.DataColumn[] { - this.columnClientPurchaseOrderLineID}, true)); - this.columnClientPurchaseOrderLineID.AutoIncrement = true; - this.columnClientPurchaseOrderLineID.AutoIncrementSeed = -1; - this.columnClientPurchaseOrderLineID.AutoIncrementStep = -1; - this.columnClientPurchaseOrderLineID.AllowDBNull = false; - this.columnClientPurchaseOrderLineID.ReadOnly = true; - this.columnClientPurchaseOrderLineID.Unique = true; - this.columnClientPurchaseOrderID.AllowDBNull = false; - this.columnLineNumber.AllowDBNull = false; - this.columnProjectJobID.AllowDBNull = false; - this.columnDescription.MaxLength = 250; - this.columnLineNetAmount.AllowDBNull = false; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - public ClientPurchaseOrderLineRow NewClientPurchaseOrderLineRow() { - return ((ClientPurchaseOrderLineRow)(this.NewRow())); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - protected override global::System.Data.DataRow NewRowFromBuilder(global::System.Data.DataRowBuilder builder) { - return new ClientPurchaseOrderLineRow(builder); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - protected override global::System.Type GetRowType() { - return typeof(ClientPurchaseOrderLineRow); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - protected override void OnRowChanged(global::System.Data.DataRowChangeEventArgs e) { - base.OnRowChanged(e); - if ((this.ClientPurchaseOrderLineRowChanged != null)) { - this.ClientPurchaseOrderLineRowChanged(this, new ClientPurchaseOrderLineRowChangeEvent(((ClientPurchaseOrderLineRow)(e.Row)), e.Action)); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - protected override void OnRowChanging(global::System.Data.DataRowChangeEventArgs e) { - base.OnRowChanging(e); - if ((this.ClientPurchaseOrderLineRowChanging != null)) { - this.ClientPurchaseOrderLineRowChanging(this, new ClientPurchaseOrderLineRowChangeEvent(((ClientPurchaseOrderLineRow)(e.Row)), e.Action)); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - protected override void OnRowDeleted(global::System.Data.DataRowChangeEventArgs e) { - base.OnRowDeleted(e); - if ((this.ClientPurchaseOrderLineRowDeleted != null)) { - this.ClientPurchaseOrderLineRowDeleted(this, new ClientPurchaseOrderLineRowChangeEvent(((ClientPurchaseOrderLineRow)(e.Row)), e.Action)); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - protected override void OnRowDeleting(global::System.Data.DataRowChangeEventArgs e) { - base.OnRowDeleting(e); - if ((this.ClientPurchaseOrderLineRowDeleting != null)) { - this.ClientPurchaseOrderLineRowDeleting(this, new ClientPurchaseOrderLineRowChangeEvent(((ClientPurchaseOrderLineRow)(e.Row)), e.Action)); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - public void RemoveClientPurchaseOrderLineRow(ClientPurchaseOrderLineRow row) { - this.Rows.Remove(row); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.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(); - BealeEngDataSet ds = new BealeEngDataSet(); - 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 = "ClientPurchaseOrderLineDataTable"; - 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 the strongly named DataTable class. - /// - [global::System.Serializable()] - [global::System.Xml.Serialization.XmlSchemaProviderAttribute("GetTypedTableSchema")] - public partial class ClientPurchaseOrderLineSalesInvoiceDataTable : global::System.Data.TypedTableBase { - - private global::System.Data.DataColumn columnClientPurchaseOrderLineID; - - private global::System.Data.DataColumn columnSaleInvoiceID; - - private global::System.Data.DataColumn columnIsApproved; - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - public ClientPurchaseOrderLineSalesInvoiceDataTable() { - this.TableName = "ClientPurchaseOrderLineSalesInvoice"; - this.BeginInit(); - this.InitClass(); - this.EndInit(); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - internal ClientPurchaseOrderLineSalesInvoiceDataTable(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", "16.0.0.0")] - protected ClientPurchaseOrderLineSalesInvoiceDataTable(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", "16.0.0.0")] - public global::System.Data.DataColumn ClientPurchaseOrderLineIDColumn { - get { - return this.columnClientPurchaseOrderLineID; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - public global::System.Data.DataColumn SaleInvoiceIDColumn { - get { - return this.columnSaleInvoiceID; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - public global::System.Data.DataColumn IsApprovedColumn { - get { - return this.columnIsApproved; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.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", "16.0.0.0")] - public ClientPurchaseOrderLineSalesInvoiceRow this[int index] { - get { - return ((ClientPurchaseOrderLineSalesInvoiceRow)(this.Rows[index])); - } - } - - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - public event ClientPurchaseOrderLineSalesInvoiceRowChangeEventHandler ClientPurchaseOrderLineSalesInvoiceRowChanging; - - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - public event ClientPurchaseOrderLineSalesInvoiceRowChangeEventHandler ClientPurchaseOrderLineSalesInvoiceRowChanged; - - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - public event ClientPurchaseOrderLineSalesInvoiceRowChangeEventHandler ClientPurchaseOrderLineSalesInvoiceRowDeleting; - - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - public event ClientPurchaseOrderLineSalesInvoiceRowChangeEventHandler ClientPurchaseOrderLineSalesInvoiceRowDeleted; - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - public void AddClientPurchaseOrderLineSalesInvoiceRow(ClientPurchaseOrderLineSalesInvoiceRow row) { - this.Rows.Add(row); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - public ClientPurchaseOrderLineSalesInvoiceRow AddClientPurchaseOrderLineSalesInvoiceRow(ClientPurchaseOrderLineRow parentClientPurchaseOrderLineRowByFK_ClientPurchaseOrderLineSalesInvoice_ClientPurchaseOrderLine, int SaleInvoiceID, bool IsApproved) { - ClientPurchaseOrderLineSalesInvoiceRow rowClientPurchaseOrderLineSalesInvoiceRow = ((ClientPurchaseOrderLineSalesInvoiceRow)(this.NewRow())); - object[] columnValuesArray = new object[] { - null, - SaleInvoiceID, - IsApproved}; - if ((parentClientPurchaseOrderLineRowByFK_ClientPurchaseOrderLineSalesInvoice_ClientPurchaseOrderLine != null)) { - columnValuesArray[0] = parentClientPurchaseOrderLineRowByFK_ClientPurchaseOrderLineSalesInvoice_ClientPurchaseOrderLine[0]; - } - rowClientPurchaseOrderLineSalesInvoiceRow.ItemArray = columnValuesArray; - this.Rows.Add(rowClientPurchaseOrderLineSalesInvoiceRow); - return rowClientPurchaseOrderLineSalesInvoiceRow; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - public ClientPurchaseOrderLineSalesInvoiceRow FindBySaleInvoiceID(int SaleInvoiceID) { - return ((ClientPurchaseOrderLineSalesInvoiceRow)(this.Rows.Find(new object[] { - SaleInvoiceID}))); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - public override global::System.Data.DataTable Clone() { - ClientPurchaseOrderLineSalesInvoiceDataTable cln = ((ClientPurchaseOrderLineSalesInvoiceDataTable)(base.Clone())); - cln.InitVars(); - return cln; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - protected override global::System.Data.DataTable CreateInstance() { - return new ClientPurchaseOrderLineSalesInvoiceDataTable(); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - internal void InitVars() { - this.columnClientPurchaseOrderLineID = base.Columns["ClientPurchaseOrderLineID"]; - this.columnSaleInvoiceID = base.Columns["SaleInvoiceID"]; - this.columnIsApproved = base.Columns["IsApproved"]; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - private void InitClass() { - this.columnClientPurchaseOrderLineID = new global::System.Data.DataColumn("ClientPurchaseOrderLineID", typeof(int), null, global::System.Data.MappingType.Element); - base.Columns.Add(this.columnClientPurchaseOrderLineID); - this.columnSaleInvoiceID = new global::System.Data.DataColumn("SaleInvoiceID", typeof(int), null, global::System.Data.MappingType.Element); - base.Columns.Add(this.columnSaleInvoiceID); - this.columnIsApproved = new global::System.Data.DataColumn("IsApproved", typeof(bool), null, global::System.Data.MappingType.Element); - base.Columns.Add(this.columnIsApproved); - this.Constraints.Add(new global::System.Data.UniqueConstraint("Constraint1", new global::System.Data.DataColumn[] { - this.columnSaleInvoiceID}, true)); - this.columnClientPurchaseOrderLineID.AllowDBNull = false; - this.columnSaleInvoiceID.AllowDBNull = false; - this.columnSaleInvoiceID.Unique = true; - this.columnIsApproved.AllowDBNull = false; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - public ClientPurchaseOrderLineSalesInvoiceRow NewClientPurchaseOrderLineSalesInvoiceRow() { - return ((ClientPurchaseOrderLineSalesInvoiceRow)(this.NewRow())); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - protected override global::System.Data.DataRow NewRowFromBuilder(global::System.Data.DataRowBuilder builder) { - return new ClientPurchaseOrderLineSalesInvoiceRow(builder); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - protected override global::System.Type GetRowType() { - return typeof(ClientPurchaseOrderLineSalesInvoiceRow); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - protected override void OnRowChanged(global::System.Data.DataRowChangeEventArgs e) { - base.OnRowChanged(e); - if ((this.ClientPurchaseOrderLineSalesInvoiceRowChanged != null)) { - this.ClientPurchaseOrderLineSalesInvoiceRowChanged(this, new ClientPurchaseOrderLineSalesInvoiceRowChangeEvent(((ClientPurchaseOrderLineSalesInvoiceRow)(e.Row)), e.Action)); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - protected override void OnRowChanging(global::System.Data.DataRowChangeEventArgs e) { - base.OnRowChanging(e); - if ((this.ClientPurchaseOrderLineSalesInvoiceRowChanging != null)) { - this.ClientPurchaseOrderLineSalesInvoiceRowChanging(this, new ClientPurchaseOrderLineSalesInvoiceRowChangeEvent(((ClientPurchaseOrderLineSalesInvoiceRow)(e.Row)), e.Action)); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - protected override void OnRowDeleted(global::System.Data.DataRowChangeEventArgs e) { - base.OnRowDeleted(e); - if ((this.ClientPurchaseOrderLineSalesInvoiceRowDeleted != null)) { - this.ClientPurchaseOrderLineSalesInvoiceRowDeleted(this, new ClientPurchaseOrderLineSalesInvoiceRowChangeEvent(((ClientPurchaseOrderLineSalesInvoiceRow)(e.Row)), e.Action)); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - protected override void OnRowDeleting(global::System.Data.DataRowChangeEventArgs e) { - base.OnRowDeleting(e); - if ((this.ClientPurchaseOrderLineSalesInvoiceRowDeleting != null)) { - this.ClientPurchaseOrderLineSalesInvoiceRowDeleting(this, new ClientPurchaseOrderLineSalesInvoiceRowChangeEvent(((ClientPurchaseOrderLineSalesInvoiceRow)(e.Row)), e.Action)); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - public void RemoveClientPurchaseOrderLineSalesInvoiceRow(ClientPurchaseOrderLineSalesInvoiceRow row) { - this.Rows.Remove(row); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.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(); - BealeEngDataSet ds = new BealeEngDataSet(); - 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 = "ClientPurchaseOrderLineSalesInvoiceDataTable"; - 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 the strongly named DataTable class. - /// - [global::System.Serializable()] - [global::System.Xml.Serialization.XmlSchemaProviderAttribute("GetTypedTableSchema")] - public partial class ContactDataTable : global::System.Data.TypedTableBase { - - private global::System.Data.DataColumn columnContactID; - - private global::System.Data.DataColumn columnContactName; - - private global::System.Data.DataColumn columnEmailAddress; - - private global::System.Data.DataColumn columnPrimaryPersonFirstName; - - private global::System.Data.DataColumn columnPrimaryPersonSurname; - - private global::System.Data.DataColumn columnPrimaryPersonEmail; - - private global::System.Data.DataColumn columnPOAddressLine1; - - private global::System.Data.DataColumn columnPOAddressLine2; - - private global::System.Data.DataColumn columnPOAddressLine3; - - private global::System.Data.DataColumn columnPOAddressLine4; - - private global::System.Data.DataColumn columnPOAddressCity; - - private global::System.Data.DataColumn columnPOAddressRegion; - - private global::System.Data.DataColumn columnPOAddressPostalCode; - - private global::System.Data.DataColumn columnPOAddressCountry; - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - public ContactDataTable() { - this.TableName = "Contact"; - this.BeginInit(); - this.InitClass(); - this.EndInit(); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - internal ContactDataTable(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", "16.0.0.0")] - protected ContactDataTable(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", "16.0.0.0")] - public global::System.Data.DataColumn ContactIDColumn { - get { - return this.columnContactID; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - public global::System.Data.DataColumn ContactNameColumn { - get { - return this.columnContactName; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - public global::System.Data.DataColumn EmailAddressColumn { - get { - return this.columnEmailAddress; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - public global::System.Data.DataColumn PrimaryPersonFirstNameColumn { - get { - return this.columnPrimaryPersonFirstName; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - public global::System.Data.DataColumn PrimaryPersonSurnameColumn { - get { - return this.columnPrimaryPersonSurname; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - public global::System.Data.DataColumn PrimaryPersonEmailColumn { - get { - return this.columnPrimaryPersonEmail; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - public global::System.Data.DataColumn POAddressLine1Column { - get { - return this.columnPOAddressLine1; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - public global::System.Data.DataColumn POAddressLine2Column { - get { - return this.columnPOAddressLine2; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - public global::System.Data.DataColumn POAddressLine3Column { - get { - return this.columnPOAddressLine3; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - public global::System.Data.DataColumn POAddressLine4Column { - get { - return this.columnPOAddressLine4; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - public global::System.Data.DataColumn POAddressCityColumn { - get { - return this.columnPOAddressCity; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - public global::System.Data.DataColumn POAddressRegionColumn { - get { - return this.columnPOAddressRegion; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - public global::System.Data.DataColumn POAddressPostalCodeColumn { - get { - return this.columnPOAddressPostalCode; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - public global::System.Data.DataColumn POAddressCountryColumn { - get { - return this.columnPOAddressCountry; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.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", "16.0.0.0")] - public ContactRow this[int index] { - get { - return ((ContactRow)(this.Rows[index])); - } - } - - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - public event ContactRowChangeEventHandler ContactRowChanging; - - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - public event ContactRowChangeEventHandler ContactRowChanged; - - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - public event ContactRowChangeEventHandler ContactRowDeleting; - - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - public event ContactRowChangeEventHandler ContactRowDeleted; - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - public void AddContactRow(ContactRow row) { - this.Rows.Add(row); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - public ContactRow AddContactRow(string ContactName, string EmailAddress, string PrimaryPersonFirstName, string PrimaryPersonSurname, string PrimaryPersonEmail, string POAddressLine1, string POAddressLine2, string POAddressLine3, string POAddressLine4, string POAddressCity, string POAddressRegion, string POAddressPostalCode, string POAddressCountry) { - ContactRow rowContactRow = ((ContactRow)(this.NewRow())); - object[] columnValuesArray = new object[] { - null, - ContactName, - EmailAddress, - PrimaryPersonFirstName, - PrimaryPersonSurname, - PrimaryPersonEmail, - POAddressLine1, - POAddressLine2, - POAddressLine3, - POAddressLine4, - POAddressCity, - POAddressRegion, - POAddressPostalCode, - POAddressCountry}; - rowContactRow.ItemArray = columnValuesArray; - this.Rows.Add(rowContactRow); - return rowContactRow; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - public ContactRow FindByContactID(int ContactID) { - return ((ContactRow)(this.Rows.Find(new object[] { - ContactID}))); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - public override global::System.Data.DataTable Clone() { - ContactDataTable cln = ((ContactDataTable)(base.Clone())); - cln.InitVars(); - return cln; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - protected override global::System.Data.DataTable CreateInstance() { - return new ContactDataTable(); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - internal void InitVars() { - this.columnContactID = base.Columns["ContactID"]; - this.columnContactName = base.Columns["ContactName"]; - this.columnEmailAddress = base.Columns["EmailAddress"]; - this.columnPrimaryPersonFirstName = base.Columns["PrimaryPersonFirstName"]; - this.columnPrimaryPersonSurname = base.Columns["PrimaryPersonSurname"]; - this.columnPrimaryPersonEmail = base.Columns["PrimaryPersonEmail"]; - this.columnPOAddressLine1 = base.Columns["POAddressLine1"]; - this.columnPOAddressLine2 = base.Columns["POAddressLine2"]; - this.columnPOAddressLine3 = base.Columns["POAddressLine3"]; - this.columnPOAddressLine4 = base.Columns["POAddressLine4"]; - this.columnPOAddressCity = base.Columns["POAddressCity"]; - this.columnPOAddressRegion = base.Columns["POAddressRegion"]; - this.columnPOAddressPostalCode = base.Columns["POAddressPostalCode"]; - this.columnPOAddressCountry = base.Columns["POAddressCountry"]; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - private void InitClass() { - this.columnContactID = new global::System.Data.DataColumn("ContactID", typeof(int), null, global::System.Data.MappingType.Element); - base.Columns.Add(this.columnContactID); - this.columnContactName = new global::System.Data.DataColumn("ContactName", typeof(string), null, global::System.Data.MappingType.Element); - base.Columns.Add(this.columnContactName); - this.columnEmailAddress = new global::System.Data.DataColumn("EmailAddress", typeof(string), null, global::System.Data.MappingType.Element); - base.Columns.Add(this.columnEmailAddress); - this.columnPrimaryPersonFirstName = new global::System.Data.DataColumn("PrimaryPersonFirstName", typeof(string), null, global::System.Data.MappingType.Element); - base.Columns.Add(this.columnPrimaryPersonFirstName); - this.columnPrimaryPersonSurname = new global::System.Data.DataColumn("PrimaryPersonSurname", typeof(string), null, global::System.Data.MappingType.Element); - base.Columns.Add(this.columnPrimaryPersonSurname); - this.columnPrimaryPersonEmail = new global::System.Data.DataColumn("PrimaryPersonEmail", typeof(string), null, global::System.Data.MappingType.Element); - base.Columns.Add(this.columnPrimaryPersonEmail); - this.columnPOAddressLine1 = new global::System.Data.DataColumn("POAddressLine1", typeof(string), null, global::System.Data.MappingType.Element); - base.Columns.Add(this.columnPOAddressLine1); - this.columnPOAddressLine2 = new global::System.Data.DataColumn("POAddressLine2", typeof(string), null, global::System.Data.MappingType.Element); - base.Columns.Add(this.columnPOAddressLine2); - this.columnPOAddressLine3 = new global::System.Data.DataColumn("POAddressLine3", typeof(string), null, global::System.Data.MappingType.Element); - base.Columns.Add(this.columnPOAddressLine3); - this.columnPOAddressLine4 = new global::System.Data.DataColumn("POAddressLine4", typeof(string), null, global::System.Data.MappingType.Element); - base.Columns.Add(this.columnPOAddressLine4); - this.columnPOAddressCity = new global::System.Data.DataColumn("POAddressCity", typeof(string), null, global::System.Data.MappingType.Element); - base.Columns.Add(this.columnPOAddressCity); - this.columnPOAddressRegion = new global::System.Data.DataColumn("POAddressRegion", typeof(string), null, global::System.Data.MappingType.Element); - base.Columns.Add(this.columnPOAddressRegion); - this.columnPOAddressPostalCode = new global::System.Data.DataColumn("POAddressPostalCode", typeof(string), null, global::System.Data.MappingType.Element); - base.Columns.Add(this.columnPOAddressPostalCode); - this.columnPOAddressCountry = new global::System.Data.DataColumn("POAddressCountry", typeof(string), null, global::System.Data.MappingType.Element); - base.Columns.Add(this.columnPOAddressCountry); - this.Constraints.Add(new global::System.Data.UniqueConstraint("Constraint1", new global::System.Data.DataColumn[] { - this.columnContactID}, true)); - this.columnContactID.AutoIncrement = true; - this.columnContactID.AutoIncrementSeed = -1; - this.columnContactID.AutoIncrementStep = -1; - this.columnContactID.AllowDBNull = false; - this.columnContactID.ReadOnly = true; - this.columnContactID.Unique = true; - this.columnContactName.AllowDBNull = false; - this.columnContactName.MaxLength = 100; - this.columnEmailAddress.MaxLength = 150; - this.columnPrimaryPersonFirstName.MaxLength = 100; - this.columnPrimaryPersonSurname.MaxLength = 100; - this.columnPrimaryPersonEmail.MaxLength = 100; - this.columnPOAddressLine1.MaxLength = 100; - this.columnPOAddressLine2.MaxLength = 100; - this.columnPOAddressLine3.MaxLength = 100; - this.columnPOAddressLine4.MaxLength = 100; - this.columnPOAddressCity.MaxLength = 100; - this.columnPOAddressRegion.MaxLength = 100; - this.columnPOAddressPostalCode.MaxLength = 50; - this.columnPOAddressCountry.MaxLength = 100; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - public ContactRow NewContactRow() { - return ((ContactRow)(this.NewRow())); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - protected override global::System.Data.DataRow NewRowFromBuilder(global::System.Data.DataRowBuilder builder) { - return new ContactRow(builder); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - protected override global::System.Type GetRowType() { - return typeof(ContactRow); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - protected override void OnRowChanged(global::System.Data.DataRowChangeEventArgs e) { - base.OnRowChanged(e); - if ((this.ContactRowChanged != null)) { - this.ContactRowChanged(this, new ContactRowChangeEvent(((ContactRow)(e.Row)), e.Action)); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - protected override void OnRowChanging(global::System.Data.DataRowChangeEventArgs e) { - base.OnRowChanging(e); - if ((this.ContactRowChanging != null)) { - this.ContactRowChanging(this, new ContactRowChangeEvent(((ContactRow)(e.Row)), e.Action)); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - protected override void OnRowDeleted(global::System.Data.DataRowChangeEventArgs e) { - base.OnRowDeleted(e); - if ((this.ContactRowDeleted != null)) { - this.ContactRowDeleted(this, new ContactRowChangeEvent(((ContactRow)(e.Row)), e.Action)); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - protected override void OnRowDeleting(global::System.Data.DataRowChangeEventArgs e) { - base.OnRowDeleting(e); - if ((this.ContactRowDeleting != null)) { - this.ContactRowDeleting(this, new ContactRowChangeEvent(((ContactRow)(e.Row)), e.Action)); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - public void RemoveContactRow(ContactRow row) { - this.Rows.Remove(row); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.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(); - BealeEngDataSet ds = new BealeEngDataSet(); - 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 = "ContactDataTable"; - 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 the strongly named DataTable class. - /// - [global::System.Serializable()] - [global::System.Xml.Serialization.XmlSchemaProviderAttribute("GetTypedTableSchema")] - public partial class ProjectDataTable : global::System.Data.TypedTableBase { - - private global::System.Data.DataColumn columnProjectID; - - private global::System.Data.DataColumn columnContactID; - - private global::System.Data.DataColumn columnProjectRef; - - private global::System.Data.DataColumn columnProjectTitle; - - private global::System.Data.DataColumn columnDateStart; - - private global::System.Data.DataColumn columnDateEnd; - - private global::System.Data.DataColumn columnClientName; - - private global::System.Data.DataColumn columnIsArchived; - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - public ProjectDataTable() { - this.TableName = "Project"; - this.BeginInit(); - this.InitClass(); - this.EndInit(); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - internal ProjectDataTable(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", "16.0.0.0")] - protected ProjectDataTable(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", "16.0.0.0")] - public global::System.Data.DataColumn ProjectIDColumn { - get { - return this.columnProjectID; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - public global::System.Data.DataColumn ContactIDColumn { - get { - return this.columnContactID; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - public global::System.Data.DataColumn ProjectRefColumn { - get { - return this.columnProjectRef; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - public global::System.Data.DataColumn ProjectTitleColumn { - get { - return this.columnProjectTitle; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - public global::System.Data.DataColumn DateStartColumn { - get { - return this.columnDateStart; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - public global::System.Data.DataColumn DateEndColumn { - get { - return this.columnDateEnd; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - public global::System.Data.DataColumn ClientNameColumn { - get { - return this.columnClientName; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - public global::System.Data.DataColumn IsArchivedColumn { - get { - return this.columnIsArchived; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.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", "16.0.0.0")] - public ProjectRow this[int index] { - get { - return ((ProjectRow)(this.Rows[index])); - } - } - - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - public event ProjectRowChangeEventHandler ProjectRowChanging; - - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - public event ProjectRowChangeEventHandler ProjectRowChanged; - - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - public event ProjectRowChangeEventHandler ProjectRowDeleting; - - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - public event ProjectRowChangeEventHandler ProjectRowDeleted; - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - public void AddProjectRow(ProjectRow row) { - this.Rows.Add(row); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - public ProjectRow AddProjectRow(int ProjectID, ContactRow parentContactRowByFK_Project_Contact, string ProjectRef, string ProjectTitle, System.DateTime DateStart, System.DateTime DateEnd, string ClientName, bool IsArchived) { - ProjectRow rowProjectRow = ((ProjectRow)(this.NewRow())); - object[] columnValuesArray = new object[] { - ProjectID, - null, - ProjectRef, - ProjectTitle, - DateStart, - DateEnd, - ClientName, - IsArchived}; - if ((parentContactRowByFK_Project_Contact != null)) { - columnValuesArray[1] = parentContactRowByFK_Project_Contact[0]; - } - rowProjectRow.ItemArray = columnValuesArray; - this.Rows.Add(rowProjectRow); - return rowProjectRow; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - public ProjectRow FindByProjectID(int ProjectID) { - return ((ProjectRow)(this.Rows.Find(new object[] { - ProjectID}))); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - public override global::System.Data.DataTable Clone() { - ProjectDataTable cln = ((ProjectDataTable)(base.Clone())); - cln.InitVars(); - return cln; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - protected override global::System.Data.DataTable CreateInstance() { - return new ProjectDataTable(); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - internal void InitVars() { - this.columnProjectID = base.Columns["ProjectID"]; - this.columnContactID = base.Columns["ContactID"]; - this.columnProjectRef = base.Columns["ProjectRef"]; - this.columnProjectTitle = base.Columns["ProjectTitle"]; - this.columnDateStart = base.Columns["DateStart"]; - this.columnDateEnd = base.Columns["DateEnd"]; - this.columnClientName = base.Columns["ClientName"]; - this.columnIsArchived = base.Columns["IsArchived"]; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - private void InitClass() { - this.columnProjectID = new global::System.Data.DataColumn("ProjectID", typeof(int), null, global::System.Data.MappingType.Element); - base.Columns.Add(this.columnProjectID); - this.columnContactID = new global::System.Data.DataColumn("ContactID", typeof(int), null, global::System.Data.MappingType.Element); - base.Columns.Add(this.columnContactID); - this.columnProjectRef = new global::System.Data.DataColumn("ProjectRef", typeof(string), null, global::System.Data.MappingType.Element); - base.Columns.Add(this.columnProjectRef); - this.columnProjectTitle = new global::System.Data.DataColumn("ProjectTitle", typeof(string), null, global::System.Data.MappingType.Element); - base.Columns.Add(this.columnProjectTitle); - this.columnDateStart = new global::System.Data.DataColumn("DateStart", typeof(global::System.DateTime), null, global::System.Data.MappingType.Element); - base.Columns.Add(this.columnDateStart); - this.columnDateEnd = new global::System.Data.DataColumn("DateEnd", typeof(global::System.DateTime), null, global::System.Data.MappingType.Element); - base.Columns.Add(this.columnDateEnd); - this.columnClientName = new global::System.Data.DataColumn("ClientName", typeof(string), null, global::System.Data.MappingType.Element); - base.Columns.Add(this.columnClientName); - this.columnIsArchived = new global::System.Data.DataColumn("IsArchived", typeof(bool), null, global::System.Data.MappingType.Element); - base.Columns.Add(this.columnIsArchived); - this.Constraints.Add(new global::System.Data.UniqueConstraint("Constraint1", new global::System.Data.DataColumn[] { - this.columnProjectID}, true)); - this.columnProjectID.AllowDBNull = false; - this.columnProjectID.Unique = true; - this.columnContactID.AllowDBNull = false; - this.columnProjectRef.MaxLength = 16; - this.columnProjectTitle.AllowDBNull = false; - this.columnProjectTitle.MaxLength = 250; - this.columnClientName.MaxLength = 50; - this.columnIsArchived.AllowDBNull = false; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - public ProjectRow NewProjectRow() { - return ((ProjectRow)(this.NewRow())); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - protected override global::System.Data.DataRow NewRowFromBuilder(global::System.Data.DataRowBuilder builder) { - return new ProjectRow(builder); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - protected override global::System.Type GetRowType() { - return typeof(ProjectRow); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - protected override void OnRowChanged(global::System.Data.DataRowChangeEventArgs e) { - base.OnRowChanged(e); - if ((this.ProjectRowChanged != null)) { - this.ProjectRowChanged(this, new ProjectRowChangeEvent(((ProjectRow)(e.Row)), e.Action)); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - protected override void OnRowChanging(global::System.Data.DataRowChangeEventArgs e) { - base.OnRowChanging(e); - if ((this.ProjectRowChanging != null)) { - this.ProjectRowChanging(this, new ProjectRowChangeEvent(((ProjectRow)(e.Row)), e.Action)); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - protected override void OnRowDeleted(global::System.Data.DataRowChangeEventArgs e) { - base.OnRowDeleted(e); - if ((this.ProjectRowDeleted != null)) { - this.ProjectRowDeleted(this, new ProjectRowChangeEvent(((ProjectRow)(e.Row)), e.Action)); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - protected override void OnRowDeleting(global::System.Data.DataRowChangeEventArgs e) { - base.OnRowDeleting(e); - if ((this.ProjectRowDeleting != null)) { - this.ProjectRowDeleting(this, new ProjectRowChangeEvent(((ProjectRow)(e.Row)), e.Action)); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - public void RemoveProjectRow(ProjectRow row) { - this.Rows.Remove(row); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.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(); - BealeEngDataSet ds = new BealeEngDataSet(); - 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 = "ProjectDataTable"; - 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 the strongly named DataTable class. - /// - [global::System.Serializable()] - [global::System.Xml.Serialization.XmlSchemaProviderAttribute("GetTypedTableSchema")] - public partial class ProjectJobDataTable : global::System.Data.TypedTableBase { - - private global::System.Data.DataColumn columnProjectJobID; - - private global::System.Data.DataColumn columnProjectID; - - private global::System.Data.DataColumn columnContactID; - - private global::System.Data.DataColumn columnJobNumber; - - private global::System.Data.DataColumn columnJobTitle; - - private global::System.Data.DataColumn columnJobDescription; - - private global::System.Data.DataColumn columnDateStart; - - private global::System.Data.DataColumn columnDateEnd; - - private global::System.Data.DataColumn columnShareBob; - - private global::System.Data.DataColumn columnShareJohn; - - private global::System.Data.DataColumn columnIsArchived; - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - public ProjectJobDataTable() { - this.TableName = "ProjectJob"; - this.BeginInit(); - this.InitClass(); - this.EndInit(); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - internal ProjectJobDataTable(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", "16.0.0.0")] - protected ProjectJobDataTable(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", "16.0.0.0")] - public global::System.Data.DataColumn ProjectJobIDColumn { - get { - return this.columnProjectJobID; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - public global::System.Data.DataColumn ProjectIDColumn { - get { - return this.columnProjectID; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - public global::System.Data.DataColumn ContactIDColumn { - get { - return this.columnContactID; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - public global::System.Data.DataColumn JobNumberColumn { - get { - return this.columnJobNumber; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - public global::System.Data.DataColumn JobTitleColumn { - get { - return this.columnJobTitle; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - public global::System.Data.DataColumn JobDescriptionColumn { - get { - return this.columnJobDescription; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - public global::System.Data.DataColumn DateStartColumn { - get { - return this.columnDateStart; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - public global::System.Data.DataColumn DateEndColumn { - get { - return this.columnDateEnd; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - public global::System.Data.DataColumn ShareBobColumn { - get { - return this.columnShareBob; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - public global::System.Data.DataColumn ShareJohnColumn { - get { - return this.columnShareJohn; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - public global::System.Data.DataColumn IsArchivedColumn { - get { - return this.columnIsArchived; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.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", "16.0.0.0")] - public ProjectJobRow this[int index] { - get { - return ((ProjectJobRow)(this.Rows[index])); - } - } - - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - public event ProjectJobRowChangeEventHandler ProjectJobRowChanging; - - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - public event ProjectJobRowChangeEventHandler ProjectJobRowChanged; - - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - public event ProjectJobRowChangeEventHandler ProjectJobRowDeleting; - - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - public event ProjectJobRowChangeEventHandler ProjectJobRowDeleted; - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - public void AddProjectJobRow(ProjectJobRow row) { - this.Rows.Add(row); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - public ProjectJobRow AddProjectJobRow(ProjectRow parentProjectRowByFK_ProjectJob_Project, ContactRow parentContactRowByFK_ProjectJob_Contact, string JobNumber, string JobTitle, string JobDescription, System.DateTime DateStart, System.DateTime DateEnd, decimal ShareBob, decimal ShareJohn, bool IsArchived) { - ProjectJobRow rowProjectJobRow = ((ProjectJobRow)(this.NewRow())); - object[] columnValuesArray = new object[] { - null, - null, - null, - JobNumber, - JobTitle, - JobDescription, - DateStart, - DateEnd, - ShareBob, - ShareJohn, - IsArchived}; - if ((parentProjectRowByFK_ProjectJob_Project != null)) { - columnValuesArray[1] = parentProjectRowByFK_ProjectJob_Project[0]; - } - if ((parentContactRowByFK_ProjectJob_Contact != null)) { - columnValuesArray[2] = parentContactRowByFK_ProjectJob_Contact[0]; - } - rowProjectJobRow.ItemArray = columnValuesArray; - this.Rows.Add(rowProjectJobRow); - return rowProjectJobRow; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - public ProjectJobRow FindByProjectJobID(int ProjectJobID) { - return ((ProjectJobRow)(this.Rows.Find(new object[] { - ProjectJobID}))); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - public override global::System.Data.DataTable Clone() { - ProjectJobDataTable cln = ((ProjectJobDataTable)(base.Clone())); - cln.InitVars(); - return cln; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - protected override global::System.Data.DataTable CreateInstance() { - return new ProjectJobDataTable(); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - internal void InitVars() { - this.columnProjectJobID = base.Columns["ProjectJobID"]; - this.columnProjectID = base.Columns["ProjectID"]; - this.columnContactID = base.Columns["ContactID"]; - this.columnJobNumber = base.Columns["JobNumber"]; - this.columnJobTitle = base.Columns["JobTitle"]; - this.columnJobDescription = base.Columns["JobDescription"]; - this.columnDateStart = base.Columns["DateStart"]; - this.columnDateEnd = base.Columns["DateEnd"]; - this.columnShareBob = base.Columns["ShareBob"]; - this.columnShareJohn = base.Columns["ShareJohn"]; - this.columnIsArchived = base.Columns["IsArchived"]; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - private void InitClass() { - this.columnProjectJobID = new global::System.Data.DataColumn("ProjectJobID", typeof(int), null, global::System.Data.MappingType.Element); - base.Columns.Add(this.columnProjectJobID); - this.columnProjectID = new global::System.Data.DataColumn("ProjectID", typeof(int), null, global::System.Data.MappingType.Element); - base.Columns.Add(this.columnProjectID); - this.columnContactID = new global::System.Data.DataColumn("ContactID", typeof(int), null, global::System.Data.MappingType.Element); - base.Columns.Add(this.columnContactID); - this.columnJobNumber = new global::System.Data.DataColumn("JobNumber", typeof(string), null, global::System.Data.MappingType.Element); - base.Columns.Add(this.columnJobNumber); - this.columnJobTitle = new global::System.Data.DataColumn("JobTitle", typeof(string), null, global::System.Data.MappingType.Element); - base.Columns.Add(this.columnJobTitle); - this.columnJobDescription = new global::System.Data.DataColumn("JobDescription", typeof(string), null, global::System.Data.MappingType.Element); - base.Columns.Add(this.columnJobDescription); - this.columnDateStart = new global::System.Data.DataColumn("DateStart", typeof(global::System.DateTime), null, global::System.Data.MappingType.Element); - base.Columns.Add(this.columnDateStart); - this.columnDateEnd = new global::System.Data.DataColumn("DateEnd", typeof(global::System.DateTime), null, global::System.Data.MappingType.Element); - base.Columns.Add(this.columnDateEnd); - this.columnShareBob = new global::System.Data.DataColumn("ShareBob", typeof(decimal), null, global::System.Data.MappingType.Element); - base.Columns.Add(this.columnShareBob); - this.columnShareJohn = new global::System.Data.DataColumn("ShareJohn", typeof(decimal), null, global::System.Data.MappingType.Element); - base.Columns.Add(this.columnShareJohn); - this.columnIsArchived = new global::System.Data.DataColumn("IsArchived", typeof(bool), null, global::System.Data.MappingType.Element); - base.Columns.Add(this.columnIsArchived); - this.Constraints.Add(new global::System.Data.UniqueConstraint("Constraint1", new global::System.Data.DataColumn[] { - this.columnProjectJobID}, true)); - this.columnProjectJobID.AutoIncrement = true; - this.columnProjectJobID.AutoIncrementSeed = -1; - this.columnProjectJobID.AutoIncrementStep = -1; - this.columnProjectJobID.AllowDBNull = false; - this.columnProjectJobID.ReadOnly = true; - this.columnProjectJobID.Unique = true; - this.columnProjectID.AllowDBNull = false; - this.columnContactID.AllowDBNull = false; - this.columnJobNumber.AllowDBNull = false; - this.columnJobNumber.MaxLength = 7; - this.columnJobTitle.MaxLength = 250; - this.columnJobDescription.MaxLength = 500; - this.columnIsArchived.AllowDBNull = false; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - public ProjectJobRow NewProjectJobRow() { - return ((ProjectJobRow)(this.NewRow())); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - protected override global::System.Data.DataRow NewRowFromBuilder(global::System.Data.DataRowBuilder builder) { - return new ProjectJobRow(builder); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - protected override global::System.Type GetRowType() { - return typeof(ProjectJobRow); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - protected override void OnRowChanged(global::System.Data.DataRowChangeEventArgs e) { - base.OnRowChanged(e); - if ((this.ProjectJobRowChanged != null)) { - this.ProjectJobRowChanged(this, new ProjectJobRowChangeEvent(((ProjectJobRow)(e.Row)), e.Action)); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - protected override void OnRowChanging(global::System.Data.DataRowChangeEventArgs e) { - base.OnRowChanging(e); - if ((this.ProjectJobRowChanging != null)) { - this.ProjectJobRowChanging(this, new ProjectJobRowChangeEvent(((ProjectJobRow)(e.Row)), e.Action)); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - protected override void OnRowDeleted(global::System.Data.DataRowChangeEventArgs e) { - base.OnRowDeleted(e); - if ((this.ProjectJobRowDeleted != null)) { - this.ProjectJobRowDeleted(this, new ProjectJobRowChangeEvent(((ProjectJobRow)(e.Row)), e.Action)); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - protected override void OnRowDeleting(global::System.Data.DataRowChangeEventArgs e) { - base.OnRowDeleting(e); - if ((this.ProjectJobRowDeleting != null)) { - this.ProjectJobRowDeleting(this, new ProjectJobRowChangeEvent(((ProjectJobRow)(e.Row)), e.Action)); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - public void RemoveProjectJobRow(ProjectJobRow row) { - this.Rows.Remove(row); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.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(); - BealeEngDataSet ds = new BealeEngDataSet(); - 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 = "ProjectJobDataTable"; - 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. - /// - public partial class ClientPurchaseOrderRow : global::System.Data.DataRow { - - private ClientPurchaseOrderDataTable tableClientPurchaseOrder; - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - internal ClientPurchaseOrderRow(global::System.Data.DataRowBuilder rb) : - base(rb) { - this.tableClientPurchaseOrder = ((ClientPurchaseOrderDataTable)(this.Table)); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - public int ClientPurchaseOrderID { - get { - return ((int)(this[this.tableClientPurchaseOrder.ClientPurchaseOrderIDColumn])); - } - set { - this[this.tableClientPurchaseOrder.ClientPurchaseOrderIDColumn] = value; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - public System.DateTime PurchaseOrderDate { - get { - return ((global::System.DateTime)(this[this.tableClientPurchaseOrder.PurchaseOrderDateColumn])); - } - set { - this[this.tableClientPurchaseOrder.PurchaseOrderDateColumn] = value; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - public int ContactID { - get { - return ((int)(this[this.tableClientPurchaseOrder.ContactIDColumn])); - } - set { - this[this.tableClientPurchaseOrder.ContactIDColumn] = value; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - public string ClientReference { - get { - return ((string)(this[this.tableClientPurchaseOrder.ClientReferenceColumn])); - } - set { - this[this.tableClientPurchaseOrder.ClientReferenceColumn] = value; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - public string RequestorEmail { - get { - try { - return ((string)(this[this.tableClientPurchaseOrder.RequestorEmailColumn])); - } - catch (global::System.InvalidCastException e) { - throw new global::System.Data.StrongTypingException("The value for column \'RequestorEmail\' in table \'ClientPurchaseOrder\' is DBNull.", e); - } - } - set { - this[this.tableClientPurchaseOrder.RequestorEmailColumn] = value; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - public decimal OrderTotal { - get { - try { - return ((decimal)(this[this.tableClientPurchaseOrder.OrderTotalColumn])); - } - catch (global::System.InvalidCastException e) { - throw new global::System.Data.StrongTypingException("The value for column \'OrderTotal\' in table \'ClientPurchaseOrder\' is DBNull.", e); - } - } - set { - this[this.tableClientPurchaseOrder.OrderTotalColumn] = value; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - public bool IsClosed { - get { - return ((bool)(this[this.tableClientPurchaseOrder.IsClosedColumn])); - } - set { - this[this.tableClientPurchaseOrder.IsClosedColumn] = value; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - public ContactRow ContactRow { - get { - return ((ContactRow)(this.GetParentRow(this.Table.ParentRelations["FK_ClientPurchaseOrder_Contact"]))); - } - set { - this.SetParentRow(value, this.Table.ParentRelations["FK_ClientPurchaseOrder_Contact"]); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - public bool IsRequestorEmailNull() { - return this.IsNull(this.tableClientPurchaseOrder.RequestorEmailColumn); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - public void SetRequestorEmailNull() { - this[this.tableClientPurchaseOrder.RequestorEmailColumn] = global::System.Convert.DBNull; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - public bool IsOrderTotalNull() { - return this.IsNull(this.tableClientPurchaseOrder.OrderTotalColumn); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - public void SetOrderTotalNull() { - this[this.tableClientPurchaseOrder.OrderTotalColumn] = global::System.Convert.DBNull; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - public ClientPurchaseOrderLineRow[] GetClientPurchaseOrderLineRows() { - if ((this.Table.ChildRelations["FK_ClientPurchaseOrderLine_ClientPurchaseOrder"] == null)) { - return new ClientPurchaseOrderLineRow[0]; - } - else { - return ((ClientPurchaseOrderLineRow[])(base.GetChildRows(this.Table.ChildRelations["FK_ClientPurchaseOrderLine_ClientPurchaseOrder"]))); - } - } - } - - /// - ///Represents strongly named DataRow class. - /// - public partial class ClientPurchaseOrderLineRow : global::System.Data.DataRow { - - private ClientPurchaseOrderLineDataTable tableClientPurchaseOrderLine; - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - internal ClientPurchaseOrderLineRow(global::System.Data.DataRowBuilder rb) : - base(rb) { - this.tableClientPurchaseOrderLine = ((ClientPurchaseOrderLineDataTable)(this.Table)); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - public int ClientPurchaseOrderLineID { - get { - return ((int)(this[this.tableClientPurchaseOrderLine.ClientPurchaseOrderLineIDColumn])); - } - set { - this[this.tableClientPurchaseOrderLine.ClientPurchaseOrderLineIDColumn] = value; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - public int ClientPurchaseOrderID { - get { - return ((int)(this[this.tableClientPurchaseOrderLine.ClientPurchaseOrderIDColumn])); - } - set { - this[this.tableClientPurchaseOrderLine.ClientPurchaseOrderIDColumn] = value; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - public int LineNumber { - get { - return ((int)(this[this.tableClientPurchaseOrderLine.LineNumberColumn])); - } - set { - this[this.tableClientPurchaseOrderLine.LineNumberColumn] = value; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - public int ProjectJobID { - get { - return ((int)(this[this.tableClientPurchaseOrderLine.ProjectJobIDColumn])); - } - set { - this[this.tableClientPurchaseOrderLine.ProjectJobIDColumn] = value; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - public string Description { - get { - try { - return ((string)(this[this.tableClientPurchaseOrderLine.DescriptionColumn])); - } - catch (global::System.InvalidCastException e) { - throw new global::System.Data.StrongTypingException("The value for column \'Description\' in table \'ClientPurchaseOrderLine\' is DBNull.", e); - } - } - set { - this[this.tableClientPurchaseOrderLine.DescriptionColumn] = value; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - public decimal LineNetAmount { - get { - return ((decimal)(this[this.tableClientPurchaseOrderLine.LineNetAmountColumn])); - } - set { - this[this.tableClientPurchaseOrderLine.LineNetAmountColumn] = value; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - public ClientPurchaseOrderRow ClientPurchaseOrderRow { - get { - return ((ClientPurchaseOrderRow)(this.GetParentRow(this.Table.ParentRelations["FK_ClientPurchaseOrderLine_ClientPurchaseOrder"]))); - } - set { - this.SetParentRow(value, this.Table.ParentRelations["FK_ClientPurchaseOrderLine_ClientPurchaseOrder"]); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - public bool IsDescriptionNull() { - return this.IsNull(this.tableClientPurchaseOrderLine.DescriptionColumn); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - public void SetDescriptionNull() { - this[this.tableClientPurchaseOrderLine.DescriptionColumn] = global::System.Convert.DBNull; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - public ClientPurchaseOrderLineSalesInvoiceRow[] GetClientPurchaseOrderLineSalesInvoiceRows() { - if ((this.Table.ChildRelations["FK_ClientPurchaseOrderLineSalesInvoice_ClientPurchaseOrderLine"] == null)) { - return new ClientPurchaseOrderLineSalesInvoiceRow[0]; - } - else { - return ((ClientPurchaseOrderLineSalesInvoiceRow[])(base.GetChildRows(this.Table.ChildRelations["FK_ClientPurchaseOrderLineSalesInvoice_ClientPurchaseOrderLine"]))); - } - } - } - - /// - ///Represents strongly named DataRow class. - /// - public partial class ClientPurchaseOrderLineSalesInvoiceRow : global::System.Data.DataRow { - - private ClientPurchaseOrderLineSalesInvoiceDataTable tableClientPurchaseOrderLineSalesInvoice; - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - internal ClientPurchaseOrderLineSalesInvoiceRow(global::System.Data.DataRowBuilder rb) : - base(rb) { - this.tableClientPurchaseOrderLineSalesInvoice = ((ClientPurchaseOrderLineSalesInvoiceDataTable)(this.Table)); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - public int ClientPurchaseOrderLineID { - get { - return ((int)(this[this.tableClientPurchaseOrderLineSalesInvoice.ClientPurchaseOrderLineIDColumn])); - } - set { - this[this.tableClientPurchaseOrderLineSalesInvoice.ClientPurchaseOrderLineIDColumn] = value; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - public int SaleInvoiceID { - get { - return ((int)(this[this.tableClientPurchaseOrderLineSalesInvoice.SaleInvoiceIDColumn])); - } - set { - this[this.tableClientPurchaseOrderLineSalesInvoice.SaleInvoiceIDColumn] = value; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - public bool IsApproved { - get { - return ((bool)(this[this.tableClientPurchaseOrderLineSalesInvoice.IsApprovedColumn])); - } - set { - this[this.tableClientPurchaseOrderLineSalesInvoice.IsApprovedColumn] = value; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - public ClientPurchaseOrderLineRow ClientPurchaseOrderLineRow { - get { - return ((ClientPurchaseOrderLineRow)(this.GetParentRow(this.Table.ParentRelations["FK_ClientPurchaseOrderLineSalesInvoice_ClientPurchaseOrderLine"]))); - } - set { - this.SetParentRow(value, this.Table.ParentRelations["FK_ClientPurchaseOrderLineSalesInvoice_ClientPurchaseOrderLine"]); - } - } - } - - /// - ///Represents strongly named DataRow class. - /// - public partial class ContactRow : global::System.Data.DataRow { - - private ContactDataTable tableContact; - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - internal ContactRow(global::System.Data.DataRowBuilder rb) : - base(rb) { - this.tableContact = ((ContactDataTable)(this.Table)); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - public int ContactID { - get { - return ((int)(this[this.tableContact.ContactIDColumn])); - } - set { - this[this.tableContact.ContactIDColumn] = value; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - public string ContactName { - get { - return ((string)(this[this.tableContact.ContactNameColumn])); - } - set { - this[this.tableContact.ContactNameColumn] = value; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - public string EmailAddress { - get { - try { - return ((string)(this[this.tableContact.EmailAddressColumn])); - } - catch (global::System.InvalidCastException e) { - throw new global::System.Data.StrongTypingException("The value for column \'EmailAddress\' in table \'Contact\' is DBNull.", e); - } - } - set { - this[this.tableContact.EmailAddressColumn] = value; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - public string PrimaryPersonFirstName { - get { - try { - return ((string)(this[this.tableContact.PrimaryPersonFirstNameColumn])); - } - catch (global::System.InvalidCastException e) { - throw new global::System.Data.StrongTypingException("The value for column \'PrimaryPersonFirstName\' in table \'Contact\' is DBNull.", e); - } - } - set { - this[this.tableContact.PrimaryPersonFirstNameColumn] = value; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - public string PrimaryPersonSurname { - get { - try { - return ((string)(this[this.tableContact.PrimaryPersonSurnameColumn])); - } - catch (global::System.InvalidCastException e) { - throw new global::System.Data.StrongTypingException("The value for column \'PrimaryPersonSurname\' in table \'Contact\' is DBNull.", e); - } - } - set { - this[this.tableContact.PrimaryPersonSurnameColumn] = value; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - public string PrimaryPersonEmail { - get { - try { - return ((string)(this[this.tableContact.PrimaryPersonEmailColumn])); - } - catch (global::System.InvalidCastException e) { - throw new global::System.Data.StrongTypingException("The value for column \'PrimaryPersonEmail\' in table \'Contact\' is DBNull.", e); - } - } - set { - this[this.tableContact.PrimaryPersonEmailColumn] = value; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - public string POAddressLine1 { - get { - try { - return ((string)(this[this.tableContact.POAddressLine1Column])); - } - catch (global::System.InvalidCastException e) { - throw new global::System.Data.StrongTypingException("The value for column \'POAddressLine1\' in table \'Contact\' is DBNull.", e); - } - } - set { - this[this.tableContact.POAddressLine1Column] = value; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - public string POAddressLine2 { - get { - try { - return ((string)(this[this.tableContact.POAddressLine2Column])); - } - catch (global::System.InvalidCastException e) { - throw new global::System.Data.StrongTypingException("The value for column \'POAddressLine2\' in table \'Contact\' is DBNull.", e); - } - } - set { - this[this.tableContact.POAddressLine2Column] = value; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - public string POAddressLine3 { - get { - try { - return ((string)(this[this.tableContact.POAddressLine3Column])); - } - catch (global::System.InvalidCastException e) { - throw new global::System.Data.StrongTypingException("The value for column \'POAddressLine3\' in table \'Contact\' is DBNull.", e); - } - } - set { - this[this.tableContact.POAddressLine3Column] = value; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - public string POAddressLine4 { - get { - try { - return ((string)(this[this.tableContact.POAddressLine4Column])); - } - catch (global::System.InvalidCastException e) { - throw new global::System.Data.StrongTypingException("The value for column \'POAddressLine4\' in table \'Contact\' is DBNull.", e); - } - } - set { - this[this.tableContact.POAddressLine4Column] = value; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - public string POAddressCity { - get { - try { - return ((string)(this[this.tableContact.POAddressCityColumn])); - } - catch (global::System.InvalidCastException e) { - throw new global::System.Data.StrongTypingException("The value for column \'POAddressCity\' in table \'Contact\' is DBNull.", e); - } - } - set { - this[this.tableContact.POAddressCityColumn] = value; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - public string POAddressRegion { - get { - try { - return ((string)(this[this.tableContact.POAddressRegionColumn])); - } - catch (global::System.InvalidCastException e) { - throw new global::System.Data.StrongTypingException("The value for column \'POAddressRegion\' in table \'Contact\' is DBNull.", e); - } - } - set { - this[this.tableContact.POAddressRegionColumn] = value; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - public string POAddressPostalCode { - get { - try { - return ((string)(this[this.tableContact.POAddressPostalCodeColumn])); - } - catch (global::System.InvalidCastException e) { - throw new global::System.Data.StrongTypingException("The value for column \'POAddressPostalCode\' in table \'Contact\' is DBNull.", e); - } - } - set { - this[this.tableContact.POAddressPostalCodeColumn] = value; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - public string POAddressCountry { - get { - try { - return ((string)(this[this.tableContact.POAddressCountryColumn])); - } - catch (global::System.InvalidCastException e) { - throw new global::System.Data.StrongTypingException("The value for column \'POAddressCountry\' in table \'Contact\' is DBNull.", e); - } - } - set { - this[this.tableContact.POAddressCountryColumn] = value; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - public bool IsEmailAddressNull() { - return this.IsNull(this.tableContact.EmailAddressColumn); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - public void SetEmailAddressNull() { - this[this.tableContact.EmailAddressColumn] = global::System.Convert.DBNull; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - public bool IsPrimaryPersonFirstNameNull() { - return this.IsNull(this.tableContact.PrimaryPersonFirstNameColumn); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - public void SetPrimaryPersonFirstNameNull() { - this[this.tableContact.PrimaryPersonFirstNameColumn] = global::System.Convert.DBNull; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - public bool IsPrimaryPersonSurnameNull() { - return this.IsNull(this.tableContact.PrimaryPersonSurnameColumn); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - public void SetPrimaryPersonSurnameNull() { - this[this.tableContact.PrimaryPersonSurnameColumn] = global::System.Convert.DBNull; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - public bool IsPrimaryPersonEmailNull() { - return this.IsNull(this.tableContact.PrimaryPersonEmailColumn); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - public void SetPrimaryPersonEmailNull() { - this[this.tableContact.PrimaryPersonEmailColumn] = global::System.Convert.DBNull; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - public bool IsPOAddressLine1Null() { - return this.IsNull(this.tableContact.POAddressLine1Column); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - public void SetPOAddressLine1Null() { - this[this.tableContact.POAddressLine1Column] = global::System.Convert.DBNull; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - public bool IsPOAddressLine2Null() { - return this.IsNull(this.tableContact.POAddressLine2Column); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - public void SetPOAddressLine2Null() { - this[this.tableContact.POAddressLine2Column] = global::System.Convert.DBNull; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - public bool IsPOAddressLine3Null() { - return this.IsNull(this.tableContact.POAddressLine3Column); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - public void SetPOAddressLine3Null() { - this[this.tableContact.POAddressLine3Column] = global::System.Convert.DBNull; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - public bool IsPOAddressLine4Null() { - return this.IsNull(this.tableContact.POAddressLine4Column); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - public void SetPOAddressLine4Null() { - this[this.tableContact.POAddressLine4Column] = global::System.Convert.DBNull; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - public bool IsPOAddressCityNull() { - return this.IsNull(this.tableContact.POAddressCityColumn); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - public void SetPOAddressCityNull() { - this[this.tableContact.POAddressCityColumn] = global::System.Convert.DBNull; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - public bool IsPOAddressRegionNull() { - return this.IsNull(this.tableContact.POAddressRegionColumn); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - public void SetPOAddressRegionNull() { - this[this.tableContact.POAddressRegionColumn] = global::System.Convert.DBNull; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - public bool IsPOAddressPostalCodeNull() { - return this.IsNull(this.tableContact.POAddressPostalCodeColumn); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - public void SetPOAddressPostalCodeNull() { - this[this.tableContact.POAddressPostalCodeColumn] = global::System.Convert.DBNull; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - public bool IsPOAddressCountryNull() { - return this.IsNull(this.tableContact.POAddressCountryColumn); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - public void SetPOAddressCountryNull() { - this[this.tableContact.POAddressCountryColumn] = global::System.Convert.DBNull; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - public ClientPurchaseOrderRow[] GetClientPurchaseOrderRows() { - if ((this.Table.ChildRelations["FK_ClientPurchaseOrder_Contact"] == null)) { - return new ClientPurchaseOrderRow[0]; - } - else { - return ((ClientPurchaseOrderRow[])(base.GetChildRows(this.Table.ChildRelations["FK_ClientPurchaseOrder_Contact"]))); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - public ProjectRow[] GetProjectRows() { - if ((this.Table.ChildRelations["FK_Project_Contact"] == null)) { - return new ProjectRow[0]; - } - else { - return ((ProjectRow[])(base.GetChildRows(this.Table.ChildRelations["FK_Project_Contact"]))); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - public ProjectJobRow[] GetProjectJobRows() { - if ((this.Table.ChildRelations["FK_ProjectJob_Contact"] == null)) { - return new ProjectJobRow[0]; - } - else { - return ((ProjectJobRow[])(base.GetChildRows(this.Table.ChildRelations["FK_ProjectJob_Contact"]))); - } - } - } - - /// - ///Represents strongly named DataRow class. - /// - public partial class ProjectRow : global::System.Data.DataRow { - - private ProjectDataTable tableProject; - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - internal ProjectRow(global::System.Data.DataRowBuilder rb) : - base(rb) { - this.tableProject = ((ProjectDataTable)(this.Table)); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - public int ProjectID { - get { - return ((int)(this[this.tableProject.ProjectIDColumn])); - } - set { - this[this.tableProject.ProjectIDColumn] = value; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - public int ContactID { - get { - return ((int)(this[this.tableProject.ContactIDColumn])); - } - set { - this[this.tableProject.ContactIDColumn] = value; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - public string ProjectRef { - get { - try { - return ((string)(this[this.tableProject.ProjectRefColumn])); - } - catch (global::System.InvalidCastException e) { - throw new global::System.Data.StrongTypingException("The value for column \'ProjectRef\' in table \'Project\' is DBNull.", e); - } - } - set { - this[this.tableProject.ProjectRefColumn] = value; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - public string ProjectTitle { - get { - return ((string)(this[this.tableProject.ProjectTitleColumn])); - } - set { - this[this.tableProject.ProjectTitleColumn] = value; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - public System.DateTime DateStart { - get { - try { - return ((global::System.DateTime)(this[this.tableProject.DateStartColumn])); - } - catch (global::System.InvalidCastException e) { - throw new global::System.Data.StrongTypingException("The value for column \'DateStart\' in table \'Project\' is DBNull.", e); - } - } - set { - this[this.tableProject.DateStartColumn] = value; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - public System.DateTime DateEnd { - get { - try { - return ((global::System.DateTime)(this[this.tableProject.DateEndColumn])); - } - catch (global::System.InvalidCastException e) { - throw new global::System.Data.StrongTypingException("The value for column \'DateEnd\' in table \'Project\' is DBNull.", e); - } - } - set { - this[this.tableProject.DateEndColumn] = value; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - public string ClientName { - get { - try { - return ((string)(this[this.tableProject.ClientNameColumn])); - } - catch (global::System.InvalidCastException e) { - throw new global::System.Data.StrongTypingException("The value for column \'ClientName\' in table \'Project\' is DBNull.", e); - } - } - set { - this[this.tableProject.ClientNameColumn] = value; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - public bool IsArchived { - get { - return ((bool)(this[this.tableProject.IsArchivedColumn])); - } - set { - this[this.tableProject.IsArchivedColumn] = value; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - public ContactRow ContactRow { - get { - return ((ContactRow)(this.GetParentRow(this.Table.ParentRelations["FK_Project_Contact"]))); - } - set { - this.SetParentRow(value, this.Table.ParentRelations["FK_Project_Contact"]); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - public bool IsProjectRefNull() { - return this.IsNull(this.tableProject.ProjectRefColumn); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - public void SetProjectRefNull() { - this[this.tableProject.ProjectRefColumn] = global::System.Convert.DBNull; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - public bool IsDateStartNull() { - return this.IsNull(this.tableProject.DateStartColumn); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - public void SetDateStartNull() { - this[this.tableProject.DateStartColumn] = global::System.Convert.DBNull; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - public bool IsDateEndNull() { - return this.IsNull(this.tableProject.DateEndColumn); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - public void SetDateEndNull() { - this[this.tableProject.DateEndColumn] = global::System.Convert.DBNull; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - public bool IsClientNameNull() { - return this.IsNull(this.tableProject.ClientNameColumn); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - public void SetClientNameNull() { - this[this.tableProject.ClientNameColumn] = global::System.Convert.DBNull; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - public ProjectJobRow[] GetProjectJobRows() { - if ((this.Table.ChildRelations["FK_ProjectJob_Project"] == null)) { - return new ProjectJobRow[0]; - } - else { - return ((ProjectJobRow[])(base.GetChildRows(this.Table.ChildRelations["FK_ProjectJob_Project"]))); - } - } - } - - /// - ///Represents strongly named DataRow class. - /// - public partial class ProjectJobRow : global::System.Data.DataRow { - - private ProjectJobDataTable tableProjectJob; - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - internal ProjectJobRow(global::System.Data.DataRowBuilder rb) : - base(rb) { - this.tableProjectJob = ((ProjectJobDataTable)(this.Table)); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - public int ProjectJobID { - get { - return ((int)(this[this.tableProjectJob.ProjectJobIDColumn])); - } - set { - this[this.tableProjectJob.ProjectJobIDColumn] = value; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - public int ProjectID { - get { - return ((int)(this[this.tableProjectJob.ProjectIDColumn])); - } - set { - this[this.tableProjectJob.ProjectIDColumn] = value; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - public int ContactID { - get { - return ((int)(this[this.tableProjectJob.ContactIDColumn])); - } - set { - this[this.tableProjectJob.ContactIDColumn] = value; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - public string JobNumber { - get { - return ((string)(this[this.tableProjectJob.JobNumberColumn])); - } - set { - this[this.tableProjectJob.JobNumberColumn] = value; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - public string JobTitle { - get { - try { - return ((string)(this[this.tableProjectJob.JobTitleColumn])); - } - catch (global::System.InvalidCastException e) { - throw new global::System.Data.StrongTypingException("The value for column \'JobTitle\' in table \'ProjectJob\' is DBNull.", e); - } - } - set { - this[this.tableProjectJob.JobTitleColumn] = value; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - public string JobDescription { - get { - try { - return ((string)(this[this.tableProjectJob.JobDescriptionColumn])); - } - catch (global::System.InvalidCastException e) { - throw new global::System.Data.StrongTypingException("The value for column \'JobDescription\' in table \'ProjectJob\' is DBNull.", e); - } - } - set { - this[this.tableProjectJob.JobDescriptionColumn] = value; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - public System.DateTime DateStart { - get { - try { - return ((global::System.DateTime)(this[this.tableProjectJob.DateStartColumn])); - } - catch (global::System.InvalidCastException e) { - throw new global::System.Data.StrongTypingException("The value for column \'DateStart\' in table \'ProjectJob\' is DBNull.", e); - } - } - set { - this[this.tableProjectJob.DateStartColumn] = value; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - public System.DateTime DateEnd { - get { - try { - return ((global::System.DateTime)(this[this.tableProjectJob.DateEndColumn])); - } - catch (global::System.InvalidCastException e) { - throw new global::System.Data.StrongTypingException("The value for column \'DateEnd\' in table \'ProjectJob\' is DBNull.", e); - } - } - set { - this[this.tableProjectJob.DateEndColumn] = value; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - public decimal ShareBob { - get { - try { - return ((decimal)(this[this.tableProjectJob.ShareBobColumn])); - } - catch (global::System.InvalidCastException e) { - throw new global::System.Data.StrongTypingException("The value for column \'ShareBob\' in table \'ProjectJob\' is DBNull.", e); - } - } - set { - this[this.tableProjectJob.ShareBobColumn] = value; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - public decimal ShareJohn { - get { - try { - return ((decimal)(this[this.tableProjectJob.ShareJohnColumn])); - } - catch (global::System.InvalidCastException e) { - throw new global::System.Data.StrongTypingException("The value for column \'ShareJohn\' in table \'ProjectJob\' is DBNull.", e); - } - } - set { - this[this.tableProjectJob.ShareJohnColumn] = value; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - public bool IsArchived { - get { - return ((bool)(this[this.tableProjectJob.IsArchivedColumn])); - } - set { - this[this.tableProjectJob.IsArchivedColumn] = value; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - public ContactRow ContactRow { - get { - return ((ContactRow)(this.GetParentRow(this.Table.ParentRelations["FK_ProjectJob_Contact"]))); - } - set { - this.SetParentRow(value, this.Table.ParentRelations["FK_ProjectJob_Contact"]); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - public ProjectRow ProjectRow { - get { - return ((ProjectRow)(this.GetParentRow(this.Table.ParentRelations["FK_ProjectJob_Project"]))); - } - set { - this.SetParentRow(value, this.Table.ParentRelations["FK_ProjectJob_Project"]); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - public bool IsJobTitleNull() { - return this.IsNull(this.tableProjectJob.JobTitleColumn); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - public void SetJobTitleNull() { - this[this.tableProjectJob.JobTitleColumn] = global::System.Convert.DBNull; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - public bool IsJobDescriptionNull() { - return this.IsNull(this.tableProjectJob.JobDescriptionColumn); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - public void SetJobDescriptionNull() { - this[this.tableProjectJob.JobDescriptionColumn] = global::System.Convert.DBNull; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - public bool IsDateStartNull() { - return this.IsNull(this.tableProjectJob.DateStartColumn); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - public void SetDateStartNull() { - this[this.tableProjectJob.DateStartColumn] = global::System.Convert.DBNull; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - public bool IsDateEndNull() { - return this.IsNull(this.tableProjectJob.DateEndColumn); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - public void SetDateEndNull() { - this[this.tableProjectJob.DateEndColumn] = global::System.Convert.DBNull; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - public bool IsShareBobNull() { - return this.IsNull(this.tableProjectJob.ShareBobColumn); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - public void SetShareBobNull() { - this[this.tableProjectJob.ShareBobColumn] = global::System.Convert.DBNull; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - public bool IsShareJohnNull() { - return this.IsNull(this.tableProjectJob.ShareJohnColumn); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - public void SetShareJohnNull() { - this[this.tableProjectJob.ShareJohnColumn] = global::System.Convert.DBNull; - } - } - - /// - ///Row event argument class - /// - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - public class ClientPurchaseOrderRowChangeEvent : global::System.EventArgs { - - private ClientPurchaseOrderRow eventRow; - - private global::System.Data.DataRowAction eventAction; - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - public ClientPurchaseOrderRowChangeEvent(ClientPurchaseOrderRow 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", "16.0.0.0")] - public ClientPurchaseOrderRow Row { - get { - return this.eventRow; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - public global::System.Data.DataRowAction Action { - get { - return this.eventAction; - } - } - } - - /// - ///Row event argument class - /// - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - public class ClientPurchaseOrderLineRowChangeEvent : global::System.EventArgs { - - private ClientPurchaseOrderLineRow eventRow; - - private global::System.Data.DataRowAction eventAction; - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - public ClientPurchaseOrderLineRowChangeEvent(ClientPurchaseOrderLineRow 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", "16.0.0.0")] - public ClientPurchaseOrderLineRow Row { - get { - return this.eventRow; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - public global::System.Data.DataRowAction Action { - get { - return this.eventAction; - } - } - } - - /// - ///Row event argument class - /// - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - public class ClientPurchaseOrderLineSalesInvoiceRowChangeEvent : global::System.EventArgs { - - private ClientPurchaseOrderLineSalesInvoiceRow eventRow; - - private global::System.Data.DataRowAction eventAction; - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - public ClientPurchaseOrderLineSalesInvoiceRowChangeEvent(ClientPurchaseOrderLineSalesInvoiceRow 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", "16.0.0.0")] - public ClientPurchaseOrderLineSalesInvoiceRow Row { - get { - return this.eventRow; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - public global::System.Data.DataRowAction Action { - get { - return this.eventAction; - } - } - } - - /// - ///Row event argument class - /// - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - public class ContactRowChangeEvent : global::System.EventArgs { - - private ContactRow eventRow; - - private global::System.Data.DataRowAction eventAction; - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - public ContactRowChangeEvent(ContactRow 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", "16.0.0.0")] - public ContactRow Row { - get { - return this.eventRow; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - public global::System.Data.DataRowAction Action { - get { - return this.eventAction; - } - } - } - - /// - ///Row event argument class - /// - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - public class ProjectRowChangeEvent : global::System.EventArgs { - - private ProjectRow eventRow; - - private global::System.Data.DataRowAction eventAction; - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - public ProjectRowChangeEvent(ProjectRow 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", "16.0.0.0")] - public ProjectRow Row { - get { - return this.eventRow; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - public global::System.Data.DataRowAction Action { - get { - return this.eventAction; - } - } - } - - /// - ///Row event argument class - /// - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - public class ProjectJobRowChangeEvent : global::System.EventArgs { - - private ProjectJobRow eventRow; - - private global::System.Data.DataRowAction eventAction; - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - public ProjectJobRowChangeEvent(ProjectJobRow 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", "16.0.0.0")] - public ProjectJobRow Row { - get { - return this.eventRow; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - public global::System.Data.DataRowAction Action { - get { - return this.eventAction; - } - } - } - } -} -namespace BealeEngineering.Accounts.BealeEngDataSetTableAdapters { - - - /// - ///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 ClientPurchaseOrderTableAdapter : 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", "16.0.0.0")] - public ClientPurchaseOrderTableAdapter() { - this.ClearBeforeFill = true; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.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", "16.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", "16.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", "16.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", "16.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", "16.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 = "ClientPurchaseOrder"; - tableMapping.ColumnMappings.Add("ClientPurchaseOrderID", "ClientPurchaseOrderID"); - tableMapping.ColumnMappings.Add("PurchaseOrderDate", "PurchaseOrderDate"); - tableMapping.ColumnMappings.Add("ContactID", "ContactID"); - tableMapping.ColumnMappings.Add("ClientReference", "ClientReference"); - tableMapping.ColumnMappings.Add("RequestorEmail", "RequestorEmail"); - tableMapping.ColumnMappings.Add("OrderTotal", "OrderTotal"); - tableMapping.ColumnMappings.Add("IsClosed", "IsClosed"); - 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].[ClientPurchaseOrder] WHERE (([ClientPurchaseOrderID] = @Original_ClientPurchaseOrderID) AND ([PurchaseOrderDate] = @Original_PurchaseOrderDate) AND ([ContactID] = @Original_ContactID) AND ([ClientReference] = @Original_ClientReference) AND ((@IsNull_RequestorEmail = 1 AND [RequestorEmail] IS NULL) OR ([RequestorEmail] = @Original_RequestorEmail)) AND ((@IsNull_OrderTotal = 1 AND [OrderTotal] IS NULL) OR ([OrderTotal] = @Original_OrderTotal)) AND ([IsClosed] = @Original_IsClosed))"; - this._adapter.DeleteCommand.CommandType = global::System.Data.CommandType.Text; - this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_ClientPurchaseOrderID", global::System.Data.SqlDbType.Int, 0, global::System.Data.ParameterDirection.Input, 0, 0, "ClientPurchaseOrderID", global::System.Data.DataRowVersion.Original, false, null, "", "", "")); - this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_PurchaseOrderDate", global::System.Data.SqlDbType.Date, 0, global::System.Data.ParameterDirection.Input, 0, 0, "PurchaseOrderDate", global::System.Data.DataRowVersion.Original, false, null, "", "", "")); - this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_ContactID", global::System.Data.SqlDbType.Int, 0, global::System.Data.ParameterDirection.Input, 0, 0, "ContactID", global::System.Data.DataRowVersion.Original, false, null, "", "", "")); - this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_ClientReference", global::System.Data.SqlDbType.VarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "ClientReference", global::System.Data.DataRowVersion.Original, false, null, "", "", "")); - this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@IsNull_RequestorEmail", global::System.Data.SqlDbType.Int, 0, global::System.Data.ParameterDirection.Input, 0, 0, "RequestorEmail", global::System.Data.DataRowVersion.Original, true, null, "", "", "")); - this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_RequestorEmail", global::System.Data.SqlDbType.VarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "RequestorEmail", global::System.Data.DataRowVersion.Original, false, null, "", "", "")); - this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@IsNull_OrderTotal", global::System.Data.SqlDbType.Int, 0, global::System.Data.ParameterDirection.Input, 0, 0, "OrderTotal", global::System.Data.DataRowVersion.Original, true, null, "", "", "")); - this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_OrderTotal", global::System.Data.SqlDbType.Decimal, 0, global::System.Data.ParameterDirection.Input, 9, 2, "OrderTotal", global::System.Data.DataRowVersion.Original, false, null, "", "", "")); - this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_IsClosed", global::System.Data.SqlDbType.Bit, 0, global::System.Data.ParameterDirection.Input, 0, 0, "IsClosed", 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].[ClientPurchaseOrder] ([PurchaseOrderDate], [ContactID], [ClientReference], [RequestorEmail], [OrderTotal], [IsClosed]) VALUES (@PurchaseOrderDate, @ContactID, @ClientReference, @RequestorEmail, @OrderTotal, @IsClosed); -SELECT ClientPurchaseOrderID, PurchaseOrderDate, ContactID, ClientReference, RequestorEmail, OrderTotal, IsClosed FROM ClientPurchaseOrder WHERE (ClientPurchaseOrderID = SCOPE_IDENTITY())"; - this._adapter.InsertCommand.CommandType = global::System.Data.CommandType.Text; - this._adapter.InsertCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@PurchaseOrderDate", global::System.Data.SqlDbType.Date, 0, global::System.Data.ParameterDirection.Input, 0, 0, "PurchaseOrderDate", global::System.Data.DataRowVersion.Current, false, null, "", "", "")); - this._adapter.InsertCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@ContactID", global::System.Data.SqlDbType.Int, 0, global::System.Data.ParameterDirection.Input, 0, 0, "ContactID", global::System.Data.DataRowVersion.Current, false, null, "", "", "")); - this._adapter.InsertCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@ClientReference", global::System.Data.SqlDbType.VarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "ClientReference", global::System.Data.DataRowVersion.Current, false, null, "", "", "")); - this._adapter.InsertCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@RequestorEmail", global::System.Data.SqlDbType.VarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "RequestorEmail", global::System.Data.DataRowVersion.Current, false, null, "", "", "")); - this._adapter.InsertCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@OrderTotal", global::System.Data.SqlDbType.Decimal, 0, global::System.Data.ParameterDirection.Input, 9, 2, "OrderTotal", global::System.Data.DataRowVersion.Current, false, null, "", "", "")); - this._adapter.InsertCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@IsClosed", global::System.Data.SqlDbType.Bit, 0, global::System.Data.ParameterDirection.Input, 0, 0, "IsClosed", 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].[ClientPurchaseOrder] SET [PurchaseOrderDate] = @PurchaseOrderDate, [ContactID] = @ContactID, [ClientReference] = @ClientReference, [RequestorEmail] = @RequestorEmail, [OrderTotal] = @OrderTotal, [IsClosed] = @IsClosed WHERE (([ClientPurchaseOrderID] = @Original_ClientPurchaseOrderID) AND ([PurchaseOrderDate] = @Original_PurchaseOrderDate) AND ([ContactID] = @Original_ContactID) AND ([ClientReference] = @Original_ClientReference) AND ((@IsNull_RequestorEmail = 1 AND [RequestorEmail] IS NULL) OR ([RequestorEmail] = @Original_RequestorEmail)) AND ((@IsNull_OrderTotal = 1 AND [OrderTotal] IS NULL) OR ([OrderTotal] = @Original_OrderTotal)) AND ([IsClosed] = @Original_IsClosed)); -SELECT ClientPurchaseOrderID, PurchaseOrderDate, ContactID, ClientReference, RequestorEmail, OrderTotal, IsClosed FROM ClientPurchaseOrder WHERE (ClientPurchaseOrderID = @ClientPurchaseOrderID)"; - this._adapter.UpdateCommand.CommandType = global::System.Data.CommandType.Text; - this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@PurchaseOrderDate", global::System.Data.SqlDbType.Date, 0, global::System.Data.ParameterDirection.Input, 0, 0, "PurchaseOrderDate", global::System.Data.DataRowVersion.Current, false, null, "", "", "")); - this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@ContactID", global::System.Data.SqlDbType.Int, 0, global::System.Data.ParameterDirection.Input, 0, 0, "ContactID", global::System.Data.DataRowVersion.Current, false, null, "", "", "")); - this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@ClientReference", global::System.Data.SqlDbType.VarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "ClientReference", global::System.Data.DataRowVersion.Current, false, null, "", "", "")); - this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@RequestorEmail", global::System.Data.SqlDbType.VarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "RequestorEmail", global::System.Data.DataRowVersion.Current, false, null, "", "", "")); - this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@OrderTotal", global::System.Data.SqlDbType.Decimal, 0, global::System.Data.ParameterDirection.Input, 9, 2, "OrderTotal", global::System.Data.DataRowVersion.Current, false, null, "", "", "")); - this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@IsClosed", global::System.Data.SqlDbType.Bit, 0, global::System.Data.ParameterDirection.Input, 0, 0, "IsClosed", global::System.Data.DataRowVersion.Current, false, null, "", "", "")); - this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_ClientPurchaseOrderID", global::System.Data.SqlDbType.Int, 0, global::System.Data.ParameterDirection.Input, 0, 0, "ClientPurchaseOrderID", global::System.Data.DataRowVersion.Original, false, null, "", "", "")); - this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_PurchaseOrderDate", global::System.Data.SqlDbType.Date, 0, global::System.Data.ParameterDirection.Input, 0, 0, "PurchaseOrderDate", global::System.Data.DataRowVersion.Original, false, null, "", "", "")); - this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_ContactID", global::System.Data.SqlDbType.Int, 0, global::System.Data.ParameterDirection.Input, 0, 0, "ContactID", global::System.Data.DataRowVersion.Original, false, null, "", "", "")); - this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_ClientReference", global::System.Data.SqlDbType.VarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "ClientReference", global::System.Data.DataRowVersion.Original, false, null, "", "", "")); - this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@IsNull_RequestorEmail", global::System.Data.SqlDbType.Int, 0, global::System.Data.ParameterDirection.Input, 0, 0, "RequestorEmail", global::System.Data.DataRowVersion.Original, true, null, "", "", "")); - this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_RequestorEmail", global::System.Data.SqlDbType.VarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "RequestorEmail", global::System.Data.DataRowVersion.Original, false, null, "", "", "")); - this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@IsNull_OrderTotal", global::System.Data.SqlDbType.Int, 0, global::System.Data.ParameterDirection.Input, 0, 0, "OrderTotal", global::System.Data.DataRowVersion.Original, true, null, "", "", "")); - this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_OrderTotal", global::System.Data.SqlDbType.Decimal, 0, global::System.Data.ParameterDirection.Input, 9, 2, "OrderTotal", global::System.Data.DataRowVersion.Original, false, null, "", "", "")); - this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_IsClosed", global::System.Data.SqlDbType.Bit, 0, global::System.Data.ParameterDirection.Input, 0, 0, "IsClosed", global::System.Data.DataRowVersion.Original, false, null, "", "", "")); - this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@ClientPurchaseOrderID", global::System.Data.SqlDbType.Int, 4, global::System.Data.ParameterDirection.Input, 0, 0, "ClientPurchaseOrderID", global::System.Data.DataRowVersion.Current, false, null, "", "", "")); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - private void InitConnection() { - this._connection = new global::System.Data.SqlClient.SqlConnection(); - this._connection.ConnectionString = global::BealeEngineering.Accounts.Properties.Settings.Default.BealeEngConnectionString; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - private void InitCommandCollection() { - this._commandCollection = new global::System.Data.SqlClient.SqlCommand[1]; - this._commandCollection[0] = new global::System.Data.SqlClient.SqlCommand(); - this._commandCollection[0].Connection = this.Connection; - this._commandCollection[0].CommandText = "SELECT ClientPurchaseOrderID, PurchaseOrderDate, ContactID, ClientReference, Requ" + - "estorEmail, OrderTotal, IsClosed FROM dbo.ClientPurchaseOrder"; - this._commandCollection[0].CommandType = global::System.Data.CommandType.Text; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.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(BealeEngDataSet.ClientPurchaseOrderDataTable 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", "16.0.0.0")] - [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")] - [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Select, true)] - public virtual BealeEngDataSet.ClientPurchaseOrderDataTable GetData() { - this.Adapter.SelectCommand = this.CommandCollection[0]; - BealeEngDataSet.ClientPurchaseOrderDataTable dataTable = new BealeEngDataSet.ClientPurchaseOrderDataTable(); - this.Adapter.Fill(dataTable); - return dataTable; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")] - public virtual int Update(BealeEngDataSet.ClientPurchaseOrderDataTable dataTable) { - return this.Adapter.Update(dataTable); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")] - public virtual int Update(BealeEngDataSet dataSet) { - return this.Adapter.Update(dataSet, "ClientPurchaseOrder"); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.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", "16.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", "16.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_ClientPurchaseOrderID, System.DateTime Original_PurchaseOrderDate, int Original_ContactID, string Original_ClientReference, string Original_RequestorEmail, global::System.Nullable Original_OrderTotal, bool Original_IsClosed) { - this.Adapter.DeleteCommand.Parameters[0].Value = ((int)(Original_ClientPurchaseOrderID)); - this.Adapter.DeleteCommand.Parameters[1].Value = ((System.DateTime)(Original_PurchaseOrderDate)); - this.Adapter.DeleteCommand.Parameters[2].Value = ((int)(Original_ContactID)); - if ((Original_ClientReference == null)) { - throw new global::System.ArgumentNullException("Original_ClientReference"); - } - else { - this.Adapter.DeleteCommand.Parameters[3].Value = ((string)(Original_ClientReference)); - } - if ((Original_RequestorEmail == null)) { - this.Adapter.DeleteCommand.Parameters[4].Value = ((object)(1)); - this.Adapter.DeleteCommand.Parameters[5].Value = global::System.DBNull.Value; - } - else { - this.Adapter.DeleteCommand.Parameters[4].Value = ((object)(0)); - this.Adapter.DeleteCommand.Parameters[5].Value = ((string)(Original_RequestorEmail)); - } - if ((Original_OrderTotal.HasValue == true)) { - this.Adapter.DeleteCommand.Parameters[6].Value = ((object)(0)); - this.Adapter.DeleteCommand.Parameters[7].Value = ((decimal)(Original_OrderTotal.Value)); - } - else { - this.Adapter.DeleteCommand.Parameters[6].Value = ((object)(1)); - this.Adapter.DeleteCommand.Parameters[7].Value = global::System.DBNull.Value; - } - this.Adapter.DeleteCommand.Parameters[8].Value = ((bool)(Original_IsClosed)); - 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", "16.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(System.DateTime PurchaseOrderDate, int ContactID, string ClientReference, string RequestorEmail, global::System.Nullable OrderTotal, bool IsClosed) { - this.Adapter.InsertCommand.Parameters[0].Value = ((System.DateTime)(PurchaseOrderDate)); - this.Adapter.InsertCommand.Parameters[1].Value = ((int)(ContactID)); - if ((ClientReference == null)) { - throw new global::System.ArgumentNullException("ClientReference"); - } - else { - this.Adapter.InsertCommand.Parameters[2].Value = ((string)(ClientReference)); - } - if ((RequestorEmail == null)) { - this.Adapter.InsertCommand.Parameters[3].Value = global::System.DBNull.Value; - } - else { - this.Adapter.InsertCommand.Parameters[3].Value = ((string)(RequestorEmail)); - } - if ((OrderTotal.HasValue == true)) { - this.Adapter.InsertCommand.Parameters[4].Value = ((decimal)(OrderTotal.Value)); - } - else { - this.Adapter.InsertCommand.Parameters[4].Value = global::System.DBNull.Value; - } - this.Adapter.InsertCommand.Parameters[5].Value = ((bool)(IsClosed)); - 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", "16.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(System.DateTime PurchaseOrderDate, int ContactID, string ClientReference, string RequestorEmail, global::System.Nullable OrderTotal, bool IsClosed, int Original_ClientPurchaseOrderID, System.DateTime Original_PurchaseOrderDate, int Original_ContactID, string Original_ClientReference, string Original_RequestorEmail, global::System.Nullable Original_OrderTotal, bool Original_IsClosed, int ClientPurchaseOrderID) { - this.Adapter.UpdateCommand.Parameters[0].Value = ((System.DateTime)(PurchaseOrderDate)); - this.Adapter.UpdateCommand.Parameters[1].Value = ((int)(ContactID)); - if ((ClientReference == null)) { - throw new global::System.ArgumentNullException("ClientReference"); - } - else { - this.Adapter.UpdateCommand.Parameters[2].Value = ((string)(ClientReference)); - } - if ((RequestorEmail == null)) { - this.Adapter.UpdateCommand.Parameters[3].Value = global::System.DBNull.Value; - } - else { - this.Adapter.UpdateCommand.Parameters[3].Value = ((string)(RequestorEmail)); - } - if ((OrderTotal.HasValue == true)) { - this.Adapter.UpdateCommand.Parameters[4].Value = ((decimal)(OrderTotal.Value)); - } - else { - this.Adapter.UpdateCommand.Parameters[4].Value = global::System.DBNull.Value; - } - this.Adapter.UpdateCommand.Parameters[5].Value = ((bool)(IsClosed)); - this.Adapter.UpdateCommand.Parameters[6].Value = ((int)(Original_ClientPurchaseOrderID)); - this.Adapter.UpdateCommand.Parameters[7].Value = ((System.DateTime)(Original_PurchaseOrderDate)); - this.Adapter.UpdateCommand.Parameters[8].Value = ((int)(Original_ContactID)); - if ((Original_ClientReference == null)) { - throw new global::System.ArgumentNullException("Original_ClientReference"); - } - else { - this.Adapter.UpdateCommand.Parameters[9].Value = ((string)(Original_ClientReference)); - } - if ((Original_RequestorEmail == null)) { - this.Adapter.UpdateCommand.Parameters[10].Value = ((object)(1)); - this.Adapter.UpdateCommand.Parameters[11].Value = global::System.DBNull.Value; - } - else { - this.Adapter.UpdateCommand.Parameters[10].Value = ((object)(0)); - this.Adapter.UpdateCommand.Parameters[11].Value = ((string)(Original_RequestorEmail)); - } - if ((Original_OrderTotal.HasValue == true)) { - this.Adapter.UpdateCommand.Parameters[12].Value = ((object)(0)); - this.Adapter.UpdateCommand.Parameters[13].Value = ((decimal)(Original_OrderTotal.Value)); - } - else { - this.Adapter.UpdateCommand.Parameters[12].Value = ((object)(1)); - this.Adapter.UpdateCommand.Parameters[13].Value = global::System.DBNull.Value; - } - this.Adapter.UpdateCommand.Parameters[14].Value = ((bool)(Original_IsClosed)); - this.Adapter.UpdateCommand.Parameters[15].Value = ((int)(ClientPurchaseOrderID)); - 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", "16.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(System.DateTime PurchaseOrderDate, int ContactID, string ClientReference, string RequestorEmail, global::System.Nullable OrderTotal, bool IsClosed, int Original_ClientPurchaseOrderID, System.DateTime Original_PurchaseOrderDate, int Original_ContactID, string Original_ClientReference, string Original_RequestorEmail, global::System.Nullable Original_OrderTotal, bool Original_IsClosed) { - return this.Update(PurchaseOrderDate, ContactID, ClientReference, RequestorEmail, OrderTotal, IsClosed, Original_ClientPurchaseOrderID, Original_PurchaseOrderDate, Original_ContactID, Original_ClientReference, Original_RequestorEmail, Original_OrderTotal, Original_IsClosed, Original_ClientPurchaseOrderID); - } - } - - /// - ///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 ClientPurchaseOrderLineTableAdapter : 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", "16.0.0.0")] - public ClientPurchaseOrderLineTableAdapter() { - this.ClearBeforeFill = true; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.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", "16.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", "16.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", "16.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", "16.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", "16.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 = "ClientPurchaseOrderLine"; - tableMapping.ColumnMappings.Add("ClientPurchaseOrderLineID", "ClientPurchaseOrderLineID"); - tableMapping.ColumnMappings.Add("ClientPurchaseOrderID", "ClientPurchaseOrderID"); - tableMapping.ColumnMappings.Add("LineNumber", "LineNumber"); - tableMapping.ColumnMappings.Add("ProjectJobID", "ProjectJobID"); - tableMapping.ColumnMappings.Add("Description", "Description"); - tableMapping.ColumnMappings.Add("LineNetAmount", "LineNetAmount"); - 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].[ClientPurchaseOrderLine] WHERE (([ClientPurchaseOrderLineID] = @Original_ClientPurchaseOrderLineID) AND ([ClientPurchaseOrderID] = @Original_ClientPurchaseOrderID) AND ([LineNumber] = @Original_LineNumber) AND ([ProjectJobID] = @Original_ProjectJobID) AND ((@IsNull_Description = 1 AND [Description] IS NULL) OR ([Description] = @Original_Description)) AND ([LineNetAmount] = @Original_LineNetAmount))"; - this._adapter.DeleteCommand.CommandType = global::System.Data.CommandType.Text; - this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_ClientPurchaseOrderLineID", global::System.Data.SqlDbType.Int, 0, global::System.Data.ParameterDirection.Input, 0, 0, "ClientPurchaseOrderLineID", global::System.Data.DataRowVersion.Original, false, null, "", "", "")); - this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_ClientPurchaseOrderID", global::System.Data.SqlDbType.Int, 0, global::System.Data.ParameterDirection.Input, 0, 0, "ClientPurchaseOrderID", global::System.Data.DataRowVersion.Original, false, null, "", "", "")); - this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_LineNumber", global::System.Data.SqlDbType.Int, 0, global::System.Data.ParameterDirection.Input, 0, 0, "LineNumber", global::System.Data.DataRowVersion.Original, false, null, "", "", "")); - this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_ProjectJobID", global::System.Data.SqlDbType.Int, 0, global::System.Data.ParameterDirection.Input, 0, 0, "ProjectJobID", global::System.Data.DataRowVersion.Original, false, null, "", "", "")); - this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@IsNull_Description", global::System.Data.SqlDbType.Int, 0, global::System.Data.ParameterDirection.Input, 0, 0, "Description", global::System.Data.DataRowVersion.Original, true, null, "", "", "")); - this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_Description", global::System.Data.SqlDbType.VarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "Description", global::System.Data.DataRowVersion.Original, false, null, "", "", "")); - this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_LineNetAmount", global::System.Data.SqlDbType.Decimal, 0, global::System.Data.ParameterDirection.Input, 9, 2, "LineNetAmount", 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].[ClientPurchaseOrderLine] ([ClientPurchaseOrderID], [LineNumber], [ProjectJobID], [Description], [LineNetAmount]) VALUES (@ClientPurchaseOrderID, @LineNumber, @ProjectJobID, @Description, @LineNetAmount); -SELECT ClientPurchaseOrderLineID, ClientPurchaseOrderID, LineNumber, ProjectJobID, Description, LineNetAmount FROM ClientPurchaseOrderLine WHERE (ClientPurchaseOrderLineID = SCOPE_IDENTITY())"; - this._adapter.InsertCommand.CommandType = global::System.Data.CommandType.Text; - this._adapter.InsertCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@ClientPurchaseOrderID", global::System.Data.SqlDbType.Int, 0, global::System.Data.ParameterDirection.Input, 0, 0, "ClientPurchaseOrderID", global::System.Data.DataRowVersion.Current, false, null, "", "", "")); - this._adapter.InsertCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@LineNumber", global::System.Data.SqlDbType.Int, 0, global::System.Data.ParameterDirection.Input, 0, 0, "LineNumber", global::System.Data.DataRowVersion.Current, false, null, "", "", "")); - this._adapter.InsertCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@ProjectJobID", global::System.Data.SqlDbType.Int, 0, global::System.Data.ParameterDirection.Input, 0, 0, "ProjectJobID", global::System.Data.DataRowVersion.Current, false, null, "", "", "")); - this._adapter.InsertCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Description", global::System.Data.SqlDbType.VarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "Description", global::System.Data.DataRowVersion.Current, false, null, "", "", "")); - this._adapter.InsertCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@LineNetAmount", global::System.Data.SqlDbType.Decimal, 0, global::System.Data.ParameterDirection.Input, 9, 2, "LineNetAmount", 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].[ClientPurchaseOrderLine] SET [ClientPurchaseOrderID] = @ClientPurchaseOrderID, [LineNumber] = @LineNumber, [ProjectJobID] = @ProjectJobID, [Description] = @Description, [LineNetAmount] = @LineNetAmount WHERE (([ClientPurchaseOrderLineID] = @Original_ClientPurchaseOrderLineID) AND ([ClientPurchaseOrderID] = @Original_ClientPurchaseOrderID) AND ([LineNumber] = @Original_LineNumber) AND ([ProjectJobID] = @Original_ProjectJobID) AND ((@IsNull_Description = 1 AND [Description] IS NULL) OR ([Description] = @Original_Description)) AND ([LineNetAmount] = @Original_LineNetAmount)); -SELECT ClientPurchaseOrderLineID, ClientPurchaseOrderID, LineNumber, ProjectJobID, Description, LineNetAmount FROM ClientPurchaseOrderLine WHERE (ClientPurchaseOrderLineID = @ClientPurchaseOrderLineID)"; - this._adapter.UpdateCommand.CommandType = global::System.Data.CommandType.Text; - this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@ClientPurchaseOrderID", global::System.Data.SqlDbType.Int, 0, global::System.Data.ParameterDirection.Input, 0, 0, "ClientPurchaseOrderID", global::System.Data.DataRowVersion.Current, false, null, "", "", "")); - this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@LineNumber", global::System.Data.SqlDbType.Int, 0, global::System.Data.ParameterDirection.Input, 0, 0, "LineNumber", global::System.Data.DataRowVersion.Current, false, null, "", "", "")); - this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@ProjectJobID", global::System.Data.SqlDbType.Int, 0, global::System.Data.ParameterDirection.Input, 0, 0, "ProjectJobID", global::System.Data.DataRowVersion.Current, false, null, "", "", "")); - this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Description", global::System.Data.SqlDbType.VarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "Description", global::System.Data.DataRowVersion.Current, false, null, "", "", "")); - this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@LineNetAmount", global::System.Data.SqlDbType.Decimal, 0, global::System.Data.ParameterDirection.Input, 9, 2, "LineNetAmount", global::System.Data.DataRowVersion.Current, false, null, "", "", "")); - this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_ClientPurchaseOrderLineID", global::System.Data.SqlDbType.Int, 0, global::System.Data.ParameterDirection.Input, 0, 0, "ClientPurchaseOrderLineID", global::System.Data.DataRowVersion.Original, false, null, "", "", "")); - this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_ClientPurchaseOrderID", global::System.Data.SqlDbType.Int, 0, global::System.Data.ParameterDirection.Input, 0, 0, "ClientPurchaseOrderID", global::System.Data.DataRowVersion.Original, false, null, "", "", "")); - this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_LineNumber", global::System.Data.SqlDbType.Int, 0, global::System.Data.ParameterDirection.Input, 0, 0, "LineNumber", global::System.Data.DataRowVersion.Original, false, null, "", "", "")); - this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_ProjectJobID", global::System.Data.SqlDbType.Int, 0, global::System.Data.ParameterDirection.Input, 0, 0, "ProjectJobID", global::System.Data.DataRowVersion.Original, false, null, "", "", "")); - this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@IsNull_Description", global::System.Data.SqlDbType.Int, 0, global::System.Data.ParameterDirection.Input, 0, 0, "Description", global::System.Data.DataRowVersion.Original, true, null, "", "", "")); - this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_Description", global::System.Data.SqlDbType.VarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "Description", global::System.Data.DataRowVersion.Original, false, null, "", "", "")); - this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_LineNetAmount", global::System.Data.SqlDbType.Decimal, 0, global::System.Data.ParameterDirection.Input, 9, 2, "LineNetAmount", global::System.Data.DataRowVersion.Original, false, null, "", "", "")); - this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@ClientPurchaseOrderLineID", global::System.Data.SqlDbType.Int, 4, global::System.Data.ParameterDirection.Input, 0, 0, "ClientPurchaseOrderLineID", global::System.Data.DataRowVersion.Current, false, null, "", "", "")); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - private void InitConnection() { - this._connection = new global::System.Data.SqlClient.SqlConnection(); - this._connection.ConnectionString = global::BealeEngineering.Accounts.Properties.Settings.Default.BealeEngConnectionString; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - private void InitCommandCollection() { - this._commandCollection = new global::System.Data.SqlClient.SqlCommand[1]; - this._commandCollection[0] = new global::System.Data.SqlClient.SqlCommand(); - this._commandCollection[0].Connection = this.Connection; - this._commandCollection[0].CommandText = "SELECT ClientPurchaseOrderLineID, ClientPurchaseOrderID, LineNumber, ProjectJobID" + - ", Description, LineNetAmount FROM dbo.ClientPurchaseOrderLine"; - this._commandCollection[0].CommandType = global::System.Data.CommandType.Text; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.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(BealeEngDataSet.ClientPurchaseOrderLineDataTable 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", "16.0.0.0")] - [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")] - [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Select, true)] - public virtual BealeEngDataSet.ClientPurchaseOrderLineDataTable GetData() { - this.Adapter.SelectCommand = this.CommandCollection[0]; - BealeEngDataSet.ClientPurchaseOrderLineDataTable dataTable = new BealeEngDataSet.ClientPurchaseOrderLineDataTable(); - this.Adapter.Fill(dataTable); - return dataTable; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")] - public virtual int Update(BealeEngDataSet.ClientPurchaseOrderLineDataTable dataTable) { - return this.Adapter.Update(dataTable); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")] - public virtual int Update(BealeEngDataSet dataSet) { - return this.Adapter.Update(dataSet, "ClientPurchaseOrderLine"); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.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", "16.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", "16.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_ClientPurchaseOrderLineID, int Original_ClientPurchaseOrderID, int Original_LineNumber, int Original_ProjectJobID, string Original_Description, decimal Original_LineNetAmount) { - this.Adapter.DeleteCommand.Parameters[0].Value = ((int)(Original_ClientPurchaseOrderLineID)); - this.Adapter.DeleteCommand.Parameters[1].Value = ((int)(Original_ClientPurchaseOrderID)); - this.Adapter.DeleteCommand.Parameters[2].Value = ((int)(Original_LineNumber)); - this.Adapter.DeleteCommand.Parameters[3].Value = ((int)(Original_ProjectJobID)); - if ((Original_Description == null)) { - this.Adapter.DeleteCommand.Parameters[4].Value = ((object)(1)); - this.Adapter.DeleteCommand.Parameters[5].Value = global::System.DBNull.Value; - } - else { - this.Adapter.DeleteCommand.Parameters[4].Value = ((object)(0)); - this.Adapter.DeleteCommand.Parameters[5].Value = ((string)(Original_Description)); - } - this.Adapter.DeleteCommand.Parameters[6].Value = ((decimal)(Original_LineNetAmount)); - 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", "16.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(int ClientPurchaseOrderID, int LineNumber, int ProjectJobID, string Description, decimal LineNetAmount) { - this.Adapter.InsertCommand.Parameters[0].Value = ((int)(ClientPurchaseOrderID)); - this.Adapter.InsertCommand.Parameters[1].Value = ((int)(LineNumber)); - this.Adapter.InsertCommand.Parameters[2].Value = ((int)(ProjectJobID)); - if ((Description == null)) { - this.Adapter.InsertCommand.Parameters[3].Value = global::System.DBNull.Value; - } - else { - this.Adapter.InsertCommand.Parameters[3].Value = ((string)(Description)); - } - this.Adapter.InsertCommand.Parameters[4].Value = ((decimal)(LineNetAmount)); - 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", "16.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(int ClientPurchaseOrderID, int LineNumber, int ProjectJobID, string Description, decimal LineNetAmount, int Original_ClientPurchaseOrderLineID, int Original_ClientPurchaseOrderID, int Original_LineNumber, int Original_ProjectJobID, string Original_Description, decimal Original_LineNetAmount, int ClientPurchaseOrderLineID) { - this.Adapter.UpdateCommand.Parameters[0].Value = ((int)(ClientPurchaseOrderID)); - this.Adapter.UpdateCommand.Parameters[1].Value = ((int)(LineNumber)); - this.Adapter.UpdateCommand.Parameters[2].Value = ((int)(ProjectJobID)); - if ((Description == null)) { - this.Adapter.UpdateCommand.Parameters[3].Value = global::System.DBNull.Value; - } - else { - this.Adapter.UpdateCommand.Parameters[3].Value = ((string)(Description)); - } - this.Adapter.UpdateCommand.Parameters[4].Value = ((decimal)(LineNetAmount)); - this.Adapter.UpdateCommand.Parameters[5].Value = ((int)(Original_ClientPurchaseOrderLineID)); - this.Adapter.UpdateCommand.Parameters[6].Value = ((int)(Original_ClientPurchaseOrderID)); - this.Adapter.UpdateCommand.Parameters[7].Value = ((int)(Original_LineNumber)); - this.Adapter.UpdateCommand.Parameters[8].Value = ((int)(Original_ProjectJobID)); - if ((Original_Description == null)) { - this.Adapter.UpdateCommand.Parameters[9].Value = ((object)(1)); - this.Adapter.UpdateCommand.Parameters[10].Value = global::System.DBNull.Value; - } - else { - this.Adapter.UpdateCommand.Parameters[9].Value = ((object)(0)); - this.Adapter.UpdateCommand.Parameters[10].Value = ((string)(Original_Description)); - } - this.Adapter.UpdateCommand.Parameters[11].Value = ((decimal)(Original_LineNetAmount)); - this.Adapter.UpdateCommand.Parameters[12].Value = ((int)(ClientPurchaseOrderLineID)); - 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", "16.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(int ClientPurchaseOrderID, int LineNumber, int ProjectJobID, string Description, decimal LineNetAmount, int Original_ClientPurchaseOrderLineID, int Original_ClientPurchaseOrderID, int Original_LineNumber, int Original_ProjectJobID, string Original_Description, decimal Original_LineNetAmount) { - return this.Update(ClientPurchaseOrderID, LineNumber, ProjectJobID, Description, LineNetAmount, Original_ClientPurchaseOrderLineID, Original_ClientPurchaseOrderID, Original_LineNumber, Original_ProjectJobID, Original_Description, Original_LineNetAmount, Original_ClientPurchaseOrderLineID); - } - } - - /// - ///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 ClientPurchaseOrderLineSalesInvoiceTableAdapter : 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", "16.0.0.0")] - public ClientPurchaseOrderLineSalesInvoiceTableAdapter() { - this.ClearBeforeFill = true; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.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", "16.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", "16.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", "16.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", "16.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", "16.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 = "ClientPurchaseOrderLineSalesInvoice"; - tableMapping.ColumnMappings.Add("ClientPurchaseOrderLineID", "ClientPurchaseOrderLineID"); - tableMapping.ColumnMappings.Add("SaleInvoiceID", "SaleInvoiceID"); - tableMapping.ColumnMappings.Add("IsApproved", "IsApproved"); - 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].[ClientPurchaseOrderLineSalesInvoice] WHERE (([ClientPurchaseOr" + - "derLineID] = @Original_ClientPurchaseOrderLineID) AND ([SaleInvoiceID] = @Origin" + - "al_SaleInvoiceID) AND ([IsApproved] = @Original_IsApproved))"; - this._adapter.DeleteCommand.CommandType = global::System.Data.CommandType.Text; - this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_ClientPurchaseOrderLineID", global::System.Data.SqlDbType.Int, 0, global::System.Data.ParameterDirection.Input, 0, 0, "ClientPurchaseOrderLineID", global::System.Data.DataRowVersion.Original, false, null, "", "", "")); - this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_SaleInvoiceID", global::System.Data.SqlDbType.Int, 0, global::System.Data.ParameterDirection.Input, 0, 0, "SaleInvoiceID", global::System.Data.DataRowVersion.Original, false, null, "", "", "")); - this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_IsApproved", global::System.Data.SqlDbType.Bit, 0, global::System.Data.ParameterDirection.Input, 0, 0, "IsApproved", 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].[ClientPurchaseOrderLineSalesInvoice] ([ClientPurchaseOrderLineID], [SaleInvoiceID], [IsApproved]) VALUES (@ClientPurchaseOrderLineID, @SaleInvoiceID, @IsApproved); -SELECT ClientPurchaseOrderLineID, SaleInvoiceID, IsApproved FROM ClientPurchaseOrderLineSalesInvoice WHERE (SaleInvoiceID = @SaleInvoiceID)"; - this._adapter.InsertCommand.CommandType = global::System.Data.CommandType.Text; - this._adapter.InsertCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@ClientPurchaseOrderLineID", global::System.Data.SqlDbType.Int, 0, global::System.Data.ParameterDirection.Input, 0, 0, "ClientPurchaseOrderLineID", global::System.Data.DataRowVersion.Current, false, null, "", "", "")); - this._adapter.InsertCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@SaleInvoiceID", global::System.Data.SqlDbType.Int, 0, global::System.Data.ParameterDirection.Input, 0, 0, "SaleInvoiceID", global::System.Data.DataRowVersion.Current, false, null, "", "", "")); - this._adapter.InsertCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@IsApproved", global::System.Data.SqlDbType.Bit, 0, global::System.Data.ParameterDirection.Input, 0, 0, "IsApproved", 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].[ClientPurchaseOrderLineSalesInvoice] SET [ClientPurchaseOrderLineID] = @ClientPurchaseOrderLineID, [SaleInvoiceID] = @SaleInvoiceID, [IsApproved] = @IsApproved WHERE (([ClientPurchaseOrderLineID] = @Original_ClientPurchaseOrderLineID) AND ([SaleInvoiceID] = @Original_SaleInvoiceID) AND ([IsApproved] = @Original_IsApproved)); -SELECT ClientPurchaseOrderLineID, SaleInvoiceID, IsApproved FROM ClientPurchaseOrderLineSalesInvoice WHERE (SaleInvoiceID = @SaleInvoiceID)"; - this._adapter.UpdateCommand.CommandType = global::System.Data.CommandType.Text; - this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@ClientPurchaseOrderLineID", global::System.Data.SqlDbType.Int, 0, global::System.Data.ParameterDirection.Input, 0, 0, "ClientPurchaseOrderLineID", global::System.Data.DataRowVersion.Current, false, null, "", "", "")); - this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@SaleInvoiceID", global::System.Data.SqlDbType.Int, 0, global::System.Data.ParameterDirection.Input, 0, 0, "SaleInvoiceID", global::System.Data.DataRowVersion.Current, false, null, "", "", "")); - this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@IsApproved", global::System.Data.SqlDbType.Bit, 0, global::System.Data.ParameterDirection.Input, 0, 0, "IsApproved", global::System.Data.DataRowVersion.Current, false, null, "", "", "")); - this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_ClientPurchaseOrderLineID", global::System.Data.SqlDbType.Int, 0, global::System.Data.ParameterDirection.Input, 0, 0, "ClientPurchaseOrderLineID", global::System.Data.DataRowVersion.Original, false, null, "", "", "")); - this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_SaleInvoiceID", global::System.Data.SqlDbType.Int, 0, global::System.Data.ParameterDirection.Input, 0, 0, "SaleInvoiceID", global::System.Data.DataRowVersion.Original, false, null, "", "", "")); - this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_IsApproved", global::System.Data.SqlDbType.Bit, 0, global::System.Data.ParameterDirection.Input, 0, 0, "IsApproved", global::System.Data.DataRowVersion.Original, false, null, "", "", "")); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - private void InitConnection() { - this._connection = new global::System.Data.SqlClient.SqlConnection(); - this._connection.ConnectionString = global::BealeEngineering.Accounts.Properties.Settings.Default.BealeEngConnectionString; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - private void InitCommandCollection() { - this._commandCollection = new global::System.Data.SqlClient.SqlCommand[1]; - this._commandCollection[0] = new global::System.Data.SqlClient.SqlCommand(); - this._commandCollection[0].Connection = this.Connection; - this._commandCollection[0].CommandText = "SELECT ClientPurchaseOrderLineID, SaleInvoiceID, IsApproved FROM dbo.ClientPurcha" + - "seOrderLineSalesInvoice"; - this._commandCollection[0].CommandType = global::System.Data.CommandType.Text; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.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(BealeEngDataSet.ClientPurchaseOrderLineSalesInvoiceDataTable 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", "16.0.0.0")] - [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")] - [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Select, true)] - public virtual BealeEngDataSet.ClientPurchaseOrderLineSalesInvoiceDataTable GetData() { - this.Adapter.SelectCommand = this.CommandCollection[0]; - BealeEngDataSet.ClientPurchaseOrderLineSalesInvoiceDataTable dataTable = new BealeEngDataSet.ClientPurchaseOrderLineSalesInvoiceDataTable(); - this.Adapter.Fill(dataTable); - return dataTable; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")] - public virtual int Update(BealeEngDataSet.ClientPurchaseOrderLineSalesInvoiceDataTable dataTable) { - return this.Adapter.Update(dataTable); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")] - public virtual int Update(BealeEngDataSet dataSet) { - return this.Adapter.Update(dataSet, "ClientPurchaseOrderLineSalesInvoice"); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.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", "16.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", "16.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_ClientPurchaseOrderLineID, int Original_SaleInvoiceID, bool Original_IsApproved) { - this.Adapter.DeleteCommand.Parameters[0].Value = ((int)(Original_ClientPurchaseOrderLineID)); - this.Adapter.DeleteCommand.Parameters[1].Value = ((int)(Original_SaleInvoiceID)); - this.Adapter.DeleteCommand.Parameters[2].Value = ((bool)(Original_IsApproved)); - 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", "16.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(int ClientPurchaseOrderLineID, int SaleInvoiceID, bool IsApproved) { - this.Adapter.InsertCommand.Parameters[0].Value = ((int)(ClientPurchaseOrderLineID)); - this.Adapter.InsertCommand.Parameters[1].Value = ((int)(SaleInvoiceID)); - this.Adapter.InsertCommand.Parameters[2].Value = ((bool)(IsApproved)); - 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", "16.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(int ClientPurchaseOrderLineID, int SaleInvoiceID, bool IsApproved, int Original_ClientPurchaseOrderLineID, int Original_SaleInvoiceID, bool Original_IsApproved) { - this.Adapter.UpdateCommand.Parameters[0].Value = ((int)(ClientPurchaseOrderLineID)); - this.Adapter.UpdateCommand.Parameters[1].Value = ((int)(SaleInvoiceID)); - this.Adapter.UpdateCommand.Parameters[2].Value = ((bool)(IsApproved)); - this.Adapter.UpdateCommand.Parameters[3].Value = ((int)(Original_ClientPurchaseOrderLineID)); - this.Adapter.UpdateCommand.Parameters[4].Value = ((int)(Original_SaleInvoiceID)); - this.Adapter.UpdateCommand.Parameters[5].Value = ((bool)(Original_IsApproved)); - 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", "16.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(int ClientPurchaseOrderLineID, bool IsApproved, int Original_ClientPurchaseOrderLineID, int Original_SaleInvoiceID, bool Original_IsApproved) { - return this.Update(ClientPurchaseOrderLineID, Original_SaleInvoiceID, IsApproved, Original_ClientPurchaseOrderLineID, Original_SaleInvoiceID, Original_IsApproved); - } - } - - /// - ///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 ContactTableAdapter : 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", "16.0.0.0")] - public ContactTableAdapter() { - this.ClearBeforeFill = true; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.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", "16.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", "16.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", "16.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", "16.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", "16.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 = "Contact"; - tableMapping.ColumnMappings.Add("ContactID", "ContactID"); - tableMapping.ColumnMappings.Add("ContactName", "ContactName"); - tableMapping.ColumnMappings.Add("EmailAddress", "EmailAddress"); - tableMapping.ColumnMappings.Add("PrimaryPersonFirstName", "PrimaryPersonFirstName"); - tableMapping.ColumnMappings.Add("PrimaryPersonSurname", "PrimaryPersonSurname"); - tableMapping.ColumnMappings.Add("PrimaryPersonEmail", "PrimaryPersonEmail"); - tableMapping.ColumnMappings.Add("POAddressLine1", "POAddressLine1"); - tableMapping.ColumnMappings.Add("POAddressLine2", "POAddressLine2"); - tableMapping.ColumnMappings.Add("POAddressLine3", "POAddressLine3"); - tableMapping.ColumnMappings.Add("POAddressLine4", "POAddressLine4"); - tableMapping.ColumnMappings.Add("POAddressCity", "POAddressCity"); - tableMapping.ColumnMappings.Add("POAddressRegion", "POAddressRegion"); - tableMapping.ColumnMappings.Add("POAddressPostalCode", "POAddressPostalCode"); - tableMapping.ColumnMappings.Add("POAddressCountry", "POAddressCountry"); - 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].[Contact] WHERE (([ContactID] = @Original_ContactID) AND ([Cont" + - "actName] = @Original_ContactName) AND ((@IsNull_EmailAddress = 1 AND [EmailAddre" + - "ss] IS NULL) OR ([EmailAddress] = @Original_EmailAddress)) AND ((@IsNull_Primary" + - "PersonFirstName = 1 AND [PrimaryPersonFirstName] IS NULL) OR ([PrimaryPersonFirs" + - "tName] = @Original_PrimaryPersonFirstName)) AND ((@IsNull_PrimaryPersonSurname =" + - " 1 AND [PrimaryPersonSurname] IS NULL) OR ([PrimaryPersonSurname] = @Original_Pr" + - "imaryPersonSurname)) AND ((@IsNull_PrimaryPersonEmail = 1 AND [PrimaryPersonEmai" + - "l] IS NULL) OR ([PrimaryPersonEmail] = @Original_PrimaryPersonEmail)) AND ((@IsN" + - "ull_POAddressLine1 = 1 AND [POAddressLine1] IS NULL) OR ([POAddressLine1] = @Ori" + - "ginal_POAddressLine1)) AND ((@IsNull_POAddressLine2 = 1 AND [POAddressLine2] IS " + - "NULL) OR ([POAddressLine2] = @Original_POAddressLine2)) AND ((@IsNull_POAddressL" + - "ine3 = 1 AND [POAddressLine3] IS NULL) OR ([POAddressLine3] = @Original_POAddres" + - "sLine3)) AND ((@IsNull_POAddressLine4 = 1 AND [POAddressLine4] IS NULL) OR ([POA" + - "ddressLine4] = @Original_POAddressLine4)) AND ((@IsNull_POAddressCity = 1 AND [P" + - "OAddressCity] IS NULL) OR ([POAddressCity] = @Original_POAddressCity)) AND ((@Is" + - "Null_POAddressRegion = 1 AND [POAddressRegion] IS NULL) OR ([POAddressRegion] = " + - "@Original_POAddressRegion)) AND ((@IsNull_POAddressPostalCode = 1 AND [POAddress" + - "PostalCode] IS NULL) OR ([POAddressPostalCode] = @Original_POAddressPostalCode))" + - " AND ((@IsNull_POAddressCountry = 1 AND [POAddressCountry] IS NULL) OR ([POAddre" + - "ssCountry] = @Original_POAddressCountry)))"; - this._adapter.DeleteCommand.CommandType = global::System.Data.CommandType.Text; - this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_ContactID", global::System.Data.SqlDbType.Int, 0, global::System.Data.ParameterDirection.Input, 0, 0, "ContactID", global::System.Data.DataRowVersion.Original, false, null, "", "", "")); - this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_ContactName", global::System.Data.SqlDbType.VarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "ContactName", global::System.Data.DataRowVersion.Original, false, null, "", "", "")); - this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@IsNull_EmailAddress", global::System.Data.SqlDbType.Int, 0, global::System.Data.ParameterDirection.Input, 0, 0, "EmailAddress", global::System.Data.DataRowVersion.Original, true, null, "", "", "")); - this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_EmailAddress", global::System.Data.SqlDbType.VarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "EmailAddress", global::System.Data.DataRowVersion.Original, false, null, "", "", "")); - this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@IsNull_PrimaryPersonFirstName", global::System.Data.SqlDbType.Int, 0, global::System.Data.ParameterDirection.Input, 0, 0, "PrimaryPersonFirstName", global::System.Data.DataRowVersion.Original, true, null, "", "", "")); - this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_PrimaryPersonFirstName", global::System.Data.SqlDbType.VarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "PrimaryPersonFirstName", global::System.Data.DataRowVersion.Original, false, null, "", "", "")); - this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@IsNull_PrimaryPersonSurname", global::System.Data.SqlDbType.Int, 0, global::System.Data.ParameterDirection.Input, 0, 0, "PrimaryPersonSurname", global::System.Data.DataRowVersion.Original, true, null, "", "", "")); - this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_PrimaryPersonSurname", global::System.Data.SqlDbType.VarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "PrimaryPersonSurname", global::System.Data.DataRowVersion.Original, false, null, "", "", "")); - this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@IsNull_PrimaryPersonEmail", global::System.Data.SqlDbType.Int, 0, global::System.Data.ParameterDirection.Input, 0, 0, "PrimaryPersonEmail", global::System.Data.DataRowVersion.Original, true, null, "", "", "")); - this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_PrimaryPersonEmail", global::System.Data.SqlDbType.VarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "PrimaryPersonEmail", global::System.Data.DataRowVersion.Original, false, null, "", "", "")); - this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@IsNull_POAddressLine1", global::System.Data.SqlDbType.Int, 0, global::System.Data.ParameterDirection.Input, 0, 0, "POAddressLine1", global::System.Data.DataRowVersion.Original, true, null, "", "", "")); - this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_POAddressLine1", global::System.Data.SqlDbType.VarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "POAddressLine1", global::System.Data.DataRowVersion.Original, false, null, "", "", "")); - this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@IsNull_POAddressLine2", global::System.Data.SqlDbType.Int, 0, global::System.Data.ParameterDirection.Input, 0, 0, "POAddressLine2", global::System.Data.DataRowVersion.Original, true, null, "", "", "")); - this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_POAddressLine2", global::System.Data.SqlDbType.VarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "POAddressLine2", global::System.Data.DataRowVersion.Original, false, null, "", "", "")); - this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@IsNull_POAddressLine3", global::System.Data.SqlDbType.Int, 0, global::System.Data.ParameterDirection.Input, 0, 0, "POAddressLine3", global::System.Data.DataRowVersion.Original, true, null, "", "", "")); - this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_POAddressLine3", global::System.Data.SqlDbType.VarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "POAddressLine3", global::System.Data.DataRowVersion.Original, false, null, "", "", "")); - this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@IsNull_POAddressLine4", global::System.Data.SqlDbType.Int, 0, global::System.Data.ParameterDirection.Input, 0, 0, "POAddressLine4", global::System.Data.DataRowVersion.Original, true, null, "", "", "")); - this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_POAddressLine4", global::System.Data.SqlDbType.VarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "POAddressLine4", global::System.Data.DataRowVersion.Original, false, null, "", "", "")); - this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@IsNull_POAddressCity", global::System.Data.SqlDbType.Int, 0, global::System.Data.ParameterDirection.Input, 0, 0, "POAddressCity", global::System.Data.DataRowVersion.Original, true, null, "", "", "")); - this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_POAddressCity", global::System.Data.SqlDbType.VarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "POAddressCity", global::System.Data.DataRowVersion.Original, false, null, "", "", "")); - this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@IsNull_POAddressRegion", global::System.Data.SqlDbType.Int, 0, global::System.Data.ParameterDirection.Input, 0, 0, "POAddressRegion", global::System.Data.DataRowVersion.Original, true, null, "", "", "")); - this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_POAddressRegion", global::System.Data.SqlDbType.VarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "POAddressRegion", global::System.Data.DataRowVersion.Original, false, null, "", "", "")); - this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@IsNull_POAddressPostalCode", global::System.Data.SqlDbType.Int, 0, global::System.Data.ParameterDirection.Input, 0, 0, "POAddressPostalCode", global::System.Data.DataRowVersion.Original, true, null, "", "", "")); - this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_POAddressPostalCode", global::System.Data.SqlDbType.VarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "POAddressPostalCode", global::System.Data.DataRowVersion.Original, false, null, "", "", "")); - this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@IsNull_POAddressCountry", global::System.Data.SqlDbType.Int, 0, global::System.Data.ParameterDirection.Input, 0, 0, "POAddressCountry", global::System.Data.DataRowVersion.Original, true, null, "", "", "")); - this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_POAddressCountry", global::System.Data.SqlDbType.VarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "POAddressCountry", 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].[Contact] ([ContactName], [EmailAddress], [PrimaryPersonFirstName], [PrimaryPersonSurname], [PrimaryPersonEmail], [POAddressLine1], [POAddressLine2], [POAddressLine3], [POAddressLine4], [POAddressCity], [POAddressRegion], [POAddressPostalCode], [POAddressCountry]) VALUES (@ContactName, @EmailAddress, @PrimaryPersonFirstName, @PrimaryPersonSurname, @PrimaryPersonEmail, @POAddressLine1, @POAddressLine2, @POAddressLine3, @POAddressLine4, @POAddressCity, @POAddressRegion, @POAddressPostalCode, @POAddressCountry); -SELECT ContactID, ContactName, EmailAddress, PrimaryPersonFirstName, PrimaryPersonSurname, PrimaryPersonEmail, POAddressLine1, POAddressLine2, POAddressLine3, POAddressLine4, POAddressCity, POAddressRegion, POAddressPostalCode, POAddressCountry FROM Contact WHERE (ContactID = SCOPE_IDENTITY())"; - this._adapter.InsertCommand.CommandType = global::System.Data.CommandType.Text; - this._adapter.InsertCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@ContactName", global::System.Data.SqlDbType.VarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "ContactName", global::System.Data.DataRowVersion.Current, false, null, "", "", "")); - this._adapter.InsertCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@EmailAddress", global::System.Data.SqlDbType.VarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "EmailAddress", global::System.Data.DataRowVersion.Current, false, null, "", "", "")); - this._adapter.InsertCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@PrimaryPersonFirstName", global::System.Data.SqlDbType.VarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "PrimaryPersonFirstName", global::System.Data.DataRowVersion.Current, false, null, "", "", "")); - this._adapter.InsertCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@PrimaryPersonSurname", global::System.Data.SqlDbType.VarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "PrimaryPersonSurname", global::System.Data.DataRowVersion.Current, false, null, "", "", "")); - this._adapter.InsertCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@PrimaryPersonEmail", global::System.Data.SqlDbType.VarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "PrimaryPersonEmail", global::System.Data.DataRowVersion.Current, false, null, "", "", "")); - this._adapter.InsertCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@POAddressLine1", global::System.Data.SqlDbType.VarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "POAddressLine1", global::System.Data.DataRowVersion.Current, false, null, "", "", "")); - this._adapter.InsertCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@POAddressLine2", global::System.Data.SqlDbType.VarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "POAddressLine2", global::System.Data.DataRowVersion.Current, false, null, "", "", "")); - this._adapter.InsertCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@POAddressLine3", global::System.Data.SqlDbType.VarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "POAddressLine3", global::System.Data.DataRowVersion.Current, false, null, "", "", "")); - this._adapter.InsertCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@POAddressLine4", global::System.Data.SqlDbType.VarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "POAddressLine4", global::System.Data.DataRowVersion.Current, false, null, "", "", "")); - this._adapter.InsertCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@POAddressCity", global::System.Data.SqlDbType.VarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "POAddressCity", global::System.Data.DataRowVersion.Current, false, null, "", "", "")); - this._adapter.InsertCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@POAddressRegion", global::System.Data.SqlDbType.VarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "POAddressRegion", global::System.Data.DataRowVersion.Current, false, null, "", "", "")); - this._adapter.InsertCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@POAddressPostalCode", global::System.Data.SqlDbType.VarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "POAddressPostalCode", global::System.Data.DataRowVersion.Current, false, null, "", "", "")); - this._adapter.InsertCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@POAddressCountry", global::System.Data.SqlDbType.VarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "POAddressCountry", 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].[Contact] SET [ContactName] = @ContactName, [EmailAddress] = @EmailA" + - "ddress, [PrimaryPersonFirstName] = @PrimaryPersonFirstName, [PrimaryPersonSurnam" + - "e] = @PrimaryPersonSurname, [PrimaryPersonEmail] = @PrimaryPersonEmail, [POAddre" + - "ssLine1] = @POAddressLine1, [POAddressLine2] = @POAddressLine2, [POAddressLine3]" + - " = @POAddressLine3, [POAddressLine4] = @POAddressLine4, [POAddressCity] = @POAdd" + - "ressCity, [POAddressRegion] = @POAddressRegion, [POAddressPostalCode] = @POAddre" + - "ssPostalCode, [POAddressCountry] = @POAddressCountry WHERE (([ContactID] = @Orig" + - "inal_ContactID) AND ([ContactName] = @Original_ContactName) AND ((@IsNull_EmailA" + - "ddress = 1 AND [EmailAddress] IS NULL) OR ([EmailAddress] = @Original_EmailAddre" + - "ss)) AND ((@IsNull_PrimaryPersonFirstName = 1 AND [PrimaryPersonFirstName] IS NU" + - "LL) OR ([PrimaryPersonFirstName] = @Original_PrimaryPersonFirstName)) AND ((@IsN" + - "ull_PrimaryPersonSurname = 1 AND [PrimaryPersonSurname] IS NULL) OR ([PrimaryPer" + - "sonSurname] = @Original_PrimaryPersonSurname)) AND ((@IsNull_PrimaryPersonEmail " + - "= 1 AND [PrimaryPersonEmail] IS NULL) OR ([PrimaryPersonEmail] = @Original_Prima" + - "ryPersonEmail)) AND ((@IsNull_POAddressLine1 = 1 AND [POAddressLine1] IS NULL) O" + - "R ([POAddressLine1] = @Original_POAddressLine1)) AND ((@IsNull_POAddressLine2 = " + - "1 AND [POAddressLine2] IS NULL) OR ([POAddressLine2] = @Original_POAddressLine2)" + - ") AND ((@IsNull_POAddressLine3 = 1 AND [POAddressLine3] IS NULL) OR ([POAddressL" + - "ine3] = @Original_POAddressLine3)) AND ((@IsNull_POAddressLine4 = 1 AND [POAddre" + - "ssLine4] IS NULL) OR ([POAddressLine4] = @Original_POAddressLine4)) AND ((@IsNul" + - "l_POAddressCity = 1 AND [POAddressCity] IS NULL) OR ([POAddressCity] = @Original" + - "_POAddressCity)) AND ((@IsNull_POAddressRegion = 1 AND [POAddressRegion] IS NULL" + - ") OR ([POAddressRegion] = @Original_POAddressRegion)) AND ((@IsNull_POAddressPos" + - "talCode = 1 AND [POAddressPostalCode] IS NULL) OR ([POAddressPostalCode] = @Orig" + - "inal_POAddressPostalCode)) AND ((@IsNull_POAddressCountry = 1 AND [POAddressCoun" + - "try] IS NULL) OR ([POAddressCountry] = @Original_POAddressCountry)));\r\nSELECT Co" + - "ntactID, ContactName, EmailAddress, PrimaryPersonFirstName, PrimaryPersonSurname" + - ", PrimaryPersonEmail, POAddressLine1, POAddressLine2, POAddressLine3, POAddressL" + - "ine4, POAddressCity, POAddressRegion, POAddressPostalCode, POAddressCountry FROM" + - " Contact WHERE (ContactID = @ContactID)"; - this._adapter.UpdateCommand.CommandType = global::System.Data.CommandType.Text; - this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@ContactName", global::System.Data.SqlDbType.VarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "ContactName", global::System.Data.DataRowVersion.Current, false, null, "", "", "")); - this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@EmailAddress", global::System.Data.SqlDbType.VarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "EmailAddress", global::System.Data.DataRowVersion.Current, false, null, "", "", "")); - this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@PrimaryPersonFirstName", global::System.Data.SqlDbType.VarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "PrimaryPersonFirstName", global::System.Data.DataRowVersion.Current, false, null, "", "", "")); - this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@PrimaryPersonSurname", global::System.Data.SqlDbType.VarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "PrimaryPersonSurname", global::System.Data.DataRowVersion.Current, false, null, "", "", "")); - this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@PrimaryPersonEmail", global::System.Data.SqlDbType.VarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "PrimaryPersonEmail", global::System.Data.DataRowVersion.Current, false, null, "", "", "")); - this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@POAddressLine1", global::System.Data.SqlDbType.VarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "POAddressLine1", global::System.Data.DataRowVersion.Current, false, null, "", "", "")); - this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@POAddressLine2", global::System.Data.SqlDbType.VarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "POAddressLine2", global::System.Data.DataRowVersion.Current, false, null, "", "", "")); - this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@POAddressLine3", global::System.Data.SqlDbType.VarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "POAddressLine3", global::System.Data.DataRowVersion.Current, false, null, "", "", "")); - this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@POAddressLine4", global::System.Data.SqlDbType.VarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "POAddressLine4", global::System.Data.DataRowVersion.Current, false, null, "", "", "")); - this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@POAddressCity", global::System.Data.SqlDbType.VarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "POAddressCity", global::System.Data.DataRowVersion.Current, false, null, "", "", "")); - this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@POAddressRegion", global::System.Data.SqlDbType.VarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "POAddressRegion", global::System.Data.DataRowVersion.Current, false, null, "", "", "")); - this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@POAddressPostalCode", global::System.Data.SqlDbType.VarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "POAddressPostalCode", global::System.Data.DataRowVersion.Current, false, null, "", "", "")); - this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@POAddressCountry", global::System.Data.SqlDbType.VarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "POAddressCountry", global::System.Data.DataRowVersion.Current, false, null, "", "", "")); - this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_ContactID", global::System.Data.SqlDbType.Int, 0, global::System.Data.ParameterDirection.Input, 0, 0, "ContactID", global::System.Data.DataRowVersion.Original, false, null, "", "", "")); - this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_ContactName", global::System.Data.SqlDbType.VarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "ContactName", global::System.Data.DataRowVersion.Original, false, null, "", "", "")); - this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@IsNull_EmailAddress", global::System.Data.SqlDbType.Int, 0, global::System.Data.ParameterDirection.Input, 0, 0, "EmailAddress", global::System.Data.DataRowVersion.Original, true, null, "", "", "")); - this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_EmailAddress", global::System.Data.SqlDbType.VarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "EmailAddress", global::System.Data.DataRowVersion.Original, false, null, "", "", "")); - this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@IsNull_PrimaryPersonFirstName", global::System.Data.SqlDbType.Int, 0, global::System.Data.ParameterDirection.Input, 0, 0, "PrimaryPersonFirstName", global::System.Data.DataRowVersion.Original, true, null, "", "", "")); - this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_PrimaryPersonFirstName", global::System.Data.SqlDbType.VarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "PrimaryPersonFirstName", global::System.Data.DataRowVersion.Original, false, null, "", "", "")); - this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@IsNull_PrimaryPersonSurname", global::System.Data.SqlDbType.Int, 0, global::System.Data.ParameterDirection.Input, 0, 0, "PrimaryPersonSurname", global::System.Data.DataRowVersion.Original, true, null, "", "", "")); - this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_PrimaryPersonSurname", global::System.Data.SqlDbType.VarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "PrimaryPersonSurname", global::System.Data.DataRowVersion.Original, false, null, "", "", "")); - this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@IsNull_PrimaryPersonEmail", global::System.Data.SqlDbType.Int, 0, global::System.Data.ParameterDirection.Input, 0, 0, "PrimaryPersonEmail", global::System.Data.DataRowVersion.Original, true, null, "", "", "")); - this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_PrimaryPersonEmail", global::System.Data.SqlDbType.VarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "PrimaryPersonEmail", global::System.Data.DataRowVersion.Original, false, null, "", "", "")); - this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@IsNull_POAddressLine1", global::System.Data.SqlDbType.Int, 0, global::System.Data.ParameterDirection.Input, 0, 0, "POAddressLine1", global::System.Data.DataRowVersion.Original, true, null, "", "", "")); - this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_POAddressLine1", global::System.Data.SqlDbType.VarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "POAddressLine1", global::System.Data.DataRowVersion.Original, false, null, "", "", "")); - this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@IsNull_POAddressLine2", global::System.Data.SqlDbType.Int, 0, global::System.Data.ParameterDirection.Input, 0, 0, "POAddressLine2", global::System.Data.DataRowVersion.Original, true, null, "", "", "")); - this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_POAddressLine2", global::System.Data.SqlDbType.VarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "POAddressLine2", global::System.Data.DataRowVersion.Original, false, null, "", "", "")); - this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@IsNull_POAddressLine3", global::System.Data.SqlDbType.Int, 0, global::System.Data.ParameterDirection.Input, 0, 0, "POAddressLine3", global::System.Data.DataRowVersion.Original, true, null, "", "", "")); - this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_POAddressLine3", global::System.Data.SqlDbType.VarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "POAddressLine3", global::System.Data.DataRowVersion.Original, false, null, "", "", "")); - this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@IsNull_POAddressLine4", global::System.Data.SqlDbType.Int, 0, global::System.Data.ParameterDirection.Input, 0, 0, "POAddressLine4", global::System.Data.DataRowVersion.Original, true, null, "", "", "")); - this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_POAddressLine4", global::System.Data.SqlDbType.VarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "POAddressLine4", global::System.Data.DataRowVersion.Original, false, null, "", "", "")); - this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@IsNull_POAddressCity", global::System.Data.SqlDbType.Int, 0, global::System.Data.ParameterDirection.Input, 0, 0, "POAddressCity", global::System.Data.DataRowVersion.Original, true, null, "", "", "")); - this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_POAddressCity", global::System.Data.SqlDbType.VarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "POAddressCity", global::System.Data.DataRowVersion.Original, false, null, "", "", "")); - this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@IsNull_POAddressRegion", global::System.Data.SqlDbType.Int, 0, global::System.Data.ParameterDirection.Input, 0, 0, "POAddressRegion", global::System.Data.DataRowVersion.Original, true, null, "", "", "")); - this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_POAddressRegion", global::System.Data.SqlDbType.VarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "POAddressRegion", global::System.Data.DataRowVersion.Original, false, null, "", "", "")); - this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@IsNull_POAddressPostalCode", global::System.Data.SqlDbType.Int, 0, global::System.Data.ParameterDirection.Input, 0, 0, "POAddressPostalCode", global::System.Data.DataRowVersion.Original, true, null, "", "", "")); - this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_POAddressPostalCode", global::System.Data.SqlDbType.VarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "POAddressPostalCode", global::System.Data.DataRowVersion.Original, false, null, "", "", "")); - this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@IsNull_POAddressCountry", global::System.Data.SqlDbType.Int, 0, global::System.Data.ParameterDirection.Input, 0, 0, "POAddressCountry", global::System.Data.DataRowVersion.Original, true, null, "", "", "")); - this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_POAddressCountry", global::System.Data.SqlDbType.VarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "POAddressCountry", global::System.Data.DataRowVersion.Original, false, null, "", "", "")); - this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@ContactID", global::System.Data.SqlDbType.Int, 4, global::System.Data.ParameterDirection.Input, 0, 0, "ContactID", global::System.Data.DataRowVersion.Current, false, null, "", "", "")); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - private void InitConnection() { - this._connection = new global::System.Data.SqlClient.SqlConnection(); - this._connection.ConnectionString = global::BealeEngineering.Accounts.Properties.Settings.Default.BealeEngConnectionString; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - private void InitCommandCollection() { - this._commandCollection = new global::System.Data.SqlClient.SqlCommand[1]; - this._commandCollection[0] = new global::System.Data.SqlClient.SqlCommand(); - this._commandCollection[0].Connection = this.Connection; - this._commandCollection[0].CommandText = @"SELECT ContactID, ContactName, EmailAddress, PrimaryPersonFirstName, PrimaryPersonSurname, PrimaryPersonEmail, POAddressLine1, POAddressLine2, POAddressLine3, POAddressLine4, POAddressCity, POAddressRegion, POAddressPostalCode, POAddressCountry FROM dbo.Contact"; - this._commandCollection[0].CommandType = global::System.Data.CommandType.Text; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.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(BealeEngDataSet.ContactDataTable 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", "16.0.0.0")] - [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")] - [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Select, true)] - public virtual BealeEngDataSet.ContactDataTable GetData() { - this.Adapter.SelectCommand = this.CommandCollection[0]; - BealeEngDataSet.ContactDataTable dataTable = new BealeEngDataSet.ContactDataTable(); - this.Adapter.Fill(dataTable); - return dataTable; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")] - public virtual int Update(BealeEngDataSet.ContactDataTable dataTable) { - return this.Adapter.Update(dataTable); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")] - public virtual int Update(BealeEngDataSet dataSet) { - return this.Adapter.Update(dataSet, "Contact"); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.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", "16.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", "16.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_ContactID, string Original_ContactName, string Original_EmailAddress, string Original_PrimaryPersonFirstName, string Original_PrimaryPersonSurname, string Original_PrimaryPersonEmail, string Original_POAddressLine1, string Original_POAddressLine2, string Original_POAddressLine3, string Original_POAddressLine4, string Original_POAddressCity, string Original_POAddressRegion, string Original_POAddressPostalCode, string Original_POAddressCountry) { - this.Adapter.DeleteCommand.Parameters[0].Value = ((int)(Original_ContactID)); - if ((Original_ContactName == null)) { - throw new global::System.ArgumentNullException("Original_ContactName"); - } - else { - this.Adapter.DeleteCommand.Parameters[1].Value = ((string)(Original_ContactName)); - } - if ((Original_EmailAddress == null)) { - this.Adapter.DeleteCommand.Parameters[2].Value = ((object)(1)); - this.Adapter.DeleteCommand.Parameters[3].Value = global::System.DBNull.Value; - } - else { - this.Adapter.DeleteCommand.Parameters[2].Value = ((object)(0)); - this.Adapter.DeleteCommand.Parameters[3].Value = ((string)(Original_EmailAddress)); - } - if ((Original_PrimaryPersonFirstName == null)) { - this.Adapter.DeleteCommand.Parameters[4].Value = ((object)(1)); - this.Adapter.DeleteCommand.Parameters[5].Value = global::System.DBNull.Value; - } - else { - this.Adapter.DeleteCommand.Parameters[4].Value = ((object)(0)); - this.Adapter.DeleteCommand.Parameters[5].Value = ((string)(Original_PrimaryPersonFirstName)); - } - if ((Original_PrimaryPersonSurname == null)) { - this.Adapter.DeleteCommand.Parameters[6].Value = ((object)(1)); - this.Adapter.DeleteCommand.Parameters[7].Value = global::System.DBNull.Value; - } - else { - this.Adapter.DeleteCommand.Parameters[6].Value = ((object)(0)); - this.Adapter.DeleteCommand.Parameters[7].Value = ((string)(Original_PrimaryPersonSurname)); - } - if ((Original_PrimaryPersonEmail == null)) { - this.Adapter.DeleteCommand.Parameters[8].Value = ((object)(1)); - this.Adapter.DeleteCommand.Parameters[9].Value = global::System.DBNull.Value; - } - else { - this.Adapter.DeleteCommand.Parameters[8].Value = ((object)(0)); - this.Adapter.DeleteCommand.Parameters[9].Value = ((string)(Original_PrimaryPersonEmail)); - } - if ((Original_POAddressLine1 == null)) { - this.Adapter.DeleteCommand.Parameters[10].Value = ((object)(1)); - this.Adapter.DeleteCommand.Parameters[11].Value = global::System.DBNull.Value; - } - else { - this.Adapter.DeleteCommand.Parameters[10].Value = ((object)(0)); - this.Adapter.DeleteCommand.Parameters[11].Value = ((string)(Original_POAddressLine1)); - } - if ((Original_POAddressLine2 == null)) { - this.Adapter.DeleteCommand.Parameters[12].Value = ((object)(1)); - this.Adapter.DeleteCommand.Parameters[13].Value = global::System.DBNull.Value; - } - else { - this.Adapter.DeleteCommand.Parameters[12].Value = ((object)(0)); - this.Adapter.DeleteCommand.Parameters[13].Value = ((string)(Original_POAddressLine2)); - } - if ((Original_POAddressLine3 == null)) { - this.Adapter.DeleteCommand.Parameters[14].Value = ((object)(1)); - this.Adapter.DeleteCommand.Parameters[15].Value = global::System.DBNull.Value; - } - else { - this.Adapter.DeleteCommand.Parameters[14].Value = ((object)(0)); - this.Adapter.DeleteCommand.Parameters[15].Value = ((string)(Original_POAddressLine3)); - } - if ((Original_POAddressLine4 == null)) { - this.Adapter.DeleteCommand.Parameters[16].Value = ((object)(1)); - this.Adapter.DeleteCommand.Parameters[17].Value = global::System.DBNull.Value; - } - else { - this.Adapter.DeleteCommand.Parameters[16].Value = ((object)(0)); - this.Adapter.DeleteCommand.Parameters[17].Value = ((string)(Original_POAddressLine4)); - } - if ((Original_POAddressCity == null)) { - this.Adapter.DeleteCommand.Parameters[18].Value = ((object)(1)); - this.Adapter.DeleteCommand.Parameters[19].Value = global::System.DBNull.Value; - } - else { - this.Adapter.DeleteCommand.Parameters[18].Value = ((object)(0)); - this.Adapter.DeleteCommand.Parameters[19].Value = ((string)(Original_POAddressCity)); - } - if ((Original_POAddressRegion == null)) { - this.Adapter.DeleteCommand.Parameters[20].Value = ((object)(1)); - this.Adapter.DeleteCommand.Parameters[21].Value = global::System.DBNull.Value; - } - else { - this.Adapter.DeleteCommand.Parameters[20].Value = ((object)(0)); - this.Adapter.DeleteCommand.Parameters[21].Value = ((string)(Original_POAddressRegion)); - } - if ((Original_POAddressPostalCode == null)) { - this.Adapter.DeleteCommand.Parameters[22].Value = ((object)(1)); - this.Adapter.DeleteCommand.Parameters[23].Value = global::System.DBNull.Value; - } - else { - this.Adapter.DeleteCommand.Parameters[22].Value = ((object)(0)); - this.Adapter.DeleteCommand.Parameters[23].Value = ((string)(Original_POAddressPostalCode)); - } - if ((Original_POAddressCountry == null)) { - this.Adapter.DeleteCommand.Parameters[24].Value = ((object)(1)); - this.Adapter.DeleteCommand.Parameters[25].Value = global::System.DBNull.Value; - } - else { - this.Adapter.DeleteCommand.Parameters[24].Value = ((object)(0)); - this.Adapter.DeleteCommand.Parameters[25].Value = ((string)(Original_POAddressCountry)); - } - 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", "16.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 ContactName, string EmailAddress, string PrimaryPersonFirstName, string PrimaryPersonSurname, string PrimaryPersonEmail, string POAddressLine1, string POAddressLine2, string POAddressLine3, string POAddressLine4, string POAddressCity, string POAddressRegion, string POAddressPostalCode, string POAddressCountry) { - if ((ContactName == null)) { - throw new global::System.ArgumentNullException("ContactName"); - } - else { - this.Adapter.InsertCommand.Parameters[0].Value = ((string)(ContactName)); - } - if ((EmailAddress == null)) { - this.Adapter.InsertCommand.Parameters[1].Value = global::System.DBNull.Value; - } - else { - this.Adapter.InsertCommand.Parameters[1].Value = ((string)(EmailAddress)); - } - if ((PrimaryPersonFirstName == null)) { - this.Adapter.InsertCommand.Parameters[2].Value = global::System.DBNull.Value; - } - else { - this.Adapter.InsertCommand.Parameters[2].Value = ((string)(PrimaryPersonFirstName)); - } - if ((PrimaryPersonSurname == null)) { - this.Adapter.InsertCommand.Parameters[3].Value = global::System.DBNull.Value; - } - else { - this.Adapter.InsertCommand.Parameters[3].Value = ((string)(PrimaryPersonSurname)); - } - if ((PrimaryPersonEmail == null)) { - this.Adapter.InsertCommand.Parameters[4].Value = global::System.DBNull.Value; - } - else { - this.Adapter.InsertCommand.Parameters[4].Value = ((string)(PrimaryPersonEmail)); - } - if ((POAddressLine1 == null)) { - this.Adapter.InsertCommand.Parameters[5].Value = global::System.DBNull.Value; - } - else { - this.Adapter.InsertCommand.Parameters[5].Value = ((string)(POAddressLine1)); - } - if ((POAddressLine2 == null)) { - this.Adapter.InsertCommand.Parameters[6].Value = global::System.DBNull.Value; - } - else { - this.Adapter.InsertCommand.Parameters[6].Value = ((string)(POAddressLine2)); - } - if ((POAddressLine3 == null)) { - this.Adapter.InsertCommand.Parameters[7].Value = global::System.DBNull.Value; - } - else { - this.Adapter.InsertCommand.Parameters[7].Value = ((string)(POAddressLine3)); - } - if ((POAddressLine4 == null)) { - this.Adapter.InsertCommand.Parameters[8].Value = global::System.DBNull.Value; - } - else { - this.Adapter.InsertCommand.Parameters[8].Value = ((string)(POAddressLine4)); - } - if ((POAddressCity == null)) { - this.Adapter.InsertCommand.Parameters[9].Value = global::System.DBNull.Value; - } - else { - this.Adapter.InsertCommand.Parameters[9].Value = ((string)(POAddressCity)); - } - if ((POAddressRegion == null)) { - this.Adapter.InsertCommand.Parameters[10].Value = global::System.DBNull.Value; - } - else { - this.Adapter.InsertCommand.Parameters[10].Value = ((string)(POAddressRegion)); - } - if ((POAddressPostalCode == null)) { - this.Adapter.InsertCommand.Parameters[11].Value = global::System.DBNull.Value; - } - else { - this.Adapter.InsertCommand.Parameters[11].Value = ((string)(POAddressPostalCode)); - } - if ((POAddressCountry == null)) { - this.Adapter.InsertCommand.Parameters[12].Value = global::System.DBNull.Value; - } - else { - this.Adapter.InsertCommand.Parameters[12].Value = ((string)(POAddressCountry)); - } - 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", "16.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 ContactName, - string EmailAddress, - string PrimaryPersonFirstName, - string PrimaryPersonSurname, - string PrimaryPersonEmail, - string POAddressLine1, - string POAddressLine2, - string POAddressLine3, - string POAddressLine4, - string POAddressCity, - string POAddressRegion, - string POAddressPostalCode, - string POAddressCountry, - int Original_ContactID, - string Original_ContactName, - string Original_EmailAddress, - string Original_PrimaryPersonFirstName, - string Original_PrimaryPersonSurname, - string Original_PrimaryPersonEmail, - string Original_POAddressLine1, - string Original_POAddressLine2, - string Original_POAddressLine3, - string Original_POAddressLine4, - string Original_POAddressCity, - string Original_POAddressRegion, - string Original_POAddressPostalCode, - string Original_POAddressCountry, - int ContactID) { - if ((ContactName == null)) { - throw new global::System.ArgumentNullException("ContactName"); - } - else { - this.Adapter.UpdateCommand.Parameters[0].Value = ((string)(ContactName)); - } - if ((EmailAddress == null)) { - this.Adapter.UpdateCommand.Parameters[1].Value = global::System.DBNull.Value; - } - else { - this.Adapter.UpdateCommand.Parameters[1].Value = ((string)(EmailAddress)); - } - if ((PrimaryPersonFirstName == null)) { - this.Adapter.UpdateCommand.Parameters[2].Value = global::System.DBNull.Value; - } - else { - this.Adapter.UpdateCommand.Parameters[2].Value = ((string)(PrimaryPersonFirstName)); - } - if ((PrimaryPersonSurname == null)) { - this.Adapter.UpdateCommand.Parameters[3].Value = global::System.DBNull.Value; - } - else { - this.Adapter.UpdateCommand.Parameters[3].Value = ((string)(PrimaryPersonSurname)); - } - if ((PrimaryPersonEmail == null)) { - this.Adapter.UpdateCommand.Parameters[4].Value = global::System.DBNull.Value; - } - else { - this.Adapter.UpdateCommand.Parameters[4].Value = ((string)(PrimaryPersonEmail)); - } - if ((POAddressLine1 == null)) { - this.Adapter.UpdateCommand.Parameters[5].Value = global::System.DBNull.Value; - } - else { - this.Adapter.UpdateCommand.Parameters[5].Value = ((string)(POAddressLine1)); - } - if ((POAddressLine2 == null)) { - this.Adapter.UpdateCommand.Parameters[6].Value = global::System.DBNull.Value; - } - else { - this.Adapter.UpdateCommand.Parameters[6].Value = ((string)(POAddressLine2)); - } - if ((POAddressLine3 == null)) { - this.Adapter.UpdateCommand.Parameters[7].Value = global::System.DBNull.Value; - } - else { - this.Adapter.UpdateCommand.Parameters[7].Value = ((string)(POAddressLine3)); - } - if ((POAddressLine4 == null)) { - this.Adapter.UpdateCommand.Parameters[8].Value = global::System.DBNull.Value; - } - else { - this.Adapter.UpdateCommand.Parameters[8].Value = ((string)(POAddressLine4)); - } - if ((POAddressCity == null)) { - this.Adapter.UpdateCommand.Parameters[9].Value = global::System.DBNull.Value; - } - else { - this.Adapter.UpdateCommand.Parameters[9].Value = ((string)(POAddressCity)); - } - if ((POAddressRegion == null)) { - this.Adapter.UpdateCommand.Parameters[10].Value = global::System.DBNull.Value; - } - else { - this.Adapter.UpdateCommand.Parameters[10].Value = ((string)(POAddressRegion)); - } - if ((POAddressPostalCode == null)) { - this.Adapter.UpdateCommand.Parameters[11].Value = global::System.DBNull.Value; - } - else { - this.Adapter.UpdateCommand.Parameters[11].Value = ((string)(POAddressPostalCode)); - } - if ((POAddressCountry == null)) { - this.Adapter.UpdateCommand.Parameters[12].Value = global::System.DBNull.Value; - } - else { - this.Adapter.UpdateCommand.Parameters[12].Value = ((string)(POAddressCountry)); - } - this.Adapter.UpdateCommand.Parameters[13].Value = ((int)(Original_ContactID)); - if ((Original_ContactName == null)) { - throw new global::System.ArgumentNullException("Original_ContactName"); - } - else { - this.Adapter.UpdateCommand.Parameters[14].Value = ((string)(Original_ContactName)); - } - if ((Original_EmailAddress == null)) { - this.Adapter.UpdateCommand.Parameters[15].Value = ((object)(1)); - this.Adapter.UpdateCommand.Parameters[16].Value = global::System.DBNull.Value; - } - else { - this.Adapter.UpdateCommand.Parameters[15].Value = ((object)(0)); - this.Adapter.UpdateCommand.Parameters[16].Value = ((string)(Original_EmailAddress)); - } - if ((Original_PrimaryPersonFirstName == null)) { - this.Adapter.UpdateCommand.Parameters[17].Value = ((object)(1)); - this.Adapter.UpdateCommand.Parameters[18].Value = global::System.DBNull.Value; - } - else { - this.Adapter.UpdateCommand.Parameters[17].Value = ((object)(0)); - this.Adapter.UpdateCommand.Parameters[18].Value = ((string)(Original_PrimaryPersonFirstName)); - } - if ((Original_PrimaryPersonSurname == null)) { - this.Adapter.UpdateCommand.Parameters[19].Value = ((object)(1)); - this.Adapter.UpdateCommand.Parameters[20].Value = global::System.DBNull.Value; - } - else { - this.Adapter.UpdateCommand.Parameters[19].Value = ((object)(0)); - this.Adapter.UpdateCommand.Parameters[20].Value = ((string)(Original_PrimaryPersonSurname)); - } - if ((Original_PrimaryPersonEmail == null)) { - this.Adapter.UpdateCommand.Parameters[21].Value = ((object)(1)); - this.Adapter.UpdateCommand.Parameters[22].Value = global::System.DBNull.Value; - } - else { - this.Adapter.UpdateCommand.Parameters[21].Value = ((object)(0)); - this.Adapter.UpdateCommand.Parameters[22].Value = ((string)(Original_PrimaryPersonEmail)); - } - if ((Original_POAddressLine1 == null)) { - this.Adapter.UpdateCommand.Parameters[23].Value = ((object)(1)); - this.Adapter.UpdateCommand.Parameters[24].Value = global::System.DBNull.Value; - } - else { - this.Adapter.UpdateCommand.Parameters[23].Value = ((object)(0)); - this.Adapter.UpdateCommand.Parameters[24].Value = ((string)(Original_POAddressLine1)); - } - if ((Original_POAddressLine2 == null)) { - this.Adapter.UpdateCommand.Parameters[25].Value = ((object)(1)); - this.Adapter.UpdateCommand.Parameters[26].Value = global::System.DBNull.Value; - } - else { - this.Adapter.UpdateCommand.Parameters[25].Value = ((object)(0)); - this.Adapter.UpdateCommand.Parameters[26].Value = ((string)(Original_POAddressLine2)); - } - if ((Original_POAddressLine3 == null)) { - this.Adapter.UpdateCommand.Parameters[27].Value = ((object)(1)); - this.Adapter.UpdateCommand.Parameters[28].Value = global::System.DBNull.Value; - } - else { - this.Adapter.UpdateCommand.Parameters[27].Value = ((object)(0)); - this.Adapter.UpdateCommand.Parameters[28].Value = ((string)(Original_POAddressLine3)); - } - if ((Original_POAddressLine4 == null)) { - this.Adapter.UpdateCommand.Parameters[29].Value = ((object)(1)); - this.Adapter.UpdateCommand.Parameters[30].Value = global::System.DBNull.Value; - } - else { - this.Adapter.UpdateCommand.Parameters[29].Value = ((object)(0)); - this.Adapter.UpdateCommand.Parameters[30].Value = ((string)(Original_POAddressLine4)); - } - if ((Original_POAddressCity == null)) { - this.Adapter.UpdateCommand.Parameters[31].Value = ((object)(1)); - this.Adapter.UpdateCommand.Parameters[32].Value = global::System.DBNull.Value; - } - else { - this.Adapter.UpdateCommand.Parameters[31].Value = ((object)(0)); - this.Adapter.UpdateCommand.Parameters[32].Value = ((string)(Original_POAddressCity)); - } - if ((Original_POAddressRegion == null)) { - this.Adapter.UpdateCommand.Parameters[33].Value = ((object)(1)); - this.Adapter.UpdateCommand.Parameters[34].Value = global::System.DBNull.Value; - } - else { - this.Adapter.UpdateCommand.Parameters[33].Value = ((object)(0)); - this.Adapter.UpdateCommand.Parameters[34].Value = ((string)(Original_POAddressRegion)); - } - if ((Original_POAddressPostalCode == null)) { - this.Adapter.UpdateCommand.Parameters[35].Value = ((object)(1)); - this.Adapter.UpdateCommand.Parameters[36].Value = global::System.DBNull.Value; - } - else { - this.Adapter.UpdateCommand.Parameters[35].Value = ((object)(0)); - this.Adapter.UpdateCommand.Parameters[36].Value = ((string)(Original_POAddressPostalCode)); - } - if ((Original_POAddressCountry == null)) { - this.Adapter.UpdateCommand.Parameters[37].Value = ((object)(1)); - this.Adapter.UpdateCommand.Parameters[38].Value = global::System.DBNull.Value; - } - else { - this.Adapter.UpdateCommand.Parameters[37].Value = ((object)(0)); - this.Adapter.UpdateCommand.Parameters[38].Value = ((string)(Original_POAddressCountry)); - } - this.Adapter.UpdateCommand.Parameters[39].Value = ((int)(ContactID)); - 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", "16.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 ContactName, - string EmailAddress, - string PrimaryPersonFirstName, - string PrimaryPersonSurname, - string PrimaryPersonEmail, - string POAddressLine1, - string POAddressLine2, - string POAddressLine3, - string POAddressLine4, - string POAddressCity, - string POAddressRegion, - string POAddressPostalCode, - string POAddressCountry, - int Original_ContactID, - string Original_ContactName, - string Original_EmailAddress, - string Original_PrimaryPersonFirstName, - string Original_PrimaryPersonSurname, - string Original_PrimaryPersonEmail, - string Original_POAddressLine1, - string Original_POAddressLine2, - string Original_POAddressLine3, - string Original_POAddressLine4, - string Original_POAddressCity, - string Original_POAddressRegion, - string Original_POAddressPostalCode, - string Original_POAddressCountry) { - return this.Update(ContactName, EmailAddress, PrimaryPersonFirstName, PrimaryPersonSurname, PrimaryPersonEmail, POAddressLine1, POAddressLine2, POAddressLine3, POAddressLine4, POAddressCity, POAddressRegion, POAddressPostalCode, POAddressCountry, Original_ContactID, Original_ContactName, Original_EmailAddress, Original_PrimaryPersonFirstName, Original_PrimaryPersonSurname, Original_PrimaryPersonEmail, Original_POAddressLine1, Original_POAddressLine2, Original_POAddressLine3, Original_POAddressLine4, Original_POAddressCity, Original_POAddressRegion, Original_POAddressPostalCode, Original_POAddressCountry, Original_ContactID); - } - } - - /// - ///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 ProjectTableAdapter : 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", "16.0.0.0")] - public ProjectTableAdapter() { - this.ClearBeforeFill = true; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.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", "16.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", "16.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", "16.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", "16.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", "16.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 = "Project"; - tableMapping.ColumnMappings.Add("ProjectID", "ProjectID"); - tableMapping.ColumnMappings.Add("ContactID", "ContactID"); - tableMapping.ColumnMappings.Add("ProjectRef", "ProjectRef"); - tableMapping.ColumnMappings.Add("ProjectTitle", "ProjectTitle"); - tableMapping.ColumnMappings.Add("DateStart", "DateStart"); - tableMapping.ColumnMappings.Add("DateEnd", "DateEnd"); - tableMapping.ColumnMappings.Add("ClientName", "ClientName"); - tableMapping.ColumnMappings.Add("IsArchived", "IsArchived"); - 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].[Project] WHERE (([ProjectID] = @Original_ProjectID) AND ([ContactID] = @Original_ContactID) AND ((@IsNull_ProjectRef = 1 AND [ProjectRef] IS NULL) OR ([ProjectRef] = @Original_ProjectRef)) AND ([ProjectTitle] = @Original_ProjectTitle) AND ((@IsNull_DateStart = 1 AND [DateStart] IS NULL) OR ([DateStart] = @Original_DateStart)) AND ((@IsNull_DateEnd = 1 AND [DateEnd] IS NULL) OR ([DateEnd] = @Original_DateEnd)) AND ((@IsNull_ClientName = 1 AND [ClientName] IS NULL) OR ([ClientName] = @Original_ClientName)) AND ([IsArchived] = @Original_IsArchived))"; - this._adapter.DeleteCommand.CommandType = global::System.Data.CommandType.Text; - this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_ProjectID", global::System.Data.SqlDbType.Int, 0, global::System.Data.ParameterDirection.Input, 0, 0, "ProjectID", global::System.Data.DataRowVersion.Original, false, null, "", "", "")); - this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_ContactID", global::System.Data.SqlDbType.Int, 0, global::System.Data.ParameterDirection.Input, 0, 0, "ContactID", global::System.Data.DataRowVersion.Original, false, null, "", "", "")); - this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@IsNull_ProjectRef", global::System.Data.SqlDbType.Int, 0, global::System.Data.ParameterDirection.Input, 0, 0, "ProjectRef", global::System.Data.DataRowVersion.Original, true, null, "", "", "")); - this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_ProjectRef", global::System.Data.SqlDbType.VarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "ProjectRef", global::System.Data.DataRowVersion.Original, false, null, "", "", "")); - this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_ProjectTitle", global::System.Data.SqlDbType.VarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "ProjectTitle", global::System.Data.DataRowVersion.Original, false, null, "", "", "")); - this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@IsNull_DateStart", global::System.Data.SqlDbType.Int, 0, global::System.Data.ParameterDirection.Input, 0, 0, "DateStart", global::System.Data.DataRowVersion.Original, true, null, "", "", "")); - this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_DateStart", global::System.Data.SqlDbType.Date, 0, global::System.Data.ParameterDirection.Input, 0, 0, "DateStart", global::System.Data.DataRowVersion.Original, false, null, "", "", "")); - this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@IsNull_DateEnd", global::System.Data.SqlDbType.Int, 0, global::System.Data.ParameterDirection.Input, 0, 0, "DateEnd", global::System.Data.DataRowVersion.Original, true, null, "", "", "")); - this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_DateEnd", global::System.Data.SqlDbType.Date, 0, global::System.Data.ParameterDirection.Input, 0, 0, "DateEnd", global::System.Data.DataRowVersion.Original, false, null, "", "", "")); - this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@IsNull_ClientName", global::System.Data.SqlDbType.Int, 0, global::System.Data.ParameterDirection.Input, 0, 0, "ClientName", global::System.Data.DataRowVersion.Original, true, null, "", "", "")); - this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_ClientName", global::System.Data.SqlDbType.VarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "ClientName", global::System.Data.DataRowVersion.Original, false, null, "", "", "")); - this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_IsArchived", global::System.Data.SqlDbType.Bit, 0, global::System.Data.ParameterDirection.Input, 0, 0, "IsArchived", 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].[Project] ([ProjectID], [ContactID], [ProjectRef], [ProjectTitle], [DateStart], [DateEnd], [ClientName], [IsArchived]) VALUES (@ProjectID, @ContactID, @ProjectRef, @ProjectTitle, @DateStart, @DateEnd, @ClientName, @IsArchived); -SELECT ProjectID, ContactID, ProjectRef, ProjectTitle, DateStart, DateEnd, ClientName, IsArchived FROM Project WHERE (ProjectID = @ProjectID)"; - this._adapter.InsertCommand.CommandType = global::System.Data.CommandType.Text; - this._adapter.InsertCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@ProjectID", global::System.Data.SqlDbType.Int, 0, global::System.Data.ParameterDirection.Input, 0, 0, "ProjectID", global::System.Data.DataRowVersion.Current, false, null, "", "", "")); - this._adapter.InsertCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@ContactID", global::System.Data.SqlDbType.Int, 0, global::System.Data.ParameterDirection.Input, 0, 0, "ContactID", global::System.Data.DataRowVersion.Current, false, null, "", "", "")); - this._adapter.InsertCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@ProjectRef", global::System.Data.SqlDbType.VarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "ProjectRef", global::System.Data.DataRowVersion.Current, false, null, "", "", "")); - this._adapter.InsertCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@ProjectTitle", global::System.Data.SqlDbType.VarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "ProjectTitle", global::System.Data.DataRowVersion.Current, false, null, "", "", "")); - this._adapter.InsertCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@DateStart", global::System.Data.SqlDbType.Date, 0, global::System.Data.ParameterDirection.Input, 0, 0, "DateStart", global::System.Data.DataRowVersion.Current, false, null, "", "", "")); - this._adapter.InsertCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@DateEnd", global::System.Data.SqlDbType.Date, 0, global::System.Data.ParameterDirection.Input, 0, 0, "DateEnd", global::System.Data.DataRowVersion.Current, false, null, "", "", "")); - this._adapter.InsertCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@ClientName", global::System.Data.SqlDbType.VarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "ClientName", global::System.Data.DataRowVersion.Current, false, null, "", "", "")); - this._adapter.InsertCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@IsArchived", global::System.Data.SqlDbType.Bit, 0, global::System.Data.ParameterDirection.Input, 0, 0, "IsArchived", 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].[Project] SET [ProjectID] = @ProjectID, [ContactID] = @ContactID, [ProjectRef] = @ProjectRef, [ProjectTitle] = @ProjectTitle, [DateStart] = @DateStart, [DateEnd] = @DateEnd, [ClientName] = @ClientName, [IsArchived] = @IsArchived WHERE (([ProjectID] = @Original_ProjectID) AND ([ContactID] = @Original_ContactID) AND ((@IsNull_ProjectRef = 1 AND [ProjectRef] IS NULL) OR ([ProjectRef] = @Original_ProjectRef)) AND ([ProjectTitle] = @Original_ProjectTitle) AND ((@IsNull_DateStart = 1 AND [DateStart] IS NULL) OR ([DateStart] = @Original_DateStart)) AND ((@IsNull_DateEnd = 1 AND [DateEnd] IS NULL) OR ([DateEnd] = @Original_DateEnd)) AND ((@IsNull_ClientName = 1 AND [ClientName] IS NULL) OR ([ClientName] = @Original_ClientName)) AND ([IsArchived] = @Original_IsArchived)); -SELECT ProjectID, ContactID, ProjectRef, ProjectTitle, DateStart, DateEnd, ClientName, IsArchived FROM Project WHERE (ProjectID = @ProjectID)"; - this._adapter.UpdateCommand.CommandType = global::System.Data.CommandType.Text; - this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@ProjectID", global::System.Data.SqlDbType.Int, 0, global::System.Data.ParameterDirection.Input, 0, 0, "ProjectID", global::System.Data.DataRowVersion.Current, false, null, "", "", "")); - this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@ContactID", global::System.Data.SqlDbType.Int, 0, global::System.Data.ParameterDirection.Input, 0, 0, "ContactID", global::System.Data.DataRowVersion.Current, false, null, "", "", "")); - this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@ProjectRef", global::System.Data.SqlDbType.VarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "ProjectRef", global::System.Data.DataRowVersion.Current, false, null, "", "", "")); - this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@ProjectTitle", global::System.Data.SqlDbType.VarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "ProjectTitle", global::System.Data.DataRowVersion.Current, false, null, "", "", "")); - this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@DateStart", global::System.Data.SqlDbType.Date, 0, global::System.Data.ParameterDirection.Input, 0, 0, "DateStart", global::System.Data.DataRowVersion.Current, false, null, "", "", "")); - this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@DateEnd", global::System.Data.SqlDbType.Date, 0, global::System.Data.ParameterDirection.Input, 0, 0, "DateEnd", global::System.Data.DataRowVersion.Current, false, null, "", "", "")); - this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@ClientName", global::System.Data.SqlDbType.VarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "ClientName", global::System.Data.DataRowVersion.Current, false, null, "", "", "")); - this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@IsArchived", global::System.Data.SqlDbType.Bit, 0, global::System.Data.ParameterDirection.Input, 0, 0, "IsArchived", global::System.Data.DataRowVersion.Current, false, null, "", "", "")); - this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_ProjectID", global::System.Data.SqlDbType.Int, 0, global::System.Data.ParameterDirection.Input, 0, 0, "ProjectID", global::System.Data.DataRowVersion.Original, false, null, "", "", "")); - this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_ContactID", global::System.Data.SqlDbType.Int, 0, global::System.Data.ParameterDirection.Input, 0, 0, "ContactID", global::System.Data.DataRowVersion.Original, false, null, "", "", "")); - this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@IsNull_ProjectRef", global::System.Data.SqlDbType.Int, 0, global::System.Data.ParameterDirection.Input, 0, 0, "ProjectRef", global::System.Data.DataRowVersion.Original, true, null, "", "", "")); - this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_ProjectRef", global::System.Data.SqlDbType.VarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "ProjectRef", global::System.Data.DataRowVersion.Original, false, null, "", "", "")); - this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_ProjectTitle", global::System.Data.SqlDbType.VarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "ProjectTitle", global::System.Data.DataRowVersion.Original, false, null, "", "", "")); - this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@IsNull_DateStart", global::System.Data.SqlDbType.Int, 0, global::System.Data.ParameterDirection.Input, 0, 0, "DateStart", global::System.Data.DataRowVersion.Original, true, null, "", "", "")); - this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_DateStart", global::System.Data.SqlDbType.Date, 0, global::System.Data.ParameterDirection.Input, 0, 0, "DateStart", global::System.Data.DataRowVersion.Original, false, null, "", "", "")); - this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@IsNull_DateEnd", global::System.Data.SqlDbType.Int, 0, global::System.Data.ParameterDirection.Input, 0, 0, "DateEnd", global::System.Data.DataRowVersion.Original, true, null, "", "", "")); - this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_DateEnd", global::System.Data.SqlDbType.Date, 0, global::System.Data.ParameterDirection.Input, 0, 0, "DateEnd", global::System.Data.DataRowVersion.Original, false, null, "", "", "")); - this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@IsNull_ClientName", global::System.Data.SqlDbType.Int, 0, global::System.Data.ParameterDirection.Input, 0, 0, "ClientName", global::System.Data.DataRowVersion.Original, true, null, "", "", "")); - this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_ClientName", global::System.Data.SqlDbType.VarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "ClientName", global::System.Data.DataRowVersion.Original, false, null, "", "", "")); - this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_IsArchived", global::System.Data.SqlDbType.Bit, 0, global::System.Data.ParameterDirection.Input, 0, 0, "IsArchived", global::System.Data.DataRowVersion.Original, false, null, "", "", "")); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - private void InitConnection() { - this._connection = new global::System.Data.SqlClient.SqlConnection(); - this._connection.ConnectionString = global::BealeEngineering.Accounts.Properties.Settings.Default.BealeEngConnectionString; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - private void InitCommandCollection() { - this._commandCollection = new global::System.Data.SqlClient.SqlCommand[1]; - this._commandCollection[0] = new global::System.Data.SqlClient.SqlCommand(); - this._commandCollection[0].Connection = this.Connection; - this._commandCollection[0].CommandText = "SELECT ProjectID, ContactID, ProjectRef, ProjectTitle, DateStart, DateEnd, Client" + - "Name, IsArchived FROM dbo.Project"; - this._commandCollection[0].CommandType = global::System.Data.CommandType.Text; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.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(BealeEngDataSet.ProjectDataTable 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", "16.0.0.0")] - [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")] - [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Select, true)] - public virtual BealeEngDataSet.ProjectDataTable GetData() { - this.Adapter.SelectCommand = this.CommandCollection[0]; - BealeEngDataSet.ProjectDataTable dataTable = new BealeEngDataSet.ProjectDataTable(); - this.Adapter.Fill(dataTable); - return dataTable; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")] - public virtual int Update(BealeEngDataSet.ProjectDataTable dataTable) { - return this.Adapter.Update(dataTable); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")] - public virtual int Update(BealeEngDataSet dataSet) { - return this.Adapter.Update(dataSet, "Project"); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.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", "16.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", "16.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_ProjectID, int Original_ContactID, string Original_ProjectRef, string Original_ProjectTitle, global::System.Nullable Original_DateStart, global::System.Nullable Original_DateEnd, string Original_ClientName, bool Original_IsArchived) { - this.Adapter.DeleteCommand.Parameters[0].Value = ((int)(Original_ProjectID)); - this.Adapter.DeleteCommand.Parameters[1].Value = ((int)(Original_ContactID)); - if ((Original_ProjectRef == null)) { - this.Adapter.DeleteCommand.Parameters[2].Value = ((object)(1)); - this.Adapter.DeleteCommand.Parameters[3].Value = global::System.DBNull.Value; - } - else { - this.Adapter.DeleteCommand.Parameters[2].Value = ((object)(0)); - this.Adapter.DeleteCommand.Parameters[3].Value = ((string)(Original_ProjectRef)); - } - if ((Original_ProjectTitle == null)) { - throw new global::System.ArgumentNullException("Original_ProjectTitle"); - } - else { - this.Adapter.DeleteCommand.Parameters[4].Value = ((string)(Original_ProjectTitle)); - } - if ((Original_DateStart.HasValue == true)) { - this.Adapter.DeleteCommand.Parameters[5].Value = ((object)(0)); - this.Adapter.DeleteCommand.Parameters[6].Value = ((System.DateTime)(Original_DateStart.Value)); - } - else { - this.Adapter.DeleteCommand.Parameters[5].Value = ((object)(1)); - this.Adapter.DeleteCommand.Parameters[6].Value = global::System.DBNull.Value; - } - if ((Original_DateEnd.HasValue == true)) { - this.Adapter.DeleteCommand.Parameters[7].Value = ((object)(0)); - this.Adapter.DeleteCommand.Parameters[8].Value = ((System.DateTime)(Original_DateEnd.Value)); - } - else { - this.Adapter.DeleteCommand.Parameters[7].Value = ((object)(1)); - this.Adapter.DeleteCommand.Parameters[8].Value = global::System.DBNull.Value; - } - if ((Original_ClientName == null)) { - this.Adapter.DeleteCommand.Parameters[9].Value = ((object)(1)); - this.Adapter.DeleteCommand.Parameters[10].Value = global::System.DBNull.Value; - } - else { - this.Adapter.DeleteCommand.Parameters[9].Value = ((object)(0)); - this.Adapter.DeleteCommand.Parameters[10].Value = ((string)(Original_ClientName)); - } - this.Adapter.DeleteCommand.Parameters[11].Value = ((bool)(Original_IsArchived)); - 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", "16.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(int ProjectID, int ContactID, string ProjectRef, string ProjectTitle, global::System.Nullable DateStart, global::System.Nullable DateEnd, string ClientName, bool IsArchived) { - this.Adapter.InsertCommand.Parameters[0].Value = ((int)(ProjectID)); - this.Adapter.InsertCommand.Parameters[1].Value = ((int)(ContactID)); - if ((ProjectRef == null)) { - this.Adapter.InsertCommand.Parameters[2].Value = global::System.DBNull.Value; - } - else { - this.Adapter.InsertCommand.Parameters[2].Value = ((string)(ProjectRef)); - } - if ((ProjectTitle == null)) { - throw new global::System.ArgumentNullException("ProjectTitle"); - } - else { - this.Adapter.InsertCommand.Parameters[3].Value = ((string)(ProjectTitle)); - } - if ((DateStart.HasValue == true)) { - this.Adapter.InsertCommand.Parameters[4].Value = ((System.DateTime)(DateStart.Value)); - } - else { - this.Adapter.InsertCommand.Parameters[4].Value = global::System.DBNull.Value; - } - if ((DateEnd.HasValue == true)) { - this.Adapter.InsertCommand.Parameters[5].Value = ((System.DateTime)(DateEnd.Value)); - } - else { - this.Adapter.InsertCommand.Parameters[5].Value = global::System.DBNull.Value; - } - if ((ClientName == null)) { - this.Adapter.InsertCommand.Parameters[6].Value = global::System.DBNull.Value; - } - else { - this.Adapter.InsertCommand.Parameters[6].Value = ((string)(ClientName)); - } - this.Adapter.InsertCommand.Parameters[7].Value = ((bool)(IsArchived)); - 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", "16.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( - int ProjectID, - int ContactID, - string ProjectRef, - string ProjectTitle, - global::System.Nullable DateStart, - global::System.Nullable DateEnd, - string ClientName, - bool IsArchived, - int Original_ProjectID, - int Original_ContactID, - string Original_ProjectRef, - string Original_ProjectTitle, - global::System.Nullable Original_DateStart, - global::System.Nullable Original_DateEnd, - string Original_ClientName, - bool Original_IsArchived) { - this.Adapter.UpdateCommand.Parameters[0].Value = ((int)(ProjectID)); - this.Adapter.UpdateCommand.Parameters[1].Value = ((int)(ContactID)); - if ((ProjectRef == null)) { - this.Adapter.UpdateCommand.Parameters[2].Value = global::System.DBNull.Value; - } - else { - this.Adapter.UpdateCommand.Parameters[2].Value = ((string)(ProjectRef)); - } - if ((ProjectTitle == null)) { - throw new global::System.ArgumentNullException("ProjectTitle"); - } - else { - this.Adapter.UpdateCommand.Parameters[3].Value = ((string)(ProjectTitle)); - } - if ((DateStart.HasValue == true)) { - this.Adapter.UpdateCommand.Parameters[4].Value = ((System.DateTime)(DateStart.Value)); - } - else { - this.Adapter.UpdateCommand.Parameters[4].Value = global::System.DBNull.Value; - } - if ((DateEnd.HasValue == true)) { - this.Adapter.UpdateCommand.Parameters[5].Value = ((System.DateTime)(DateEnd.Value)); - } - else { - this.Adapter.UpdateCommand.Parameters[5].Value = global::System.DBNull.Value; - } - if ((ClientName == null)) { - this.Adapter.UpdateCommand.Parameters[6].Value = global::System.DBNull.Value; - } - else { - this.Adapter.UpdateCommand.Parameters[6].Value = ((string)(ClientName)); - } - this.Adapter.UpdateCommand.Parameters[7].Value = ((bool)(IsArchived)); - this.Adapter.UpdateCommand.Parameters[8].Value = ((int)(Original_ProjectID)); - this.Adapter.UpdateCommand.Parameters[9].Value = ((int)(Original_ContactID)); - if ((Original_ProjectRef == null)) { - this.Adapter.UpdateCommand.Parameters[10].Value = ((object)(1)); - this.Adapter.UpdateCommand.Parameters[11].Value = global::System.DBNull.Value; - } - else { - this.Adapter.UpdateCommand.Parameters[10].Value = ((object)(0)); - this.Adapter.UpdateCommand.Parameters[11].Value = ((string)(Original_ProjectRef)); - } - if ((Original_ProjectTitle == null)) { - throw new global::System.ArgumentNullException("Original_ProjectTitle"); - } - else { - this.Adapter.UpdateCommand.Parameters[12].Value = ((string)(Original_ProjectTitle)); - } - if ((Original_DateStart.HasValue == true)) { - this.Adapter.UpdateCommand.Parameters[13].Value = ((object)(0)); - this.Adapter.UpdateCommand.Parameters[14].Value = ((System.DateTime)(Original_DateStart.Value)); - } - else { - this.Adapter.UpdateCommand.Parameters[13].Value = ((object)(1)); - this.Adapter.UpdateCommand.Parameters[14].Value = global::System.DBNull.Value; - } - if ((Original_DateEnd.HasValue == true)) { - this.Adapter.UpdateCommand.Parameters[15].Value = ((object)(0)); - this.Adapter.UpdateCommand.Parameters[16].Value = ((System.DateTime)(Original_DateEnd.Value)); - } - else { - this.Adapter.UpdateCommand.Parameters[15].Value = ((object)(1)); - this.Adapter.UpdateCommand.Parameters[16].Value = global::System.DBNull.Value; - } - if ((Original_ClientName == null)) { - this.Adapter.UpdateCommand.Parameters[17].Value = ((object)(1)); - this.Adapter.UpdateCommand.Parameters[18].Value = global::System.DBNull.Value; - } - else { - this.Adapter.UpdateCommand.Parameters[17].Value = ((object)(0)); - this.Adapter.UpdateCommand.Parameters[18].Value = ((string)(Original_ClientName)); - } - this.Adapter.UpdateCommand.Parameters[19].Value = ((bool)(Original_IsArchived)); - 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", "16.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(int ContactID, string ProjectRef, string ProjectTitle, global::System.Nullable DateStart, global::System.Nullable DateEnd, string ClientName, bool IsArchived, int Original_ProjectID, int Original_ContactID, string Original_ProjectRef, string Original_ProjectTitle, global::System.Nullable Original_DateStart, global::System.Nullable Original_DateEnd, string Original_ClientName, bool Original_IsArchived) { - return this.Update(Original_ProjectID, ContactID, ProjectRef, ProjectTitle, DateStart, DateEnd, ClientName, IsArchived, Original_ProjectID, Original_ContactID, Original_ProjectRef, Original_ProjectTitle, Original_DateStart, Original_DateEnd, Original_ClientName, Original_IsArchived); - } - } - - /// - ///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 ProjectJobTableAdapter : 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", "16.0.0.0")] - public ProjectJobTableAdapter() { - this.ClearBeforeFill = true; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.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", "16.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", "16.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", "16.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", "16.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", "16.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 = "ProjectJob"; - tableMapping.ColumnMappings.Add("ProjectJobID", "ProjectJobID"); - tableMapping.ColumnMappings.Add("ProjectID", "ProjectID"); - tableMapping.ColumnMappings.Add("ContactID", "ContactID"); - tableMapping.ColumnMappings.Add("JobNumber", "JobNumber"); - tableMapping.ColumnMappings.Add("JobTitle", "JobTitle"); - tableMapping.ColumnMappings.Add("JobDescription", "JobDescription"); - tableMapping.ColumnMappings.Add("DateStart", "DateStart"); - tableMapping.ColumnMappings.Add("DateEnd", "DateEnd"); - tableMapping.ColumnMappings.Add("ShareBob", "ShareBob"); - tableMapping.ColumnMappings.Add("ShareJohn", "ShareJohn"); - tableMapping.ColumnMappings.Add("IsArchived", "IsArchived"); - 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].[ProjectJob] WHERE (([ProjectJobID] = @Original_ProjectJobID) AND ([ProjectID] = @Original_ProjectID) AND ([ContactID] = @Original_ContactID) AND ([JobNumber] = @Original_JobNumber) AND ((@IsNull_JobTitle = 1 AND [JobTitle] IS NULL) OR ([JobTitle] = @Original_JobTitle)) AND ((@IsNull_JobDescription = 1 AND [JobDescription] IS NULL) OR ([JobDescription] = @Original_JobDescription)) AND ((@IsNull_DateStart = 1 AND [DateStart] IS NULL) OR ([DateStart] = @Original_DateStart)) AND ((@IsNull_DateEnd = 1 AND [DateEnd] IS NULL) OR ([DateEnd] = @Original_DateEnd)) AND ((@IsNull_ShareBob = 1 AND [ShareBob] IS NULL) OR ([ShareBob] = @Original_ShareBob)) AND ((@IsNull_ShareJohn = 1 AND [ShareJohn] IS NULL) OR ([ShareJohn] = @Original_ShareJohn)) AND ([IsArchived] = @Original_IsArchived))"; - this._adapter.DeleteCommand.CommandType = global::System.Data.CommandType.Text; - this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_ProjectJobID", global::System.Data.SqlDbType.Int, 0, global::System.Data.ParameterDirection.Input, 0, 0, "ProjectJobID", global::System.Data.DataRowVersion.Original, false, null, "", "", "")); - this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_ProjectID", global::System.Data.SqlDbType.Int, 0, global::System.Data.ParameterDirection.Input, 0, 0, "ProjectID", global::System.Data.DataRowVersion.Original, false, null, "", "", "")); - this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_ContactID", global::System.Data.SqlDbType.Int, 0, global::System.Data.ParameterDirection.Input, 0, 0, "ContactID", global::System.Data.DataRowVersion.Original, false, null, "", "", "")); - this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_JobNumber", global::System.Data.SqlDbType.NChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "JobNumber", global::System.Data.DataRowVersion.Original, false, null, "", "", "")); - this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@IsNull_JobTitle", global::System.Data.SqlDbType.Int, 0, global::System.Data.ParameterDirection.Input, 0, 0, "JobTitle", global::System.Data.DataRowVersion.Original, true, null, "", "", "")); - this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_JobTitle", global::System.Data.SqlDbType.NVarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "JobTitle", global::System.Data.DataRowVersion.Original, false, null, "", "", "")); - this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@IsNull_JobDescription", global::System.Data.SqlDbType.Int, 0, global::System.Data.ParameterDirection.Input, 0, 0, "JobDescription", global::System.Data.DataRowVersion.Original, true, null, "", "", "")); - this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_JobDescription", global::System.Data.SqlDbType.NVarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "JobDescription", global::System.Data.DataRowVersion.Original, false, null, "", "", "")); - this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@IsNull_DateStart", global::System.Data.SqlDbType.Int, 0, global::System.Data.ParameterDirection.Input, 0, 0, "DateStart", global::System.Data.DataRowVersion.Original, true, null, "", "", "")); - this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_DateStart", global::System.Data.SqlDbType.Date, 0, global::System.Data.ParameterDirection.Input, 0, 0, "DateStart", global::System.Data.DataRowVersion.Original, false, null, "", "", "")); - this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@IsNull_DateEnd", global::System.Data.SqlDbType.Int, 0, global::System.Data.ParameterDirection.Input, 0, 0, "DateEnd", global::System.Data.DataRowVersion.Original, true, null, "", "", "")); - this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_DateEnd", global::System.Data.SqlDbType.Date, 0, global::System.Data.ParameterDirection.Input, 0, 0, "DateEnd", global::System.Data.DataRowVersion.Original, false, null, "", "", "")); - this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@IsNull_ShareBob", global::System.Data.SqlDbType.Int, 0, global::System.Data.ParameterDirection.Input, 0, 0, "ShareBob", global::System.Data.DataRowVersion.Original, true, null, "", "", "")); - this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_ShareBob", global::System.Data.SqlDbType.Decimal, 0, global::System.Data.ParameterDirection.Input, 9, 8, "ShareBob", global::System.Data.DataRowVersion.Original, false, null, "", "", "")); - this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@IsNull_ShareJohn", global::System.Data.SqlDbType.Int, 0, global::System.Data.ParameterDirection.Input, 0, 0, "ShareJohn", global::System.Data.DataRowVersion.Original, true, null, "", "", "")); - this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_ShareJohn", global::System.Data.SqlDbType.Decimal, 0, global::System.Data.ParameterDirection.Input, 9, 8, "ShareJohn", global::System.Data.DataRowVersion.Original, false, null, "", "", "")); - this._adapter.DeleteCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_IsArchived", global::System.Data.SqlDbType.Bit, 0, global::System.Data.ParameterDirection.Input, 0, 0, "IsArchived", 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].[ProjectJob] ([ProjectID], [ContactID], [JobNumber], [JobTitle], [JobDescription], [DateStart], [DateEnd], [ShareBob], [ShareJohn], [IsArchived]) VALUES (@ProjectID, @ContactID, @JobNumber, @JobTitle, @JobDescription, @DateStart, @DateEnd, @ShareBob, @ShareJohn, @IsArchived); -SELECT ProjectJobID, ProjectID, ContactID, JobNumber, JobTitle, JobDescription, DateStart, DateEnd, ShareBob, ShareJohn, IsArchived FROM ProjectJob WHERE (ProjectJobID = SCOPE_IDENTITY())"; - this._adapter.InsertCommand.CommandType = global::System.Data.CommandType.Text; - this._adapter.InsertCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@ProjectID", global::System.Data.SqlDbType.Int, 0, global::System.Data.ParameterDirection.Input, 0, 0, "ProjectID", global::System.Data.DataRowVersion.Current, false, null, "", "", "")); - this._adapter.InsertCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@ContactID", global::System.Data.SqlDbType.Int, 0, global::System.Data.ParameterDirection.Input, 0, 0, "ContactID", global::System.Data.DataRowVersion.Current, false, null, "", "", "")); - this._adapter.InsertCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@JobNumber", global::System.Data.SqlDbType.NChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "JobNumber", global::System.Data.DataRowVersion.Current, false, null, "", "", "")); - this._adapter.InsertCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@JobTitle", global::System.Data.SqlDbType.NVarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "JobTitle", global::System.Data.DataRowVersion.Current, false, null, "", "", "")); - this._adapter.InsertCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@JobDescription", global::System.Data.SqlDbType.NVarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "JobDescription", global::System.Data.DataRowVersion.Current, false, null, "", "", "")); - this._adapter.InsertCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@DateStart", global::System.Data.SqlDbType.Date, 0, global::System.Data.ParameterDirection.Input, 0, 0, "DateStart", global::System.Data.DataRowVersion.Current, false, null, "", "", "")); - this._adapter.InsertCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@DateEnd", global::System.Data.SqlDbType.Date, 0, global::System.Data.ParameterDirection.Input, 0, 0, "DateEnd", global::System.Data.DataRowVersion.Current, false, null, "", "", "")); - this._adapter.InsertCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@ShareBob", global::System.Data.SqlDbType.Decimal, 0, global::System.Data.ParameterDirection.Input, 9, 8, "ShareBob", global::System.Data.DataRowVersion.Current, false, null, "", "", "")); - this._adapter.InsertCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@ShareJohn", global::System.Data.SqlDbType.Decimal, 0, global::System.Data.ParameterDirection.Input, 9, 8, "ShareJohn", global::System.Data.DataRowVersion.Current, false, null, "", "", "")); - this._adapter.InsertCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@IsArchived", global::System.Data.SqlDbType.Bit, 0, global::System.Data.ParameterDirection.Input, 0, 0, "IsArchived", 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].[ProjectJob] SET [ProjectID] = @ProjectID, [ContactID] = @ContactID, [JobNumber] = @JobNumber, [JobTitle] = @JobTitle, [JobDescription] = @JobDescription, [DateStart] = @DateStart, [DateEnd] = @DateEnd, [ShareBob] = @ShareBob, [ShareJohn] = @ShareJohn, [IsArchived] = @IsArchived WHERE (([ProjectJobID] = @Original_ProjectJobID) AND ([ProjectID] = @Original_ProjectID) AND ([ContactID] = @Original_ContactID) AND ([JobNumber] = @Original_JobNumber) AND ((@IsNull_JobTitle = 1 AND [JobTitle] IS NULL) OR ([JobTitle] = @Original_JobTitle)) AND ((@IsNull_JobDescription = 1 AND [JobDescription] IS NULL) OR ([JobDescription] = @Original_JobDescription)) AND ((@IsNull_DateStart = 1 AND [DateStart] IS NULL) OR ([DateStart] = @Original_DateStart)) AND ((@IsNull_DateEnd = 1 AND [DateEnd] IS NULL) OR ([DateEnd] = @Original_DateEnd)) AND ((@IsNull_ShareBob = 1 AND [ShareBob] IS NULL) OR ([ShareBob] = @Original_ShareBob)) AND ((@IsNull_ShareJohn = 1 AND [ShareJohn] IS NULL) OR ([ShareJohn] = @Original_ShareJohn)) AND ([IsArchived] = @Original_IsArchived)); -SELECT ProjectJobID, ProjectID, ContactID, JobNumber, JobTitle, JobDescription, DateStart, DateEnd, ShareBob, ShareJohn, IsArchived FROM ProjectJob WHERE (ProjectJobID = @ProjectJobID)"; - this._adapter.UpdateCommand.CommandType = global::System.Data.CommandType.Text; - this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@ProjectID", global::System.Data.SqlDbType.Int, 0, global::System.Data.ParameterDirection.Input, 0, 0, "ProjectID", global::System.Data.DataRowVersion.Current, false, null, "", "", "")); - this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@ContactID", global::System.Data.SqlDbType.Int, 0, global::System.Data.ParameterDirection.Input, 0, 0, "ContactID", global::System.Data.DataRowVersion.Current, false, null, "", "", "")); - this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@JobNumber", global::System.Data.SqlDbType.NChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "JobNumber", global::System.Data.DataRowVersion.Current, false, null, "", "", "")); - this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@JobTitle", global::System.Data.SqlDbType.NVarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "JobTitle", global::System.Data.DataRowVersion.Current, false, null, "", "", "")); - this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@JobDescription", global::System.Data.SqlDbType.NVarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "JobDescription", global::System.Data.DataRowVersion.Current, false, null, "", "", "")); - this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@DateStart", global::System.Data.SqlDbType.Date, 0, global::System.Data.ParameterDirection.Input, 0, 0, "DateStart", global::System.Data.DataRowVersion.Current, false, null, "", "", "")); - this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@DateEnd", global::System.Data.SqlDbType.Date, 0, global::System.Data.ParameterDirection.Input, 0, 0, "DateEnd", global::System.Data.DataRowVersion.Current, false, null, "", "", "")); - this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@ShareBob", global::System.Data.SqlDbType.Decimal, 0, global::System.Data.ParameterDirection.Input, 9, 8, "ShareBob", global::System.Data.DataRowVersion.Current, false, null, "", "", "")); - this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@ShareJohn", global::System.Data.SqlDbType.Decimal, 0, global::System.Data.ParameterDirection.Input, 9, 8, "ShareJohn", global::System.Data.DataRowVersion.Current, false, null, "", "", "")); - this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@IsArchived", global::System.Data.SqlDbType.Bit, 0, global::System.Data.ParameterDirection.Input, 0, 0, "IsArchived", global::System.Data.DataRowVersion.Current, false, null, "", "", "")); - this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_ProjectJobID", global::System.Data.SqlDbType.Int, 0, global::System.Data.ParameterDirection.Input, 0, 0, "ProjectJobID", global::System.Data.DataRowVersion.Original, false, null, "", "", "")); - this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_ProjectID", global::System.Data.SqlDbType.Int, 0, global::System.Data.ParameterDirection.Input, 0, 0, "ProjectID", global::System.Data.DataRowVersion.Original, false, null, "", "", "")); - this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_ContactID", global::System.Data.SqlDbType.Int, 0, global::System.Data.ParameterDirection.Input, 0, 0, "ContactID", global::System.Data.DataRowVersion.Original, false, null, "", "", "")); - this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_JobNumber", global::System.Data.SqlDbType.NChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "JobNumber", global::System.Data.DataRowVersion.Original, false, null, "", "", "")); - this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@IsNull_JobTitle", global::System.Data.SqlDbType.Int, 0, global::System.Data.ParameterDirection.Input, 0, 0, "JobTitle", global::System.Data.DataRowVersion.Original, true, null, "", "", "")); - this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_JobTitle", global::System.Data.SqlDbType.NVarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "JobTitle", global::System.Data.DataRowVersion.Original, false, null, "", "", "")); - this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@IsNull_JobDescription", global::System.Data.SqlDbType.Int, 0, global::System.Data.ParameterDirection.Input, 0, 0, "JobDescription", global::System.Data.DataRowVersion.Original, true, null, "", "", "")); - this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_JobDescription", global::System.Data.SqlDbType.NVarChar, 0, global::System.Data.ParameterDirection.Input, 0, 0, "JobDescription", global::System.Data.DataRowVersion.Original, false, null, "", "", "")); - this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@IsNull_DateStart", global::System.Data.SqlDbType.Int, 0, global::System.Data.ParameterDirection.Input, 0, 0, "DateStart", global::System.Data.DataRowVersion.Original, true, null, "", "", "")); - this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_DateStart", global::System.Data.SqlDbType.Date, 0, global::System.Data.ParameterDirection.Input, 0, 0, "DateStart", global::System.Data.DataRowVersion.Original, false, null, "", "", "")); - this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@IsNull_DateEnd", global::System.Data.SqlDbType.Int, 0, global::System.Data.ParameterDirection.Input, 0, 0, "DateEnd", global::System.Data.DataRowVersion.Original, true, null, "", "", "")); - this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_DateEnd", global::System.Data.SqlDbType.Date, 0, global::System.Data.ParameterDirection.Input, 0, 0, "DateEnd", global::System.Data.DataRowVersion.Original, false, null, "", "", "")); - this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@IsNull_ShareBob", global::System.Data.SqlDbType.Int, 0, global::System.Data.ParameterDirection.Input, 0, 0, "ShareBob", global::System.Data.DataRowVersion.Original, true, null, "", "", "")); - this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_ShareBob", global::System.Data.SqlDbType.Decimal, 0, global::System.Data.ParameterDirection.Input, 9, 8, "ShareBob", global::System.Data.DataRowVersion.Original, false, null, "", "", "")); - this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@IsNull_ShareJohn", global::System.Data.SqlDbType.Int, 0, global::System.Data.ParameterDirection.Input, 0, 0, "ShareJohn", global::System.Data.DataRowVersion.Original, true, null, "", "", "")); - this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_ShareJohn", global::System.Data.SqlDbType.Decimal, 0, global::System.Data.ParameterDirection.Input, 9, 8, "ShareJohn", global::System.Data.DataRowVersion.Original, false, null, "", "", "")); - this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_IsArchived", global::System.Data.SqlDbType.Bit, 0, global::System.Data.ParameterDirection.Input, 0, 0, "IsArchived", global::System.Data.DataRowVersion.Original, false, null, "", "", "")); - this._adapter.UpdateCommand.Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@ProjectJobID", global::System.Data.SqlDbType.Int, 4, global::System.Data.ParameterDirection.Input, 0, 0, "ProjectJobID", global::System.Data.DataRowVersion.Current, false, null, "", "", "")); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - private void InitConnection() { - this._connection = new global::System.Data.SqlClient.SqlConnection(); - this._connection.ConnectionString = global::BealeEngineering.Accounts.Properties.Settings.Default.BealeEngConnectionString; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - private void InitCommandCollection() { - this._commandCollection = new global::System.Data.SqlClient.SqlCommand[1]; - this._commandCollection[0] = new global::System.Data.SqlClient.SqlCommand(); - this._commandCollection[0].Connection = this.Connection; - this._commandCollection[0].CommandText = "SELECT ProjectJobID, ProjectID, ContactID, JobNumber, JobTitle, JobDescription, D" + - "ateStart, DateEnd, ShareBob, ShareJohn, IsArchived FROM dbo.ProjectJob"; - this._commandCollection[0].CommandType = global::System.Data.CommandType.Text; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.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(BealeEngDataSet.ProjectJobDataTable 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", "16.0.0.0")] - [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")] - [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Select, true)] - public virtual BealeEngDataSet.ProjectJobDataTable GetData() { - this.Adapter.SelectCommand = this.CommandCollection[0]; - BealeEngDataSet.ProjectJobDataTable dataTable = new BealeEngDataSet.ProjectJobDataTable(); - this.Adapter.Fill(dataTable); - return dataTable; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")] - public virtual int Update(BealeEngDataSet.ProjectJobDataTable dataTable) { - return this.Adapter.Update(dataTable); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")] - public virtual int Update(BealeEngDataSet dataSet) { - return this.Adapter.Update(dataSet, "ProjectJob"); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.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", "16.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", "16.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_ProjectJobID, int Original_ProjectID, int Original_ContactID, string Original_JobNumber, string Original_JobTitle, string Original_JobDescription, global::System.Nullable Original_DateStart, global::System.Nullable Original_DateEnd, global::System.Nullable Original_ShareBob, global::System.Nullable Original_ShareJohn, bool Original_IsArchived) { - this.Adapter.DeleteCommand.Parameters[0].Value = ((int)(Original_ProjectJobID)); - this.Adapter.DeleteCommand.Parameters[1].Value = ((int)(Original_ProjectID)); - this.Adapter.DeleteCommand.Parameters[2].Value = ((int)(Original_ContactID)); - if ((Original_JobNumber == null)) { - throw new global::System.ArgumentNullException("Original_JobNumber"); - } - else { - this.Adapter.DeleteCommand.Parameters[3].Value = ((string)(Original_JobNumber)); - } - if ((Original_JobTitle == null)) { - this.Adapter.DeleteCommand.Parameters[4].Value = ((object)(1)); - this.Adapter.DeleteCommand.Parameters[5].Value = global::System.DBNull.Value; - } - else { - this.Adapter.DeleteCommand.Parameters[4].Value = ((object)(0)); - this.Adapter.DeleteCommand.Parameters[5].Value = ((string)(Original_JobTitle)); - } - if ((Original_JobDescription == null)) { - this.Adapter.DeleteCommand.Parameters[6].Value = ((object)(1)); - this.Adapter.DeleteCommand.Parameters[7].Value = global::System.DBNull.Value; - } - else { - this.Adapter.DeleteCommand.Parameters[6].Value = ((object)(0)); - this.Adapter.DeleteCommand.Parameters[7].Value = ((string)(Original_JobDescription)); - } - if ((Original_DateStart.HasValue == true)) { - this.Adapter.DeleteCommand.Parameters[8].Value = ((object)(0)); - this.Adapter.DeleteCommand.Parameters[9].Value = ((System.DateTime)(Original_DateStart.Value)); - } - else { - this.Adapter.DeleteCommand.Parameters[8].Value = ((object)(1)); - this.Adapter.DeleteCommand.Parameters[9].Value = global::System.DBNull.Value; - } - if ((Original_DateEnd.HasValue == true)) { - this.Adapter.DeleteCommand.Parameters[10].Value = ((object)(0)); - this.Adapter.DeleteCommand.Parameters[11].Value = ((System.DateTime)(Original_DateEnd.Value)); - } - else { - this.Adapter.DeleteCommand.Parameters[10].Value = ((object)(1)); - this.Adapter.DeleteCommand.Parameters[11].Value = global::System.DBNull.Value; - } - if ((Original_ShareBob.HasValue == true)) { - this.Adapter.DeleteCommand.Parameters[12].Value = ((object)(0)); - this.Adapter.DeleteCommand.Parameters[13].Value = ((decimal)(Original_ShareBob.Value)); - } - else { - this.Adapter.DeleteCommand.Parameters[12].Value = ((object)(1)); - this.Adapter.DeleteCommand.Parameters[13].Value = global::System.DBNull.Value; - } - if ((Original_ShareJohn.HasValue == true)) { - this.Adapter.DeleteCommand.Parameters[14].Value = ((object)(0)); - this.Adapter.DeleteCommand.Parameters[15].Value = ((decimal)(Original_ShareJohn.Value)); - } - else { - this.Adapter.DeleteCommand.Parameters[14].Value = ((object)(1)); - this.Adapter.DeleteCommand.Parameters[15].Value = global::System.DBNull.Value; - } - this.Adapter.DeleteCommand.Parameters[16].Value = ((bool)(Original_IsArchived)); - 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", "16.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(int ProjectID, int ContactID, string JobNumber, string JobTitle, string JobDescription, global::System.Nullable DateStart, global::System.Nullable DateEnd, global::System.Nullable ShareBob, global::System.Nullable ShareJohn, bool IsArchived) { - this.Adapter.InsertCommand.Parameters[0].Value = ((int)(ProjectID)); - this.Adapter.InsertCommand.Parameters[1].Value = ((int)(ContactID)); - if ((JobNumber == null)) { - throw new global::System.ArgumentNullException("JobNumber"); - } - else { - this.Adapter.InsertCommand.Parameters[2].Value = ((string)(JobNumber)); - } - if ((JobTitle == null)) { - this.Adapter.InsertCommand.Parameters[3].Value = global::System.DBNull.Value; - } - else { - this.Adapter.InsertCommand.Parameters[3].Value = ((string)(JobTitle)); - } - if ((JobDescription == null)) { - this.Adapter.InsertCommand.Parameters[4].Value = global::System.DBNull.Value; - } - else { - this.Adapter.InsertCommand.Parameters[4].Value = ((string)(JobDescription)); - } - if ((DateStart.HasValue == true)) { - this.Adapter.InsertCommand.Parameters[5].Value = ((System.DateTime)(DateStart.Value)); - } - else { - this.Adapter.InsertCommand.Parameters[5].Value = global::System.DBNull.Value; - } - if ((DateEnd.HasValue == true)) { - this.Adapter.InsertCommand.Parameters[6].Value = ((System.DateTime)(DateEnd.Value)); - } - else { - this.Adapter.InsertCommand.Parameters[6].Value = global::System.DBNull.Value; - } - if ((ShareBob.HasValue == true)) { - this.Adapter.InsertCommand.Parameters[7].Value = ((decimal)(ShareBob.Value)); - } - else { - this.Adapter.InsertCommand.Parameters[7].Value = global::System.DBNull.Value; - } - if ((ShareJohn.HasValue == true)) { - this.Adapter.InsertCommand.Parameters[8].Value = ((decimal)(ShareJohn.Value)); - } - else { - this.Adapter.InsertCommand.Parameters[8].Value = global::System.DBNull.Value; - } - this.Adapter.InsertCommand.Parameters[9].Value = ((bool)(IsArchived)); - 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", "16.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( - int ProjectID, - int ContactID, - string JobNumber, - string JobTitle, - string JobDescription, - global::System.Nullable DateStart, - global::System.Nullable DateEnd, - global::System.Nullable ShareBob, - global::System.Nullable ShareJohn, - bool IsArchived, - int Original_ProjectJobID, - int Original_ProjectID, - int Original_ContactID, - string Original_JobNumber, - string Original_JobTitle, - string Original_JobDescription, - global::System.Nullable Original_DateStart, - global::System.Nullable Original_DateEnd, - global::System.Nullable Original_ShareBob, - global::System.Nullable Original_ShareJohn, - bool Original_IsArchived, - int ProjectJobID) { - this.Adapter.UpdateCommand.Parameters[0].Value = ((int)(ProjectID)); - this.Adapter.UpdateCommand.Parameters[1].Value = ((int)(ContactID)); - if ((JobNumber == null)) { - throw new global::System.ArgumentNullException("JobNumber"); - } - else { - this.Adapter.UpdateCommand.Parameters[2].Value = ((string)(JobNumber)); - } - if ((JobTitle == null)) { - this.Adapter.UpdateCommand.Parameters[3].Value = global::System.DBNull.Value; - } - else { - this.Adapter.UpdateCommand.Parameters[3].Value = ((string)(JobTitle)); - } - if ((JobDescription == null)) { - this.Adapter.UpdateCommand.Parameters[4].Value = global::System.DBNull.Value; - } - else { - this.Adapter.UpdateCommand.Parameters[4].Value = ((string)(JobDescription)); - } - if ((DateStart.HasValue == true)) { - this.Adapter.UpdateCommand.Parameters[5].Value = ((System.DateTime)(DateStart.Value)); - } - else { - this.Adapter.UpdateCommand.Parameters[5].Value = global::System.DBNull.Value; - } - if ((DateEnd.HasValue == true)) { - this.Adapter.UpdateCommand.Parameters[6].Value = ((System.DateTime)(DateEnd.Value)); - } - else { - this.Adapter.UpdateCommand.Parameters[6].Value = global::System.DBNull.Value; - } - if ((ShareBob.HasValue == true)) { - this.Adapter.UpdateCommand.Parameters[7].Value = ((decimal)(ShareBob.Value)); - } - else { - this.Adapter.UpdateCommand.Parameters[7].Value = global::System.DBNull.Value; - } - if ((ShareJohn.HasValue == true)) { - this.Adapter.UpdateCommand.Parameters[8].Value = ((decimal)(ShareJohn.Value)); - } - else { - this.Adapter.UpdateCommand.Parameters[8].Value = global::System.DBNull.Value; - } - this.Adapter.UpdateCommand.Parameters[9].Value = ((bool)(IsArchived)); - this.Adapter.UpdateCommand.Parameters[10].Value = ((int)(Original_ProjectJobID)); - this.Adapter.UpdateCommand.Parameters[11].Value = ((int)(Original_ProjectID)); - this.Adapter.UpdateCommand.Parameters[12].Value = ((int)(Original_ContactID)); - if ((Original_JobNumber == null)) { - throw new global::System.ArgumentNullException("Original_JobNumber"); - } - else { - this.Adapter.UpdateCommand.Parameters[13].Value = ((string)(Original_JobNumber)); - } - if ((Original_JobTitle == null)) { - this.Adapter.UpdateCommand.Parameters[14].Value = ((object)(1)); - this.Adapter.UpdateCommand.Parameters[15].Value = global::System.DBNull.Value; - } - else { - this.Adapter.UpdateCommand.Parameters[14].Value = ((object)(0)); - this.Adapter.UpdateCommand.Parameters[15].Value = ((string)(Original_JobTitle)); - } - if ((Original_JobDescription == null)) { - this.Adapter.UpdateCommand.Parameters[16].Value = ((object)(1)); - this.Adapter.UpdateCommand.Parameters[17].Value = global::System.DBNull.Value; - } - else { - this.Adapter.UpdateCommand.Parameters[16].Value = ((object)(0)); - this.Adapter.UpdateCommand.Parameters[17].Value = ((string)(Original_JobDescription)); - } - if ((Original_DateStart.HasValue == true)) { - this.Adapter.UpdateCommand.Parameters[18].Value = ((object)(0)); - this.Adapter.UpdateCommand.Parameters[19].Value = ((System.DateTime)(Original_DateStart.Value)); - } - else { - this.Adapter.UpdateCommand.Parameters[18].Value = ((object)(1)); - this.Adapter.UpdateCommand.Parameters[19].Value = global::System.DBNull.Value; - } - if ((Original_DateEnd.HasValue == true)) { - this.Adapter.UpdateCommand.Parameters[20].Value = ((object)(0)); - this.Adapter.UpdateCommand.Parameters[21].Value = ((System.DateTime)(Original_DateEnd.Value)); - } - else { - this.Adapter.UpdateCommand.Parameters[20].Value = ((object)(1)); - this.Adapter.UpdateCommand.Parameters[21].Value = global::System.DBNull.Value; - } - if ((Original_ShareBob.HasValue == true)) { - this.Adapter.UpdateCommand.Parameters[22].Value = ((object)(0)); - this.Adapter.UpdateCommand.Parameters[23].Value = ((decimal)(Original_ShareBob.Value)); - } - else { - this.Adapter.UpdateCommand.Parameters[22].Value = ((object)(1)); - this.Adapter.UpdateCommand.Parameters[23].Value = global::System.DBNull.Value; - } - if ((Original_ShareJohn.HasValue == true)) { - this.Adapter.UpdateCommand.Parameters[24].Value = ((object)(0)); - this.Adapter.UpdateCommand.Parameters[25].Value = ((decimal)(Original_ShareJohn.Value)); - } - else { - this.Adapter.UpdateCommand.Parameters[24].Value = ((object)(1)); - this.Adapter.UpdateCommand.Parameters[25].Value = global::System.DBNull.Value; - } - this.Adapter.UpdateCommand.Parameters[26].Value = ((bool)(Original_IsArchived)); - this.Adapter.UpdateCommand.Parameters[27].Value = ((int)(ProjectJobID)); - 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", "16.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( - int ProjectID, - int ContactID, - string JobNumber, - string JobTitle, - string JobDescription, - global::System.Nullable DateStart, - global::System.Nullable DateEnd, - global::System.Nullable ShareBob, - global::System.Nullable ShareJohn, - bool IsArchived, - int Original_ProjectJobID, - int Original_ProjectID, - int Original_ContactID, - string Original_JobNumber, - string Original_JobTitle, - string Original_JobDescription, - global::System.Nullable Original_DateStart, - global::System.Nullable Original_DateEnd, - global::System.Nullable Original_ShareBob, - global::System.Nullable Original_ShareJohn, - bool Original_IsArchived) { - return this.Update(ProjectID, ContactID, JobNumber, JobTitle, JobDescription, DateStart, DateEnd, ShareBob, ShareJohn, IsArchived, Original_ProjectJobID, Original_ProjectID, Original_ContactID, Original_JobNumber, Original_JobTitle, Original_JobDescription, Original_DateStart, Original_DateEnd, Original_ShareBob, Original_ShareJohn, Original_IsArchived, Original_ProjectJobID); - } - } - - /// - ///TableAdapterManager is used to coordinate TableAdapters in the dataset to enable Hierarchical Update scenarios - /// - [global::System.ComponentModel.DesignerCategoryAttribute("code")] - [global::System.ComponentModel.ToolboxItem(true)] - [global::System.ComponentModel.DesignerAttribute("Microsoft.VSDesigner.DataSource.Design.TableAdapterManagerDesigner, Microsoft.VSD" + - "esigner, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")] - [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapterManager")] - public partial class TableAdapterManager : global::System.ComponentModel.Component { - - private UpdateOrderOption _updateOrder; - - private ClientPurchaseOrderTableAdapter _clientPurchaseOrderTableAdapter; - - private ClientPurchaseOrderLineTableAdapter _clientPurchaseOrderLineTableAdapter; - - private ClientPurchaseOrderLineSalesInvoiceTableAdapter _clientPurchaseOrderLineSalesInvoiceTableAdapter; - - private ContactTableAdapter _contactTableAdapter; - - private ProjectTableAdapter _projectTableAdapter; - - private ProjectJobTableAdapter _projectJobTableAdapter; - - private bool _backupDataSetBeforeUpdate; - - private global::System.Data.IDbConnection _connection; - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - public UpdateOrderOption UpdateOrder { - get { - return this._updateOrder; - } - set { - this._updateOrder = value; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.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 ClientPurchaseOrderTableAdapter ClientPurchaseOrderTableAdapter { - get { - return this._clientPurchaseOrderTableAdapter; - } - set { - this._clientPurchaseOrderTableAdapter = value; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.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 ClientPurchaseOrderLineTableAdapter ClientPurchaseOrderLineTableAdapter { - get { - return this._clientPurchaseOrderLineTableAdapter; - } - set { - this._clientPurchaseOrderLineTableAdapter = value; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.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 ClientPurchaseOrderLineSalesInvoiceTableAdapter ClientPurchaseOrderLineSalesInvoiceTableAdapter { - get { - return this._clientPurchaseOrderLineSalesInvoiceTableAdapter; - } - set { - this._clientPurchaseOrderLineSalesInvoiceTableAdapter = value; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.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 ContactTableAdapter ContactTableAdapter { - get { - return this._contactTableAdapter; - } - set { - this._contactTableAdapter = value; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.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 ProjectTableAdapter ProjectTableAdapter { - get { - return this._projectTableAdapter; - } - set { - this._projectTableAdapter = value; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.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 ProjectJobTableAdapter ProjectJobTableAdapter { - get { - return this._projectJobTableAdapter; - } - set { - this._projectJobTableAdapter = value; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - public bool BackupDataSetBeforeUpdate { - get { - return this._backupDataSetBeforeUpdate; - } - set { - this._backupDataSetBeforeUpdate = value; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - [global::System.ComponentModel.Browsable(false)] - public global::System.Data.IDbConnection Connection { - get { - if ((this._connection != null)) { - return this._connection; - } - if (((this._clientPurchaseOrderTableAdapter != null) - && (this._clientPurchaseOrderTableAdapter.Connection != null))) { - return this._clientPurchaseOrderTableAdapter.Connection; - } - if (((this._clientPurchaseOrderLineTableAdapter != null) - && (this._clientPurchaseOrderLineTableAdapter.Connection != null))) { - return this._clientPurchaseOrderLineTableAdapter.Connection; - } - if (((this._clientPurchaseOrderLineSalesInvoiceTableAdapter != null) - && (this._clientPurchaseOrderLineSalesInvoiceTableAdapter.Connection != null))) { - return this._clientPurchaseOrderLineSalesInvoiceTableAdapter.Connection; - } - if (((this._contactTableAdapter != null) - && (this._contactTableAdapter.Connection != null))) { - return this._contactTableAdapter.Connection; - } - if (((this._projectTableAdapter != null) - && (this._projectTableAdapter.Connection != null))) { - return this._projectTableAdapter.Connection; - } - if (((this._projectJobTableAdapter != null) - && (this._projectJobTableAdapter.Connection != null))) { - return this._projectJobTableAdapter.Connection; - } - return null; - } - set { - this._connection = value; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - [global::System.ComponentModel.Browsable(false)] - public int TableAdapterInstanceCount { - get { - int count = 0; - if ((this._clientPurchaseOrderTableAdapter != null)) { - count = (count + 1); - } - if ((this._clientPurchaseOrderLineTableAdapter != null)) { - count = (count + 1); - } - if ((this._clientPurchaseOrderLineSalesInvoiceTableAdapter != null)) { - count = (count + 1); - } - if ((this._contactTableAdapter != null)) { - count = (count + 1); - } - if ((this._projectTableAdapter != null)) { - count = (count + 1); - } - if ((this._projectJobTableAdapter != null)) { - count = (count + 1); - } - return count; - } - } - - /// - ///Update rows in top-down order. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - private int UpdateUpdatedRows(BealeEngDataSet dataSet, global::System.Collections.Generic.List allChangedRows, global::System.Collections.Generic.List allAddedRows) { - int result = 0; - if ((this._contactTableAdapter != null)) { - global::System.Data.DataRow[] updatedRows = dataSet.Contact.Select(null, null, global::System.Data.DataViewRowState.ModifiedCurrent); - updatedRows = this.GetRealUpdatedRows(updatedRows, allAddedRows); - if (((updatedRows != null) - && (0 < updatedRows.Length))) { - result = (result + this._contactTableAdapter.Update(updatedRows)); - allChangedRows.AddRange(updatedRows); - } - } - if ((this._clientPurchaseOrderTableAdapter != null)) { - global::System.Data.DataRow[] updatedRows = dataSet.ClientPurchaseOrder.Select(null, null, global::System.Data.DataViewRowState.ModifiedCurrent); - updatedRows = this.GetRealUpdatedRows(updatedRows, allAddedRows); - if (((updatedRows != null) - && (0 < updatedRows.Length))) { - result = (result + this._clientPurchaseOrderTableAdapter.Update(updatedRows)); - allChangedRows.AddRange(updatedRows); - } - } - if ((this._clientPurchaseOrderLineTableAdapter != null)) { - global::System.Data.DataRow[] updatedRows = dataSet.ClientPurchaseOrderLine.Select(null, null, global::System.Data.DataViewRowState.ModifiedCurrent); - updatedRows = this.GetRealUpdatedRows(updatedRows, allAddedRows); - if (((updatedRows != null) - && (0 < updatedRows.Length))) { - result = (result + this._clientPurchaseOrderLineTableAdapter.Update(updatedRows)); - allChangedRows.AddRange(updatedRows); - } - } - if ((this._projectTableAdapter != null)) { - global::System.Data.DataRow[] updatedRows = dataSet.Project.Select(null, null, global::System.Data.DataViewRowState.ModifiedCurrent); - updatedRows = this.GetRealUpdatedRows(updatedRows, allAddedRows); - if (((updatedRows != null) - && (0 < updatedRows.Length))) { - result = (result + this._projectTableAdapter.Update(updatedRows)); - allChangedRows.AddRange(updatedRows); - } - } - if ((this._clientPurchaseOrderLineSalesInvoiceTableAdapter != null)) { - global::System.Data.DataRow[] updatedRows = dataSet.ClientPurchaseOrderLineSalesInvoice.Select(null, null, global::System.Data.DataViewRowState.ModifiedCurrent); - updatedRows = this.GetRealUpdatedRows(updatedRows, allAddedRows); - if (((updatedRows != null) - && (0 < updatedRows.Length))) { - result = (result + this._clientPurchaseOrderLineSalesInvoiceTableAdapter.Update(updatedRows)); - allChangedRows.AddRange(updatedRows); - } - } - if ((this._projectJobTableAdapter != null)) { - global::System.Data.DataRow[] updatedRows = dataSet.ProjectJob.Select(null, null, global::System.Data.DataViewRowState.ModifiedCurrent); - updatedRows = this.GetRealUpdatedRows(updatedRows, allAddedRows); - if (((updatedRows != null) - && (0 < updatedRows.Length))) { - result = (result + this._projectJobTableAdapter.Update(updatedRows)); - allChangedRows.AddRange(updatedRows); - } - } - return result; - } - - /// - ///Insert rows in top-down order. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - private int UpdateInsertedRows(BealeEngDataSet dataSet, global::System.Collections.Generic.List allAddedRows) { - int result = 0; - if ((this._contactTableAdapter != null)) { - global::System.Data.DataRow[] addedRows = dataSet.Contact.Select(null, null, global::System.Data.DataViewRowState.Added); - if (((addedRows != null) - && (0 < addedRows.Length))) { - result = (result + this._contactTableAdapter.Update(addedRows)); - allAddedRows.AddRange(addedRows); - } - } - if ((this._clientPurchaseOrderTableAdapter != null)) { - global::System.Data.DataRow[] addedRows = dataSet.ClientPurchaseOrder.Select(null, null, global::System.Data.DataViewRowState.Added); - if (((addedRows != null) - && (0 < addedRows.Length))) { - result = (result + this._clientPurchaseOrderTableAdapter.Update(addedRows)); - allAddedRows.AddRange(addedRows); - } - } - if ((this._clientPurchaseOrderLineTableAdapter != null)) { - global::System.Data.DataRow[] addedRows = dataSet.ClientPurchaseOrderLine.Select(null, null, global::System.Data.DataViewRowState.Added); - if (((addedRows != null) - && (0 < addedRows.Length))) { - result = (result + this._clientPurchaseOrderLineTableAdapter.Update(addedRows)); - allAddedRows.AddRange(addedRows); - } - } - if ((this._projectTableAdapter != null)) { - global::System.Data.DataRow[] addedRows = dataSet.Project.Select(null, null, global::System.Data.DataViewRowState.Added); - if (((addedRows != null) - && (0 < addedRows.Length))) { - result = (result + this._projectTableAdapter.Update(addedRows)); - allAddedRows.AddRange(addedRows); - } - } - if ((this._clientPurchaseOrderLineSalesInvoiceTableAdapter != null)) { - global::System.Data.DataRow[] addedRows = dataSet.ClientPurchaseOrderLineSalesInvoice.Select(null, null, global::System.Data.DataViewRowState.Added); - if (((addedRows != null) - && (0 < addedRows.Length))) { - result = (result + this._clientPurchaseOrderLineSalesInvoiceTableAdapter.Update(addedRows)); - allAddedRows.AddRange(addedRows); - } - } - if ((this._projectJobTableAdapter != null)) { - global::System.Data.DataRow[] addedRows = dataSet.ProjectJob.Select(null, null, global::System.Data.DataViewRowState.Added); - if (((addedRows != null) - && (0 < addedRows.Length))) { - result = (result + this._projectJobTableAdapter.Update(addedRows)); - allAddedRows.AddRange(addedRows); - } - } - return result; - } - - /// - ///Delete rows in bottom-up order. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - private int UpdateDeletedRows(BealeEngDataSet dataSet, global::System.Collections.Generic.List allChangedRows) { - int result = 0; - if ((this._projectJobTableAdapter != null)) { - global::System.Data.DataRow[] deletedRows = dataSet.ProjectJob.Select(null, null, global::System.Data.DataViewRowState.Deleted); - if (((deletedRows != null) - && (0 < deletedRows.Length))) { - result = (result + this._projectJobTableAdapter.Update(deletedRows)); - allChangedRows.AddRange(deletedRows); - } - } - if ((this._clientPurchaseOrderLineSalesInvoiceTableAdapter != null)) { - global::System.Data.DataRow[] deletedRows = dataSet.ClientPurchaseOrderLineSalesInvoice.Select(null, null, global::System.Data.DataViewRowState.Deleted); - if (((deletedRows != null) - && (0 < deletedRows.Length))) { - result = (result + this._clientPurchaseOrderLineSalesInvoiceTableAdapter.Update(deletedRows)); - allChangedRows.AddRange(deletedRows); - } - } - if ((this._projectTableAdapter != null)) { - global::System.Data.DataRow[] deletedRows = dataSet.Project.Select(null, null, global::System.Data.DataViewRowState.Deleted); - if (((deletedRows != null) - && (0 < deletedRows.Length))) { - result = (result + this._projectTableAdapter.Update(deletedRows)); - allChangedRows.AddRange(deletedRows); - } - } - if ((this._clientPurchaseOrderLineTableAdapter != null)) { - global::System.Data.DataRow[] deletedRows = dataSet.ClientPurchaseOrderLine.Select(null, null, global::System.Data.DataViewRowState.Deleted); - if (((deletedRows != null) - && (0 < deletedRows.Length))) { - result = (result + this._clientPurchaseOrderLineTableAdapter.Update(deletedRows)); - allChangedRows.AddRange(deletedRows); - } - } - if ((this._clientPurchaseOrderTableAdapter != null)) { - global::System.Data.DataRow[] deletedRows = dataSet.ClientPurchaseOrder.Select(null, null, global::System.Data.DataViewRowState.Deleted); - if (((deletedRows != null) - && (0 < deletedRows.Length))) { - result = (result + this._clientPurchaseOrderTableAdapter.Update(deletedRows)); - allChangedRows.AddRange(deletedRows); - } - } - if ((this._contactTableAdapter != null)) { - global::System.Data.DataRow[] deletedRows = dataSet.Contact.Select(null, null, global::System.Data.DataViewRowState.Deleted); - if (((deletedRows != null) - && (0 < deletedRows.Length))) { - result = (result + this._contactTableAdapter.Update(deletedRows)); - allChangedRows.AddRange(deletedRows); - } - } - return result; - } - - /// - ///Remove inserted rows that become updated rows after calling TableAdapter.Update(inserted rows) first - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - private global::System.Data.DataRow[] GetRealUpdatedRows(global::System.Data.DataRow[] updatedRows, global::System.Collections.Generic.List allAddedRows) { - if (((updatedRows == null) - || (updatedRows.Length < 1))) { - return updatedRows; - } - if (((allAddedRows == null) - || (allAddedRows.Count < 1))) { - return updatedRows; - } - global::System.Collections.Generic.List realUpdatedRows = new global::System.Collections.Generic.List(); - for (int i = 0; (i < updatedRows.Length); i = (i + 1)) { - global::System.Data.DataRow row = updatedRows[i]; - if ((allAddedRows.Contains(row) == false)) { - realUpdatedRows.Add(row); - } - } - return realUpdatedRows.ToArray(); - } - - /// - ///Update all changes to the dataset. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - public virtual int UpdateAll(BealeEngDataSet dataSet) { - if ((dataSet == null)) { - throw new global::System.ArgumentNullException("dataSet"); - } - if ((dataSet.HasChanges() == false)) { - return 0; - } - if (((this._clientPurchaseOrderTableAdapter != null) - && (this.MatchTableAdapterConnection(this._clientPurchaseOrderTableAdapter.Connection) == false))) { - throw new global::System.ArgumentException("All TableAdapters managed by a TableAdapterManager must use the same connection s" + - "tring."); - } - if (((this._clientPurchaseOrderLineTableAdapter != null) - && (this.MatchTableAdapterConnection(this._clientPurchaseOrderLineTableAdapter.Connection) == false))) { - throw new global::System.ArgumentException("All TableAdapters managed by a TableAdapterManager must use the same connection s" + - "tring."); - } - if (((this._clientPurchaseOrderLineSalesInvoiceTableAdapter != null) - && (this.MatchTableAdapterConnection(this._clientPurchaseOrderLineSalesInvoiceTableAdapter.Connection) == false))) { - throw new global::System.ArgumentException("All TableAdapters managed by a TableAdapterManager must use the same connection s" + - "tring."); - } - if (((this._contactTableAdapter != null) - && (this.MatchTableAdapterConnection(this._contactTableAdapter.Connection) == false))) { - throw new global::System.ArgumentException("All TableAdapters managed by a TableAdapterManager must use the same connection s" + - "tring."); - } - if (((this._projectTableAdapter != null) - && (this.MatchTableAdapterConnection(this._projectTableAdapter.Connection) == false))) { - throw new global::System.ArgumentException("All TableAdapters managed by a TableAdapterManager must use the same connection s" + - "tring."); - } - if (((this._projectJobTableAdapter != null) - && (this.MatchTableAdapterConnection(this._projectJobTableAdapter.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" + - "ger TableAdapter property to a valid TableAdapter instance."); - } - bool workConnOpened = false; - if (((workConnection.State & global::System.Data.ConnectionState.Broken) - == global::System.Data.ConnectionState.Broken)) { - workConnection.Close(); - } - if ((workConnection.State == global::System.Data.ConnectionState.Closed)) { - workConnection.Open(); - workConnOpened = true; - } - global::System.Data.IDbTransaction workTransaction = workConnection.BeginTransaction(); - if ((workTransaction == null)) { - throw new global::System.ApplicationException("The transaction cannot begin. The current data connection does not support transa" + - "ctions or the current state is not allowing the transaction to begin."); - } - global::System.Collections.Generic.List allChangedRows = new global::System.Collections.Generic.List(); - global::System.Collections.Generic.List allAddedRows = new global::System.Collections.Generic.List(); - global::System.Collections.Generic.List adaptersWithAcceptChangesDuringUpdate = new global::System.Collections.Generic.List(); - global::System.Collections.Generic.Dictionary revertConnections = new global::System.Collections.Generic.Dictionary(); - int result = 0; - global::System.Data.DataSet backupDataSet = null; - if (this.BackupDataSetBeforeUpdate) { - backupDataSet = new global::System.Data.DataSet(); - backupDataSet.Merge(dataSet); - } - try { - // ---- Prepare for update ----------- - // - if ((this._clientPurchaseOrderTableAdapter != null)) { - revertConnections.Add(this._clientPurchaseOrderTableAdapter, this._clientPurchaseOrderTableAdapter.Connection); - this._clientPurchaseOrderTableAdapter.Connection = ((global::System.Data.SqlClient.SqlConnection)(workConnection)); - this._clientPurchaseOrderTableAdapter.Transaction = ((global::System.Data.SqlClient.SqlTransaction)(workTransaction)); - if (this._clientPurchaseOrderTableAdapter.Adapter.AcceptChangesDuringUpdate) { - this._clientPurchaseOrderTableAdapter.Adapter.AcceptChangesDuringUpdate = false; - adaptersWithAcceptChangesDuringUpdate.Add(this._clientPurchaseOrderTableAdapter.Adapter); - } - } - if ((this._clientPurchaseOrderLineTableAdapter != null)) { - revertConnections.Add(this._clientPurchaseOrderLineTableAdapter, this._clientPurchaseOrderLineTableAdapter.Connection); - this._clientPurchaseOrderLineTableAdapter.Connection = ((global::System.Data.SqlClient.SqlConnection)(workConnection)); - this._clientPurchaseOrderLineTableAdapter.Transaction = ((global::System.Data.SqlClient.SqlTransaction)(workTransaction)); - if (this._clientPurchaseOrderLineTableAdapter.Adapter.AcceptChangesDuringUpdate) { - this._clientPurchaseOrderLineTableAdapter.Adapter.AcceptChangesDuringUpdate = false; - adaptersWithAcceptChangesDuringUpdate.Add(this._clientPurchaseOrderLineTableAdapter.Adapter); - } - } - if ((this._clientPurchaseOrderLineSalesInvoiceTableAdapter != null)) { - revertConnections.Add(this._clientPurchaseOrderLineSalesInvoiceTableAdapter, this._clientPurchaseOrderLineSalesInvoiceTableAdapter.Connection); - this._clientPurchaseOrderLineSalesInvoiceTableAdapter.Connection = ((global::System.Data.SqlClient.SqlConnection)(workConnection)); - this._clientPurchaseOrderLineSalesInvoiceTableAdapter.Transaction = ((global::System.Data.SqlClient.SqlTransaction)(workTransaction)); - if (this._clientPurchaseOrderLineSalesInvoiceTableAdapter.Adapter.AcceptChangesDuringUpdate) { - this._clientPurchaseOrderLineSalesInvoiceTableAdapter.Adapter.AcceptChangesDuringUpdate = false; - adaptersWithAcceptChangesDuringUpdate.Add(this._clientPurchaseOrderLineSalesInvoiceTableAdapter.Adapter); - } - } - if ((this._contactTableAdapter != null)) { - revertConnections.Add(this._contactTableAdapter, this._contactTableAdapter.Connection); - this._contactTableAdapter.Connection = ((global::System.Data.SqlClient.SqlConnection)(workConnection)); - this._contactTableAdapter.Transaction = ((global::System.Data.SqlClient.SqlTransaction)(workTransaction)); - if (this._contactTableAdapter.Adapter.AcceptChangesDuringUpdate) { - this._contactTableAdapter.Adapter.AcceptChangesDuringUpdate = false; - adaptersWithAcceptChangesDuringUpdate.Add(this._contactTableAdapter.Adapter); - } - } - if ((this._projectTableAdapter != null)) { - revertConnections.Add(this._projectTableAdapter, this._projectTableAdapter.Connection); - this._projectTableAdapter.Connection = ((global::System.Data.SqlClient.SqlConnection)(workConnection)); - this._projectTableAdapter.Transaction = ((global::System.Data.SqlClient.SqlTransaction)(workTransaction)); - if (this._projectTableAdapter.Adapter.AcceptChangesDuringUpdate) { - this._projectTableAdapter.Adapter.AcceptChangesDuringUpdate = false; - adaptersWithAcceptChangesDuringUpdate.Add(this._projectTableAdapter.Adapter); - } - } - if ((this._projectJobTableAdapter != null)) { - revertConnections.Add(this._projectJobTableAdapter, this._projectJobTableAdapter.Connection); - this._projectJobTableAdapter.Connection = ((global::System.Data.SqlClient.SqlConnection)(workConnection)); - this._projectJobTableAdapter.Transaction = ((global::System.Data.SqlClient.SqlTransaction)(workTransaction)); - if (this._projectJobTableAdapter.Adapter.AcceptChangesDuringUpdate) { - this._projectJobTableAdapter.Adapter.AcceptChangesDuringUpdate = false; - adaptersWithAcceptChangesDuringUpdate.Add(this._projectJobTableAdapter.Adapter); - } - } - // - //---- Perform updates ----------- - // - if ((this.UpdateOrder == UpdateOrderOption.UpdateInsertDelete)) { - result = (result + this.UpdateUpdatedRows(dataSet, allChangedRows, allAddedRows)); - result = (result + this.UpdateInsertedRows(dataSet, allAddedRows)); - } - else { - result = (result + this.UpdateInsertedRows(dataSet, allAddedRows)); - result = (result + this.UpdateUpdatedRows(dataSet, allChangedRows, allAddedRows)); - } - result = (result + this.UpdateDeletedRows(dataSet, allChangedRows)); - // - //---- Commit updates ----------- - // - workTransaction.Commit(); - if ((0 < allAddedRows.Count)) { - global::System.Data.DataRow[] rows = new System.Data.DataRow[allAddedRows.Count]; - allAddedRows.CopyTo(rows); - for (int i = 0; (i < rows.Length); i = (i + 1)) { - global::System.Data.DataRow row = rows[i]; - row.AcceptChanges(); - } - } - if ((0 < allChangedRows.Count)) { - global::System.Data.DataRow[] rows = new System.Data.DataRow[allChangedRows.Count]; - allChangedRows.CopyTo(rows); - for (int i = 0; (i < rows.Length); i = (i + 1)) { - global::System.Data.DataRow row = rows[i]; - row.AcceptChanges(); - } - } - } - catch (global::System.Exception ex) { - workTransaction.Rollback(); - // ---- Restore the dataset ----------- - if (this.BackupDataSetBeforeUpdate) { - global::System.Diagnostics.Debug.Assert((backupDataSet != null)); - dataSet.Clear(); - dataSet.Merge(backupDataSet); - } - else { - if ((0 < allAddedRows.Count)) { - global::System.Data.DataRow[] rows = new System.Data.DataRow[allAddedRows.Count]; - allAddedRows.CopyTo(rows); - for (int i = 0; (i < rows.Length); i = (i + 1)) { - global::System.Data.DataRow row = rows[i]; - row.AcceptChanges(); - row.SetAdded(); - } - } - } - throw ex; - } - finally { - if (workConnOpened) { - workConnection.Close(); - } - if ((this._clientPurchaseOrderTableAdapter != null)) { - this._clientPurchaseOrderTableAdapter.Connection = ((global::System.Data.SqlClient.SqlConnection)(revertConnections[this._clientPurchaseOrderTableAdapter])); - this._clientPurchaseOrderTableAdapter.Transaction = null; - } - if ((this._clientPurchaseOrderLineTableAdapter != null)) { - this._clientPurchaseOrderLineTableAdapter.Connection = ((global::System.Data.SqlClient.SqlConnection)(revertConnections[this._clientPurchaseOrderLineTableAdapter])); - this._clientPurchaseOrderLineTableAdapter.Transaction = null; - } - if ((this._clientPurchaseOrderLineSalesInvoiceTableAdapter != null)) { - this._clientPurchaseOrderLineSalesInvoiceTableAdapter.Connection = ((global::System.Data.SqlClient.SqlConnection)(revertConnections[this._clientPurchaseOrderLineSalesInvoiceTableAdapter])); - this._clientPurchaseOrderLineSalesInvoiceTableAdapter.Transaction = null; - } - if ((this._contactTableAdapter != null)) { - this._contactTableAdapter.Connection = ((global::System.Data.SqlClient.SqlConnection)(revertConnections[this._contactTableAdapter])); - this._contactTableAdapter.Transaction = null; - } - if ((this._projectTableAdapter != null)) { - this._projectTableAdapter.Connection = ((global::System.Data.SqlClient.SqlConnection)(revertConnections[this._projectTableAdapter])); - this._projectTableAdapter.Transaction = null; - } - if ((this._projectJobTableAdapter != null)) { - this._projectJobTableAdapter.Connection = ((global::System.Data.SqlClient.SqlConnection)(revertConnections[this._projectJobTableAdapter])); - this._projectJobTableAdapter.Transaction = null; - } - if ((0 < adaptersWithAcceptChangesDuringUpdate.Count)) { - global::System.Data.Common.DataAdapter[] adapters = new System.Data.Common.DataAdapter[adaptersWithAcceptChangesDuringUpdate.Count]; - adaptersWithAcceptChangesDuringUpdate.CopyTo(adapters); - for (int i = 0; (i < adapters.Length); i = (i + 1)) { - global::System.Data.Common.DataAdapter adapter = adapters[i]; - adapter.AcceptChangesDuringUpdate = true; - } - } - } - return result; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - protected virtual void SortSelfReferenceRows(global::System.Data.DataRow[] rows, global::System.Data.DataRelation relation, bool childFirst) { - global::System.Array.Sort(rows, new SelfReferenceComparer(relation, childFirst)); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - protected virtual bool MatchTableAdapterConnection(global::System.Data.IDbConnection inputConnection) { - if ((this._connection != null)) { - return true; - } - if (((this.Connection == null) - || (inputConnection == null))) { - return true; - } - if (string.Equals(this.Connection.ConnectionString, inputConnection.ConnectionString, global::System.StringComparison.Ordinal)) { - return true; - } - return false; - } - - /// - ///Update Order Option - /// - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - public enum UpdateOrderOption { - - InsertUpdateDelete = 0, - - UpdateInsertDelete = 1, - } - - /// - ///Used to sort self-referenced table's rows - /// - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - private class SelfReferenceComparer : object, global::System.Collections.Generic.IComparer { - - private global::System.Data.DataRelation _relation; - - private int _childFirst; - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - internal SelfReferenceComparer(global::System.Data.DataRelation relation, bool childFirst) { - this._relation = relation; - if (childFirst) { - this._childFirst = -1; - } - else { - this._childFirst = 1; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - private global::System.Data.DataRow GetRoot(global::System.Data.DataRow row, out int distance) { - global::System.Diagnostics.Debug.Assert((row != null)); - global::System.Data.DataRow root = row; - distance = 0; - - global::System.Collections.Generic.IDictionary traversedRows = new global::System.Collections.Generic.Dictionary(); - traversedRows[row] = row; - - global::System.Data.DataRow parent = row.GetParentRow(this._relation, global::System.Data.DataRowVersion.Default); - for ( - ; ((parent != null) - && (traversedRows.ContainsKey(parent) == false)); - ) { - distance = (distance + 1); - root = parent; - traversedRows[parent] = parent; - parent = parent.GetParentRow(this._relation, global::System.Data.DataRowVersion.Default); - } - - if ((distance == 0)) { - traversedRows.Clear(); - traversedRows[row] = row; - parent = row.GetParentRow(this._relation, global::System.Data.DataRowVersion.Original); - for ( - ; ((parent != null) - && (traversedRows.ContainsKey(parent) == false)); - ) { - distance = (distance + 1); - root = parent; - traversedRows[parent] = parent; - parent = parent.GetParentRow(this._relation, global::System.Data.DataRowVersion.Original); - } - } - - return root; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - public int Compare(global::System.Data.DataRow row1, global::System.Data.DataRow row2) { - if (object.ReferenceEquals(row1, row2)) { - return 0; - } - if ((row1 == null)) { - return -1; - } - if ((row2 == null)) { - return 1; - } - - int distance1 = 0; - global::System.Data.DataRow root1 = this.GetRoot(row1, out distance1); - - int distance2 = 0; - global::System.Data.DataRow root2 = this.GetRoot(row2, out distance2); - - if (object.ReferenceEquals(root1, root2)) { - return (this._childFirst * distance1.CompareTo(distance2)); - } - else { - global::System.Diagnostics.Debug.Assert(((root1.Table != null) - && (root2.Table != null))); - if ((root1.Table.Rows.IndexOf(root1) < root2.Table.Rows.IndexOf(root2))) { - return -1; - } - else { - return 1; - } - } - } - } - } -} - -#pragma warning restore 1591 \ No newline at end of file diff --git a/BealeEngineering/BealeEngineering.Accounts/BealeEngDataSet.xsc b/BealeEngineering/BealeEngineering.Accounts/BealeEngDataSet.xsc deleted file mode 100644 index 5f28270..0000000 --- a/BealeEngineering/BealeEngineering.Accounts/BealeEngDataSet.xsc +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/BealeEngineering/BealeEngineering.Accounts/BealeEngDataSet.xsd b/BealeEngineering/BealeEngineering.Accounts/BealeEngDataSet.xsd deleted file mode 100644 index 8594dd9..0000000 --- a/BealeEngineering/BealeEngineering.Accounts/BealeEngDataSet.xsd +++ /dev/null @@ -1,791 +0,0 @@ - - - - - - - - - - - - - - - DELETE FROM [dbo].[ClientPurchaseOrder] WHERE (([ClientPurchaseOrderID] = @Original_ClientPurchaseOrderID) AND ([PurchaseOrderDate] = @Original_PurchaseOrderDate) AND ([ContactID] = @Original_ContactID) AND ([ClientReference] = @Original_ClientReference) AND ((@IsNull_RequestorEmail = 1 AND [RequestorEmail] IS NULL) OR ([RequestorEmail] = @Original_RequestorEmail)) AND ((@IsNull_OrderTotal = 1 AND [OrderTotal] IS NULL) OR ([OrderTotal] = @Original_OrderTotal)) AND ([IsClosed] = @Original_IsClosed)) - - - - - - - - - - - - - - - - INSERT INTO [dbo].[ClientPurchaseOrder] ([PurchaseOrderDate], [ContactID], [ClientReference], [RequestorEmail], [OrderTotal], [IsClosed]) VALUES (@PurchaseOrderDate, @ContactID, @ClientReference, @RequestorEmail, @OrderTotal, @IsClosed); -SELECT ClientPurchaseOrderID, PurchaseOrderDate, ContactID, ClientReference, RequestorEmail, OrderTotal, IsClosed FROM ClientPurchaseOrder WHERE (ClientPurchaseOrderID = SCOPE_IDENTITY()) - - - - - - - - - - - - - SELECT ClientPurchaseOrderID, PurchaseOrderDate, ContactID, ClientReference, RequestorEmail, OrderTotal, IsClosed FROM dbo.ClientPurchaseOrder - - - - - - UPDATE [dbo].[ClientPurchaseOrder] SET [PurchaseOrderDate] = @PurchaseOrderDate, [ContactID] = @ContactID, [ClientReference] = @ClientReference, [RequestorEmail] = @RequestorEmail, [OrderTotal] = @OrderTotal, [IsClosed] = @IsClosed WHERE (([ClientPurchaseOrderID] = @Original_ClientPurchaseOrderID) AND ([PurchaseOrderDate] = @Original_PurchaseOrderDate) AND ([ContactID] = @Original_ContactID) AND ([ClientReference] = @Original_ClientReference) AND ((@IsNull_RequestorEmail = 1 AND [RequestorEmail] IS NULL) OR ([RequestorEmail] = @Original_RequestorEmail)) AND ((@IsNull_OrderTotal = 1 AND [OrderTotal] IS NULL) OR ([OrderTotal] = @Original_OrderTotal)) AND ([IsClosed] = @Original_IsClosed)); -SELECT ClientPurchaseOrderID, PurchaseOrderDate, ContactID, ClientReference, RequestorEmail, OrderTotal, IsClosed FROM ClientPurchaseOrder WHERE (ClientPurchaseOrderID = @ClientPurchaseOrderID) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - DELETE FROM [dbo].[ClientPurchaseOrderLine] WHERE (([ClientPurchaseOrderLineID] = @Original_ClientPurchaseOrderLineID) AND ([ClientPurchaseOrderID] = @Original_ClientPurchaseOrderID) AND ([LineNumber] = @Original_LineNumber) AND ([ProjectJobID] = @Original_ProjectJobID) AND ((@IsNull_Description = 1 AND [Description] IS NULL) OR ([Description] = @Original_Description)) AND ([LineNetAmount] = @Original_LineNetAmount)) - - - - - - - - - - - - - - INSERT INTO [dbo].[ClientPurchaseOrderLine] ([ClientPurchaseOrderID], [LineNumber], [ProjectJobID], [Description], [LineNetAmount]) VALUES (@ClientPurchaseOrderID, @LineNumber, @ProjectJobID, @Description, @LineNetAmount); -SELECT ClientPurchaseOrderLineID, ClientPurchaseOrderID, LineNumber, ProjectJobID, Description, LineNetAmount FROM ClientPurchaseOrderLine WHERE (ClientPurchaseOrderLineID = SCOPE_IDENTITY()) - - - - - - - - - - - - SELECT ClientPurchaseOrderLineID, ClientPurchaseOrderID, LineNumber, ProjectJobID, Description, LineNetAmount FROM dbo.ClientPurchaseOrderLine - - - - - - UPDATE [dbo].[ClientPurchaseOrderLine] SET [ClientPurchaseOrderID] = @ClientPurchaseOrderID, [LineNumber] = @LineNumber, [ProjectJobID] = @ProjectJobID, [Description] = @Description, [LineNetAmount] = @LineNetAmount WHERE (([ClientPurchaseOrderLineID] = @Original_ClientPurchaseOrderLineID) AND ([ClientPurchaseOrderID] = @Original_ClientPurchaseOrderID) AND ([LineNumber] = @Original_LineNumber) AND ([ProjectJobID] = @Original_ProjectJobID) AND ((@IsNull_Description = 1 AND [Description] IS NULL) OR ([Description] = @Original_Description)) AND ([LineNetAmount] = @Original_LineNetAmount)); -SELECT ClientPurchaseOrderLineID, ClientPurchaseOrderID, LineNumber, ProjectJobID, Description, LineNetAmount FROM ClientPurchaseOrderLine WHERE (ClientPurchaseOrderLineID = @ClientPurchaseOrderLineID) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - DELETE FROM [dbo].[ClientPurchaseOrderLineSalesInvoice] WHERE (([ClientPurchaseOrderLineID] = @Original_ClientPurchaseOrderLineID) AND ([SaleInvoiceID] = @Original_SaleInvoiceID) AND ([IsApproved] = @Original_IsApproved)) - - - - - - - - - - INSERT INTO [dbo].[ClientPurchaseOrderLineSalesInvoice] ([ClientPurchaseOrderLineID], [SaleInvoiceID], [IsApproved]) VALUES (@ClientPurchaseOrderLineID, @SaleInvoiceID, @IsApproved); -SELECT ClientPurchaseOrderLineID, SaleInvoiceID, IsApproved FROM ClientPurchaseOrderLineSalesInvoice WHERE (SaleInvoiceID = @SaleInvoiceID) - - - - - - - - - - SELECT ClientPurchaseOrderLineID, SaleInvoiceID, IsApproved FROM dbo.ClientPurchaseOrderLineSalesInvoice - - - - - - UPDATE [dbo].[ClientPurchaseOrderLineSalesInvoice] SET [ClientPurchaseOrderLineID] = @ClientPurchaseOrderLineID, [SaleInvoiceID] = @SaleInvoiceID, [IsApproved] = @IsApproved WHERE (([ClientPurchaseOrderLineID] = @Original_ClientPurchaseOrderLineID) AND ([SaleInvoiceID] = @Original_SaleInvoiceID) AND ([IsApproved] = @Original_IsApproved)); -SELECT ClientPurchaseOrderLineID, SaleInvoiceID, IsApproved FROM ClientPurchaseOrderLineSalesInvoice WHERE (SaleInvoiceID = @SaleInvoiceID) - - - - - - - - - - - - - - - - - - - - - - - - - DELETE FROM [dbo].[Contact] WHERE (([ContactID] = @Original_ContactID) AND ([ContactName] = @Original_ContactName) AND ((@IsNull_EmailAddress = 1 AND [EmailAddress] IS NULL) OR ([EmailAddress] = @Original_EmailAddress)) AND ((@IsNull_PrimaryPersonFirstName = 1 AND [PrimaryPersonFirstName] IS NULL) OR ([PrimaryPersonFirstName] = @Original_PrimaryPersonFirstName)) AND ((@IsNull_PrimaryPersonSurname = 1 AND [PrimaryPersonSurname] IS NULL) OR ([PrimaryPersonSurname] = @Original_PrimaryPersonSurname)) AND ((@IsNull_PrimaryPersonEmail = 1 AND [PrimaryPersonEmail] IS NULL) OR ([PrimaryPersonEmail] = @Original_PrimaryPersonEmail)) AND ((@IsNull_POAddressLine1 = 1 AND [POAddressLine1] IS NULL) OR ([POAddressLine1] = @Original_POAddressLine1)) AND ((@IsNull_POAddressLine2 = 1 AND [POAddressLine2] IS NULL) OR ([POAddressLine2] = @Original_POAddressLine2)) AND ((@IsNull_POAddressLine3 = 1 AND [POAddressLine3] IS NULL) OR ([POAddressLine3] = @Original_POAddressLine3)) AND ((@IsNull_POAddressLine4 = 1 AND [POAddressLine4] IS NULL) OR ([POAddressLine4] = @Original_POAddressLine4)) AND ((@IsNull_POAddressCity = 1 AND [POAddressCity] IS NULL) OR ([POAddressCity] = @Original_POAddressCity)) AND ((@IsNull_POAddressRegion = 1 AND [POAddressRegion] IS NULL) OR ([POAddressRegion] = @Original_POAddressRegion)) AND ((@IsNull_POAddressPostalCode = 1 AND [POAddressPostalCode] IS NULL) OR ([POAddressPostalCode] = @Original_POAddressPostalCode)) AND ((@IsNull_POAddressCountry = 1 AND [POAddressCountry] IS NULL) OR ([POAddressCountry] = @Original_POAddressCountry))) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - INSERT INTO [dbo].[Contact] ([ContactName], [EmailAddress], [PrimaryPersonFirstName], [PrimaryPersonSurname], [PrimaryPersonEmail], [POAddressLine1], [POAddressLine2], [POAddressLine3], [POAddressLine4], [POAddressCity], [POAddressRegion], [POAddressPostalCode], [POAddressCountry]) VALUES (@ContactName, @EmailAddress, @PrimaryPersonFirstName, @PrimaryPersonSurname, @PrimaryPersonEmail, @POAddressLine1, @POAddressLine2, @POAddressLine3, @POAddressLine4, @POAddressCity, @POAddressRegion, @POAddressPostalCode, @POAddressCountry); -SELECT ContactID, ContactName, EmailAddress, PrimaryPersonFirstName, PrimaryPersonSurname, PrimaryPersonEmail, POAddressLine1, POAddressLine2, POAddressLine3, POAddressLine4, POAddressCity, POAddressRegion, POAddressPostalCode, POAddressCountry FROM Contact WHERE (ContactID = SCOPE_IDENTITY()) - - - - - - - - - - - - - - - - - - - - SELECT ContactID, ContactName, EmailAddress, PrimaryPersonFirstName, PrimaryPersonSurname, PrimaryPersonEmail, POAddressLine1, POAddressLine2, POAddressLine3, POAddressLine4, POAddressCity, POAddressRegion, POAddressPostalCode, POAddressCountry FROM dbo.Contact - - - - - - UPDATE [dbo].[Contact] SET [ContactName] = @ContactName, [EmailAddress] = @EmailAddress, [PrimaryPersonFirstName] = @PrimaryPersonFirstName, [PrimaryPersonSurname] = @PrimaryPersonSurname, [PrimaryPersonEmail] = @PrimaryPersonEmail, [POAddressLine1] = @POAddressLine1, [POAddressLine2] = @POAddressLine2, [POAddressLine3] = @POAddressLine3, [POAddressLine4] = @POAddressLine4, [POAddressCity] = @POAddressCity, [POAddressRegion] = @POAddressRegion, [POAddressPostalCode] = @POAddressPostalCode, [POAddressCountry] = @POAddressCountry WHERE (([ContactID] = @Original_ContactID) AND ([ContactName] = @Original_ContactName) AND ((@IsNull_EmailAddress = 1 AND [EmailAddress] IS NULL) OR ([EmailAddress] = @Original_EmailAddress)) AND ((@IsNull_PrimaryPersonFirstName = 1 AND [PrimaryPersonFirstName] IS NULL) OR ([PrimaryPersonFirstName] = @Original_PrimaryPersonFirstName)) AND ((@IsNull_PrimaryPersonSurname = 1 AND [PrimaryPersonSurname] IS NULL) OR ([PrimaryPersonSurname] = @Original_PrimaryPersonSurname)) AND ((@IsNull_PrimaryPersonEmail = 1 AND [PrimaryPersonEmail] IS NULL) OR ([PrimaryPersonEmail] = @Original_PrimaryPersonEmail)) AND ((@IsNull_POAddressLine1 = 1 AND [POAddressLine1] IS NULL) OR ([POAddressLine1] = @Original_POAddressLine1)) AND ((@IsNull_POAddressLine2 = 1 AND [POAddressLine2] IS NULL) OR ([POAddressLine2] = @Original_POAddressLine2)) AND ((@IsNull_POAddressLine3 = 1 AND [POAddressLine3] IS NULL) OR ([POAddressLine3] = @Original_POAddressLine3)) AND ((@IsNull_POAddressLine4 = 1 AND [POAddressLine4] IS NULL) OR ([POAddressLine4] = @Original_POAddressLine4)) AND ((@IsNull_POAddressCity = 1 AND [POAddressCity] IS NULL) OR ([POAddressCity] = @Original_POAddressCity)) AND ((@IsNull_POAddressRegion = 1 AND [POAddressRegion] IS NULL) OR ([POAddressRegion] = @Original_POAddressRegion)) AND ((@IsNull_POAddressPostalCode = 1 AND [POAddressPostalCode] IS NULL) OR ([POAddressPostalCode] = @Original_POAddressPostalCode)) AND ((@IsNull_POAddressCountry = 1 AND [POAddressCountry] IS NULL) OR ([POAddressCountry] = @Original_POAddressCountry))); -SELECT ContactID, ContactName, EmailAddress, PrimaryPersonFirstName, PrimaryPersonSurname, PrimaryPersonEmail, POAddressLine1, POAddressLine2, POAddressLine3, POAddressLine4, POAddressCity, POAddressRegion, POAddressPostalCode, POAddressCountry FROM Contact WHERE (ContactID = @ContactID) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - DELETE FROM [dbo].[Project] WHERE (([ProjectID] = @Original_ProjectID) AND ([ContactID] = @Original_ContactID) AND ((@IsNull_ProjectRef = 1 AND [ProjectRef] IS NULL) OR ([ProjectRef] = @Original_ProjectRef)) AND ([ProjectTitle] = @Original_ProjectTitle) AND ((@IsNull_DateStart = 1 AND [DateStart] IS NULL) OR ([DateStart] = @Original_DateStart)) AND ((@IsNull_DateEnd = 1 AND [DateEnd] IS NULL) OR ([DateEnd] = @Original_DateEnd)) AND ((@IsNull_ClientName = 1 AND [ClientName] IS NULL) OR ([ClientName] = @Original_ClientName)) AND ([IsArchived] = @Original_IsArchived)) - - - - - - - - - - - - - - - - - - - INSERT INTO [dbo].[Project] ([ProjectID], [ContactID], [ProjectRef], [ProjectTitle], [DateStart], [DateEnd], [ClientName], [IsArchived]) VALUES (@ProjectID, @ContactID, @ProjectRef, @ProjectTitle, @DateStart, @DateEnd, @ClientName, @IsArchived); -SELECT ProjectID, ContactID, ProjectRef, ProjectTitle, DateStart, DateEnd, ClientName, IsArchived FROM Project WHERE (ProjectID = @ProjectID) - - - - - - - - - - - - - - - SELECT ProjectID, ContactID, ProjectRef, ProjectTitle, DateStart, DateEnd, ClientName, IsArchived FROM dbo.Project - - - - - - UPDATE [dbo].[Project] SET [ProjectID] = @ProjectID, [ContactID] = @ContactID, [ProjectRef] = @ProjectRef, [ProjectTitle] = @ProjectTitle, [DateStart] = @DateStart, [DateEnd] = @DateEnd, [ClientName] = @ClientName, [IsArchived] = @IsArchived WHERE (([ProjectID] = @Original_ProjectID) AND ([ContactID] = @Original_ContactID) AND ((@IsNull_ProjectRef = 1 AND [ProjectRef] IS NULL) OR ([ProjectRef] = @Original_ProjectRef)) AND ([ProjectTitle] = @Original_ProjectTitle) AND ((@IsNull_DateStart = 1 AND [DateStart] IS NULL) OR ([DateStart] = @Original_DateStart)) AND ((@IsNull_DateEnd = 1 AND [DateEnd] IS NULL) OR ([DateEnd] = @Original_DateEnd)) AND ((@IsNull_ClientName = 1 AND [ClientName] IS NULL) OR ([ClientName] = @Original_ClientName)) AND ([IsArchived] = @Original_IsArchived)); -SELECT ProjectID, ContactID, ProjectRef, ProjectTitle, DateStart, DateEnd, ClientName, IsArchived FROM Project WHERE (ProjectID = @ProjectID) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - DELETE FROM [dbo].[ProjectJob] WHERE (([ProjectJobID] = @Original_ProjectJobID) AND ([ProjectID] = @Original_ProjectID) AND ([ContactID] = @Original_ContactID) AND ([JobNumber] = @Original_JobNumber) AND ((@IsNull_JobTitle = 1 AND [JobTitle] IS NULL) OR ([JobTitle] = @Original_JobTitle)) AND ((@IsNull_JobDescription = 1 AND [JobDescription] IS NULL) OR ([JobDescription] = @Original_JobDescription)) AND ((@IsNull_DateStart = 1 AND [DateStart] IS NULL) OR ([DateStart] = @Original_DateStart)) AND ((@IsNull_DateEnd = 1 AND [DateEnd] IS NULL) OR ([DateEnd] = @Original_DateEnd)) AND ((@IsNull_ShareBob = 1 AND [ShareBob] IS NULL) OR ([ShareBob] = @Original_ShareBob)) AND ((@IsNull_ShareJohn = 1 AND [ShareJohn] IS NULL) OR ([ShareJohn] = @Original_ShareJohn)) AND ([IsArchived] = @Original_IsArchived)) - - - - - - - - - - - - - - - - - - - - - - - - INSERT INTO [dbo].[ProjectJob] ([ProjectID], [ContactID], [JobNumber], [JobTitle], [JobDescription], [DateStart], [DateEnd], [ShareBob], [ShareJohn], [IsArchived]) VALUES (@ProjectID, @ContactID, @JobNumber, @JobTitle, @JobDescription, @DateStart, @DateEnd, @ShareBob, @ShareJohn, @IsArchived); -SELECT ProjectJobID, ProjectID, ContactID, JobNumber, JobTitle, JobDescription, DateStart, DateEnd, ShareBob, ShareJohn, IsArchived FROM ProjectJob WHERE (ProjectJobID = SCOPE_IDENTITY()) - - - - - - - - - - - - - - - - - SELECT ProjectJobID, ProjectID, ContactID, JobNumber, JobTitle, JobDescription, DateStart, DateEnd, ShareBob, ShareJohn, IsArchived FROM dbo.ProjectJob - - - - - - UPDATE [dbo].[ProjectJob] SET [ProjectID] = @ProjectID, [ContactID] = @ContactID, [JobNumber] = @JobNumber, [JobTitle] = @JobTitle, [JobDescription] = @JobDescription, [DateStart] = @DateStart, [DateEnd] = @DateEnd, [ShareBob] = @ShareBob, [ShareJohn] = @ShareJohn, [IsArchived] = @IsArchived WHERE (([ProjectJobID] = @Original_ProjectJobID) AND ([ProjectID] = @Original_ProjectID) AND ([ContactID] = @Original_ContactID) AND ([JobNumber] = @Original_JobNumber) AND ((@IsNull_JobTitle = 1 AND [JobTitle] IS NULL) OR ([JobTitle] = @Original_JobTitle)) AND ((@IsNull_JobDescription = 1 AND [JobDescription] IS NULL) OR ([JobDescription] = @Original_JobDescription)) AND ((@IsNull_DateStart = 1 AND [DateStart] IS NULL) OR ([DateStart] = @Original_DateStart)) AND ((@IsNull_DateEnd = 1 AND [DateEnd] IS NULL) OR ([DateEnd] = @Original_DateEnd)) AND ((@IsNull_ShareBob = 1 AND [ShareBob] IS NULL) OR ([ShareBob] = @Original_ShareBob)) AND ((@IsNull_ShareJohn = 1 AND [ShareJohn] IS NULL) OR ([ShareJohn] = @Original_ShareJohn)) AND ([IsArchived] = @Original_IsArchived)); -SELECT ProjectJobID, ProjectID, ContactID, JobNumber, JobTitle, JobDescription, DateStart, DateEnd, ShareBob, ShareJohn, IsArchived FROM ProjectJob WHERE (ProjectJobID = @ProjectJobID) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/BealeEngineering/BealeEngineering.Accounts/BealeEngDataSet.xss b/BealeEngineering/BealeEngineering.Accounts/BealeEngDataSet.xss deleted file mode 100644 index 5f28270..0000000 --- a/BealeEngineering/BealeEngineering.Accounts/BealeEngDataSet.xss +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/BealeEngineering/BealeEngineering.Accounts/BealeEngineering.Accounts.csproj b/BealeEngineering/BealeEngineering.Accounts/BealeEngineering.Accounts.csproj index 326790c..832e5a8 100644 --- a/BealeEngineering/BealeEngineering.Accounts/BealeEngineering.Accounts.csproj +++ b/BealeEngineering/BealeEngineering.Accounts/BealeEngineering.Accounts.csproj @@ -75,10 +75,11 @@ - - True - True - BealeEngDataSet.xsd + + Form + + + ContactSelect.cs Form @@ -92,6 +93,7 @@ frmMain.cs + @@ -100,6 +102,9 @@ frmSaleInvoice.cs + + ContactSelect.cs + frmClientPurchaseOrder.cs @@ -118,21 +123,16 @@ frmSaleInvoice.cs - - BealeEngDataSet.xsd - - - MSDataSetGenerator - BealeEngDataSet.Designer.cs - Designer - - - BealeEngDataSet.xsd - + + + + + + @@ -167,5 +167,6 @@ false + \ No newline at end of file diff --git a/BealeEngineering/BealeEngineering.Accounts/ContactSelect.Designer.cs b/BealeEngineering/BealeEngineering.Accounts/ContactSelect.Designer.cs new file mode 100644 index 0000000..28733e9 --- /dev/null +++ b/BealeEngineering/BealeEngineering.Accounts/ContactSelect.Designer.cs @@ -0,0 +1,101 @@ +namespace BealeEngineering.Accounts +{ + partial class ContactSelect + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.components = new System.ComponentModel.Container(); + this.listBox1 = new System.Windows.Forms.ListBox(); + this.btnOkay = new System.Windows.Forms.Button(); + this.btnCancel = new System.Windows.Forms.Button(); + this.contactBindingSource = new System.Windows.Forms.BindingSource(this.components); + ((System.ComponentModel.ISupportInitialize)(this.contactBindingSource)).BeginInit(); + this.SuspendLayout(); + // + // listBox1 + // + this.listBox1.FormattingEnabled = true; + this.listBox1.Location = new System.Drawing.Point(12, 12); + this.listBox1.Name = "listBox1"; + this.listBox1.Size = new System.Drawing.Size(338, 290); + this.listBox1.TabIndex = 0; + this.listBox1.SelectedValueChanged += new System.EventHandler(this.listBox1_SelectedValueChanged); + // + // btnOkay + // + this.btnOkay.Location = new System.Drawing.Point(262, 314); + this.btnOkay.Name = "btnOkay"; + this.btnOkay.Size = new System.Drawing.Size(88, 26); + this.btnOkay.TabIndex = 1; + this.btnOkay.Text = "OK"; + this.btnOkay.UseVisualStyleBackColor = true; + this.btnOkay.Click += new System.EventHandler(this.btnOkay_Click); + // + // btnCancel + // + this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; + this.btnCancel.Location = new System.Drawing.Point(168, 314); + this.btnCancel.Name = "btnCancel"; + this.btnCancel.Size = new System.Drawing.Size(88, 26); + this.btnCancel.TabIndex = 2; + this.btnCancel.Text = "Cancel"; + this.btnCancel.UseVisualStyleBackColor = true; + this.btnCancel.Click += new System.EventHandler(this.btnCancel_Click); + // + // contactBindingSource + // + this.contactBindingSource.DataSource = typeof(BealeEngineering.Core.Model.Contact.Contact); + // + // ContactSelect + // + this.AcceptButton = this.btnOkay; + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.CancelButton = this.btnCancel; + this.ClientSize = new System.Drawing.Size(361, 352); + this.ControlBox = false; + this.Controls.Add(this.btnCancel); + this.Controls.Add(this.btnOkay); + this.Controls.Add(this.listBox1); + this.MaximizeBox = false; + this.MinimizeBox = false; + this.Name = "ContactSelect"; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; + this.Text = "Select Contact"; + ((System.ComponentModel.ISupportInitialize)(this.contactBindingSource)).EndInit(); + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.ListBox listBox1; + private System.Windows.Forms.BindingSource contactBindingSource; + private System.Windows.Forms.Button btnOkay; + private System.Windows.Forms.Button btnCancel; + } +} \ No newline at end of file diff --git a/BealeEngineering/BealeEngineering.Accounts/ContactSelect.cs b/BealeEngineering/BealeEngineering.Accounts/ContactSelect.cs new file mode 100644 index 0000000..89e48f3 --- /dev/null +++ b/BealeEngineering/BealeEngineering.Accounts/ContactSelect.cs @@ -0,0 +1,43 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Forms; + +namespace BealeEngineering.Accounts +{ + public partial class ContactSelect : Form + { + string sqlConnectionString; + + public ContactSelect(string sqlConnectionString) + { + InitializeComponent(); + this.sqlConnectionString = sqlConnectionString; + listBox1.DataSource = new Core.Data.Database.Contact.ReadContactList(sqlConnectionString).Read(); + } + + public string SelectedContactName { get; set; } + + private void listBox1_SelectedValueChanged(object sender, EventArgs e) + { + SelectedContactName = listBox1.SelectedItem.ToString(); + } + + private void btnOkay_Click(object sender, EventArgs e) + { + this.DialogResult = DialogResult.OK; + this.Close(); + } + + private void btnCancel_Click(object sender, EventArgs e) + { + this.DialogResult = DialogResult.Cancel; + this.Close(); + } + } +} diff --git a/BealeEngineering/BealeEngineering.Accounts/ContactSelect.resx b/BealeEngineering/BealeEngineering.Accounts/ContactSelect.resx new file mode 100644 index 0000000..2d9200e --- /dev/null +++ b/BealeEngineering/BealeEngineering.Accounts/ContactSelect.resx @@ -0,0 +1,123 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 17, 17 + + \ No newline at end of file diff --git a/BealeEngineering/BealeEngineering.Accounts/Helper/FormDirtyTracker.cs b/BealeEngineering/BealeEngineering.Accounts/Helper/FormDirtyTracker.cs new file mode 100644 index 0000000..221ac2b --- /dev/null +++ b/BealeEngineering/BealeEngineering.Accounts/Helper/FormDirtyTracker.cs @@ -0,0 +1,69 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Forms; + +namespace BealeEngineering.Accounts.Helper +{ + class FormDirtyTracker + { + private Form _frmTracked; + private bool _isDirty; + + public FormDirtyTracker(Form frm) + { + _frmTracked = frm; + AssignHandlersForControlCollection(frm.Controls); + } + + // property denoting whether the tracked form is clean or dirty + public bool IsDirty + { + get { return _isDirty; } + set { _isDirty = value; } + } + + // methods to make dirty or clean + public void SetAsDirty() + { + _isDirty = true; + } + + public void SetAsClean() + { + _isDirty = false; + } + + private void SimpleDirtyTracker_TextChanged(object sender, EventArgs e) + { + _isDirty = true; + } + + private void SimpleDirtyTracker_CheckedChanged(object sender, EventArgs e) + { + _isDirty = true; + } + + private void AssignHandlersForControlCollection(Control.ControlCollection coll) + { + foreach (Control c in coll) + { + if (c is TextBox) + (c as TextBox).TextChanged + += new EventHandler(SimpleDirtyTracker_TextChanged); + + if (c is CheckBox) + (c as CheckBox).CheckedChanged + += new EventHandler(SimpleDirtyTracker_CheckedChanged); + + // ... apply for other desired input types similarly ... + + // recurively apply to inner collections + if (c.HasChildren) + AssignHandlersForControlCollection(c.Controls); + } + } + } +} diff --git a/BealeEngineering/BealeEngineering.Accounts/Properties/DataSources/BealeEngineering.Core.Model.Contact.Address.datasource b/BealeEngineering/BealeEngineering.Accounts/Properties/DataSources/BealeEngineering.Core.Model.Contact.Address.datasource new file mode 100644 index 0000000..73c0897 --- /dev/null +++ b/BealeEngineering/BealeEngineering.Accounts/Properties/DataSources/BealeEngineering.Core.Model.Contact.Address.datasource @@ -0,0 +1,10 @@ + + + + BealeEngineering.Core.Model.Contact.Address, BealeEngineering.Core, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + \ No newline at end of file diff --git a/BealeEngineering/BealeEngineering.Accounts/Properties/DataSources/BealeEngineering.Core.Model.Contact.Contact.datasource b/BealeEngineering/BealeEngineering.Accounts/Properties/DataSources/BealeEngineering.Core.Model.Contact.Contact.datasource new file mode 100644 index 0000000..374fce4 --- /dev/null +++ b/BealeEngineering/BealeEngineering.Accounts/Properties/DataSources/BealeEngineering.Core.Model.Contact.Contact.datasource @@ -0,0 +1,10 @@ + + + + BealeEngineering.Core.Model.Contact.Contact, BealeEngineering.Core, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + \ No newline at end of file diff --git a/BealeEngineering/BealeEngineering.Accounts/Properties/DataSources/BealeEngineering.Core.Model.Project.Project.datasource b/BealeEngineering/BealeEngineering.Accounts/Properties/DataSources/BealeEngineering.Core.Model.Project.Project.datasource new file mode 100644 index 0000000..60ae65c --- /dev/null +++ b/BealeEngineering/BealeEngineering.Accounts/Properties/DataSources/BealeEngineering.Core.Model.Project.Project.datasource @@ -0,0 +1,10 @@ + + + + BealeEngineering.Core.Model.Project.Project, BealeEngineering.Core, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + \ No newline at end of file diff --git a/BealeEngineering/BealeEngineering.Accounts/Properties/DataSources/BealeEngineering.Core.Model.Project.ProjectWork+ProjectWorkItem.datasource b/BealeEngineering/BealeEngineering.Accounts/Properties/DataSources/BealeEngineering.Core.Model.Project.ProjectWork+ProjectWorkItem.datasource new file mode 100644 index 0000000..72795ee --- /dev/null +++ b/BealeEngineering/BealeEngineering.Accounts/Properties/DataSources/BealeEngineering.Core.Model.Project.ProjectWork+ProjectWorkItem.datasource @@ -0,0 +1,10 @@ + + + + BealeEngineering.Core.Model.Project.ProjectWork+ProjectWorkItem, BealeEngineering.Core, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + \ No newline at end of file diff --git a/BealeEngineering/BealeEngineering.Accounts/Properties/DataSources/BealeEngineering.Core.Model.Project.ProjectWork.datasource b/BealeEngineering/BealeEngineering.Accounts/Properties/DataSources/BealeEngineering.Core.Model.Project.ProjectWork.datasource new file mode 100644 index 0000000..5394cd7 --- /dev/null +++ b/BealeEngineering/BealeEngineering.Accounts/Properties/DataSources/BealeEngineering.Core.Model.Project.ProjectWork.datasource @@ -0,0 +1,10 @@ + + + + BealeEngineering.Core.Model.Project.ProjectWork, BealeEngineering.Core, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + \ No newline at end of file diff --git a/BealeEngineering/BealeEngineering.Accounts/Properties/DataSources/BealeEngineering.Core.Model.Project.ProjectWorkItem.datasource b/BealeEngineering/BealeEngineering.Accounts/Properties/DataSources/BealeEngineering.Core.Model.Project.ProjectWorkItem.datasource new file mode 100644 index 0000000..7f0356c --- /dev/null +++ b/BealeEngineering/BealeEngineering.Accounts/Properties/DataSources/BealeEngineering.Core.Model.Project.ProjectWorkItem.datasource @@ -0,0 +1,10 @@ + + + + BealeEngineering.Core.Model.Project.ProjectWorkItem, BealeEngineering.Core, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + \ No newline at end of file diff --git a/BealeEngineering/BealeEngineering.Accounts/frmClientPurchaseOrder.Designer.cs b/BealeEngineering/BealeEngineering.Accounts/frmClientPurchaseOrder.Designer.cs index 2205e85..8877175 100644 --- a/BealeEngineering/BealeEngineering.Accounts/frmClientPurchaseOrder.Designer.cs +++ b/BealeEngineering/BealeEngineering.Accounts/frmClientPurchaseOrder.Designer.cs @@ -34,43 +34,46 @@ System.Windows.Forms.Label requestorEmailLabel; System.Windows.Forms.Label purchaseOrderDateLabel; System.Windows.Forms.Label contactNameLabel; - System.Windows.Forms.Label isClosedLabel; + System.Windows.Forms.Label label1; + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle(); this.dataGridView1 = new System.Windows.Forms.DataGridView(); + this.orderLineListBindingSource = new System.Windows.Forms.BindingSource(this.components); + this.splitContainer1 = new System.Windows.Forms.SplitContainer(); + this.linkStatus = new System.Windows.Forms.LinkLabel(); + this.StatusTextBox = new System.Windows.Forms.TextBox(); + this.btnDelete = new System.Windows.Forms.Button(); + this.linkUpdate = new System.Windows.Forms.LinkLabel(); + this.btnEdit = new System.Windows.Forms.Button(); + this.txtContactName = new System.Windows.Forms.TextBox(); + this.pickerPurchaseOrderDateDate = new System.Windows.Forms.DateTimePicker(); + this.txtRequestorEmail = new System.Windows.Forms.TextBox(); + this.txtOrderTotal = new System.Windows.Forms.TextBox(); + this.txtClientReference = new System.Windows.Forms.TextBox(); + this.purchaseOrderBindingSource = new System.Windows.Forms.BindingSource(this.components); + this.clientPurchaseOrderLineIDDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.lineNumber = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.description = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.lineNetAmount = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.clientPurchaseOrderLineIDDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.clientPurchaseOrderIDDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.projectJobIDDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.orderLineListBindingSource = new System.Windows.Forms.BindingSource(this.components); - this.purchaseOrderBindingSource = new System.Windows.Forms.BindingSource(this.components); - this.splitContainer1 = new System.Windows.Forms.SplitContainer(); - this.isClosedCheckBox = new System.Windows.Forms.CheckBox(); - this.contactNameTextBox = new System.Windows.Forms.TextBox(); - this.purchaseOrderDateDateTimePicker = new System.Windows.Forms.DateTimePicker(); - this.requestorEmailTextBox = new System.Windows.Forms.TextBox(); - this.orderTotalTextBox = new System.Windows.Forms.TextBox(); - this.clientReferenceTextBox = new System.Windows.Forms.TextBox(); - this.btnAdd = new System.Windows.Forms.Button(); + this.facility = new System.Windows.Forms.DataGridViewTextBoxColumn(); clientReferenceLabel = new System.Windows.Forms.Label(); orderTotalLabel = new System.Windows.Forms.Label(); requestorEmailLabel = new System.Windows.Forms.Label(); purchaseOrderDateLabel = new System.Windows.Forms.Label(); contactNameLabel = new System.Windows.Forms.Label(); - isClosedLabel = new System.Windows.Forms.Label(); + label1 = new System.Windows.Forms.Label(); ((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.orderLineListBindingSource)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.purchaseOrderBindingSource)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit(); this.splitContainer1.Panel1.SuspendLayout(); this.splitContainer1.Panel2.SuspendLayout(); this.splitContainer1.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.purchaseOrderBindingSource)).BeginInit(); this.SuspendLayout(); // // clientReferenceLabel // clientReferenceLabel.AutoSize = true; - clientReferenceLabel.Location = new System.Drawing.Point(83, 113); + clientReferenceLabel.Location = new System.Drawing.Point(79, 88); clientReferenceLabel.Name = "clientReferenceLabel"; clientReferenceLabel.Size = new System.Drawing.Size(89, 13); clientReferenceLabel.TabIndex = 12; @@ -79,7 +82,7 @@ // orderTotalLabel // orderTotalLabel.AutoSize = true; - orderTotalLabel.Location = new System.Drawing.Point(109, 165); + orderTotalLabel.Location = new System.Drawing.Point(105, 140); orderTotalLabel.Name = "orderTotalLabel"; orderTotalLabel.Size = new System.Drawing.Size(63, 13); orderTotalLabel.TabIndex = 14; @@ -88,7 +91,7 @@ // requestorEmailLabel // requestorEmailLabel.AutoSize = true; - requestorEmailLabel.Location = new System.Drawing.Point(85, 139); + requestorEmailLabel.Location = new System.Drawing.Point(81, 114); requestorEmailLabel.Name = "requestorEmailLabel"; requestorEmailLabel.Size = new System.Drawing.Size(87, 13); requestorEmailLabel.TabIndex = 15; @@ -97,7 +100,7 @@ // purchaseOrderDateLabel // purchaseOrderDateLabel.AutoSize = true; - purchaseOrderDateLabel.Location = new System.Drawing.Point(62, 88); + purchaseOrderDateLabel.Location = new System.Drawing.Point(58, 63); purchaseOrderDateLabel.Name = "purchaseOrderDateLabel"; purchaseOrderDateLabel.Size = new System.Drawing.Size(110, 13); purchaseOrderDateLabel.TabIndex = 16; @@ -106,45 +109,191 @@ // contactNameLabel // contactNameLabel.AutoSize = true; - contactNameLabel.Location = new System.Drawing.Point(94, 61); + contactNameLabel.Location = new System.Drawing.Point(90, 36); contactNameLabel.Name = "contactNameLabel"; contactNameLabel.Size = new System.Drawing.Size(78, 13); contactNameLabel.TabIndex = 17; contactNameLabel.Text = "Contact Name:"; // - // isClosedLabel + // label1 // - isClosedLabel.AutoSize = true; - isClosedLabel.Location = new System.Drawing.Point(119, 193); - isClosedLabel.Name = "isClosedLabel"; - isClosedLabel.Size = new System.Drawing.Size(53, 13); - isClosedLabel.TabIndex = 18; - isClosedLabel.Text = "Is Closed:"; + label1.AutoSize = true; + label1.Location = new System.Drawing.Point(105, 169); + label1.Name = "label1"; + label1.Size = new System.Drawing.Size(40, 13); + label1.TabIndex = 24; + label1.Text = "Status:"; + label1.Click += new System.EventHandler(this.label1_Click); // // dataGridView1 // this.dataGridView1.AllowUserToOrderColumns = true; this.dataGridView1.AutoGenerateColumns = false; + this.dataGridView1.AutoSizeRowsMode = System.Windows.Forms.DataGridViewAutoSizeRowsMode.AllCells; this.dataGridView1.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; this.dataGridView1.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { + this.clientPurchaseOrderLineIDDataGridViewTextBoxColumn, this.lineNumber, this.description, this.lineNetAmount, - this.clientPurchaseOrderLineIDDataGridViewTextBoxColumn, - this.clientPurchaseOrderIDDataGridViewTextBoxColumn, - this.projectJobIDDataGridViewTextBoxColumn}); + this.facility}); this.dataGridView1.DataSource = this.orderLineListBindingSource; this.dataGridView1.Dock = System.Windows.Forms.DockStyle.Fill; this.dataGridView1.Location = new System.Drawing.Point(0, 0); this.dataGridView1.Name = "dataGridView1"; - this.dataGridView1.Size = new System.Drawing.Size(823, 371); + this.dataGridView1.Size = new System.Drawing.Size(823, 525); this.dataGridView1.TabIndex = 14; + this.dataGridView1.CellFormatting += new System.Windows.Forms.DataGridViewCellFormattingEventHandler(this.dataGridView1_CellFormatting); + // + // orderLineListBindingSource + // + this.orderLineListBindingSource.DataMember = "OrderLineList"; + this.orderLineListBindingSource.DataSource = this.purchaseOrderBindingSource; + // + // splitContainer1 + // + this.splitContainer1.Dock = System.Windows.Forms.DockStyle.Fill; + this.splitContainer1.FixedPanel = System.Windows.Forms.FixedPanel.Panel1; + this.splitContainer1.Location = new System.Drawing.Point(0, 0); + this.splitContainer1.Name = "splitContainer1"; + this.splitContainer1.Orientation = System.Windows.Forms.Orientation.Horizontal; + // + // splitContainer1.Panel1 + // + this.splitContainer1.Panel1.AutoScroll = true; + this.splitContainer1.Panel1.Controls.Add(this.linkStatus); + this.splitContainer1.Panel1.Controls.Add(label1); + this.splitContainer1.Panel1.Controls.Add(this.StatusTextBox); + this.splitContainer1.Panel1.Controls.Add(this.btnDelete); + this.splitContainer1.Panel1.Controls.Add(this.linkUpdate); + this.splitContainer1.Panel1.Controls.Add(this.btnEdit); + this.splitContainer1.Panel1.Controls.Add(contactNameLabel); + this.splitContainer1.Panel1.Controls.Add(this.txtContactName); + this.splitContainer1.Panel1.Controls.Add(purchaseOrderDateLabel); + this.splitContainer1.Panel1.Controls.Add(this.pickerPurchaseOrderDateDate); + this.splitContainer1.Panel1.Controls.Add(requestorEmailLabel); + this.splitContainer1.Panel1.Controls.Add(this.txtRequestorEmail); + this.splitContainer1.Panel1.Controls.Add(orderTotalLabel); + this.splitContainer1.Panel1.Controls.Add(this.txtOrderTotal); + this.splitContainer1.Panel1.Controls.Add(clientReferenceLabel); + this.splitContainer1.Panel1.Controls.Add(this.txtClientReference); + // + // splitContainer1.Panel2 + // + this.splitContainer1.Panel2.Controls.Add(this.dataGridView1); + this.splitContainer1.Size = new System.Drawing.Size(823, 749); + this.splitContainer1.SplitterDistance = 220; + this.splitContainer1.TabIndex = 15; + // + // linkStatus + // + this.linkStatus.AutoSize = true; + this.linkStatus.Location = new System.Drawing.Point(273, 169); + this.linkStatus.Name = "linkStatus"; + this.linkStatus.Size = new System.Drawing.Size(55, 13); + this.linkStatus.TabIndex = 26; + this.linkStatus.TabStop = true; + this.linkStatus.Text = "linkLabel1"; + this.linkStatus.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.linkStatus_LinkClicked); + // + // StatusTextBox + // + this.StatusTextBox.Enabled = false; + this.StatusTextBox.Location = new System.Drawing.Point(174, 166); + this.StatusTextBox.Name = "StatusTextBox"; + this.StatusTextBox.Size = new System.Drawing.Size(93, 20); + this.StatusTextBox.TabIndex = 25; + // + // btnDelete + // + this.btnDelete.Location = new System.Drawing.Point(679, 63); + this.btnDelete.Name = "btnDelete"; + this.btnDelete.Size = new System.Drawing.Size(108, 24); + this.btnDelete.TabIndex = 23; + this.btnDelete.Text = "Delete"; + this.btnDelete.UseVisualStyleBackColor = true; + this.btnDelete.Visible = false; + this.btnDelete.Click += new System.EventHandler(this.btnDelete_Click); + // + // linkUpdate + // + this.linkUpdate.AutoSize = true; + this.linkUpdate.Location = new System.Drawing.Point(380, 36); + this.linkUpdate.Name = "linkUpdate"; + this.linkUpdate.Size = new System.Drawing.Size(24, 13); + this.linkUpdate.TabIndex = 22; + this.linkUpdate.TabStop = true; + this.linkUpdate.Text = "edit"; + this.linkUpdate.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.linkLabel1_LinkClicked); + // + // btnEdit + // + this.btnEdit.Location = new System.Drawing.Point(679, 33); + this.btnEdit.Name = "btnEdit"; + this.btnEdit.Size = new System.Drawing.Size(108, 24); + this.btnEdit.TabIndex = 20; + this.btnEdit.Text = "Edit"; + this.btnEdit.UseVisualStyleBackColor = true; + this.btnEdit.Click += new System.EventHandler(this.btnEdit_Click); + // + // txtContactName + // + this.txtContactName.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.purchaseOrderBindingSource, "ContactName", true)); + this.txtContactName.Location = new System.Drawing.Point(174, 33); + this.txtContactName.Name = "txtContactName"; + this.txtContactName.ReadOnly = true; + this.txtContactName.Size = new System.Drawing.Size(200, 20); + this.txtContactName.TabIndex = 18; + this.txtContactName.DoubleClick += new System.EventHandler(this.contactNameTextBox_DoubleClick); + // + // pickerPurchaseOrderDateDate + // + this.pickerPurchaseOrderDateDate.DataBindings.Add(new System.Windows.Forms.Binding("Value", this.purchaseOrderBindingSource, "PurchaseOrderDate", true)); + this.pickerPurchaseOrderDateDate.Location = new System.Drawing.Point(174, 59); + this.pickerPurchaseOrderDateDate.Name = "pickerPurchaseOrderDateDate"; + this.pickerPurchaseOrderDateDate.Size = new System.Drawing.Size(134, 20); + this.pickerPurchaseOrderDateDate.TabIndex = 17; + // + // txtRequestorEmail + // + this.txtRequestorEmail.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.purchaseOrderBindingSource, "RequestorEmail", true)); + this.txtRequestorEmail.Location = new System.Drawing.Point(174, 111); + this.txtRequestorEmail.Name = "txtRequestorEmail"; + this.txtRequestorEmail.Size = new System.Drawing.Size(200, 20); + this.txtRequestorEmail.TabIndex = 16; + // + // txtOrderTotal + // + this.txtOrderTotal.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.purchaseOrderBindingSource, "OrderTotal", true)); + this.txtOrderTotal.Location = new System.Drawing.Point(174, 137); + this.txtOrderTotal.Name = "txtOrderTotal"; + this.txtOrderTotal.Size = new System.Drawing.Size(134, 20); + this.txtOrderTotal.TabIndex = 15; + this.txtOrderTotal.TextChanged += new System.EventHandler(this.orderTotalTextBox_TextChanged); + // + // txtClientReference + // + this.txtClientReference.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.purchaseOrderBindingSource, "ClientReference", true)); + this.txtClientReference.Location = new System.Drawing.Point(174, 85); + this.txtClientReference.Name = "txtClientReference"; + this.txtClientReference.Size = new System.Drawing.Size(200, 20); + this.txtClientReference.TabIndex = 13; + // + // purchaseOrderBindingSource + // + this.purchaseOrderBindingSource.DataSource = typeof(BealeEngineering.Core.Model.Client.PurchaseOrder); + // + // clientPurchaseOrderLineIDDataGridViewTextBoxColumn + // + this.clientPurchaseOrderLineIDDataGridViewTextBoxColumn.DataPropertyName = "ClientPurchaseOrderLineID"; + this.clientPurchaseOrderLineIDDataGridViewTextBoxColumn.HeaderText = "ClientPurchaseOrderLineID"; + this.clientPurchaseOrderLineIDDataGridViewTextBoxColumn.Name = "clientPurchaseOrderLineIDDataGridViewTextBoxColumn"; + this.clientPurchaseOrderLineIDDataGridViewTextBoxColumn.Visible = false; // // lineNumber // this.lineNumber.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.None; this.lineNumber.DataPropertyName = "LineNumber"; - this.lineNumber.Frozen = true; this.lineNumber.HeaderText = "Line Number"; this.lineNumber.MinimumWidth = 100; this.lineNumber.Name = "lineNumber"; @@ -153,6 +302,8 @@ // this.description.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; this.description.DataPropertyName = "Description"; + dataGridViewCellStyle1.WrapMode = System.Windows.Forms.DataGridViewTriState.True; + this.description.DefaultCellStyle = dataGridViewCellStyle1; this.description.HeaderText = "Description"; this.description.Name = "description"; // @@ -164,127 +315,12 @@ this.lineNetAmount.MinimumWidth = 100; this.lineNetAmount.Name = "lineNetAmount"; // - // clientPurchaseOrderLineIDDataGridViewTextBoxColumn + // facility // - this.clientPurchaseOrderLineIDDataGridViewTextBoxColumn.DataPropertyName = "ClientPurchaseOrderLineID"; - this.clientPurchaseOrderLineIDDataGridViewTextBoxColumn.HeaderText = "ClientPurchaseOrderLineID"; - this.clientPurchaseOrderLineIDDataGridViewTextBoxColumn.Name = "clientPurchaseOrderLineIDDataGridViewTextBoxColumn"; - this.clientPurchaseOrderLineIDDataGridViewTextBoxColumn.Visible = false; - // - // clientPurchaseOrderIDDataGridViewTextBoxColumn - // - this.clientPurchaseOrderIDDataGridViewTextBoxColumn.DataPropertyName = "ClientPurchaseOrderID"; - this.clientPurchaseOrderIDDataGridViewTextBoxColumn.HeaderText = "ClientPurchaseOrderID"; - this.clientPurchaseOrderIDDataGridViewTextBoxColumn.Name = "clientPurchaseOrderIDDataGridViewTextBoxColumn"; - this.clientPurchaseOrderIDDataGridViewTextBoxColumn.Visible = false; - // - // projectJobIDDataGridViewTextBoxColumn - // - this.projectJobIDDataGridViewTextBoxColumn.DataPropertyName = "ProjectJobID"; - this.projectJobIDDataGridViewTextBoxColumn.HeaderText = "ProjectJobID"; - this.projectJobIDDataGridViewTextBoxColumn.Name = "projectJobIDDataGridViewTextBoxColumn"; - this.projectJobIDDataGridViewTextBoxColumn.Visible = false; - // - // orderLineListBindingSource - // - this.orderLineListBindingSource.DataMember = "OrderLineList"; - this.orderLineListBindingSource.DataSource = this.purchaseOrderBindingSource; - // - // purchaseOrderBindingSource - // - this.purchaseOrderBindingSource.DataSource = typeof(BealeEngineering.Core.Model.Client.PurchaseOrder); - // - // splitContainer1 - // - this.splitContainer1.Dock = System.Windows.Forms.DockStyle.Fill; - this.splitContainer1.Location = new System.Drawing.Point(0, 0); - this.splitContainer1.Name = "splitContainer1"; - this.splitContainer1.Orientation = System.Windows.Forms.Orientation.Horizontal; - // - // splitContainer1.Panel1 - // - this.splitContainer1.Panel1.AutoScroll = true; - this.splitContainer1.Panel1.Controls.Add(this.btnAdd); - this.splitContainer1.Panel1.Controls.Add(isClosedLabel); - this.splitContainer1.Panel1.Controls.Add(this.isClosedCheckBox); - this.splitContainer1.Panel1.Controls.Add(contactNameLabel); - this.splitContainer1.Panel1.Controls.Add(this.contactNameTextBox); - this.splitContainer1.Panel1.Controls.Add(purchaseOrderDateLabel); - this.splitContainer1.Panel1.Controls.Add(this.purchaseOrderDateDateTimePicker); - this.splitContainer1.Panel1.Controls.Add(requestorEmailLabel); - this.splitContainer1.Panel1.Controls.Add(this.requestorEmailTextBox); - this.splitContainer1.Panel1.Controls.Add(orderTotalLabel); - this.splitContainer1.Panel1.Controls.Add(this.orderTotalTextBox); - this.splitContainer1.Panel1.Controls.Add(clientReferenceLabel); - this.splitContainer1.Panel1.Controls.Add(this.clientReferenceTextBox); - // - // splitContainer1.Panel2 - // - this.splitContainer1.Panel2.Controls.Add(this.dataGridView1); - this.splitContainer1.Size = new System.Drawing.Size(823, 749); - this.splitContainer1.SplitterDistance = 374; - this.splitContainer1.TabIndex = 15; - // - // isClosedCheckBox - // - this.isClosedCheckBox.DataBindings.Add(new System.Windows.Forms.Binding("CheckState", this.purchaseOrderBindingSource, "IsClosed", true)); - this.isClosedCheckBox.Location = new System.Drawing.Point(178, 188); - this.isClosedCheckBox.Name = "isClosedCheckBox"; - this.isClosedCheckBox.Size = new System.Drawing.Size(104, 24); - this.isClosedCheckBox.TabIndex = 19; - this.isClosedCheckBox.Text = "checkBox1"; - this.isClosedCheckBox.UseVisualStyleBackColor = true; - // - // contactNameTextBox - // - this.contactNameTextBox.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.purchaseOrderBindingSource, "ContactName", true)); - this.contactNameTextBox.Location = new System.Drawing.Point(178, 58); - this.contactNameTextBox.Name = "contactNameTextBox"; - this.contactNameTextBox.Size = new System.Drawing.Size(200, 20); - this.contactNameTextBox.TabIndex = 18; - // - // purchaseOrderDateDateTimePicker - // - this.purchaseOrderDateDateTimePicker.DataBindings.Add(new System.Windows.Forms.Binding("Value", this.purchaseOrderBindingSource, "PurchaseOrderDate", true)); - this.purchaseOrderDateDateTimePicker.Location = new System.Drawing.Point(178, 84); - this.purchaseOrderDateDateTimePicker.Name = "purchaseOrderDateDateTimePicker"; - this.purchaseOrderDateDateTimePicker.Size = new System.Drawing.Size(200, 20); - this.purchaseOrderDateDateTimePicker.TabIndex = 17; - // - // requestorEmailTextBox - // - this.requestorEmailTextBox.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.purchaseOrderBindingSource, "RequestorEmail", true)); - this.requestorEmailTextBox.Location = new System.Drawing.Point(178, 136); - this.requestorEmailTextBox.Name = "requestorEmailTextBox"; - this.requestorEmailTextBox.Size = new System.Drawing.Size(200, 20); - this.requestorEmailTextBox.TabIndex = 16; - // - // orderTotalTextBox - // - this.orderTotalTextBox.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.purchaseOrderBindingSource, "OrderTotal", true)); - this.orderTotalTextBox.Location = new System.Drawing.Point(178, 162); - this.orderTotalTextBox.Name = "orderTotalTextBox"; - this.orderTotalTextBox.Size = new System.Drawing.Size(100, 20); - this.orderTotalTextBox.TabIndex = 15; - this.orderTotalTextBox.TextChanged += new System.EventHandler(this.orderTotalTextBox_TextChanged); - // - // clientReferenceTextBox - // - this.clientReferenceTextBox.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.purchaseOrderBindingSource, "ClientReference", true)); - this.clientReferenceTextBox.Location = new System.Drawing.Point(178, 110); - this.clientReferenceTextBox.Name = "clientReferenceTextBox"; - this.clientReferenceTextBox.Size = new System.Drawing.Size(200, 20); - this.clientReferenceTextBox.TabIndex = 13; - // - // btnAdd - // - this.btnAdd.Location = new System.Drawing.Point(703, 36); - this.btnAdd.Name = "btnAdd"; - this.btnAdd.Size = new System.Drawing.Size(108, 24); - this.btnAdd.TabIndex = 20; - this.btnAdd.Text = "Add"; - this.btnAdd.UseVisualStyleBackColor = true; - this.btnAdd.Click += new System.EventHandler(this.btnAdd_Click); + this.facility.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.None; + this.facility.HeaderText = "Facility"; + this.facility.MinimumWidth = 100; + this.facility.Name = "facility"; // // frmClientPurchaseOrder // @@ -292,37 +328,44 @@ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.ClientSize = new System.Drawing.Size(823, 749); this.Controls.Add(this.splitContainer1); + this.MaximizeBox = false; + this.MinimizeBox = false; this.Name = "frmClientPurchaseOrder"; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; this.Text = "ClientPurchaseOrder"; ((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.orderLineListBindingSource)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.purchaseOrderBindingSource)).EndInit(); this.splitContainer1.Panel1.ResumeLayout(false); this.splitContainer1.Panel1.PerformLayout(); this.splitContainer1.Panel2.ResumeLayout(false); ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).EndInit(); this.splitContainer1.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.purchaseOrderBindingSource)).EndInit(); this.ResumeLayout(false); } #endregion private System.Windows.Forms.DataGridView dataGridView1; - private System.Windows.Forms.DataGridViewTextBoxColumn lineNumber; - private System.Windows.Forms.DataGridViewTextBoxColumn description; - private System.Windows.Forms.DataGridViewTextBoxColumn lineNetAmount; - private System.Windows.Forms.DataGridViewTextBoxColumn clientPurchaseOrderLineIDDataGridViewTextBoxColumn; private System.Windows.Forms.DataGridViewTextBoxColumn clientPurchaseOrderIDDataGridViewTextBoxColumn; private System.Windows.Forms.DataGridViewTextBoxColumn projectJobIDDataGridViewTextBoxColumn; private System.Windows.Forms.SplitContainer splitContainer1; - private System.Windows.Forms.DateTimePicker purchaseOrderDateDateTimePicker; + private System.Windows.Forms.DateTimePicker pickerPurchaseOrderDateDate; private System.Windows.Forms.BindingSource purchaseOrderBindingSource; - private System.Windows.Forms.TextBox requestorEmailTextBox; - private System.Windows.Forms.TextBox orderTotalTextBox; - private System.Windows.Forms.TextBox clientReferenceTextBox; + private System.Windows.Forms.TextBox txtRequestorEmail; + private System.Windows.Forms.TextBox txtOrderTotal; + private System.Windows.Forms.TextBox txtClientReference; private System.Windows.Forms.BindingSource orderLineListBindingSource; - private System.Windows.Forms.CheckBox isClosedCheckBox; - private System.Windows.Forms.TextBox contactNameTextBox; - private System.Windows.Forms.Button btnAdd; + private System.Windows.Forms.TextBox txtContactName; + private System.Windows.Forms.Button btnEdit; + private System.Windows.Forms.LinkLabel linkUpdate; + private System.Windows.Forms.Button btnDelete; + private System.Windows.Forms.TextBox StatusTextBox; + private System.Windows.Forms.LinkLabel linkStatus; + private System.Windows.Forms.DataGridViewTextBoxColumn clientPurchaseOrderLineIDDataGridViewTextBoxColumn; + private System.Windows.Forms.DataGridViewTextBoxColumn lineNumber; + private System.Windows.Forms.DataGridViewTextBoxColumn description; + private System.Windows.Forms.DataGridViewTextBoxColumn lineNetAmount; + private System.Windows.Forms.DataGridViewTextBoxColumn facility; } } \ No newline at end of file diff --git a/BealeEngineering/BealeEngineering.Accounts/frmClientPurchaseOrder.cs b/BealeEngineering/BealeEngineering.Accounts/frmClientPurchaseOrder.cs index 1b66957..f2f881a 100644 --- a/BealeEngineering/BealeEngineering.Accounts/frmClientPurchaseOrder.cs +++ b/BealeEngineering/BealeEngineering.Accounts/frmClientPurchaseOrder.cs @@ -12,14 +12,146 @@ namespace BealeEngineering.Accounts { public partial class frmClientPurchaseOrder : Form { - public frmClientPurchaseOrder(Core.Model.Client.PurchaseOrder purchaseOrder) + Core.Model.Client.PurchaseOrder purchaseOrder = null; + string sqlConnectionString; + bool isNew = false; + Core.Data.Database.Client.ReadPurchaseOrderLineFacility lineFacility; + + public frmClientPurchaseOrder(string sqlConnectionString, Core.Model.Client.PurchaseOrder purchaseOrder) { InitializeComponent(); + this.sqlConnectionString = sqlConnectionString; + lineFacility = new Core.Data.Database.Client.ReadPurchaseOrderLineFacility(sqlConnectionString); - if (purchaseOrder != null) + if (purchaseOrder == null) { + FormEditEnable(); + PurchaseOrder = new Core.Model.Client.PurchaseOrder(); + PurchaseOrder.IsClosed = false; + SetStatus(PurchaseOrder.IsClosed); + isNew = true; + } + else + { + PurchaseOrder = purchaseOrder; + FormEditDisable(); + } + } + + public Core.Model.Client.PurchaseOrder PurchaseOrder + { + get + { + return purchaseOrder; + } + set + { + purchaseOrder = value; purchaseOrderBindingSource.DataSource = purchaseOrder; orderLineListBindingSource.DataSource = purchaseOrder.OrderLineList; + SetStatus(PurchaseOrder.IsClosed); + } + } + + private void RefreshData() + { + if (PurchaseOrder.ClientPurchaseOrderIDIsSet) + { + PurchaseOrder = new Core.Data.Database.Client.ReadPurchaseOrder(sqlConnectionString) + .ByPurchaseOrderId(PurchaseOrder.ClientPurchaseOrderID); + } + } + + private void FormEditDisable() + { + txtClientReference.ReadOnly = true; + txtOrderTotal.ReadOnly = true; + pickerPurchaseOrderDateDate.Enabled = false; + txtRequestorEmail.ReadOnly = true; + dataGridView1.ReadOnly = true; + linkUpdate.Visible = false; + btnEdit.Text = "Edit"; + btnDelete.Visible = false; + } + + private void FormEditEnable() + { + txtClientReference.ReadOnly = false; + txtOrderTotal.ReadOnly = false; + pickerPurchaseOrderDateDate.Enabled = true; + txtRequestorEmail.ReadOnly = false; + dataGridView1.ReadOnly = false; + linkUpdate.Visible = true; + btnEdit.Text = "Save"; + if (isNew == false) { btnDelete.Visible = true; } + } + + private void SetStatus (bool isClosed) + { + if (purchaseOrder.IsClosed) + { + StatusTextBox.Text = " CLOSED"; + linkStatus.Text = "Reopen"; + } + else + { + StatusTextBox.Text = " OPEN"; + linkStatus.Text = "Close"; + } + } + + private void orderTotalTextBox_TextChanged(object sender, EventArgs e) + { + + } + + private void btnEdit_Click(object sender, EventArgs e) + { + if (btnEdit.Text == "Save") + { + if (isNew) + { + new Core.Data.Database.Client.UpdatePurchaseOrder(sqlConnectionString).Create(purchaseOrder); + this.Close(); + } + else + { + new Core.Data.Database.Client.UpdatePurchaseOrder(sqlConnectionString).Update(purchaseOrder); + this.Close(); + } + } + else + { + FormEditEnable(); + } + } + + private void contactNameTextBox_DoubleClick(object sender, EventArgs e) + { + linkLabel1_LinkClicked(null, null); + } + + private void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) + { + var contactForm = new ContactSelect(sqlConnectionString); + contactForm.ShowDialog(); + string contactName = contactForm.SelectedContactName; + + if (PurchaseOrder.ContactName != contactName) + { + txtContactName.Text = contactName; + PurchaseOrder.ContactName = contactName; + } + } + + private void btnDelete_Click(object sender, EventArgs e) + { + var result = MessageBox.Show("Sorry, this does nothing atm....." + , "Delete" + , MessageBoxButtons.OK); + if (result == DialogResult.OK) + { + } } @@ -28,14 +160,26 @@ namespace BealeEngineering.Accounts } - private void orderTotalTextBox_TextChanged(object sender, EventArgs e) + private void linkStatus_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) { + bool isClosed = !purchaseOrder.IsClosed; + new Core.Data.Database.Client.UpdatePurchaseOrder(sqlConnectionString) + .UpdateIsClosed(purchaseOrder.ClientPurchaseOrderID, isClosed); + + RefreshData(); } - private void btnAdd_Click(object sender, EventArgs e) + private void dataGridView1_CellFormatting(object sender, DataGridViewCellFormattingEventArgs e) { - + if (dataGridView1.Columns[e.ColumnIndex].Name == "facility") + { + object obj = dataGridView1[0, e.RowIndex].Value; + if (obj != null) + { + e.Value = lineFacility.Read((int)obj); + } + } } } } diff --git a/BealeEngineering/BealeEngineering.Accounts/frmClientPurchaseOrder.resx b/BealeEngineering/BealeEngineering.Accounts/frmClientPurchaseOrder.resx index eb0b53f..2376474 100644 --- a/BealeEngineering/BealeEngineering.Accounts/frmClientPurchaseOrder.resx +++ b/BealeEngineering/BealeEngineering.Accounts/frmClientPurchaseOrder.resx @@ -132,16 +132,16 @@ False - + False + + True + 253, 29 37, 27 - - 37, 27 - \ No newline at end of file diff --git a/BealeEngineering/BealeEngineering.Accounts/frmMain.Designer.cs b/BealeEngineering/BealeEngineering.Accounts/frmMain.Designer.cs index d44c391..7fd5c3a 100644 --- a/BealeEngineering/BealeEngineering.Accounts/frmMain.Designer.cs +++ b/BealeEngineering/BealeEngineering.Accounts/frmMain.Designer.cs @@ -29,38 +29,33 @@ private void InitializeComponent() { this.components = new System.ComponentModel.Container(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle9 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle10 = new System.Windows.Forms.DataGridViewCellStyle(); - this.tabControl1 = new System.Windows.Forms.TabControl(); - this.tabPage1 = new System.Windows.Forms.TabPage(); - this.splitContainer3 = new System.Windows.Forms.SplitContainer(); - this.btnAssign = new System.Windows.Forms.Button(); - this.txtInvoiceStatus = new System.Windows.Forms.TextBox(); - this.txtInvoiceNetAmount = new System.Windows.Forms.TextBox(); - this.txtInvoiceContact = new System.Windows.Forms.TextBox(); - this.btnOpenInvoice = new System.Windows.Forms.Button(); - this.cmbInvoicePick = new System.Windows.Forms.ComboBox(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle3 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle4 = new System.Windows.Forms.DataGridViewCellStyle(); this.invoiceHeaderBindingSource1 = new System.Windows.Forms.BindingSource(this.components); - this.btnAutoMatch = new System.Windows.Forms.Button(); - this.btnOpenPurchaseOrder = new System.Windows.Forms.Button(); + this.bindingSourceSaleInvoice = new System.Windows.Forms.BindingSource(this.components); + this.menuStrip1 = new System.Windows.Forms.MenuStrip(); + this.fileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.importToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.xeroInvoiceToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.exportToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.excelInvoiceToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.xeroNewInvoiceToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.testToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.testItToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.invoiceHeaderBindingSource = new System.Windows.Forms.BindingSource(this.components); + this.tabClientPo = new System.Windows.Forms.TabPage(); + this.splitContainer2 = new System.Windows.Forms.SplitContainer(); this.btnAddPurchaseOrder = new System.Windows.Forms.Button(); - this.button1 = new System.Windows.Forms.Button(); - this.label1 = new System.Windows.Forms.Label(); - this.label2 = new System.Windows.Forms.Label(); - this.txtInvoiceImportDt = new System.Windows.Forms.TextBox(); - this.dataGridView1 = new System.Windows.Forms.DataGridView(); - this.ContactName = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.ProjectTitle = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.PurchaseOrderDate = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.PurchaseOrderReference = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.PurchaseOrderLineNumber = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.PurchaseOrderLineDescription = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.PurchaseOrderLineNetAmount = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.InvoicedAmount = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.PurchaseOrderLineFacility = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.JobNumber = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.PurchaseOrderLineID = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.purchaseOrderAllocationBindingSource = new System.Windows.Forms.BindingSource(this.components); + this.button2 = new System.Windows.Forms.Button(); + this.button3 = new System.Windows.Forms.Button(); + this.dataGridView3 = new System.Windows.Forms.DataGridView(); + this.clientPurchaseOrderIDDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.purchaseOrderDateDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.contactNameDataGridViewTextBoxColumn1 = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.clientReferenceDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.orderTotalDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.isClosedDataGridViewCheckBoxColumn = new System.Windows.Forms.DataGridViewCheckBoxColumn(); + this.purchaseOrderBindingSource = new System.Windows.Forms.BindingSource(this.components); this.tabSaleInvoice = new System.Windows.Forms.TabPage(); this.splitContainer1 = new System.Windows.Forms.SplitContainer(); this.btnOpenInv = new System.Windows.Forms.Button(); @@ -76,365 +71,317 @@ this.currencyCode = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.TotalAndCurrency = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.status = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.bindingSourceSaleInvoice = new System.Windows.Forms.BindingSource(this.components); - this.menuStrip1 = new System.Windows.Forms.MenuStrip(); - this.fileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.importToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.xeroInvoiceToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.exportToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.xeroInvoiceToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem(); - this.testToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.testItToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.invoiceHeaderBindingSource = new System.Windows.Forms.BindingSource(this.components); - this.tabControl1.SuspendLayout(); - this.tabPage1.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.splitContainer3)).BeginInit(); - this.splitContainer3.Panel1.SuspendLayout(); - this.splitContainer3.Panel2.SuspendLayout(); - this.splitContainer3.SuspendLayout(); + this.tabClientPoAllocation = new System.Windows.Forms.TabPage(); + this.splitContainer3 = new System.Windows.Forms.SplitContainer(); + this.btnAssign = new System.Windows.Forms.Button(); + this.txtInvoiceStatus = new System.Windows.Forms.TextBox(); + this.txtInvoiceNetAmount = new System.Windows.Forms.TextBox(); + this.txtInvoiceContact = new System.Windows.Forms.TextBox(); + this.btnOpenInvoice = new System.Windows.Forms.Button(); + this.cmbInvoicePick = new System.Windows.Forms.ComboBox(); + this.button1 = new System.Windows.Forms.Button(); + this.label1 = new System.Windows.Forms.Label(); + this.label2 = new System.Windows.Forms.Label(); + this.txtInvoiceImportDt = new System.Windows.Forms.TextBox(); + this.dataGridView1 = new System.Windows.Forms.DataGridView(); + this.PurchaseOrderLineID = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.ContactName = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.PurchaseOrderDate = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.PurchaseOrderReference = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.PurchaseOrderLineNumber = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.PurchaseOrderLineDescription = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.PurchaseOrderLineNetAmount = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.InvoicedAmount = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.PurchaseOrderLineFacility = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.WorkNumber = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.ProjectTitle = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.purchaseOrderAllocationBindingSource = new System.Windows.Forms.BindingSource(this.components); + this.tabControl1 = new System.Windows.Forms.TabControl(); + this.tabProjectWork = new System.Windows.Forms.TabPage(); + this.splitContainer4 = new System.Windows.Forms.SplitContainer(); + this.button4 = new System.Windows.Forms.Button(); + this.button5 = new System.Windows.Forms.Button(); + this.button6 = new System.Windows.Forms.Button(); + this.dataGridView4 = new System.Windows.Forms.DataGridView(); + this.workNumberDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.workItemClientDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.dataGridViewTextBoxColumn1 = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.dataGridViewTextBoxColumn3 = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.workItemTitleDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.workItemDateStartDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.workItemDateEndDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.workItemIsArchivedDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.projectWorkItemBindingSource = new System.Windows.Forms.BindingSource(this.components); + this.saleInvoiceIDDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.contactNameDataGridViewTextBoxColumn2 = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.saleInvoiceNumberDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.invoiceDateDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.dueDateDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.referenceDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.currencyCodeDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.invoiceTotalDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.invoiceNetTotalDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.taxTotalDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.isCreditNoteDataGridViewCheckBoxColumn = new System.Windows.Forms.DataGridViewCheckBoxColumn(); + this.statusDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); ((System.ComponentModel.ISupportInitialize)(this.invoiceHeaderBindingSource1)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.purchaseOrderAllocationBindingSource)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.bindingSourceSaleInvoice)).BeginInit(); + this.menuStrip1.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.invoiceHeaderBindingSource)).BeginInit(); + this.tabClientPo.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.splitContainer2)).BeginInit(); + this.splitContainer2.Panel1.SuspendLayout(); + this.splitContainer2.Panel2.SuspendLayout(); + this.splitContainer2.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.dataGridView3)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.purchaseOrderBindingSource)).BeginInit(); this.tabSaleInvoice.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit(); this.splitContainer1.Panel1.SuspendLayout(); this.splitContainer1.Panel2.SuspendLayout(); this.splitContainer1.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.dataGridView2)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.bindingSourceSaleInvoice)).BeginInit(); - this.menuStrip1.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.invoiceHeaderBindingSource)).BeginInit(); + this.tabClientPoAllocation.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.splitContainer3)).BeginInit(); + this.splitContainer3.Panel1.SuspendLayout(); + this.splitContainer3.Panel2.SuspendLayout(); + this.splitContainer3.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.purchaseOrderAllocationBindingSource)).BeginInit(); + this.tabControl1.SuspendLayout(); + this.tabProjectWork.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.splitContainer4)).BeginInit(); + this.splitContainer4.Panel1.SuspendLayout(); + this.splitContainer4.Panel2.SuspendLayout(); + this.splitContainer4.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.dataGridView4)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.projectWorkItemBindingSource)).BeginInit(); this.SuspendLayout(); // - // tabControl1 - // - this.tabControl1.Controls.Add(this.tabPage1); - this.tabControl1.Controls.Add(this.tabSaleInvoice); - this.tabControl1.Dock = System.Windows.Forms.DockStyle.Fill; - this.tabControl1.Location = new System.Drawing.Point(0, 24); - this.tabControl1.Name = "tabControl1"; - this.tabControl1.SelectedIndex = 0; - this.tabControl1.Size = new System.Drawing.Size(1151, 721); - this.tabControl1.TabIndex = 5; - this.tabControl1.SelectedIndexChanged += new System.EventHandler(this.tabControl1_SelectedIndexChanged); - // - // tabPage1 - // - this.tabPage1.Controls.Add(this.splitContainer3); - this.tabPage1.Location = new System.Drawing.Point(4, 22); - this.tabPage1.Name = "tabPage1"; - this.tabPage1.Padding = new System.Windows.Forms.Padding(3); - this.tabPage1.Size = new System.Drawing.Size(1143, 695); - this.tabPage1.TabIndex = 0; - this.tabPage1.Text = "Client Purchase Order"; - this.tabPage1.UseVisualStyleBackColor = true; - // - // splitContainer3 - // - this.splitContainer3.Dock = System.Windows.Forms.DockStyle.Fill; - this.splitContainer3.Location = new System.Drawing.Point(3, 3); - this.splitContainer3.Name = "splitContainer3"; - this.splitContainer3.Orientation = System.Windows.Forms.Orientation.Horizontal; - // - // splitContainer3.Panel1 - // - this.splitContainer3.Panel1.Controls.Add(this.btnAssign); - this.splitContainer3.Panel1.Controls.Add(this.txtInvoiceStatus); - this.splitContainer3.Panel1.Controls.Add(this.txtInvoiceNetAmount); - this.splitContainer3.Panel1.Controls.Add(this.txtInvoiceContact); - this.splitContainer3.Panel1.Controls.Add(this.btnOpenInvoice); - this.splitContainer3.Panel1.Controls.Add(this.cmbInvoicePick); - this.splitContainer3.Panel1.Controls.Add(this.btnAutoMatch); - this.splitContainer3.Panel1.Controls.Add(this.btnOpenPurchaseOrder); - this.splitContainer3.Panel1.Controls.Add(this.btnAddPurchaseOrder); - this.splitContainer3.Panel1.Controls.Add(this.button1); - this.splitContainer3.Panel1.Controls.Add(this.label1); - this.splitContainer3.Panel1.Controls.Add(this.label2); - this.splitContainer3.Panel1.Controls.Add(this.txtInvoiceImportDt); - // - // splitContainer3.Panel2 - // - this.splitContainer3.Panel2.Controls.Add(this.dataGridView1); - this.splitContainer3.Panel2.Paint += new System.Windows.Forms.PaintEventHandler(this.splitContainer3_Panel2_Paint); - this.splitContainer3.Size = new System.Drawing.Size(1137, 689); - this.splitContainer3.SplitterDistance = 93; - this.splitContainer3.TabIndex = 0; - // - // btnAssign - // - this.btnAssign.Location = new System.Drawing.Point(833, 21); - this.btnAssign.Name = "btnAssign"; - this.btnAssign.Size = new System.Drawing.Size(92, 20); - this.btnAssign.TabIndex = 17; - this.btnAssign.Text = "Assign"; - this.btnAssign.UseVisualStyleBackColor = true; - this.btnAssign.Click += new System.EventHandler(this.btnAssign_Click); - // - // txtInvoiceStatus - // - this.txtInvoiceStatus.Location = new System.Drawing.Point(599, 21); - this.txtInvoiceStatus.Name = "txtInvoiceStatus"; - this.txtInvoiceStatus.ReadOnly = true; - this.txtInvoiceStatus.Size = new System.Drawing.Size(110, 20); - this.txtInvoiceStatus.TabIndex = 16; - // - // txtInvoiceNetAmount - // - this.txtInvoiceNetAmount.Location = new System.Drawing.Point(491, 21); - this.txtInvoiceNetAmount.Name = "txtInvoiceNetAmount"; - this.txtInvoiceNetAmount.ReadOnly = true; - this.txtInvoiceNetAmount.Size = new System.Drawing.Size(86, 20); - this.txtInvoiceNetAmount.TabIndex = 15; - // - // txtInvoiceContact - // - this.txtInvoiceContact.Location = new System.Drawing.Point(296, 21); - this.txtInvoiceContact.Name = "txtInvoiceContact"; - this.txtInvoiceContact.ReadOnly = true; - this.txtInvoiceContact.Size = new System.Drawing.Size(172, 20); - this.txtInvoiceContact.TabIndex = 14; - // - // btnOpenInvoice - // - this.btnOpenInvoice.Location = new System.Drawing.Point(725, 21); - this.btnOpenInvoice.Name = "btnOpenInvoice"; - this.btnOpenInvoice.Size = new System.Drawing.Size(92, 20); - this.btnOpenInvoice.TabIndex = 13; - this.btnOpenInvoice.Text = "Open"; - this.btnOpenInvoice.UseVisualStyleBackColor = true; - this.btnOpenInvoice.Click += new System.EventHandler(this.btnOpenInvoice_Click); - // - // cmbInvoicePick - // - this.cmbInvoicePick.DataSource = this.invoiceHeaderBindingSource1; - this.cmbInvoicePick.DisplayMember = "SaleInvoiceNumber"; - this.cmbInvoicePick.FormattingEnabled = true; - this.cmbInvoicePick.Location = new System.Drawing.Point(145, 21); - this.cmbInvoicePick.Name = "cmbInvoicePick"; - this.cmbInvoicePick.Size = new System.Drawing.Size(128, 21); - this.cmbInvoicePick.TabIndex = 12; - this.cmbInvoicePick.ValueMember = "SaleInvoiceID"; - this.cmbInvoicePick.SelectedIndexChanged += new System.EventHandler(this.cmbInvoicePick_SelectedIndexChanged); - // // invoiceHeaderBindingSource1 // this.invoiceHeaderBindingSource1.DataSource = typeof(BealeEngineering.Core.Model.Sale.InvoiceHeader); // - // btnAutoMatch + // bindingSourceSaleInvoice // - this.btnAutoMatch.Location = new System.Drawing.Point(943, 20); - this.btnAutoMatch.Name = "btnAutoMatch"; - this.btnAutoMatch.Size = new System.Drawing.Size(75, 20); - this.btnAutoMatch.TabIndex = 10; - this.btnAutoMatch.Text = "Auto Match"; - this.btnAutoMatch.UseVisualStyleBackColor = true; - this.btnAutoMatch.Click += new System.EventHandler(this.btnAutoMatch_Click); + this.bindingSourceSaleInvoice.DataSource = typeof(BealeEngineering.Core.Model.Sale.Invoice); // - // btnOpenPurchaseOrder + // menuStrip1 // - this.btnOpenPurchaseOrder.Anchor = System.Windows.Forms.AnchorStyles.Right; - this.btnOpenPurchaseOrder.Location = new System.Drawing.Point(882, 55); - this.btnOpenPurchaseOrder.Name = "btnOpenPurchaseOrder"; - this.btnOpenPurchaseOrder.Size = new System.Drawing.Size(160, 20); - this.btnOpenPurchaseOrder.TabIndex = 11; - this.btnOpenPurchaseOrder.Text = "Open Purchase Order"; - this.btnOpenPurchaseOrder.UseVisualStyleBackColor = true; - this.btnOpenPurchaseOrder.Click += new System.EventHandler(this.btnOpenPurchaseOrder_Click); + this.menuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.fileToolStripMenuItem, + this.importToolStripMenuItem, + this.exportToolStripMenuItem, + this.testToolStripMenuItem}); + this.menuStrip1.Location = new System.Drawing.Point(0, 0); + this.menuStrip1.Name = "menuStrip1"; + this.menuStrip1.Size = new System.Drawing.Size(1151, 24); + this.menuStrip1.TabIndex = 6; + this.menuStrip1.Text = "menuStrip1"; + // + // fileToolStripMenuItem + // + this.fileToolStripMenuItem.Name = "fileToolStripMenuItem"; + this.fileToolStripMenuItem.Size = new System.Drawing.Size(37, 20); + this.fileToolStripMenuItem.Text = "File"; + // + // importToolStripMenuItem + // + this.importToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.xeroInvoiceToolStripMenuItem}); + this.importToolStripMenuItem.Name = "importToolStripMenuItem"; + this.importToolStripMenuItem.Size = new System.Drawing.Size(55, 20); + this.importToolStripMenuItem.Text = "Import"; + // + // xeroInvoiceToolStripMenuItem + // + this.xeroInvoiceToolStripMenuItem.Name = "xeroInvoiceToolStripMenuItem"; + this.xeroInvoiceToolStripMenuItem.Size = new System.Drawing.Size(139, 22); + this.xeroInvoiceToolStripMenuItem.Text = "Xero Invoice"; + this.xeroInvoiceToolStripMenuItem.Click += new System.EventHandler(this.xeroInvoiceToolStripMenuItem_Click); + // + // exportToolStripMenuItem + // + this.exportToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.excelInvoiceToolStripMenuItem, + this.xeroNewInvoiceToolStripMenuItem}); + this.exportToolStripMenuItem.Name = "exportToolStripMenuItem"; + this.exportToolStripMenuItem.Size = new System.Drawing.Size(53, 20); + this.exportToolStripMenuItem.Text = "Export"; + // + // excelInvoiceToolStripMenuItem + // + this.excelInvoiceToolStripMenuItem.Name = "excelInvoiceToolStripMenuItem"; + this.excelInvoiceToolStripMenuItem.Size = new System.Drawing.Size(166, 22); + this.excelInvoiceToolStripMenuItem.Text = "Excel Invoice"; + this.excelInvoiceToolStripMenuItem.Click += new System.EventHandler(this.xeroInvoiceToolStripMenuItem1_Click); + // + // xeroNewInvoiceToolStripMenuItem + // + this.xeroNewInvoiceToolStripMenuItem.Name = "xeroNewInvoiceToolStripMenuItem"; + this.xeroNewInvoiceToolStripMenuItem.Size = new System.Drawing.Size(166, 22); + this.xeroNewInvoiceToolStripMenuItem.Text = "Xero New Invoice"; + this.xeroNewInvoiceToolStripMenuItem.Click += new System.EventHandler(this.xeroNewInvoiceToolStripMenuItem_Click); + // + // testToolStripMenuItem + // + this.testToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.testItToolStripMenuItem}); + this.testToolStripMenuItem.Name = "testToolStripMenuItem"; + this.testToolStripMenuItem.Size = new System.Drawing.Size(39, 20); + this.testToolStripMenuItem.Text = "Test"; + // + // testItToolStripMenuItem + // + this.testItToolStripMenuItem.Name = "testItToolStripMenuItem"; + this.testItToolStripMenuItem.Size = new System.Drawing.Size(107, 22); + this.testItToolStripMenuItem.Text = "Test it!"; + this.testItToolStripMenuItem.Click += new System.EventHandler(this.testItToolStripMenuItem_Click); + // + // invoiceHeaderBindingSource + // + this.invoiceHeaderBindingSource.DataSource = typeof(BealeEngineering.Core.Model.Sale.InvoiceHeader); + // + // tabClientPo + // + this.tabClientPo.Controls.Add(this.splitContainer2); + this.tabClientPo.Location = new System.Drawing.Point(4, 22); + this.tabClientPo.Name = "tabClientPo"; + this.tabClientPo.Padding = new System.Windows.Forms.Padding(3); + this.tabClientPo.Size = new System.Drawing.Size(1143, 695); + this.tabClientPo.TabIndex = 3; + this.tabClientPo.Text = "Client Purchase Order"; + this.tabClientPo.UseVisualStyleBackColor = true; + // + // splitContainer2 + // + this.splitContainer2.Dock = System.Windows.Forms.DockStyle.Fill; + this.splitContainer2.Location = new System.Drawing.Point(3, 3); + this.splitContainer2.Name = "splitContainer2"; + this.splitContainer2.Orientation = System.Windows.Forms.Orientation.Horizontal; + // + // splitContainer2.Panel1 + // + this.splitContainer2.Panel1.Controls.Add(this.btnAddPurchaseOrder); + this.splitContainer2.Panel1.Controls.Add(this.button2); + this.splitContainer2.Panel1.Controls.Add(this.button3); + // + // splitContainer2.Panel2 + // + this.splitContainer2.Panel2.Controls.Add(this.dataGridView3); + this.splitContainer2.Size = new System.Drawing.Size(1137, 689); + this.splitContainer2.SplitterDistance = 93; + this.splitContainer2.TabIndex = 0; // // btnAddPurchaseOrder // this.btnAddPurchaseOrder.Anchor = System.Windows.Forms.AnchorStyles.Right; - this.btnAddPurchaseOrder.Location = new System.Drawing.Point(716, 55); + this.btnAddPurchaseOrder.Location = new System.Drawing.Point(25, 29); this.btnAddPurchaseOrder.Name = "btnAddPurchaseOrder"; - this.btnAddPurchaseOrder.Size = new System.Drawing.Size(160, 20); - this.btnAddPurchaseOrder.TabIndex = 10; - this.btnAddPurchaseOrder.Text = "Add Purchase Order"; + this.btnAddPurchaseOrder.Size = new System.Drawing.Size(92, 20); + this.btnAddPurchaseOrder.TabIndex = 15; + this.btnAddPurchaseOrder.Text = "New"; this.btnAddPurchaseOrder.UseVisualStyleBackColor = true; - this.btnAddPurchaseOrder.Click += new System.EventHandler(this.btnAddPurchaseOrder_Click); + this.btnAddPurchaseOrder.Click += new System.EventHandler(this.btnAddPurchaseOrder_Click_1); // - // button1 + // button2 // - this.button1.Anchor = System.Windows.Forms.AnchorStyles.Right; - this.button1.Location = new System.Drawing.Point(1048, 56); - this.button1.Name = "button1"; - this.button1.Size = new System.Drawing.Size(75, 20); - this.button1.TabIndex = 4; - this.button1.Text = "Refresh"; - this.button1.UseVisualStyleBackColor = true; - this.button1.Click += new System.EventHandler(this.button1_Click); + this.button2.Location = new System.Drawing.Point(25, 55); + this.button2.Name = "button2"; + this.button2.Size = new System.Drawing.Size(92, 20); + this.button2.TabIndex = 14; + this.button2.Text = "Open"; + this.button2.UseVisualStyleBackColor = true; + this.button2.Click += new System.EventHandler(this.btnOpenPo); // - // label1 + // button3 // - this.label1.AutoSize = true; - this.label1.Location = new System.Drawing.Point(21, 58); - this.label1.Name = "label1"; - this.label1.Size = new System.Drawing.Size(84, 13); - this.label1.TabIndex = 6; - this.label1.Text = "Last Xero Import"; - this.label1.Click += new System.EventHandler(this.label1_Click); + this.button3.Anchor = System.Windows.Forms.AnchorStyles.Right; + this.button3.Location = new System.Drawing.Point(1035, 55); + this.button3.Name = "button3"; + this.button3.Size = new System.Drawing.Size(75, 20); + this.button3.TabIndex = 5; + this.button3.Text = "Refresh"; + this.button3.UseVisualStyleBackColor = true; + this.button3.Click += new System.EventHandler(this.btnRefreshClientPo_Click); // - // label2 + // dataGridView3 // - this.label2.AutoSize = true; - this.label2.Location = new System.Drawing.Point(21, 24); - this.label2.Name = "label2"; - this.label2.Size = new System.Drawing.Size(107, 13); - this.label2.TabIndex = 8; - this.label2.Text = "Unallocated Invoices"; + this.dataGridView3.AllowUserToAddRows = false; + this.dataGridView3.AllowUserToDeleteRows = false; + this.dataGridView3.AutoGenerateColumns = false; + this.dataGridView3.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; + this.dataGridView3.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { + this.clientPurchaseOrderIDDataGridViewTextBoxColumn, + this.purchaseOrderDateDataGridViewTextBoxColumn, + this.contactNameDataGridViewTextBoxColumn1, + this.clientReferenceDataGridViewTextBoxColumn, + this.orderTotalDataGridViewTextBoxColumn, + this.isClosedDataGridViewCheckBoxColumn}); + this.dataGridView3.DataSource = this.purchaseOrderBindingSource; + this.dataGridView3.Dock = System.Windows.Forms.DockStyle.Fill; + this.dataGridView3.Location = new System.Drawing.Point(0, 0); + this.dataGridView3.Name = "dataGridView3"; + this.dataGridView3.ReadOnly = true; + this.dataGridView3.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect; + this.dataGridView3.Size = new System.Drawing.Size(1137, 592); + this.dataGridView3.TabIndex = 0; // - // txtInvoiceImportDt + // clientPurchaseOrderIDDataGridViewTextBoxColumn // - this.txtInvoiceImportDt.Location = new System.Drawing.Point(143, 55); - this.txtInvoiceImportDt.Name = "txtInvoiceImportDt"; - this.txtInvoiceImportDt.ReadOnly = true; - this.txtInvoiceImportDt.Size = new System.Drawing.Size(130, 20); - this.txtInvoiceImportDt.TabIndex = 5; + this.clientPurchaseOrderIDDataGridViewTextBoxColumn.DataPropertyName = "ClientPurchaseOrderID"; + this.clientPurchaseOrderIDDataGridViewTextBoxColumn.HeaderText = "ClientPurchaseOrderID"; + this.clientPurchaseOrderIDDataGridViewTextBoxColumn.Name = "clientPurchaseOrderIDDataGridViewTextBoxColumn"; + this.clientPurchaseOrderIDDataGridViewTextBoxColumn.ReadOnly = true; + this.clientPurchaseOrderIDDataGridViewTextBoxColumn.Visible = false; // - // dataGridView1 + // purchaseOrderDateDataGridViewTextBoxColumn // - this.dataGridView1.AllowUserToAddRows = false; - this.dataGridView1.AllowUserToDeleteRows = false; - this.dataGridView1.AllowUserToOrderColumns = true; - this.dataGridView1.AutoGenerateColumns = false; - this.dataGridView1.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill; - this.dataGridView1.CellBorderStyle = System.Windows.Forms.DataGridViewCellBorderStyle.None; - this.dataGridView1.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; - this.dataGridView1.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { - this.ContactName, - this.ProjectTitle, - this.PurchaseOrderDate, - this.PurchaseOrderReference, - this.PurchaseOrderLineNumber, - this.PurchaseOrderLineDescription, - this.PurchaseOrderLineNetAmount, - this.InvoicedAmount, - this.PurchaseOrderLineFacility, - this.JobNumber, - this.PurchaseOrderLineID}); - this.dataGridView1.DataSource = this.purchaseOrderAllocationBindingSource; - this.dataGridView1.Dock = System.Windows.Forms.DockStyle.Fill; - this.dataGridView1.Location = new System.Drawing.Point(0, 0); - this.dataGridView1.MultiSelect = false; - this.dataGridView1.Name = "dataGridView1"; - this.dataGridView1.ReadOnly = true; - this.dataGridView1.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect; - this.dataGridView1.Size = new System.Drawing.Size(1137, 592); - this.dataGridView1.TabIndex = 2; - this.dataGridView1.CellContentClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.dataGridView1_CellContentClick); - this.dataGridView1.CellDoubleClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.dataGridView1_CellDoubleClick); + this.purchaseOrderDateDataGridViewTextBoxColumn.DataPropertyName = "PurchaseOrderDate"; + this.purchaseOrderDateDataGridViewTextBoxColumn.HeaderText = "Order Date"; + this.purchaseOrderDateDataGridViewTextBoxColumn.MinimumWidth = 150; + this.purchaseOrderDateDataGridViewTextBoxColumn.Name = "purchaseOrderDateDataGridViewTextBoxColumn"; + this.purchaseOrderDateDataGridViewTextBoxColumn.ReadOnly = true; + this.purchaseOrderDateDataGridViewTextBoxColumn.Width = 150; // - // ContactName + // contactNameDataGridViewTextBoxColumn1 // - this.ContactName.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; - this.ContactName.DataPropertyName = "ContactName"; - this.ContactName.FillWeight = 150F; - this.ContactName.HeaderText = "Client"; - this.ContactName.MinimumWidth = 100; - this.ContactName.Name = "ContactName"; - this.ContactName.ReadOnly = true; + this.contactNameDataGridViewTextBoxColumn1.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; + this.contactNameDataGridViewTextBoxColumn1.DataPropertyName = "ContactName"; + this.contactNameDataGridViewTextBoxColumn1.HeaderText = "Client"; + this.contactNameDataGridViewTextBoxColumn1.MinimumWidth = 300; + this.contactNameDataGridViewTextBoxColumn1.Name = "contactNameDataGridViewTextBoxColumn1"; + this.contactNameDataGridViewTextBoxColumn1.ReadOnly = true; // - // ProjectTitle + // clientReferenceDataGridViewTextBoxColumn // - this.ProjectTitle.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; - this.ProjectTitle.DataPropertyName = "ProjectTitle"; - this.ProjectTitle.FillWeight = 200F; - this.ProjectTitle.HeaderText = "Project"; - this.ProjectTitle.MinimumWidth = 100; - this.ProjectTitle.Name = "ProjectTitle"; - this.ProjectTitle.ReadOnly = true; + this.clientReferenceDataGridViewTextBoxColumn.DataPropertyName = "ClientReference"; + this.clientReferenceDataGridViewTextBoxColumn.HeaderText = "Order Number"; + this.clientReferenceDataGridViewTextBoxColumn.MinimumWidth = 200; + this.clientReferenceDataGridViewTextBoxColumn.Name = "clientReferenceDataGridViewTextBoxColumn"; + this.clientReferenceDataGridViewTextBoxColumn.ReadOnly = true; + this.clientReferenceDataGridViewTextBoxColumn.Width = 200; // - // PurchaseOrderDate + // orderTotalDataGridViewTextBoxColumn // - this.PurchaseOrderDate.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; - this.PurchaseOrderDate.DataPropertyName = "PurchaseOrderDate"; - this.PurchaseOrderDate.FillWeight = 30.59646F; - this.PurchaseOrderDate.HeaderText = "PO Date"; - this.PurchaseOrderDate.MinimumWidth = 80; - this.PurchaseOrderDate.Name = "PurchaseOrderDate"; - this.PurchaseOrderDate.ReadOnly = true; + this.orderTotalDataGridViewTextBoxColumn.DataPropertyName = "OrderTotal"; + this.orderTotalDataGridViewTextBoxColumn.HeaderText = "Order Total"; + this.orderTotalDataGridViewTextBoxColumn.MinimumWidth = 150; + this.orderTotalDataGridViewTextBoxColumn.Name = "orderTotalDataGridViewTextBoxColumn"; + this.orderTotalDataGridViewTextBoxColumn.ReadOnly = true; + this.orderTotalDataGridViewTextBoxColumn.Width = 150; // - // PurchaseOrderReference + // isClosedDataGridViewCheckBoxColumn // - this.PurchaseOrderReference.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; - this.PurchaseOrderReference.DataPropertyName = "PurchaseOrderReference"; - this.PurchaseOrderReference.FillWeight = 30.59646F; - this.PurchaseOrderReference.HeaderText = "PO Number"; - this.PurchaseOrderReference.MinimumWidth = 100; - this.PurchaseOrderReference.Name = "PurchaseOrderReference"; - this.PurchaseOrderReference.ReadOnly = true; + this.isClosedDataGridViewCheckBoxColumn.DataPropertyName = "IsClosed"; + this.isClosedDataGridViewCheckBoxColumn.HeaderText = "Closed"; + this.isClosedDataGridViewCheckBoxColumn.MinimumWidth = 60; + this.isClosedDataGridViewCheckBoxColumn.Name = "isClosedDataGridViewCheckBoxColumn"; + this.isClosedDataGridViewCheckBoxColumn.ReadOnly = true; // - // PurchaseOrderLineNumber + // purchaseOrderBindingSource // - this.PurchaseOrderLineNumber.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; - this.PurchaseOrderLineNumber.DataPropertyName = "PurchaseOrderLineNumber"; - this.PurchaseOrderLineNumber.FillWeight = 30.59646F; - this.PurchaseOrderLineNumber.HeaderText = "Line No"; - this.PurchaseOrderLineNumber.MinimumWidth = 50; - this.PurchaseOrderLineNumber.Name = "PurchaseOrderLineNumber"; - this.PurchaseOrderLineNumber.ReadOnly = true; - // - // PurchaseOrderLineDescription - // - this.PurchaseOrderLineDescription.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; - this.PurchaseOrderLineDescription.DataPropertyName = "PurchaseOrderLineDescription"; - this.PurchaseOrderLineDescription.FillWeight = 300F; - this.PurchaseOrderLineDescription.HeaderText = "Description"; - this.PurchaseOrderLineDescription.MinimumWidth = 242; - this.PurchaseOrderLineDescription.Name = "PurchaseOrderLineDescription"; - this.PurchaseOrderLineDescription.ReadOnly = true; - // - // PurchaseOrderLineNetAmount - // - this.PurchaseOrderLineNetAmount.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; - this.PurchaseOrderLineNetAmount.DataPropertyName = "PurchaseOrderLineNetAmount"; - this.PurchaseOrderLineNetAmount.FillWeight = 50F; - this.PurchaseOrderLineNetAmount.HeaderText = "Line Amount"; - this.PurchaseOrderLineNetAmount.MinimumWidth = 80; - this.PurchaseOrderLineNetAmount.Name = "PurchaseOrderLineNetAmount"; - this.PurchaseOrderLineNetAmount.ReadOnly = true; - // - // InvoicedAmount - // - this.InvoicedAmount.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; - this.InvoicedAmount.DataPropertyName = "InvoicedAmount"; - this.InvoicedAmount.FillWeight = 50F; - this.InvoicedAmount.HeaderText = "Invoiced"; - this.InvoicedAmount.MinimumWidth = 80; - this.InvoicedAmount.Name = "InvoicedAmount"; - this.InvoicedAmount.ReadOnly = true; - // - // PurchaseOrderLineFacility - // - this.PurchaseOrderLineFacility.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; - this.PurchaseOrderLineFacility.DataPropertyName = "PurchaseOrderLineFacility"; - this.PurchaseOrderLineFacility.FillWeight = 50F; - this.PurchaseOrderLineFacility.HeaderText = "Facility"; - this.PurchaseOrderLineFacility.MinimumWidth = 80; - this.PurchaseOrderLineFacility.Name = "PurchaseOrderLineFacility"; - this.PurchaseOrderLineFacility.ReadOnly = true; - // - // JobNumber - // - this.JobNumber.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; - this.JobNumber.DataPropertyName = "JobNumber"; - this.JobNumber.FillWeight = 30.59646F; - this.JobNumber.HeaderText = "Job Number"; - this.JobNumber.MinimumWidth = 80; - this.JobNumber.Name = "JobNumber"; - this.JobNumber.ReadOnly = true; - // - // PurchaseOrderLineID - // - this.PurchaseOrderLineID.DataPropertyName = "PurchaseOrderLineID"; - this.PurchaseOrderLineID.HeaderText = "PurchaseOrderLineID"; - this.PurchaseOrderLineID.Name = "PurchaseOrderLineID"; - this.PurchaseOrderLineID.ReadOnly = true; - this.PurchaseOrderLineID.Visible = false; - // - // purchaseOrderAllocationBindingSource - // - this.purchaseOrderAllocationBindingSource.AllowNew = false; - this.purchaseOrderAllocationBindingSource.DataSource = typeof(BealeEngineering.Core.Model.Client.PurchaseOrderAllocation); + this.purchaseOrderBindingSource.DataSource = typeof(BealeEngineering.Core.Model.Client.PurchaseOrder); // // tabSaleInvoice // @@ -507,6 +454,7 @@ this.dataGridView2.DataSource = this.bindingSourceSaleInvoice; this.dataGridView2.Dock = System.Windows.Forms.DockStyle.Fill; this.dataGridView2.Location = new System.Drawing.Point(0, 0); + this.dataGridView2.MultiSelect = false; this.dataGridView2.Name = "dataGridView2"; this.dataGridView2.ReadOnly = true; this.dataGridView2.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect; @@ -593,8 +541,8 @@ // TotalAndCurrency // this.TotalAndCurrency.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.None; - dataGridViewCellStyle9.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleRight; - this.TotalAndCurrency.DefaultCellStyle = dataGridViewCellStyle9; + dataGridViewCellStyle3.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleRight; + this.TotalAndCurrency.DefaultCellStyle = dataGridViewCellStyle3; this.TotalAndCurrency.HeaderText = "InvoiceTotal"; this.TotalAndCurrency.MinimumWidth = 120; this.TotalAndCurrency.Name = "TotalAndCurrency"; @@ -605,84 +553,550 @@ // this.status.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; this.status.DataPropertyName = "Status"; - dataGridViewCellStyle10.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; - this.status.DefaultCellStyle = dataGridViewCellStyle10; + dataGridViewCellStyle4.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + this.status.DefaultCellStyle = dataGridViewCellStyle4; this.status.HeaderText = "Status"; this.status.MinimumWidth = 100; this.status.Name = "status"; this.status.ReadOnly = true; // - // bindingSourceSaleInvoice + // tabClientPoAllocation // - this.bindingSourceSaleInvoice.DataSource = typeof(BealeEngineering.Core.Model.Sale.Invoice); + this.tabClientPoAllocation.Controls.Add(this.splitContainer3); + this.tabClientPoAllocation.Location = new System.Drawing.Point(4, 22); + this.tabClientPoAllocation.Name = "tabClientPoAllocation"; + this.tabClientPoAllocation.Padding = new System.Windows.Forms.Padding(3); + this.tabClientPoAllocation.Size = new System.Drawing.Size(1143, 695); + this.tabClientPoAllocation.TabIndex = 0; + this.tabClientPoAllocation.Text = "Invoice Allocation"; + this.tabClientPoAllocation.UseVisualStyleBackColor = true; // - // menuStrip1 + // splitContainer3 // - this.menuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.fileToolStripMenuItem, - this.importToolStripMenuItem, - this.exportToolStripMenuItem, - this.testToolStripMenuItem}); - this.menuStrip1.Location = new System.Drawing.Point(0, 0); - this.menuStrip1.Name = "menuStrip1"; - this.menuStrip1.Size = new System.Drawing.Size(1151, 24); - this.menuStrip1.TabIndex = 6; - this.menuStrip1.Text = "menuStrip1"; + this.splitContainer3.Dock = System.Windows.Forms.DockStyle.Fill; + this.splitContainer3.Location = new System.Drawing.Point(3, 3); + this.splitContainer3.Name = "splitContainer3"; + this.splitContainer3.Orientation = System.Windows.Forms.Orientation.Horizontal; // - // fileToolStripMenuItem + // splitContainer3.Panel1 // - this.fileToolStripMenuItem.Name = "fileToolStripMenuItem"; - this.fileToolStripMenuItem.Size = new System.Drawing.Size(37, 20); - this.fileToolStripMenuItem.Text = "File"; + this.splitContainer3.Panel1.Controls.Add(this.btnAssign); + this.splitContainer3.Panel1.Controls.Add(this.txtInvoiceStatus); + this.splitContainer3.Panel1.Controls.Add(this.txtInvoiceNetAmount); + this.splitContainer3.Panel1.Controls.Add(this.txtInvoiceContact); + this.splitContainer3.Panel1.Controls.Add(this.btnOpenInvoice); + this.splitContainer3.Panel1.Controls.Add(this.cmbInvoicePick); + this.splitContainer3.Panel1.Controls.Add(this.button1); + this.splitContainer3.Panel1.Controls.Add(this.label1); + this.splitContainer3.Panel1.Controls.Add(this.label2); + this.splitContainer3.Panel1.Controls.Add(this.txtInvoiceImportDt); // - // importToolStripMenuItem + // splitContainer3.Panel2 // - this.importToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.xeroInvoiceToolStripMenuItem}); - this.importToolStripMenuItem.Name = "importToolStripMenuItem"; - this.importToolStripMenuItem.Size = new System.Drawing.Size(55, 20); - this.importToolStripMenuItem.Text = "Import"; + this.splitContainer3.Panel2.Controls.Add(this.dataGridView1); + this.splitContainer3.Panel2.Paint += new System.Windows.Forms.PaintEventHandler(this.splitContainer3_Panel2_Paint); + this.splitContainer3.Size = new System.Drawing.Size(1137, 689); + this.splitContainer3.SplitterDistance = 93; + this.splitContainer3.TabIndex = 0; // - // xeroInvoiceToolStripMenuItem + // btnAssign // - this.xeroInvoiceToolStripMenuItem.Name = "xeroInvoiceToolStripMenuItem"; - this.xeroInvoiceToolStripMenuItem.Size = new System.Drawing.Size(139, 22); - this.xeroInvoiceToolStripMenuItem.Text = "Xero Invoice"; - this.xeroInvoiceToolStripMenuItem.Click += new System.EventHandler(this.xeroInvoiceToolStripMenuItem_Click); + this.btnAssign.Location = new System.Drawing.Point(833, 21); + this.btnAssign.Name = "btnAssign"; + this.btnAssign.Size = new System.Drawing.Size(92, 20); + this.btnAssign.TabIndex = 17; + this.btnAssign.Text = "Assign"; + this.btnAssign.UseVisualStyleBackColor = true; + this.btnAssign.Click += new System.EventHandler(this.btnAssign_Click); // - // exportToolStripMenuItem + // txtInvoiceStatus // - this.exportToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.xeroInvoiceToolStripMenuItem1}); - this.exportToolStripMenuItem.Name = "exportToolStripMenuItem"; - this.exportToolStripMenuItem.Size = new System.Drawing.Size(53, 20); - this.exportToolStripMenuItem.Text = "Export"; + this.txtInvoiceStatus.Location = new System.Drawing.Point(599, 21); + this.txtInvoiceStatus.Name = "txtInvoiceStatus"; + this.txtInvoiceStatus.ReadOnly = true; + this.txtInvoiceStatus.Size = new System.Drawing.Size(110, 20); + this.txtInvoiceStatus.TabIndex = 16; // - // xeroInvoiceToolStripMenuItem1 + // txtInvoiceNetAmount // - this.xeroInvoiceToolStripMenuItem1.Name = "xeroInvoiceToolStripMenuItem1"; - this.xeroInvoiceToolStripMenuItem1.Size = new System.Drawing.Size(139, 22); - this.xeroInvoiceToolStripMenuItem1.Text = "Xero Invoice"; - this.xeroInvoiceToolStripMenuItem1.Click += new System.EventHandler(this.xeroInvoiceToolStripMenuItem1_Click); + this.txtInvoiceNetAmount.Location = new System.Drawing.Point(491, 21); + this.txtInvoiceNetAmount.Name = "txtInvoiceNetAmount"; + this.txtInvoiceNetAmount.ReadOnly = true; + this.txtInvoiceNetAmount.Size = new System.Drawing.Size(86, 20); + this.txtInvoiceNetAmount.TabIndex = 15; // - // testToolStripMenuItem + // txtInvoiceContact // - this.testToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.testItToolStripMenuItem}); - this.testToolStripMenuItem.Name = "testToolStripMenuItem"; - this.testToolStripMenuItem.Size = new System.Drawing.Size(39, 20); - this.testToolStripMenuItem.Text = "Test"; + this.txtInvoiceContact.Location = new System.Drawing.Point(296, 21); + this.txtInvoiceContact.Name = "txtInvoiceContact"; + this.txtInvoiceContact.ReadOnly = true; + this.txtInvoiceContact.Size = new System.Drawing.Size(172, 20); + this.txtInvoiceContact.TabIndex = 14; // - // testItToolStripMenuItem + // btnOpenInvoice // - this.testItToolStripMenuItem.Name = "testItToolStripMenuItem"; - this.testItToolStripMenuItem.Size = new System.Drawing.Size(107, 22); - this.testItToolStripMenuItem.Text = "Test it!"; - this.testItToolStripMenuItem.Click += new System.EventHandler(this.testItToolStripMenuItem_Click); + this.btnOpenInvoice.Location = new System.Drawing.Point(725, 21); + this.btnOpenInvoice.Name = "btnOpenInvoice"; + this.btnOpenInvoice.Size = new System.Drawing.Size(92, 20); + this.btnOpenInvoice.TabIndex = 13; + this.btnOpenInvoice.Text = "Open"; + this.btnOpenInvoice.UseVisualStyleBackColor = true; + this.btnOpenInvoice.Click += new System.EventHandler(this.btnOpenInvoice_Click); // - // invoiceHeaderBindingSource + // cmbInvoicePick // - this.invoiceHeaderBindingSource.DataSource = typeof(BealeEngineering.Core.Model.Sale.InvoiceHeader); + this.cmbInvoicePick.DataSource = this.invoiceHeaderBindingSource1; + this.cmbInvoicePick.DisplayMember = "SaleInvoiceNumber"; + this.cmbInvoicePick.FormattingEnabled = true; + this.cmbInvoicePick.Location = new System.Drawing.Point(145, 21); + this.cmbInvoicePick.Name = "cmbInvoicePick"; + this.cmbInvoicePick.Size = new System.Drawing.Size(128, 21); + this.cmbInvoicePick.TabIndex = 12; + this.cmbInvoicePick.ValueMember = "SaleInvoiceID"; + this.cmbInvoicePick.SelectedIndexChanged += new System.EventHandler(this.cmbInvoicePick_SelectedIndexChanged); + // + // button1 + // + this.button1.Anchor = System.Windows.Forms.AnchorStyles.Right; + this.button1.Location = new System.Drawing.Point(1046, 55); + this.button1.Name = "button1"; + this.button1.Size = new System.Drawing.Size(75, 20); + this.button1.TabIndex = 4; + this.button1.Text = "Refresh"; + this.button1.UseVisualStyleBackColor = true; + this.button1.Click += new System.EventHandler(this.btnRefreshInvAllocation_Click); + // + // label1 + // + this.label1.AutoSize = true; + this.label1.Location = new System.Drawing.Point(21, 58); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(84, 13); + this.label1.TabIndex = 6; + this.label1.Text = "Last Xero Import"; + this.label1.Click += new System.EventHandler(this.label1_Click); + // + // label2 + // + this.label2.AutoSize = true; + this.label2.Location = new System.Drawing.Point(21, 24); + this.label2.Name = "label2"; + this.label2.Size = new System.Drawing.Size(107, 13); + this.label2.TabIndex = 8; + this.label2.Text = "Unallocated Invoices"; + // + // txtInvoiceImportDt + // + this.txtInvoiceImportDt.Location = new System.Drawing.Point(143, 55); + this.txtInvoiceImportDt.Name = "txtInvoiceImportDt"; + this.txtInvoiceImportDt.ReadOnly = true; + this.txtInvoiceImportDt.Size = new System.Drawing.Size(130, 20); + this.txtInvoiceImportDt.TabIndex = 5; + // + // dataGridView1 + // + this.dataGridView1.AllowUserToAddRows = false; + this.dataGridView1.AllowUserToDeleteRows = false; + this.dataGridView1.AllowUserToOrderColumns = true; + this.dataGridView1.AutoGenerateColumns = false; + this.dataGridView1.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill; + this.dataGridView1.CellBorderStyle = System.Windows.Forms.DataGridViewCellBorderStyle.None; + this.dataGridView1.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; + this.dataGridView1.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { + this.PurchaseOrderLineID, + this.ContactName, + this.PurchaseOrderDate, + this.PurchaseOrderReference, + this.PurchaseOrderLineNumber, + this.PurchaseOrderLineDescription, + this.PurchaseOrderLineNetAmount, + this.InvoicedAmount, + this.PurchaseOrderLineFacility, + this.WorkNumber, + this.ProjectTitle}); + this.dataGridView1.DataSource = this.purchaseOrderAllocationBindingSource; + this.dataGridView1.Dock = System.Windows.Forms.DockStyle.Fill; + this.dataGridView1.Location = new System.Drawing.Point(0, 0); + this.dataGridView1.MultiSelect = false; + this.dataGridView1.Name = "dataGridView1"; + this.dataGridView1.ReadOnly = true; + this.dataGridView1.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect; + this.dataGridView1.Size = new System.Drawing.Size(1137, 592); + this.dataGridView1.TabIndex = 2; + this.dataGridView1.CellContentClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.dataGridView1_CellContentClick); + this.dataGridView1.CellDoubleClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.dataGridView1_CellDoubleClick); + // + // PurchaseOrderLineID + // + this.PurchaseOrderLineID.DataPropertyName = "PurchaseOrderLineID"; + this.PurchaseOrderLineID.HeaderText = "PurchaseOrderLineID"; + this.PurchaseOrderLineID.Name = "PurchaseOrderLineID"; + this.PurchaseOrderLineID.ReadOnly = true; + this.PurchaseOrderLineID.Visible = false; + // + // ContactName + // + this.ContactName.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; + this.ContactName.DataPropertyName = "ContactName"; + this.ContactName.FillWeight = 150F; + this.ContactName.HeaderText = "Client"; + this.ContactName.MinimumWidth = 90; + this.ContactName.Name = "ContactName"; + this.ContactName.ReadOnly = true; + // + // PurchaseOrderDate + // + this.PurchaseOrderDate.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; + this.PurchaseOrderDate.DataPropertyName = "PurchaseOrderDate"; + this.PurchaseOrderDate.FillWeight = 30.59646F; + this.PurchaseOrderDate.HeaderText = "PO Date"; + this.PurchaseOrderDate.MinimumWidth = 80; + this.PurchaseOrderDate.Name = "PurchaseOrderDate"; + this.PurchaseOrderDate.ReadOnly = true; + // + // PurchaseOrderReference + // + this.PurchaseOrderReference.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; + this.PurchaseOrderReference.DataPropertyName = "PurchaseOrderReference"; + this.PurchaseOrderReference.FillWeight = 30.59646F; + this.PurchaseOrderReference.HeaderText = "PO Number"; + this.PurchaseOrderReference.MinimumWidth = 100; + this.PurchaseOrderReference.Name = "PurchaseOrderReference"; + this.PurchaseOrderReference.ReadOnly = true; + // + // PurchaseOrderLineNumber + // + this.PurchaseOrderLineNumber.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; + this.PurchaseOrderLineNumber.DataPropertyName = "PurchaseOrderLineNumber"; + this.PurchaseOrderLineNumber.FillWeight = 30.59646F; + this.PurchaseOrderLineNumber.HeaderText = "Line No"; + this.PurchaseOrderLineNumber.MinimumWidth = 50; + this.PurchaseOrderLineNumber.Name = "PurchaseOrderLineNumber"; + this.PurchaseOrderLineNumber.ReadOnly = true; + // + // PurchaseOrderLineDescription + // + this.PurchaseOrderLineDescription.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; + this.PurchaseOrderLineDescription.DataPropertyName = "PurchaseOrderLineDescription"; + this.PurchaseOrderLineDescription.FillWeight = 300F; + this.PurchaseOrderLineDescription.HeaderText = "Description"; + this.PurchaseOrderLineDescription.MinimumWidth = 242; + this.PurchaseOrderLineDescription.Name = "PurchaseOrderLineDescription"; + this.PurchaseOrderLineDescription.ReadOnly = true; + // + // PurchaseOrderLineNetAmount + // + this.PurchaseOrderLineNetAmount.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; + this.PurchaseOrderLineNetAmount.DataPropertyName = "PurchaseOrderLineNetAmount"; + this.PurchaseOrderLineNetAmount.FillWeight = 50F; + this.PurchaseOrderLineNetAmount.HeaderText = "Line Amount"; + this.PurchaseOrderLineNetAmount.MinimumWidth = 80; + this.PurchaseOrderLineNetAmount.Name = "PurchaseOrderLineNetAmount"; + this.PurchaseOrderLineNetAmount.ReadOnly = true; + // + // InvoicedAmount + // + this.InvoicedAmount.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; + this.InvoicedAmount.DataPropertyName = "InvoicedAmount"; + this.InvoicedAmount.FillWeight = 50F; + this.InvoicedAmount.HeaderText = "Invoiced"; + this.InvoicedAmount.MinimumWidth = 80; + this.InvoicedAmount.Name = "InvoicedAmount"; + this.InvoicedAmount.ReadOnly = true; + // + // PurchaseOrderLineFacility + // + this.PurchaseOrderLineFacility.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; + this.PurchaseOrderLineFacility.DataPropertyName = "PurchaseOrderLineFacility"; + this.PurchaseOrderLineFacility.FillWeight = 50F; + this.PurchaseOrderLineFacility.HeaderText = "Facility"; + this.PurchaseOrderLineFacility.MinimumWidth = 80; + this.PurchaseOrderLineFacility.Name = "PurchaseOrderLineFacility"; + this.PurchaseOrderLineFacility.ReadOnly = true; + // + // WorkNumber + // + this.WorkNumber.DataPropertyName = "WorkNumber"; + this.WorkNumber.HeaderText = "WorkNumber"; + this.WorkNumber.MinimumWidth = 80; + this.WorkNumber.Name = "WorkNumber"; + this.WorkNumber.ReadOnly = true; + // + // ProjectTitle + // + this.ProjectTitle.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; + this.ProjectTitle.DataPropertyName = "ProjectTitle"; + this.ProjectTitle.FillWeight = 200F; + this.ProjectTitle.HeaderText = "Project"; + this.ProjectTitle.MinimumWidth = 100; + this.ProjectTitle.Name = "ProjectTitle"; + this.ProjectTitle.ReadOnly = true; + // + // purchaseOrderAllocationBindingSource + // + this.purchaseOrderAllocationBindingSource.AllowNew = false; + this.purchaseOrderAllocationBindingSource.DataSource = typeof(BealeEngineering.Core.Model.Client.PurchaseOrderAllocation); + // + // tabControl1 + // + this.tabControl1.Controls.Add(this.tabClientPoAllocation); + this.tabControl1.Controls.Add(this.tabSaleInvoice); + this.tabControl1.Controls.Add(this.tabClientPo); + this.tabControl1.Controls.Add(this.tabProjectWork); + this.tabControl1.Dock = System.Windows.Forms.DockStyle.Fill; + this.tabControl1.Location = new System.Drawing.Point(0, 24); + this.tabControl1.Name = "tabControl1"; + this.tabControl1.SelectedIndex = 0; + this.tabControl1.Size = new System.Drawing.Size(1151, 721); + this.tabControl1.TabIndex = 5; + this.tabControl1.SelectedIndexChanged += new System.EventHandler(this.tabControl1_SelectedIndexChanged); + // + // tabProjectWork + // + this.tabProjectWork.Controls.Add(this.splitContainer4); + this.tabProjectWork.Location = new System.Drawing.Point(4, 22); + this.tabProjectWork.Name = "tabProjectWork"; + this.tabProjectWork.Padding = new System.Windows.Forms.Padding(3); + this.tabProjectWork.Size = new System.Drawing.Size(1143, 695); + this.tabProjectWork.TabIndex = 4; + this.tabProjectWork.Text = "Project Work"; + this.tabProjectWork.UseVisualStyleBackColor = true; + // + // splitContainer4 + // + this.splitContainer4.Dock = System.Windows.Forms.DockStyle.Fill; + this.splitContainer4.Location = new System.Drawing.Point(3, 3); + this.splitContainer4.Name = "splitContainer4"; + this.splitContainer4.Orientation = System.Windows.Forms.Orientation.Horizontal; + // + // splitContainer4.Panel1 + // + this.splitContainer4.Panel1.Controls.Add(this.button4); + this.splitContainer4.Panel1.Controls.Add(this.button5); + this.splitContainer4.Panel1.Controls.Add(this.button6); + // + // splitContainer4.Panel2 + // + this.splitContainer4.Panel2.Controls.Add(this.dataGridView4); + this.splitContainer4.Size = new System.Drawing.Size(1137, 689); + this.splitContainer4.SplitterDistance = 93; + this.splitContainer4.TabIndex = 0; + // + // button4 + // + this.button4.Anchor = System.Windows.Forms.AnchorStyles.Right; + this.button4.Location = new System.Drawing.Point(25, 29); + this.button4.Name = "button4"; + this.button4.Size = new System.Drawing.Size(92, 20); + this.button4.TabIndex = 15; + this.button4.Text = "New"; + this.button4.UseVisualStyleBackColor = true; + this.button4.Click += new System.EventHandler(this.button4_Click); + // + // button5 + // + this.button5.Location = new System.Drawing.Point(25, 55); + this.button5.Name = "button5"; + this.button5.Size = new System.Drawing.Size(92, 20); + this.button5.TabIndex = 14; + this.button5.Text = "Open"; + this.button5.UseVisualStyleBackColor = true; + this.button5.Click += new System.EventHandler(this.button5_Click); + // + // button6 + // + this.button6.Anchor = System.Windows.Forms.AnchorStyles.Right; + this.button6.Location = new System.Drawing.Point(1035, 55); + this.button6.Name = "button6"; + this.button6.Size = new System.Drawing.Size(75, 20); + this.button6.TabIndex = 5; + this.button6.Text = "Refresh"; + this.button6.UseVisualStyleBackColor = true; + this.button6.Click += new System.EventHandler(this.btnRefreshProjectWork_Click); + // + // dataGridView4 + // + this.dataGridView4.AllowUserToAddRows = false; + this.dataGridView4.AllowUserToDeleteRows = false; + this.dataGridView4.AutoGenerateColumns = false; + this.dataGridView4.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; + this.dataGridView4.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { + this.workNumberDataGridViewTextBoxColumn, + this.workItemClientDataGridViewTextBoxColumn, + this.dataGridViewTextBoxColumn1, + this.dataGridViewTextBoxColumn3, + this.workItemTitleDataGridViewTextBoxColumn, + this.workItemDateStartDataGridViewTextBoxColumn, + this.workItemDateEndDataGridViewTextBoxColumn, + this.workItemIsArchivedDataGridViewTextBoxColumn}); + this.dataGridView4.DataSource = this.projectWorkItemBindingSource; + this.dataGridView4.Dock = System.Windows.Forms.DockStyle.Fill; + this.dataGridView4.Location = new System.Drawing.Point(0, 0); + this.dataGridView4.Name = "dataGridView4"; + this.dataGridView4.ReadOnly = true; + this.dataGridView4.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect; + this.dataGridView4.Size = new System.Drawing.Size(1137, 592); + this.dataGridView4.TabIndex = 0; + // + // workNumberDataGridViewTextBoxColumn + // + this.workNumberDataGridViewTextBoxColumn.DataPropertyName = "WorkNumber"; + this.workNumberDataGridViewTextBoxColumn.HeaderText = "Work Number"; + this.workNumberDataGridViewTextBoxColumn.MinimumWidth = 90; + this.workNumberDataGridViewTextBoxColumn.Name = "workNumberDataGridViewTextBoxColumn"; + this.workNumberDataGridViewTextBoxColumn.ReadOnly = true; + this.workNumberDataGridViewTextBoxColumn.Width = 90; + // + // workItemClientDataGridViewTextBoxColumn + // + this.workItemClientDataGridViewTextBoxColumn.DataPropertyName = "WorkItemClient"; + this.workItemClientDataGridViewTextBoxColumn.HeaderText = "Client"; + this.workItemClientDataGridViewTextBoxColumn.MinimumWidth = 150; + this.workItemClientDataGridViewTextBoxColumn.Name = "workItemClientDataGridViewTextBoxColumn"; + this.workItemClientDataGridViewTextBoxColumn.ReadOnly = true; + this.workItemClientDataGridViewTextBoxColumn.Width = 150; + // + // dataGridViewTextBoxColumn1 + // + this.dataGridViewTextBoxColumn1.DataPropertyName = "ProjectNumber"; + this.dataGridViewTextBoxColumn1.HeaderText = "Project No."; + this.dataGridViewTextBoxColumn1.MinimumWidth = 80; + this.dataGridViewTextBoxColumn1.Name = "dataGridViewTextBoxColumn1"; + this.dataGridViewTextBoxColumn1.ReadOnly = true; + this.dataGridViewTextBoxColumn1.Width = 80; + // + // dataGridViewTextBoxColumn3 + // + this.dataGridViewTextBoxColumn3.DataPropertyName = "ProjectTitle"; + this.dataGridViewTextBoxColumn3.HeaderText = "Project"; + this.dataGridViewTextBoxColumn3.MinimumWidth = 200; + this.dataGridViewTextBoxColumn3.Name = "dataGridViewTextBoxColumn3"; + this.dataGridViewTextBoxColumn3.ReadOnly = true; + this.dataGridViewTextBoxColumn3.Width = 200; + // + // workItemTitleDataGridViewTextBoxColumn + // + this.workItemTitleDataGridViewTextBoxColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; + this.workItemTitleDataGridViewTextBoxColumn.DataPropertyName = "WorkItemTitle"; + this.workItemTitleDataGridViewTextBoxColumn.HeaderText = "Work Item Title"; + this.workItemTitleDataGridViewTextBoxColumn.MinimumWidth = 200; + this.workItemTitleDataGridViewTextBoxColumn.Name = "workItemTitleDataGridViewTextBoxColumn"; + this.workItemTitleDataGridViewTextBoxColumn.ReadOnly = true; + // + // workItemDateStartDataGridViewTextBoxColumn + // + this.workItemDateStartDataGridViewTextBoxColumn.DataPropertyName = "WorkItemDateStart"; + this.workItemDateStartDataGridViewTextBoxColumn.HeaderText = "Start Date"; + this.workItemDateStartDataGridViewTextBoxColumn.MinimumWidth = 90; + this.workItemDateStartDataGridViewTextBoxColumn.Name = "workItemDateStartDataGridViewTextBoxColumn"; + this.workItemDateStartDataGridViewTextBoxColumn.ReadOnly = true; + this.workItemDateStartDataGridViewTextBoxColumn.Width = 90; + // + // workItemDateEndDataGridViewTextBoxColumn + // + this.workItemDateEndDataGridViewTextBoxColumn.DataPropertyName = "WorkItemDateEnd"; + this.workItemDateEndDataGridViewTextBoxColumn.HeaderText = "End Date"; + this.workItemDateEndDataGridViewTextBoxColumn.MinimumWidth = 90; + this.workItemDateEndDataGridViewTextBoxColumn.Name = "workItemDateEndDataGridViewTextBoxColumn"; + this.workItemDateEndDataGridViewTextBoxColumn.ReadOnly = true; + this.workItemDateEndDataGridViewTextBoxColumn.Width = 90; + // + // workItemIsArchivedDataGridViewTextBoxColumn + // + this.workItemIsArchivedDataGridViewTextBoxColumn.DataPropertyName = "WorkItemIsArchived"; + this.workItemIsArchivedDataGridViewTextBoxColumn.HeaderText = "Archived"; + this.workItemIsArchivedDataGridViewTextBoxColumn.MinimumWidth = 70; + this.workItemIsArchivedDataGridViewTextBoxColumn.Name = "workItemIsArchivedDataGridViewTextBoxColumn"; + this.workItemIsArchivedDataGridViewTextBoxColumn.ReadOnly = true; + this.workItemIsArchivedDataGridViewTextBoxColumn.Width = 70; + // + // projectWorkItemBindingSource + // + this.projectWorkItemBindingSource.DataSource = typeof(BealeEngineering.Core.Model.Project.ProjectWorkItem); + // + // saleInvoiceIDDataGridViewTextBoxColumn + // + this.saleInvoiceIDDataGridViewTextBoxColumn.DataPropertyName = "SaleInvoiceID"; + this.saleInvoiceIDDataGridViewTextBoxColumn.HeaderText = "SaleInvoiceID"; + this.saleInvoiceIDDataGridViewTextBoxColumn.Name = "saleInvoiceIDDataGridViewTextBoxColumn"; + this.saleInvoiceIDDataGridViewTextBoxColumn.ReadOnly = true; + // + // contactNameDataGridViewTextBoxColumn2 + // + this.contactNameDataGridViewTextBoxColumn2.DataPropertyName = "ContactName"; + this.contactNameDataGridViewTextBoxColumn2.HeaderText = "ContactName"; + this.contactNameDataGridViewTextBoxColumn2.Name = "contactNameDataGridViewTextBoxColumn2"; + this.contactNameDataGridViewTextBoxColumn2.ReadOnly = true; + // + // saleInvoiceNumberDataGridViewTextBoxColumn + // + this.saleInvoiceNumberDataGridViewTextBoxColumn.DataPropertyName = "SaleInvoiceNumber"; + this.saleInvoiceNumberDataGridViewTextBoxColumn.HeaderText = "SaleInvoiceNumber"; + this.saleInvoiceNumberDataGridViewTextBoxColumn.Name = "saleInvoiceNumberDataGridViewTextBoxColumn"; + this.saleInvoiceNumberDataGridViewTextBoxColumn.ReadOnly = true; + // + // invoiceDateDataGridViewTextBoxColumn + // + this.invoiceDateDataGridViewTextBoxColumn.DataPropertyName = "InvoiceDate"; + this.invoiceDateDataGridViewTextBoxColumn.HeaderText = "InvoiceDate"; + this.invoiceDateDataGridViewTextBoxColumn.Name = "invoiceDateDataGridViewTextBoxColumn"; + this.invoiceDateDataGridViewTextBoxColumn.ReadOnly = true; + // + // dueDateDataGridViewTextBoxColumn + // + this.dueDateDataGridViewTextBoxColumn.DataPropertyName = "DueDate"; + this.dueDateDataGridViewTextBoxColumn.HeaderText = "DueDate"; + this.dueDateDataGridViewTextBoxColumn.Name = "dueDateDataGridViewTextBoxColumn"; + this.dueDateDataGridViewTextBoxColumn.ReadOnly = true; + // + // referenceDataGridViewTextBoxColumn + // + this.referenceDataGridViewTextBoxColumn.DataPropertyName = "Reference"; + this.referenceDataGridViewTextBoxColumn.HeaderText = "Reference"; + this.referenceDataGridViewTextBoxColumn.Name = "referenceDataGridViewTextBoxColumn"; + this.referenceDataGridViewTextBoxColumn.ReadOnly = true; + // + // currencyCodeDataGridViewTextBoxColumn + // + this.currencyCodeDataGridViewTextBoxColumn.DataPropertyName = "CurrencyCode"; + this.currencyCodeDataGridViewTextBoxColumn.HeaderText = "CurrencyCode"; + this.currencyCodeDataGridViewTextBoxColumn.Name = "currencyCodeDataGridViewTextBoxColumn"; + this.currencyCodeDataGridViewTextBoxColumn.ReadOnly = true; + // + // invoiceTotalDataGridViewTextBoxColumn + // + this.invoiceTotalDataGridViewTextBoxColumn.DataPropertyName = "InvoiceTotal"; + this.invoiceTotalDataGridViewTextBoxColumn.HeaderText = "InvoiceTotal"; + this.invoiceTotalDataGridViewTextBoxColumn.Name = "invoiceTotalDataGridViewTextBoxColumn"; + this.invoiceTotalDataGridViewTextBoxColumn.ReadOnly = true; + // + // invoiceNetTotalDataGridViewTextBoxColumn + // + this.invoiceNetTotalDataGridViewTextBoxColumn.DataPropertyName = "InvoiceNetTotal"; + this.invoiceNetTotalDataGridViewTextBoxColumn.HeaderText = "InvoiceNetTotal"; + this.invoiceNetTotalDataGridViewTextBoxColumn.Name = "invoiceNetTotalDataGridViewTextBoxColumn"; + this.invoiceNetTotalDataGridViewTextBoxColumn.ReadOnly = true; + // + // taxTotalDataGridViewTextBoxColumn + // + this.taxTotalDataGridViewTextBoxColumn.DataPropertyName = "TaxTotal"; + this.taxTotalDataGridViewTextBoxColumn.HeaderText = "TaxTotal"; + this.taxTotalDataGridViewTextBoxColumn.Name = "taxTotalDataGridViewTextBoxColumn"; + this.taxTotalDataGridViewTextBoxColumn.ReadOnly = true; + // + // isCreditNoteDataGridViewCheckBoxColumn + // + this.isCreditNoteDataGridViewCheckBoxColumn.DataPropertyName = "IsCreditNote"; + this.isCreditNoteDataGridViewCheckBoxColumn.HeaderText = "IsCreditNote"; + this.isCreditNoteDataGridViewCheckBoxColumn.Name = "isCreditNoteDataGridViewCheckBoxColumn"; + this.isCreditNoteDataGridViewCheckBoxColumn.ReadOnly = true; + // + // statusDataGridViewTextBoxColumn + // + this.statusDataGridViewTextBoxColumn.DataPropertyName = "Status"; + this.statusDataGridViewTextBoxColumn.HeaderText = "Status"; + this.statusDataGridViewTextBoxColumn.Name = "statusDataGridViewTextBoxColumn"; + this.statusDataGridViewTextBoxColumn.ReadOnly = true; // // frmMain // @@ -695,26 +1109,40 @@ this.Name = "frmMain"; this.Text = "Form1"; this.Load += new System.EventHandler(this.Form1_Load); - this.tabControl1.ResumeLayout(false); - this.tabPage1.ResumeLayout(false); - this.splitContainer3.Panel1.ResumeLayout(false); - this.splitContainer3.Panel1.PerformLayout(); - this.splitContainer3.Panel2.ResumeLayout(false); - ((System.ComponentModel.ISupportInitialize)(this.splitContainer3)).EndInit(); - this.splitContainer3.ResumeLayout(false); ((System.ComponentModel.ISupportInitialize)(this.invoiceHeaderBindingSource1)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.purchaseOrderAllocationBindingSource)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.bindingSourceSaleInvoice)).EndInit(); + this.menuStrip1.ResumeLayout(false); + this.menuStrip1.PerformLayout(); + ((System.ComponentModel.ISupportInitialize)(this.invoiceHeaderBindingSource)).EndInit(); + this.tabClientPo.ResumeLayout(false); + this.splitContainer2.Panel1.ResumeLayout(false); + this.splitContainer2.Panel2.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.splitContainer2)).EndInit(); + this.splitContainer2.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.dataGridView3)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.purchaseOrderBindingSource)).EndInit(); this.tabSaleInvoice.ResumeLayout(false); this.splitContainer1.Panel1.ResumeLayout(false); this.splitContainer1.Panel2.ResumeLayout(false); ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).EndInit(); this.splitContainer1.ResumeLayout(false); ((System.ComponentModel.ISupportInitialize)(this.dataGridView2)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.bindingSourceSaleInvoice)).EndInit(); - this.menuStrip1.ResumeLayout(false); - this.menuStrip1.PerformLayout(); - ((System.ComponentModel.ISupportInitialize)(this.invoiceHeaderBindingSource)).EndInit(); + this.tabClientPoAllocation.ResumeLayout(false); + this.splitContainer3.Panel1.ResumeLayout(false); + this.splitContainer3.Panel1.PerformLayout(); + this.splitContainer3.Panel2.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.splitContainer3)).EndInit(); + this.splitContainer3.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.purchaseOrderAllocationBindingSource)).EndInit(); + this.tabControl1.ResumeLayout(false); + this.tabProjectWork.ResumeLayout(false); + this.splitContainer4.Panel1.ResumeLayout(false); + this.splitContainer4.Panel2.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.splitContainer4)).EndInit(); + this.splitContainer4.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.dataGridView4)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.projectWorkItemBindingSource)).EndInit(); this.ResumeLayout(false); this.PerformLayout(); @@ -722,14 +1150,6 @@ #endregion private System.Windows.Forms.BindingSource purchaseOrderAllocationBindingSource; - private System.Windows.Forms.TabControl tabControl1; - private System.Windows.Forms.TabPage tabPage1; - private System.Windows.Forms.SplitContainer splitContainer3; - private System.Windows.Forms.Button button1; - private System.Windows.Forms.Label label1; - private System.Windows.Forms.Label label2; - private System.Windows.Forms.TextBox txtInvoiceImportDt; - private System.Windows.Forms.DataGridView dataGridView1; private System.Windows.Forms.MenuStrip menuStrip1; private System.Windows.Forms.ToolStripMenuItem fileToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem importToolStripMenuItem; @@ -737,35 +1157,27 @@ private System.Windows.Forms.ToolStripMenuItem testToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem testItToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem exportToolStripMenuItem; - private System.Windows.Forms.ToolStripMenuItem xeroInvoiceToolStripMenuItem1; - private System.Windows.Forms.Button btnAutoMatch; - private System.Windows.Forms.Button btnAddPurchaseOrder; - private System.Windows.Forms.Button btnOpenPurchaseOrder; - private System.Windows.Forms.TabPage tabSaleInvoice; - private System.Windows.Forms.SplitContainer splitContainer1; - private System.Windows.Forms.DataGridView dataGridView2; + private System.Windows.Forms.ToolStripMenuItem excelInvoiceToolStripMenuItem; private System.Windows.Forms.BindingSource bindingSourceSaleInvoice; - private System.Windows.Forms.Button btnRefreshSaleInvoice; - private System.Windows.Forms.ComboBox cmbInvoicePick; private System.Windows.Forms.BindingSource invoiceHeaderBindingSource; private System.Windows.Forms.BindingSource invoiceHeaderBindingSource1; - private System.Windows.Forms.Button btnOpenInvoice; - private System.Windows.Forms.TextBox txtInvoiceStatus; - private System.Windows.Forms.TextBox txtInvoiceNetAmount; - private System.Windows.Forms.TextBox txtInvoiceContact; - private System.Windows.Forms.DataGridViewTextBoxColumn ContactName; - private System.Windows.Forms.DataGridViewTextBoxColumn ProjectTitle; - private System.Windows.Forms.DataGridViewTextBoxColumn PurchaseOrderDate; - private System.Windows.Forms.DataGridViewTextBoxColumn PurchaseOrderReference; - private System.Windows.Forms.DataGridViewTextBoxColumn PurchaseOrderLineNumber; - private System.Windows.Forms.DataGridViewTextBoxColumn PurchaseOrderLineDescription; - private System.Windows.Forms.DataGridViewTextBoxColumn PurchaseOrderLineNetAmount; - private System.Windows.Forms.DataGridViewTextBoxColumn InvoicedAmount; - private System.Windows.Forms.DataGridViewTextBoxColumn PurchaseOrderLineFacility; - private System.Windows.Forms.DataGridViewTextBoxColumn JobNumber; - private System.Windows.Forms.DataGridViewTextBoxColumn PurchaseOrderLineID; - private System.Windows.Forms.Button btnAssign; + private System.Windows.Forms.TabPage tabClientPo; + private System.Windows.Forms.SplitContainer splitContainer2; + private System.Windows.Forms.Button button2; + private System.Windows.Forms.Button button3; + private System.Windows.Forms.DataGridView dataGridView3; + private System.Windows.Forms.DataGridViewTextBoxColumn clientPurchaseOrderIDDataGridViewTextBoxColumn; + private System.Windows.Forms.DataGridViewTextBoxColumn purchaseOrderDateDataGridViewTextBoxColumn; + private System.Windows.Forms.DataGridViewTextBoxColumn contactNameDataGridViewTextBoxColumn1; + private System.Windows.Forms.DataGridViewTextBoxColumn clientReferenceDataGridViewTextBoxColumn; + private System.Windows.Forms.DataGridViewTextBoxColumn orderTotalDataGridViewTextBoxColumn; + private System.Windows.Forms.DataGridViewCheckBoxColumn isClosedDataGridViewCheckBoxColumn; + private System.Windows.Forms.BindingSource purchaseOrderBindingSource; + private System.Windows.Forms.TabPage tabSaleInvoice; + private System.Windows.Forms.SplitContainer splitContainer1; private System.Windows.Forms.Button btnOpenInv; + private System.Windows.Forms.Button btnRefreshSaleInvoice; + private System.Windows.Forms.DataGridView dataGridView2; private System.Windows.Forms.DataGridViewTextBoxColumn saleInvoice; private System.Windows.Forms.DataGridViewTextBoxColumn saleInvoiceNumber; private System.Windows.Forms.DataGridViewTextBoxColumn contactNameDataGridViewTextBoxColumn; @@ -776,6 +1188,69 @@ private System.Windows.Forms.DataGridViewTextBoxColumn currencyCode; private System.Windows.Forms.DataGridViewTextBoxColumn TotalAndCurrency; private System.Windows.Forms.DataGridViewTextBoxColumn status; + private System.Windows.Forms.TabPage tabClientPoAllocation; + private System.Windows.Forms.SplitContainer splitContainer3; + private System.Windows.Forms.Button btnAssign; + private System.Windows.Forms.TextBox txtInvoiceStatus; + private System.Windows.Forms.TextBox txtInvoiceNetAmount; + private System.Windows.Forms.TextBox txtInvoiceContact; + private System.Windows.Forms.Button btnOpenInvoice; + private System.Windows.Forms.ComboBox cmbInvoicePick; + private System.Windows.Forms.Button button1; + private System.Windows.Forms.Label label1; + private System.Windows.Forms.Label label2; + private System.Windows.Forms.TextBox txtInvoiceImportDt; + private System.Windows.Forms.DataGridView dataGridView1; + private System.Windows.Forms.TabControl tabControl1; + private System.Windows.Forms.Button btnAddPurchaseOrder; + private System.Windows.Forms.DataGridViewTextBoxColumn JobNumber; + private System.Windows.Forms.TabPage tabProjectWork; + private System.Windows.Forms.SplitContainer splitContainer4; + private System.Windows.Forms.Button button4; + private System.Windows.Forms.Button button5; + private System.Windows.Forms.Button button6; + private System.Windows.Forms.DataGridView dataGridView4; + private System.Windows.Forms.DataGridViewTextBoxColumn saleInvoiceIDDataGridViewTextBoxColumn; + private System.Windows.Forms.DataGridViewTextBoxColumn contactNameDataGridViewTextBoxColumn2; + private System.Windows.Forms.DataGridViewTextBoxColumn saleInvoiceNumberDataGridViewTextBoxColumn; + private System.Windows.Forms.DataGridViewTextBoxColumn invoiceDateDataGridViewTextBoxColumn; + private System.Windows.Forms.DataGridViewTextBoxColumn dueDateDataGridViewTextBoxColumn; + private System.Windows.Forms.DataGridViewTextBoxColumn referenceDataGridViewTextBoxColumn; + private System.Windows.Forms.DataGridViewTextBoxColumn currencyCodeDataGridViewTextBoxColumn; + private System.Windows.Forms.DataGridViewTextBoxColumn invoiceTotalDataGridViewTextBoxColumn; + private System.Windows.Forms.DataGridViewTextBoxColumn invoiceNetTotalDataGridViewTextBoxColumn; + private System.Windows.Forms.DataGridViewTextBoxColumn taxTotalDataGridViewTextBoxColumn; + private System.Windows.Forms.DataGridViewCheckBoxColumn isCreditNoteDataGridViewCheckBoxColumn; + private System.Windows.Forms.DataGridViewTextBoxColumn statusDataGridViewTextBoxColumn; + private System.Windows.Forms.DataGridViewCheckBoxColumn projectWorkItemListIsSetDataGridViewCheckBoxColumn; + private System.Windows.Forms.DataGridViewTextBoxColumn projectNumberDataGridViewTextBoxColumn; + private System.Windows.Forms.DataGridViewTextBoxColumn projectClientDataGridViewTextBoxColumn; + private System.Windows.Forms.DataGridViewTextBoxColumn projectReferenceDataGridViewTextBoxColumn; + private System.Windows.Forms.DataGridViewTextBoxColumn projectTitleDataGridViewTextBoxColumn; + private System.Windows.Forms.DataGridViewTextBoxColumn dateStartDataGridViewTextBoxColumn; + private System.Windows.Forms.DataGridViewTextBoxColumn dateEndDataGridViewTextBoxColumn; + private System.Windows.Forms.DataGridViewTextBoxColumn isArchivedDataGridViewTextBoxColumn; + private System.Windows.Forms.BindingSource projectWorkItemBindingSource; + private System.Windows.Forms.DataGridViewTextBoxColumn PurchaseOrderLineID; + private System.Windows.Forms.DataGridViewTextBoxColumn ContactName; + private System.Windows.Forms.DataGridViewTextBoxColumn PurchaseOrderDate; + private System.Windows.Forms.DataGridViewTextBoxColumn PurchaseOrderReference; + private System.Windows.Forms.DataGridViewTextBoxColumn PurchaseOrderLineNumber; + private System.Windows.Forms.DataGridViewTextBoxColumn PurchaseOrderLineDescription; + private System.Windows.Forms.DataGridViewTextBoxColumn PurchaseOrderLineNetAmount; + private System.Windows.Forms.DataGridViewTextBoxColumn InvoicedAmount; + private System.Windows.Forms.DataGridViewTextBoxColumn PurchaseOrderLineFacility; + private System.Windows.Forms.DataGridViewTextBoxColumn WorkNumber; + private System.Windows.Forms.DataGridViewTextBoxColumn ProjectTitle; + private System.Windows.Forms.DataGridViewTextBoxColumn workNumberDataGridViewTextBoxColumn; + private System.Windows.Forms.DataGridViewTextBoxColumn workItemClientDataGridViewTextBoxColumn; + private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn1; + private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn3; + private System.Windows.Forms.DataGridViewTextBoxColumn workItemTitleDataGridViewTextBoxColumn; + private System.Windows.Forms.DataGridViewTextBoxColumn workItemDateStartDataGridViewTextBoxColumn; + private System.Windows.Forms.DataGridViewTextBoxColumn workItemDateEndDataGridViewTextBoxColumn; + private System.Windows.Forms.DataGridViewTextBoxColumn workItemIsArchivedDataGridViewTextBoxColumn; + private System.Windows.Forms.ToolStripMenuItem xeroNewInvoiceToolStripMenuItem; } } diff --git a/BealeEngineering/BealeEngineering.Accounts/frmMain.cs b/BealeEngineering/BealeEngineering.Accounts/frmMain.cs index 7ab40bd..5f76bcd 100644 --- a/BealeEngineering/BealeEngineering.Accounts/frmMain.cs +++ b/BealeEngineering/BealeEngineering.Accounts/frmMain.cs @@ -15,6 +15,10 @@ namespace BealeEngineering.Accounts public partial class frmMain : Form { private string sqlConnectionString; + private bool isDirtyInvoiceAllocation = true; + private bool isDirtySaleInvoice = true; + private bool isDirtyClientPo = true; + private bool isDirtyProjectWork = true; Core.Logic.Sale.SaleInvoiceAssign assignInvoice; @@ -30,8 +34,45 @@ namespace BealeEngineering.Accounts private void Form1_Load(object sender, EventArgs e) { - button1_Click(null, null); + RefreshTabInvoiceAllocation(); + } + + private void TabSetAllIsDirty() + { + isDirtyInvoiceAllocation = true; + isDirtySaleInvoice = true; + isDirtyClientPo = true; + isDirtyProjectWork = true; + + tabControl1_SelectedIndexChanged(null, null); + } + + private void tabControl1_SelectedIndexChanged(object sender, EventArgs e) + { + if (tabControl1.SelectedTab == tabControl1.TabPages["tabClientPoAllocation"] && isDirtyInvoiceAllocation) + { + btnRefreshInvAllocation_Click(null, null); + } + else if (tabControl1.SelectedTab == tabControl1.TabPages["tabSaleInvoice"] && isDirtySaleInvoice) + { + btnRefreshSaleInvoice_Click(null, null); + } + else if (tabControl1.SelectedTab == tabControl1.TabPages["tabClientPo"] && isDirtyClientPo) + { + btnRefreshClientPo_Click(null, null); + } + else if (tabControl1.SelectedTab == tabControl1.TabPages["tabProjectWork"] && isDirtyProjectWork) + { + btnRefreshProjectWork_Click(null, null); + } + } + + private void RefreshTabInvoiceAllocation() + { + btnRefreshInvAllocation_Click(null, null); UpdateInvoiceCombo(); + UpdateInvoiceImportText(); + isDirtyInvoiceAllocation = false; } private void cmbInvoicePick_SelectedIndexChanged(object sender, EventArgs e) @@ -69,18 +110,12 @@ namespace BealeEngineering.Accounts frmInvoice.ShowDialog(); } - private void button1_Click(object sender, EventArgs e) + private void btnRefreshInvAllocation_Click(object sender, EventArgs e) { var readData = new Core.Data.Database.Client.ReadPurchaseOrderAllocation(sqlConnectionString); var data = readData.Read(); - purchaseOrderAllocationBindingSource.DataSource = data.OrderBy(x => x.JobNumber).ThenBy(x => x.PurchaseOrderDate); - - //purchaseOrderAllocationBindingSource.DataSource = data; - - //sort order - //dataGridView1.Sort(dataGridView1.Columns["purchaseOrderDate"], ListSortDirection.Ascending); - //dataGridView1.Sort(dataGridView1.Columns["jobNumber"], ListSortDirection.Ascending); + purchaseOrderAllocationBindingSource.DataSource = data.OrderBy(x => x.WorkNumber).ThenBy(x => x.PurchaseOrderDate); // high light over invoiced lines int facilityIndex = dataGridView1.Columns["PurchaseOrderLineFacility"].Index; @@ -118,28 +153,7 @@ namespace BealeEngineering.Accounts private void dataGridView1_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { - string poNumber = dataGridView1.Rows[e.RowIndex].Cells[6].Value.ToString(); - bool multiPoLine = false; - for (var i = 0; i < dataGridView1.Rows.Count; i++ ) - { - if (i == e.RowIndex) { continue; } - else if (dataGridView1.Rows[i].Cells[6].Value.ToString() == poNumber) - { - multiPoLine = true; - break; - } - } - if (multiPoLine) - { - poNumber = poNumber + "-" + dataGridView1.Rows[e.RowIndex].Cells[7].Value.ToString().PadLeft(3, '0'); - } - - var dataIndexNo = dataGridView1.Rows[e.RowIndex].Index.ToString(); - string cellValue = dataGridView1.Rows[e.RowIndex].Cells[1].Value.ToString(); - - Clipboard.SetText(poNumber); - - MessageBox.Show(poNumber); + btnOpenPurchaseOrder_Click(null, null); } private void label1_Click(object sender, EventArgs e) @@ -215,7 +229,8 @@ namespace BealeEngineering.Accounts MessageBox.Show(dialogText); } - UpdateInvoiceImportText(); + + TabSetAllIsDirty(); } private void xeroInvoiceToolStripMenuItem1_Click(object sender, EventArgs e) @@ -229,7 +244,7 @@ namespace BealeEngineering.Accounts DialogResult dialogResult = MessageBox.Show(dialogText, "Export Xero Invoice flat-file", MessageBoxButtons.OKCancel); if (dialogResult == DialogResult.OK) { - var exportXeroInvoice = new BealeEngineering.Core.Logic.Export.XeroInvoiceFlatFile(sqlConnectionString); + var exportXeroInvoice = new BealeEngineering.Core.Logic.Export.ExcelInvoiceFlatFile(sqlConnectionString); exportXeroInvoice.FileOutputPath = filePath; exportXeroInvoice.Execute(); @@ -257,7 +272,7 @@ namespace BealeEngineering.Accounts MessageBox.Show(dialogText); } - button1_Click(null, null); + btnRefreshInvAllocation_Click(null, null); } private void purchaseOrderAllocationBindingSource_CurrentChanged(object sender, EventArgs e) @@ -267,7 +282,7 @@ namespace BealeEngineering.Accounts private void btnAddPurchaseOrder_Click(object sender, EventArgs e) { - var frmCLient = new frmClientPurchaseOrder(null); + var frmCLient = new frmClientPurchaseOrder(sqlConnectionString, null); frmCLient.ShowDialog(); } @@ -280,8 +295,9 @@ namespace BealeEngineering.Accounts private void btnOpenPurchaseOrder_Click(object sender, EventArgs e) { - var frmPo = new frmClientPurchaseOrder(GetSelectPurchaseOrder()); + var frmPo = new frmClientPurchaseOrder(sqlConnectionString, GetSelectPurchaseOrder()); frmPo.ShowDialog(); + btnRefreshInvAllocation_Click(null, null); } private void dataGridView2_CellFormatting(object sender, DataGridViewCellFormattingEventArgs e) @@ -298,15 +314,14 @@ namespace BealeEngineering.Accounts private void btnRefreshSaleInvoice_Click(object sender, EventArgs e) { - // update text box var invoiceRead = new Core.Data.Database.Sale.ReadInvoiceHeader(sqlConnectionString); var invoiceData = invoiceRead.Read(); - //bindingSourceSaleInvoice.DataSource = invoiceData.OrderByDescending(x => x.SaleInvoiceNumber); - bindingSourceSaleInvoice.DataSource = invoiceData.OrderByDescending(x => x.SaleInvoiceNumber .Substring(x.SaleInvoiceNumber.IndexOf("#") + 1, x.SaleInvoiceNumber.Length - x.SaleInvoiceNumber.IndexOf("#") - 1)); + + isDirtySaleInvoice = false; } private void btnAssign_Click(object sender, EventArgs e) @@ -368,8 +383,17 @@ namespace BealeEngineering.Accounts int lineIdIndex = dataGridView1.Columns["PurchaseOrderLineID"].Index; int lineId = (int)dataGridView1[lineIdIndex, dataGridView1.CurrentCell.RowIndex].Value; + try + { + Cursor.Current = Cursors.WaitCursor; + assignInvoice.ToPurchaseOrderLine(invoiceHeader.SaleInvoiceNumber, lineId); + } + finally + { + Cursor.Current = Cursors.Default; + } - assignInvoice.ToPurchaseOrderLine(invoiceHeader.SaleInvoiceNumber, lineId); + TabSetAllIsDirty(); } private void UpdateInvoiceImportText() @@ -389,6 +413,9 @@ namespace BealeEngineering.Accounts var frmInvoice = new frmSaleInvoice(currentSaleInvoice); frmInvoice.ShowDialog(); } + + isDirtySaleInvoice = true; + tabControl1_SelectedIndexChanged(null, null); } private void dataGridView2_CellContentClick(object sender, DataGridViewCellEventArgs e) @@ -396,17 +423,101 @@ namespace BealeEngineering.Accounts } - private void tabControl1_SelectedIndexChanged(object sender, EventArgs e) - { - if (tabControl1.SelectedTab == tabControl1.TabPages["tabSaleInvoice"] && dataGridView2.Rows.Count == 0) - { - btnRefreshSaleInvoice_Click(null, null); - } - } - private void dataGridView2_DoubleClick(object sender, EventArgs e) { btnOpenInv_Click(null, null); } + + private void btnRefreshClientPo_Click(object sender, EventArgs e) + { + var poRead = new Core.Data.Database.Client.ReadPurchaseOrderHeader(sqlConnectionString); + var poData = poRead.Read(); + + purchaseOrderBindingSource.DataSource= + poData.OrderByDescending(x => x.PurchaseOrderDate); + + isDirtyClientPo = false; + } + + private void btnOpenPo(object sender, EventArgs e) + { + int poId = (int)dataGridView3.Rows[dataGridView3.CurrentRow.Index].Cells[0].Value; + var po = new Core.Data.Database.Client.ReadPurchaseOrder(sqlConnectionString).ByPurchaseOrderId(poId); + + var frmPo = new frmClientPurchaseOrder(sqlConnectionString, po); + frmPo.ShowDialog(); + btnRefreshClientPo_Click(null, null); + + isDirtyClientPo = true; + tabControl1_SelectedIndexChanged(null, null); + } + + private void btnAddPurchaseOrder_Click_1(object sender, EventArgs e) + { + var frmPo = new frmClientPurchaseOrder(sqlConnectionString, null); + frmPo.ShowDialog(); + + isDirtyClientPo = true; + tabControl1_SelectedIndexChanged(null, null); + } + + private void btnRefreshProjectWork_Click(object sender, EventArgs e) + { + dataGridView4.DataSource = new Core.Data.Database.Project.ReadProjectWorkItem(sqlConnectionString).Read(); + + isDirtyProjectWork = false; + } + + private void xeroNewInvoiceToolStripMenuItem_Click(object sender, EventArgs e) + { + string newStatus = new Core.Data.SaleInvoiceFormat().ReadStatusStringNew(); + string fileInputPath = null; + + using (SaveFileDialog openFileDialog = new SaveFileDialog()) + { + openFileDialog.InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.UserProfile) + @"\Downloads"; + openFileDialog.FileName = "Xero-" + newStatus + "-Invoices.csv"; + openFileDialog.Filter = ".csv files (*.csv)|*.csv|All files (*.*)|*.*"; + openFileDialog.FilterIndex = 1; + openFileDialog.RestoreDirectory = true; + + if (openFileDialog.ShowDialog() == DialogResult.OK) + { + //Get the path of specified file + fileInputPath = openFileDialog.FileName; + } + else + { + return; + } + } + + if (fileInputPath != null) + { + var exportXeroInvoice = new BealeEngineering.Core.Logic.Export.XeroInvoiceFlatFile(sqlConnectionString); + try + { + Cursor.Current = Cursors.WaitCursor; + exportXeroInvoice.FileOutputPath = fileInputPath; + exportXeroInvoice.Execute(); + } + finally + { + Cursor.Current = Cursors.Default; + } + + MessageBox.Show("Complete. " + exportXeroInvoice.InvoicesExported + " invoice(s) exported."); + } + } + + private void button5_Click(object sender, EventArgs e) + { + + } + + private void button4_Click(object sender, EventArgs e) + { + + } } } diff --git a/BealeEngineering/BealeEngineering.Accounts/frmMain.resx b/BealeEngineering/BealeEngineering.Accounts/frmMain.resx index dce7018..1179737 100644 --- a/BealeEngineering/BealeEngineering.Accounts/frmMain.resx +++ b/BealeEngineering/BealeEngineering.Accounts/frmMain.resx @@ -120,24 +120,6 @@ 834, 24 - - True - - - 24, 20 - - - 834, 24 - - - True - - - 435, 24 - - - True - 435, 24 @@ -147,4 +129,43 @@ 626, 24 + + 17, 63 + + + 17, 63 + + + True + + + True + + + True + + + True + + + 24, 20 + + + True + + + True + + + 24, 20 + + + 228, 63 + + + 228, 63 + + + 93 + \ No newline at end of file diff --git a/BealeEngineering/BealeEngineering.Accounts/frmSaleInvoice.Designer.cs b/BealeEngineering/BealeEngineering.Accounts/frmSaleInvoice.Designer.cs index a61f6a2..873915c 100644 --- a/BealeEngineering/BealeEngineering.Accounts/frmSaleInvoice.Designer.cs +++ b/BealeEngineering/BealeEngineering.Accounts/frmSaleInvoice.Designer.cs @@ -39,6 +39,8 @@ System.Windows.Forms.Label saleInvoiceNumberLabel; System.Windows.Forms.Label statusLabel; System.Windows.Forms.Label taxTotalLabel; + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle(); this.contactNameTextBox = new System.Windows.Forms.TextBox(); this.bsInvoice = new System.Windows.Forms.BindingSource(this.components); this.currencyCodeTextBox = new System.Windows.Forms.TextBox(); @@ -58,7 +60,6 @@ this.dataGridViewTextBoxColumn7 = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.dataGridViewTextBoxColumn8 = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.dataGridViewTextBoxColumn9 = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.dataGridViewTextBoxColumn10 = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.splitContainer1 = new System.Windows.Forms.SplitContainer(); this.taxTotalTextBox = new System.Windows.Forms.TextBox(); contactNameLabel = new System.Windows.Forms.Label(); @@ -161,6 +162,15 @@ statusLabel.TabIndex = 16; statusLabel.Text = "Status:"; // + // taxTotalLabel + // + taxTotalLabel.AutoSize = true; + taxTotalLabel.Location = new System.Drawing.Point(517, 53); + taxTotalLabel.Name = "taxTotalLabel"; + taxTotalLabel.Size = new System.Drawing.Size(55, 13); + taxTotalLabel.TabIndex = 18; + taxTotalLabel.Text = "Tax Total:"; + // // contactNameTextBox // this.contactNameTextBox.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.bsInvoice, "ContactName", true)); @@ -249,6 +259,7 @@ this.invoiceLineListDataGridView.AllowUserToAddRows = false; this.invoiceLineListDataGridView.AllowUserToDeleteRows = false; this.invoiceLineListDataGridView.AutoGenerateColumns = false; + this.invoiceLineListDataGridView.AutoSizeRowsMode = System.Windows.Forms.DataGridViewAutoSizeRowsMode.AllCells; this.invoiceLineListDataGridView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; this.invoiceLineListDataGridView.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { this.dataGridViewTextBoxColumn1, @@ -257,9 +268,16 @@ this.dataGridViewTextBoxColumn5, this.dataGridViewTextBoxColumn7, this.dataGridViewTextBoxColumn8, - this.dataGridViewTextBoxColumn9, - this.dataGridViewTextBoxColumn10}); + this.dataGridViewTextBoxColumn9}); this.invoiceLineListDataGridView.DataSource = this.invoiceLineListBindingSource; + dataGridViewCellStyle2.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; + dataGridViewCellStyle2.BackColor = System.Drawing.SystemColors.Window; + dataGridViewCellStyle2.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + dataGridViewCellStyle2.ForeColor = System.Drawing.SystemColors.ControlText; + dataGridViewCellStyle2.SelectionBackColor = System.Drawing.SystemColors.Highlight; + dataGridViewCellStyle2.SelectionForeColor = System.Drawing.SystemColors.HighlightText; + dataGridViewCellStyle2.WrapMode = System.Windows.Forms.DataGridViewTriState.True; + this.invoiceLineListDataGridView.DefaultCellStyle = dataGridViewCellStyle2; this.invoiceLineListDataGridView.Dock = System.Windows.Forms.DockStyle.Fill; this.invoiceLineListDataGridView.Location = new System.Drawing.Point(0, 0); this.invoiceLineListDataGridView.Name = "invoiceLineListDataGridView"; @@ -280,6 +298,8 @@ // this.dataGridViewTextBoxColumn3.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; this.dataGridViewTextBoxColumn3.DataPropertyName = "Description"; + dataGridViewCellStyle1.WrapMode = System.Windows.Forms.DataGridViewTriState.True; + this.dataGridViewTextBoxColumn3.DefaultCellStyle = dataGridViewCellStyle1; this.dataGridViewTextBoxColumn3.HeaderText = "Description"; this.dataGridViewTextBoxColumn3.Name = "dataGridViewTextBoxColumn3"; this.dataGridViewTextBoxColumn3.ReadOnly = true; @@ -329,15 +349,6 @@ this.dataGridViewTextBoxColumn9.ReadOnly = true; this.dataGridViewTextBoxColumn9.Width = 50; // - // dataGridViewTextBoxColumn10 - // - this.dataGridViewTextBoxColumn10.DataPropertyName = "LineAmount"; - this.dataGridViewTextBoxColumn10.HeaderText = "Line Amount"; - this.dataGridViewTextBoxColumn10.MinimumWidth = 50; - this.dataGridViewTextBoxColumn10.Name = "dataGridViewTextBoxColumn10"; - this.dataGridViewTextBoxColumn10.ReadOnly = true; - this.dataGridViewTextBoxColumn10.Width = 50; - // // splitContainer1 // this.splitContainer1.Dock = System.Windows.Forms.DockStyle.Fill; @@ -377,15 +388,6 @@ this.splitContainer1.SplitterDistance = 175; this.splitContainer1.TabIndex = 19; // - // taxTotalLabel - // - taxTotalLabel.AutoSize = true; - taxTotalLabel.Location = new System.Drawing.Point(517, 53); - taxTotalLabel.Name = "taxTotalLabel"; - taxTotalLabel.Size = new System.Drawing.Size(55, 13); - taxTotalLabel.TabIndex = 18; - taxTotalLabel.Text = "Tax Total:"; - // // taxTotalTextBox // this.taxTotalTextBox.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.bsInvoice, "TaxTotal", true)); @@ -400,7 +402,10 @@ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.ClientSize = new System.Drawing.Size(800, 475); this.Controls.Add(this.splitContainer1); + this.MaximizeBox = false; + this.MinimizeBox = false; this.Name = "frmSaleInvoice"; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; this.Text = "SaleInvoice"; ((System.ComponentModel.ISupportInitialize)(this.bsInvoice)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.invoiceLineListBindingSource)).EndInit(); @@ -428,6 +433,9 @@ private System.Windows.Forms.TextBox statusTextBox; private System.Windows.Forms.BindingSource invoiceLineListBindingSource; private System.Windows.Forms.DataGridView invoiceLineListDataGridView; + private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn10; + private System.Windows.Forms.SplitContainer splitContainer1; + private System.Windows.Forms.TextBox taxTotalTextBox; private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn1; private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn3; private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn4; @@ -435,8 +443,5 @@ private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn7; private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn8; private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn9; - private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn10; - private System.Windows.Forms.SplitContainer splitContainer1; - private System.Windows.Forms.TextBox taxTotalTextBox; } } \ No newline at end of file diff --git a/BealeEngineering/BealeEngineering.Accounts/frmSaleInvoice.resx b/BealeEngineering/BealeEngineering.Accounts/frmSaleInvoice.resx index 8d4f78e..10d536f 100644 --- a/BealeEngineering/BealeEngineering.Accounts/frmSaleInvoice.resx +++ b/BealeEngineering/BealeEngineering.Accounts/frmSaleInvoice.resx @@ -144,8 +144,8 @@ False - - 69, 24 + + False 69, 24 @@ -153,7 +153,4 @@ 186, 27 - - False - \ No newline at end of file diff --git a/BealeEngineering/BealeEngineering.Core/BealeEngineering.Core.csproj b/BealeEngineering/BealeEngineering.Core/BealeEngineering.Core.csproj index 022cbb0..b843b09 100644 --- a/BealeEngineering/BealeEngineering.Core/BealeEngineering.Core.csproj +++ b/BealeEngineering/BealeEngineering.Core/BealeEngineering.Core.csproj @@ -60,25 +60,35 @@ + + + + + + + - + + - - + + + + @@ -96,8 +106,13 @@ + + + + + diff --git a/BealeEngineering/BealeEngineering.Core/Data/CurrencyFormat.cs b/BealeEngineering/BealeEngineering.Core/Data/CurrencyFormat.cs new file mode 100644 index 0000000..81f9a29 --- /dev/null +++ b/BealeEngineering/BealeEngineering.Core/Data/CurrencyFormat.cs @@ -0,0 +1,61 @@ +using System; +using System.Collections.Generic; +using System.Globalization; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace BealeEngineering.Core.Data +{ + public class CurrencyFormat + { + Dictionary dictionarySymbol = new Dictionary(); + Dictionary dictionaryCulture = new Dictionary(); + public CurrencyFormat() + { + dictionarySymbol.Add("GBP", "£"); + dictionarySymbol.Add("EUR", "€"); + dictionarySymbol.Add("USD", "$"); + + dictionaryCulture.Add("GBP", "en-GB"); + dictionaryCulture.Add("EUR", "fr-FR"); + dictionaryCulture.Add("USD", "en-US"); + } + + public string ReadCurrencySymbol(string currencyCode) + { + if (dictionarySymbol.ContainsKey(currencyCode)) + { + return dictionarySymbol[currencyCode]; + } + else + { + throw new Exception("Invalid currency code."); + } + } + + public string ReadCultureString(string currencyCode) + { + if (dictionaryCulture.ContainsKey(currencyCode)) + { + return dictionaryCulture[currencyCode]; + } + else + { + throw new Exception("Invalid currency code."); + } + } + + public CultureInfo ReadCulture(string currencyCode) + { + if (dictionaryCulture.ContainsKey(currencyCode)) + { + return new CultureInfo(dictionaryCulture[currencyCode]); + } + else + { + throw new Exception("Invalid currency code."); + } + } + } +} diff --git a/BealeEngineering/BealeEngineering.Core/Data/Database/Client/CreatePurchaseOrder.cs b/BealeEngineering/BealeEngineering.Core/Data/Database/Client/CreatePurchaseOrder.cs new file mode 100644 index 0000000..4ca299f --- /dev/null +++ b/BealeEngineering/BealeEngineering.Core/Data/Database/Client/CreatePurchaseOrder.cs @@ -0,0 +1,131 @@ +using System; +using System.Collections.Generic; +using System.Data.SqlClient; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Transactions; + +namespace BealeEngineering.Core.Data.Database.Client +{ + public class CreatePurchaseOrder : Connection + { + public CreatePurchaseOrder(string sqlConnectionString) : base(sqlConnectionString) + { + + } + + public void Create(Model.Client.PurchaseOrder purchaseOrder) + { + // validate + var validate = new Logic.Validate.CientPurchaseOrder(); + bool isValid = validate.IsValid(purchaseOrder); + if (!isValid) + { + if (validate.ValidationResults.Count == 1) + { + throw new Exception(validate.ValidationResults[0].ToString()); + } + else + { + throw new Exception("Validation failed."); + } + } + + using (var scope = new TransactionScope()) + { + using (SqlConnection conn = new SqlConnection(sqlConnectionString)) + { + conn.Open(); + + // insert header + int purchaseOrderId; + using (SqlCommand cmd = new SqlCommand(@" + INSERT INTO ClientPurchaseOrder + ( + PurchaseOrderDate + , ContactID + , ClientReference + , RequestorEmail + , OrderTotal + , IsClosed + ) + OUTPUT INSERTED.ClientPurchaseOrderID + VALUES + ( + @purchaseOrderDate + ,( + SELECT ContactID + FROM Contact + WHERE ContactName=@contactName + ) + ,@clientReference + ,@requestorEmail + ,@orderTotal + ,@isClosed + ) + ", conn)) + { + cmd.Parameters.AddWithValue("@purchaseOrderDate", purchaseOrder.PurchaseOrderDate); + cmd.Parameters.AddWithValue("@contactName", purchaseOrder.ContactName); + cmd.Parameters.AddWithValue("@clientReference", purchaseOrder.ClientReference); + if (purchaseOrder.RequestorEmail == null) { cmd.Parameters.AddWithValue("@requestorEmail", DBNull.Value); } + else { cmd.Parameters.AddWithValue("@requestorEmail", purchaseOrder.RequestorEmail); } + cmd.Parameters.AddWithValue("@orderTotal", purchaseOrder.OrderTotal); + cmd.Parameters.AddWithValue("@isClosed", purchaseOrder.IsClosed); + + purchaseOrderId = (int)cmd.ExecuteScalar(); + } + + // insert lines + for (int i = 0; i < purchaseOrder.OrderLineList.Count; i++) + { + InsertOrderLine( + purchaseOrderId + , purchaseOrder.OrderLineList[i].LineNumber + , purchaseOrder.OrderLineList[i].ProjectWorkNumber + , purchaseOrder.OrderLineList[i].Description + , purchaseOrder.OrderLineList[i].LineNetAmount + ); + } + } + scope.Complete(); + } + } + + protected int InsertOrderLine(int purchaseOrderId, int lineNumber, string projectWorkNo, string description, decimal lineNetAmount) + { + using (SqlConnection conn = new SqlConnection(sqlConnectionString)) + { + conn.Open(); + + using (SqlCommand cmd = new SqlCommand(@" + INSERT INTO ClientPurchaseOrderLine + ( + ClientPurchaseOrderID + ,LineNumber + ,Description + ,LineNetAmount + ) + OUTPUT INSERTED.ClientPurchaseOrderLineID + VALUES + ( + @purchaseOrderId + ,@lineNumber + ,@description + ,@lineNetAmount + ) + ", conn)) + { + cmd.Parameters.AddWithValue("@purchaseOrderId", purchaseOrderId); + cmd.Parameters.AddWithValue("@lineNumber", lineNumber); + if (string.IsNullOrWhiteSpace(description)) { cmd.Parameters.AddWithValue("@description", DBNull.Value); } + else { cmd.Parameters.AddWithValue("@description", description); } + cmd.Parameters.AddWithValue("@lineNetAmount", lineNetAmount); + + return (int)cmd.ExecuteScalar(); + } + } + } + } +} diff --git a/BealeEngineering/BealeEngineering.Core/Data/Database/Client/CreatePurchaseOrderAllocation.cs b/BealeEngineering/BealeEngineering.Core/Data/Database/Client/CreatePurchaseOrderAllocation.cs index 0517d86..ff3a333 100644 --- a/BealeEngineering/BealeEngineering.Core/Data/Database/Client/CreatePurchaseOrderAllocation.cs +++ b/BealeEngineering/BealeEngineering.Core/Data/Database/Client/CreatePurchaseOrderAllocation.cs @@ -14,7 +14,14 @@ namespace BealeEngineering.Core.Data.Database.Client { } - public int ByDictionary(Dictionary saleInvoiceIdToPoLineId) + public int Create(int saleInvoiceId, int purchaseOrderLineId) + { + var value = new Dictionary(); + value.Add(saleInvoiceId, purchaseOrderLineId); + return Create(value); + } + + public int Create(Dictionary saleInvoiceIdToPoLineId) { int rowsCreated = 0; if (saleInvoiceIdToPoLineId == null || !saleInvoiceIdToPoLineId.Any()) @@ -22,33 +29,29 @@ namespace BealeEngineering.Core.Data.Database.Client throw new Exception("No data passed to function."); } - using (TransactionScope scope = new TransactionScope()) + using (SqlConnection conn = new SqlConnection(sqlConnectionString)) { - using (SqlConnection conn = new SqlConnection(sqlConnectionString)) + conn.Open(); + + foreach (var item in saleInvoiceIdToPoLineId) { - conn.Open(); - - foreach (var item in saleInvoiceIdToPoLineId) + using (SqlCommand cmd = new SqlCommand(@" + INSERT INTO ClientPurchaseOrderLineSalesInvoice ( + ClientPurchaseOrderLineID + ,SaleInvoiceID + ) + VALUES ( + @clientPurchaseOrderLineID + ,@saleInvoiceID + ) + ", conn)) { - using (SqlCommand cmd = new SqlCommand(@" - INSERT INTO ClientPurchaseOrderLineSalesInvoice ( - ClientPurchaseOrderLineID - ,SaleInvoiceID - ) - VALUES ( - @clientPurchaseOrderLineID - ,@saleInvoiceID - ) - ", conn)) - { - cmd.Parameters.AddWithValue("@clientPurchaseOrderLineID", item.Value); - cmd.Parameters.AddWithValue("@saleInvoiceID", item.Key); + cmd.Parameters.AddWithValue("@clientPurchaseOrderLineID", item.Value); + cmd.Parameters.AddWithValue("@saleInvoiceID", item.Key); - rowsCreated = rowsCreated + cmd.ExecuteNonQuery(); - } + rowsCreated = rowsCreated + cmd.ExecuteNonQuery(); } } - scope.Complete(); } return rowsCreated; } diff --git a/BealeEngineering/BealeEngineering.Core/Data/Database/Client/ReadPurchaseOrder.cs b/BealeEngineering/BealeEngineering.Core/Data/Database/Client/ReadPurchaseOrder.cs index cd6985f..c0f55c4 100644 --- a/BealeEngineering/BealeEngineering.Core/Data/Database/Client/ReadPurchaseOrder.cs +++ b/BealeEngineering/BealeEngineering.Core/Data/Database/Client/ReadPurchaseOrder.cs @@ -16,6 +16,21 @@ namespace BealeEngineering.Core.Data.Database.Client } + public new Model.Client.PurchaseOrder ByPurchaseOrderId(int orderId) + { + var orderIdList = new List { orderId }; + var result = ByPurchaseOrderId(orderIdList); + + if (result == null || !result.Any()) + { + return null; + } + else + { + return result[0]; + } + } + /// /// Any filters set will be ignored /// @@ -24,7 +39,7 @@ namespace BealeEngineering.Core.Data.Database.Client ClientPurchaseOrderIdList = orderIdList; try { - return GetByFilters(); + return Read(); } catch (Exception ex) { @@ -44,7 +59,7 @@ namespace BealeEngineering.Core.Data.Database.Client purchaseOrderLineId = orderLineId; try { - var result = GetByFilters(); + var result = Read(); if (result == null) { return null; } else { return result[0]; } } @@ -58,27 +73,30 @@ namespace BealeEngineering.Core.Data.Database.Client } } - public new List GetByFilters() + public new List Read() { // build the sql string and dapper parameters var parameters = new DynamicParameters(); string sqlString = @" SELECT ClientPurchaseOrder.ClientPurchaseOrderID - ,ClientPurchaseOrder.PurchaseOrderDate - ,ClientPurchaseOrder.ContactID - ,Contact.ContactName - ,ClientPurchaseOrder.ClientReference - ,ClientPurchaseOrder.RequestorEmail - ,ClientPurchaseOrder.OrderTotal - ,ClientPurchaseOrder.IsClosed - ,ClientPurchaseOrderLine.ClientPurchaseOrderLineID - ,ClientPurchaseOrderLine.LineNumber - ,ClientPurchaseOrderLine.ProjectJobID - ,ClientPurchaseOrderLine.Description - ,ClientPurchaseOrderLine.LineNetAmount - FROM ClientPurchaseOrder - INNER JOIN Contact ON ClientPurchaseOrder.ContactID = Contact.ContactID - LEFT OUTER JOIN ClientPurchaseOrderLine ON ClientPurchaseOrder.ClientPurchaseOrderID = ClientPurchaseOrderLine.ClientPurchaseOrderID + ,ClientPurchaseOrder.PurchaseOrderDate + ,ClientPurchaseOrder.ContactID + ,Contact.ContactName + ,ClientPurchaseOrder.ClientReference + ,ClientPurchaseOrder.RequestorEmail + ,ClientPurchaseOrder.OrderTotal + ,ClientPurchaseOrder.IsClosed + ,ClientPurchaseOrderLine.ClientPurchaseOrderLineID + ,ClientPurchaseOrderLine.LineNumber + ,ProjectWork.WorkNumber AS ProjectWorkNumber + ,ClientPurchaseOrderLine.Description + ,ClientPurchaseOrderLine.LineNetAmount + FROM ProjectWork + RIGHT OUTER JOIN ClientPurchaseOrderLine + ON ProjectWork.ProjectWorkID = ClientPurchaseOrderLine.ProjectWorkID + RIGHT OUTER JOIN ClientPurchaseOrder + INNER JOIN Contact ON ClientPurchaseOrder.ContactID = Contact.ContactID + ON ClientPurchaseOrderLine.ClientPurchaseOrderID = ClientPurchaseOrder.ClientPurchaseOrderID "; AddSqlWhereString(ref sqlString, ref parameters); diff --git a/BealeEngineering/BealeEngineering.Core/Data/Database/Client/ReadPurchaseOrderAllocation.cs b/BealeEngineering/BealeEngineering.Core/Data/Database/Client/ReadPurchaseOrderAllocation.cs index 8a9c5e6..b457fb0 100644 --- a/BealeEngineering/BealeEngineering.Core/Data/Database/Client/ReadPurchaseOrderAllocation.cs +++ b/BealeEngineering/BealeEngineering.Core/Data/Database/Client/ReadPurchaseOrderAllocation.cs @@ -22,11 +22,11 @@ namespace BealeEngineering.Core.Data.Database.Client // build the sql string and dapper parameters string sqlString = @" SELECT ClientPurchaseOrder.PurchaseOrderDate - ,ProjectJob.JobNumber + ,ProjectWork.WorkNumber ,Contact.ContactName ,Project.ProjectTitle - ,ProjectJob.JobTitle - ,ProjectJob.JobDescription + ,ProjectWork.WorkTitle + ,ProjectWork.WorkDescription ,ClientPurchaseOrder.ClientReference AS PurchaseOrderReference ,ClientPurchaseOrderLine.ClientPurchaseOrderLineID AS PurchaseOrderLineID ,ClientPurchaseOrderLine.LineNumber AS PurchaseOrderLineNumber @@ -34,20 +34,21 @@ namespace BealeEngineering.Core.Data.Database.Client ,ClientPurchaseOrderLine.LineNetAmount AS PurchaseOrderLineNetAmount ,ClientPurchaseOrder.IsClosed AS PurchaseOrderIsClosed ,ISNULL(derivedtbl_1.InvoicedAmount, 0) AS InvoicedAmount - FROM ProjectJob - INNER JOIN Project ON ProjectJob.ProjectID = Project.ProjectID - INNER JOIN ClientPurchaseOrder + FROM ProjectWork + INNER JOIN Project ON ProjectWork.ProjectID = Project.ProjectID + RIGHT OUTER JOIN ClientPurchaseOrder INNER JOIN ClientPurchaseOrderLine ON ClientPurchaseOrder.ClientPurchaseOrderID = ClientPurchaseOrderLine.ClientPurchaseOrderID - INNER JOIN Contact ON ClientPurchaseOrder.ContactID = Contact.ContactID ON ProjectJob.ProjectJobID = ClientPurchaseOrderLine.ProjectJobID LEFT OUTER JOIN ( - SELECT SUM(ISNULL(SaleInvoice.InvoiceTotal, 0) - ISNULL(SaleInvoice.TaxTotal, 0)) AS InvoicedAmount + INNER JOIN Contact ON ClientPurchaseOrder.ContactID = Contact.ContactID ON ProjectWork.ProjectWorkID = ClientPurchaseOrderLine.ProjectWorkID LEFT OUTER JOIN ( + SELECT SUM( + ISNULL(SaleInvoice.InvoiceTotal, 0) - ISNULL(SaleInvoice.TaxTotal, 0)) AS InvoicedAmount ,ClientPurchaseOrderLineSalesInvoice.ClientPurchaseOrderLineID - FROM ClientPurchaseOrderLineSalesInvoice - LEFT OUTER JOIN SaleInvoice ON ClientPurchaseOrderLineSalesInvoice.SaleInvoiceID = SaleInvoice.SaleInvoiceID - GROUP BY ClientPurchaseOrderLineSalesInvoice.ClientPurchaseOrderLineID + FROM ClientPurchaseOrderLineSalesInvoice + LEFT OUTER JOIN SaleInvoice ON ClientPurchaseOrderLineSalesInvoice.SaleInvoiceID = SaleInvoice.SaleInvoiceID + GROUP BY ClientPurchaseOrderLineSalesInvoice.ClientPurchaseOrderLineID ) AS derivedtbl_1 ON ClientPurchaseOrderLine.ClientPurchaseOrderLineID = derivedtbl_1.ClientPurchaseOrderLineID WHERE (ClientPurchaseOrder.IsClosed = 0 OR ClientPurchaseOrder.IsClosed = @returnClosed) ORDER BY ClientPurchaseOrder.PurchaseOrderDate - ,ProjectJob.JobNumber"; + ,ProjectWork.WorkNumber"; // make the call using (SqlConnection conn = new SqlConnection(sqlConnectionString)) diff --git a/BealeEngineering/BealeEngineering.Core/Data/Database/Client/ReadPurchaseOrderHeader.cs b/BealeEngineering/BealeEngineering.Core/Data/Database/Client/ReadPurchaseOrderHeader.cs index 4acfc57..734fe53 100644 --- a/BealeEngineering/BealeEngineering.Core/Data/Database/Client/ReadPurchaseOrderHeader.cs +++ b/BealeEngineering/BealeEngineering.Core/Data/Database/Client/ReadPurchaseOrderHeader.cs @@ -66,12 +66,27 @@ namespace BealeEngineering.Core.Data.Database.Client public bool ReturnIsClosed { get; set; } = true; + public Model.Client.PurchaseOrderHeader ByPurchaseOrderId(int orderId) + { + var orderIdList = new List { orderId }; + var result = ByPurchaseOrderId(orderIdList); + + if (result == null || !result.Any()) + { + return null; + } + else + { + return result[0]; + } + } + public List ByPurchaseOrderId(List orderIdList) { ClientPurchaseOrderIdList = orderIdList; try { - return GetByFilters(); + return Read(); } catch (Exception ex) { @@ -144,7 +159,7 @@ namespace BealeEngineering.Core.Data.Database.Client } } - public List GetByFilters() + public List Read() { // build the sql string and dapper parameters var parameters = new DynamicParameters(); diff --git a/BealeEngineering/BealeEngineering.Core/Data/Database/Client/UpdatePurchaseOrder.cs b/BealeEngineering/BealeEngineering.Core/Data/Database/Client/UpdatePurchaseOrder.cs new file mode 100644 index 0000000..a0c1fe2 --- /dev/null +++ b/BealeEngineering/BealeEngineering.Core/Data/Database/Client/UpdatePurchaseOrder.cs @@ -0,0 +1,254 @@ +using Dapper; +using System; +using System.Collections.Generic; +using System.Data.SqlClient; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Transactions; + +namespace BealeEngineering.Core.Data.Database.Client +{ + public class UpdatePurchaseOrder : CreatePurchaseOrder + { + public UpdatePurchaseOrder(string sqlConnectionString) : base(sqlConnectionString) + { + + } + + public void UpdateIsClosed(int purchaseOrderId, bool isClosed) + { + using (SqlConnection conn = new SqlConnection(sqlConnectionString)) + { + conn.Open(); + + // update header + using (SqlCommand cmd = new SqlCommand(@" + UPDATE ClientPurchaseOrder + SET IsClosed = @isClosed + WHERE ClientPurchaseOrderID = @clientPurchaseOrderID + ", conn)) + { + cmd.Parameters.AddWithValue("@isClosed", isClosed); + cmd.Parameters.AddWithValue("@clientPurchaseOrderID", purchaseOrderId); + + int effected = cmd.ExecuteNonQuery(); + + if (effected == 0) + { + throw new Exception("ClientPurchaseOrderID '" + + purchaseOrderId + "' does not exist in database"); + } + } + } + } + + public void Update(Model.Client.PurchaseOrder purchaseOrder) + { + if (!purchaseOrder.ClientPurchaseOrderIDIsSet) + { + throw new Exception("ClientPurchaseOrderID is not set."); + } + + // validate + var validate = new Logic.Validate.CientPurchaseOrder(); + bool isValid = validate.IsValid(purchaseOrder); + if (!isValid) + { + if (validate.ValidationResults.Count == 1) + { + throw new Exception(validate.ValidationResults[0].ToString()); + } + else + { + throw new Exception("Validation failed."); + } + } + + using (var scope = new TransactionScope()) + { + // get DB version for comparison + var existingOrder = new Client.ReadPurchaseOrder(sqlConnectionString).ByPurchaseOrderId(purchaseOrder.ClientPurchaseOrderID); + + if (existingOrder.Equals(purchaseOrder)) + { + // no need to update + return; + } + + // ensure lineIds are part of PO we're updating + for (int i = 0; i < purchaseOrder.OrderLineList.Count; i++) + { + if (purchaseOrder.OrderLineList[i].ClientPurchaseOrderLineIDIsSet) + { + bool isValidId = false; + for (int j = 0; j < existingOrder.OrderLineList.Count; j++) + { + if (purchaseOrder.OrderLineList[i].ClientPurchaseOrderLineID + == existingOrder.OrderLineList[j].ClientPurchaseOrderLineID) + { + isValidId = true; + break; + } + } + if (isValidId == false) + { + throw new InvalidOperationException("Invalid PurchaseOrderLineID '" + + purchaseOrder.OrderLineList[i].ClientPurchaseOrderLineID + "'. Is not FK of PurchaseOrderID '" + + purchaseOrder.ClientPurchaseOrderID + "'"); + } + } + } + + // find any lines to be deleted + var deleteList = new List(); + for (int i = 0; i < existingOrder.OrderLineList.Count; i++) + { + bool delete = true; + for (int j = 0; j < purchaseOrder.OrderLineList.Count; j++) + { + if (purchaseOrder.OrderLineList[j].ClientPurchaseOrderLineIDIsSet + && purchaseOrder.OrderLineList[j].ClientPurchaseOrderLineID == existingOrder.OrderLineList[i].ClientPurchaseOrderLineID) + { + delete = false; + break; + } + } + if (delete) + { + deleteList.Add(existingOrder.OrderLineList[i].ClientPurchaseOrderLineID); + } + } + + using (SqlConnection conn = new SqlConnection(sqlConnectionString)) + { + conn.Open(); + + // update header + using (SqlCommand cmd = new SqlCommand(@" + UPDATE ClientPurchaseOrder + SET PurchaseOrderDate = @purchaseOrderDate + ,ContactID = + ( + SELECT ContactID + FROM Contact + WHERE ContactName = @contact + ) + ,ClientReference = @clientReference + ,RequestorEmail = @requestorEmail + ,OrderTotal = @orderTotal + ,IsClosed = @isClosed + WHERE ClientPurchaseOrderID = @clientPurchaseOrderID + ", conn)) + { + cmd.Parameters.AddWithValue("@clientPurchaseOrderID", purchaseOrder.ClientPurchaseOrderID); + cmd.Parameters.AddWithValue("@purchaseOrderDate", purchaseOrder.PurchaseOrderDate); + cmd.Parameters.AddWithValue("@contact", purchaseOrder.ContactName); + cmd.Parameters.AddWithValue("@clientReference", purchaseOrder.ClientReference); + if (purchaseOrder.RequestorEmail == null) { cmd.Parameters.AddWithValue("@requestorEmail", DBNull.Value); } + else { cmd.Parameters.AddWithValue("@requestorEmail", purchaseOrder.RequestorEmail); } + cmd.Parameters.AddWithValue("@orderTotal", purchaseOrder.OrderTotal); + cmd.Parameters.AddWithValue("@isClosed", purchaseOrder.IsClosed); + + int effected = cmd.ExecuteNonQuery(); + + if (effected == 0) + { + throw new Exception("ClientPurchaseOrderID '" + + purchaseOrder.ClientPurchaseOrderID + "' does not exist in database"); + } + } + + // delete lines + if (deleteList.Any()) + { + foreach ( int lineId in deleteList) + { + int effected = DeleteOrderLine(lineId); + + if (effected < 1) + { + throw new Exception("Incistancey Error"); + } + } + } + + // update lines + for (int i = 0; i < purchaseOrder.OrderLineList.Count; i++) + { + if (purchaseOrder.OrderLineList[i].ClientPurchaseOrderLineIDIsSet) + { + UpdateOrderLine( + purchaseOrder.OrderLineList[i].ClientPurchaseOrderLineID + , purchaseOrder.OrderLineList[i].LineNumber + , purchaseOrder.OrderLineList[i].ProjectWorkNumber + , purchaseOrder.OrderLineList[i].Description + , purchaseOrder.OrderLineList[i].LineNetAmount + ); + } + } + + // insert new lines + for (int i = 0; i < purchaseOrder.OrderLineList.Count; i++) + { + if (!purchaseOrder.OrderLineList[i].ClientPurchaseOrderLineIDIsSet) + { + InsertOrderLine( + purchaseOrder.ClientPurchaseOrderID + , purchaseOrder.OrderLineList[i].LineNumber + , purchaseOrder.OrderLineList[i].ProjectWorkNumber + , purchaseOrder.OrderLineList[i].Description + , purchaseOrder.OrderLineList[i].LineNetAmount + ); + } + } + } + scope.Complete(); + } + } + + private int DeleteOrderLine(int purchaseOrderLineId) + { + using (SqlConnection conn = new SqlConnection(sqlConnectionString)) + { + conn.Open(); + + using (SqlCommand cmd = new SqlCommand(@" + DELETE FROM ClientPurchaseOrderLine + WHERE ClientPurchaseOrderLineID = @purchaseOrderLineId + ", conn)) + { + cmd.Parameters.AddWithValue("@purchaseOrderLineId", purchaseOrderLineId); + + return cmd.ExecuteNonQuery(); + } + } + } + + private int UpdateOrderLine(int purchaseOrderLineId, int lineNumber, string projectWorkNo, string description, decimal lineNetAmount) + { + using (SqlConnection conn = new SqlConnection(sqlConnectionString)) + { + conn.Open(); + + using (SqlCommand cmd = new SqlCommand(@" + UPDATE ClientPurchaseOrderLine + SET LineNumber = @lineNumber + ,Description = @description + ,LineNetAmount = @lineNetAmount + WHERE ClientPurchaseOrderLineID = @purchaseOrderLineId + ", conn)) + { + cmd.Parameters.AddWithValue("@lineNumber", lineNumber); + //cmd.Parameters.AddWithValue("@projectWorkNo", projectWorkNo); + if (string.IsNullOrWhiteSpace(description)) { cmd.Parameters.AddWithValue("@description", DBNull.Value); } + else { cmd.Parameters.AddWithValue("@description", description); } + cmd.Parameters.AddWithValue("@lineNetAmount", lineNetAmount); + cmd.Parameters.AddWithValue("@purchaseOrderLineId", purchaseOrderLineId); + + return cmd.ExecuteNonQuery(); + } + } + } + } +} \ No newline at end of file diff --git a/BealeEngineering/BealeEngineering.Core/Data/Database/Connection.cs b/BealeEngineering/BealeEngineering.Core/Data/Database/Connection.cs index 6d9646c..8e6cf0a 100644 --- a/BealeEngineering/BealeEngineering.Core/Data/Database/Connection.cs +++ b/BealeEngineering/BealeEngineering.Core/Data/Database/Connection.cs @@ -11,11 +11,15 @@ namespace BealeEngineering.Core.Data.Database public class Connection { protected readonly string sqlConnectionString; + public Connection(string sqlConnectionString) { // setup sql parameters - if (sqlConnectionString.Length == 0) - { throw new Exception("Zero length sql connectionstring passed"); } + if (string.IsNullOrEmpty(sqlConnectionString)) + { + throw new Exception("Zero length sql connectionstring passed"); + } + this.sqlConnectionString = sqlConnectionString; } } diff --git a/BealeEngineering/BealeEngineering.Core/Data/Database/Contact/ReadContactList.cs b/BealeEngineering/BealeEngineering.Core/Data/Database/Contact/ReadContactList.cs new file mode 100644 index 0000000..ab82926 --- /dev/null +++ b/BealeEngineering/BealeEngineering.Core/Data/Database/Contact/ReadContactList.cs @@ -0,0 +1,50 @@ +using System; +using System.Collections.Generic; +using System.Data.SqlClient; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace BealeEngineering.Core.Data.Database.Contact +{ + public class ReadContactList : Connection + { + public ReadContactList(string sqlConnectionString) : base(sqlConnectionString) + { + + } + + public List Read() + { + var result = new List(); + + using (var conn = new SqlConnection(sqlConnectionString)) + { + conn.Open(); + + using (var cmd = new SqlCommand(@" + SELECT ContactName + FROM Contact + ", conn)) + { + using(var reader = cmd.ExecuteReader()) + { + while (reader.Read()) + { + result.Add(reader.GetString(0)); + } + } + } + } + + if (result.Any()) + { + return result; + } + else + { + return null; + } + } + } +} diff --git a/BealeEngineering/BealeEngineering.Core/Data/Database/Log/ReadDateTime.cs b/BealeEngineering/BealeEngineering.Core/Data/Database/Log/ReadDateTime.cs new file mode 100644 index 0000000..5073721 --- /dev/null +++ b/BealeEngineering/BealeEngineering.Core/Data/Database/Log/ReadDateTime.cs @@ -0,0 +1,46 @@ +using System; +using System.Collections.Generic; +using System.Data.SqlClient; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace BealeEngineering.Core.Data.Database.Log +{ + public class ReadDateTime : Connection + { + public ReadDateTime(string sqlConnectionString) : base(sqlConnectionString) + { + + } + + public DateTime ByMatchString(string matchString) + { + using (var conn = new SqlConnection(sqlConnectionString)) + { + conn.Open(); + + using (var cmd = new SqlCommand(@" + SELECT + DateTimeUtc + FROM + LogDateTime + WHERE + LogDateTimeID = @matchString + ", conn)) + { + cmd.Parameters.AddWithValue("@matchString", matchString); + + object obj = cmd.ExecuteScalar(); + + if (obj == null || obj == DBNull.Value) + { + throw new NullReferenceException("Match string not valid."); + } + + return DateTime.SpecifyKind((DateTime)obj, DateTimeKind.Utc); + } + } + } + } +} diff --git a/BealeEngineering/BealeEngineering.Core/Data/Database/Log/UpdateDateTime.cs b/BealeEngineering/BealeEngineering.Core/Data/Database/Log/UpdateDateTime.cs new file mode 100644 index 0000000..079e9ed --- /dev/null +++ b/BealeEngineering/BealeEngineering.Core/Data/Database/Log/UpdateDateTime.cs @@ -0,0 +1,44 @@ +using System; +using System.Collections.Generic; +using System.Data.SqlClient; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace BealeEngineering.Core.Data.Database.Log +{ + public class UpdateDateTime : Connection + { + public UpdateDateTime(string sqlConnectionString) : base(sqlConnectionString) + { + + } + + public void ByMatchString(string matchString, DateTime logDateTime) + { + using (var conn = new SqlConnection(sqlConnectionString)) + { + conn.Open(); + + using (var cmd = new SqlCommand(@" + UPDATE + LogDateTime + SET + DateTimeUtc = @logDateTime + ,RecordModified = getutcdate() + WHERE + LogDateTimeID = @matchString + ", conn)) + { + cmd.Parameters.AddWithValue("@matchString", matchString); + cmd.Parameters.AddWithValue("@logDateTime", logDateTime.ToUniversalTime()); + + if (!(cmd.ExecuteNonQuery() > 0)) + { + throw new NullReferenceException("Match string not valid."); + } + } + } + } + } +} diff --git a/BealeEngineering/BealeEngineering.Core/Data/Database/Project/ReadProject.cs b/BealeEngineering/BealeEngineering.Core/Data/Database/Project/ReadProject.cs new file mode 100644 index 0000000..15b1df4 --- /dev/null +++ b/BealeEngineering/BealeEngineering.Core/Data/Database/Project/ReadProject.cs @@ -0,0 +1,113 @@ +using System; +using System.Collections.Generic; +using System.Data.SqlClient; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Dapper; + +namespace BealeEngineering.Core.Data.Database.Project +{ + public class ReadProject : Connection + { + public ReadProject(string sqlConnectionString) : base(sqlConnectionString) + { + + } + + public bool ReturnIsArchived { get; set; } = false; + + public Model.Project.ProjectWork ByProjectNumber(int projectNumber) + { + var result = ByProjectNumber(new List { projectNumber }); + + if (result == null) { return null; } + else { return result[0]; } + } + + public List ByProjectNumber(List projectNumberList) + { + if (projectNumberList == null || !projectNumberList.Any()) + { return null; } + + string sqlWhere = @" + WHERE Project.ProjectID IN @projectid + ORDER BY ProjectNumber"; + + var parameters = new DynamicParameters(); + parameters.Add("@projectid", projectNumberList); + + return Execute(sqlWhere, parameters); + } + + public List Read() + { + string sqlWhere = ""; + if (!ReturnIsArchived) + { + sqlWhere += @" + WHERE Project.IsArchived = 0"; + } + + sqlWhere += @" + ORDER BY ProjectNumber"; + + var parameters = new DynamicParameters(); + return Execute(sqlWhere, parameters); + } + + private List Execute(string sqlWhere, DynamicParameters parameters) + { + // build the sql string + string sqlString = @" + SELECT Project.ProjectID AS ProjectNumber + ,Contact.ContactName AS ProjectClient + ,Project.ProjectReference + ,Project.ProjectTitle + ,Project.DateStart + ,Project.DateEnd + ,Project.IsArchived + ,Contact_pw.ContactName AS WorkItemClient + ,ProjectWork.WorkNumber + ,ProjectWork.WorkTitle AS WorkItemTitle + ,ProjectWork.WorkDescription AS WorkItemDescription + ,ProjectWork.DateStart AS WorkItemDateStart + ,ProjectWork.DateEnd AS WorkItemDateEnd + ,ProjectWork.IsArchived AS WorkItemIsArchived + FROM Project + INNER JOIN Contact ON Project.ContactID = Contact.ContactID + INNER JOIN ProjectWork ON Project.ProjectID = ProjectWork.ProjectID + INNER JOIN Contact AS Contact_pw ON ProjectWork.ContactID = Contact_pw.ContactID + " + sqlWhere; + + using (var conn = new SqlConnection(sqlConnectionString)) + { + conn.Open(); + + var workDictionary = new Dictionary(); + + return conn.Query + ( + sqlString, + (project, workItemList) => + { + Model.Project.ProjectWork workEntry; + + if (!workDictionary.TryGetValue((int)project.ProjectNumber, out workEntry)) + { + workEntry = project; + workEntry.ProjectWorkLineList = new List(); + workDictionary.Add((int)workEntry.ProjectNumber, workEntry); + } + + workEntry.ProjectWorkLineList.Add(workItemList); + return workEntry; + }, + parameters, + splitOn: "WorkItemClient") + .Distinct() + .ToList(); + } + } + } +} diff --git a/BealeEngineering/BealeEngineering.Core/Data/Database/Project/ReadProjectWork.cs b/BealeEngineering/BealeEngineering.Core/Data/Database/Project/ReadProjectWork.cs new file mode 100644 index 0000000..6f810ca --- /dev/null +++ b/BealeEngineering/BealeEngineering.Core/Data/Database/Project/ReadProjectWork.cs @@ -0,0 +1,82 @@ +using Dapper; +using System; +using System.Collections.Generic; +using System.Data.SqlClient; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace BealeEngineering.Core.Data.Database.Project +{ + class ReadProjectWork : Connection + { + public ReadProjectWork(string sqlConnectionString) : base(sqlConnectionString) + { + + } + + public bool ReturnIsArchived { get; set; } = false; + + public Model.Project.Project ByProjectNumber(int projectNumber) + { + var result = ByProjectNumber(new List { projectNumber }); + + if (result == null) { return null; } + else { return result[0]; } + } + + public List ByProjectNumber(List projectNumberList) + { + if (projectNumberList == null || !projectNumberList.Any()) + { return null; } + + string sqlWhere = @" + WHERE Project.ProjectID IN @projectid + ORDER BY ProjectNumber"; + + var parameters = new DynamicParameters(); + parameters.Add("@projectid", projectNumberList); + + return Execute(sqlWhere, parameters); + } + + public List Read() + { + string sqlWhere = ""; + if (!ReturnIsArchived) + { + sqlWhere += @" + WHERE Project.IsArchived = 0"; + } + + sqlWhere += @" + ORDER BY ProjectNumber"; + + var parameters = new DynamicParameters(); + return Execute(sqlWhere, parameters); + } + + private List Execute(string sqlWhere, DynamicParameters parameters) + { + // build the sql string + string sqlString = @" + SELECT Project.ProjectID AS ProjectNumber + ,Contact.ContactName AS ProjectClient + ,Project.ProjectReference + ,Project.ProjectTitle + ,Project.DateStart + ,Project.DateEnd + ,Project.IsArchived + FROM Project + INNER JOIN Contact ON Project.ContactID = Contact.ContactID" + + sqlWhere; + + using (var conn = new SqlConnection(sqlConnectionString)) + { + conn.Open(); + + return conn.Query(sqlString).ToList(); + } + } + } +} diff --git a/BealeEngineering/BealeEngineering.Core/Data/Database/Project/ReadProjectWorkItem.cs b/BealeEngineering/BealeEngineering.Core/Data/Database/Project/ReadProjectWorkItem.cs new file mode 100644 index 0000000..67e1b10 --- /dev/null +++ b/BealeEngineering/BealeEngineering.Core/Data/Database/Project/ReadProjectWorkItem.cs @@ -0,0 +1,86 @@ +using Dapper; +using System; +using System.Collections.Generic; +using System.Data.SqlClient; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace BealeEngineering.Core.Data.Database.Project +{ + public class ReadProjectWorkItem : Connection + { + public ReadProjectWorkItem(string sqlConnectionString) : base(sqlConnectionString) + { + + } + + public bool ReturnIsArchived { get; set; } = false; + + public Model.Project.ProjectWorkItem ByWorkNumber(string projectNumber) + { + var result = ByWorkNumber(new List { projectNumber }); + + if (result == null) { return null; } + else { return result[0]; } + } + + public List ByWorkNumber(List workNumberList) + { + if (workNumberList == null || !workNumberList.Any()) + { return null; } + + string sqlWhere = @" + WHERE ProjectWork.WorkNumber IN @workNumber + ORDER BY ProjectNumber"; + + var parameters = new DynamicParameters(); + parameters.Add("@workNumber", workNumberList); + + return Execute(sqlWhere, parameters); + } + + public List Read() + { + string sqlWhere = ""; + if (!ReturnIsArchived) + { + sqlWhere += @" + WHERE ProjectWork.IsArchived = 0"; + } + + sqlWhere += @" + ORDER BY WorkNumber"; + + var parameters = new DynamicParameters(); + return Execute(sqlWhere, parameters); + } + + private List Execute(string sqlWhere, DynamicParameters parameters) + { + // build the sql string + string sqlString = @" + SELECT Project.ProjectID AS ProjectNumber + ,Project.ProjectReference + ,Project.ProjectTitle + ,Contact.ContactName AS WorkItemClient + ,ProjectWork.WorkNumber + ,ProjectWork.WorkTitle AS WorkItemTitle + ,ProjectWork.WorkDescription AS WorkItemDescription + ,ProjectWork.DateStart AS WorkItemDateStart + ,ProjectWork.DateEnd AS WorkItemDateEnd + ,ProjectWork.IsArchived AS WorkItemIsArchived + FROM Project + INNER JOIN ProjectWork ON Project.ProjectID = ProjectWork.ProjectID + INNER JOIN Contact ON ProjectWork.ContactID = Contact.ContactID + " + sqlWhere; + + using (var conn = new SqlConnection(sqlConnectionString)) + { + conn.Open(); + + return conn.Query(sqlString, parameters).ToList(); + } + } + } +} diff --git a/BealeEngineering/BealeEngineering.Core/Data/Database/Sale/ReadInvoiceHeader.cs b/BealeEngineering/BealeEngineering.Core/Data/Database/Sale/ReadInvoiceHeader.cs index 758b17d..da92bcc 100644 --- a/BealeEngineering/BealeEngineering.Core/Data/Database/Sale/ReadInvoiceHeader.cs +++ b/BealeEngineering/BealeEngineering.Core/Data/Database/Sale/ReadInvoiceHeader.cs @@ -81,6 +81,17 @@ namespace BealeEngineering.Core.Data.Database.Sale } } + public List Status { get; set; } + + public bool StatusIsSet + { + get + { + if (Status == null || !Status.Any()) { return false; } + else { return true; } + } + } + public Model.Sale.InvoiceHeader BySaleInvoiceId(int invoiceId) { var invoiceList = new List { invoiceId }; @@ -185,6 +196,13 @@ namespace BealeEngineering.Core.Data.Database.Sale parameters.Add("@reference", Reference); } + if (StatusIsSet) + { + sqlString = sqlString + @" + AND Status IN @status"; + + parameters.Add("@status", Status); + } } } public List Read() diff --git a/BealeEngineering/BealeEngineering.Core/Data/Database/Sale/ReadNextInvoiceNumber.cs b/BealeEngineering/BealeEngineering.Core/Data/Database/Sale/ReadNextInvoiceNumber.cs index 8650ed0..5ec9e15 100644 --- a/BealeEngineering/BealeEngineering.Core/Data/Database/Sale/ReadNextInvoiceNumber.cs +++ b/BealeEngineering/BealeEngineering.Core/Data/Database/Sale/ReadNextInvoiceNumber.cs @@ -9,7 +9,7 @@ namespace BealeEngineering.Core.Data.Database.Sale { public class ReadNextInvoiceNumber : Connection { - Data.SaleInvoiceNumberFormat numberFormat = new Data.SaleInvoiceNumberFormat(); + Data.SaleInvoiceFormat numberFormat = new Data.SaleInvoiceFormat(); public ReadNextInvoiceNumber(string sqlConnectionString) : base(sqlConnectionString) { @@ -32,7 +32,7 @@ namespace BealeEngineering.Core.Data.Database.Sale { conn.Open(); - int prefixLength = new Data.SaleInvoiceNumberFormat().ReadNumberPrefixLength(); + int prefixLength = new Data.SaleInvoiceFormat().ReadNumberPrefixLength(); //get remaining facility on purchase order line using (var cmd = new SqlCommand(@" diff --git a/BealeEngineering/BealeEngineering.Core/Data/SaleInvoiceNumberFormat.cs b/BealeEngineering/BealeEngineering.Core/Data/SaleInvoiceFormat.cs similarity index 69% rename from BealeEngineering/BealeEngineering.Core/Data/SaleInvoiceNumberFormat.cs rename to BealeEngineering/BealeEngineering.Core/Data/SaleInvoiceFormat.cs index bf650bf..9aa6a99 100644 --- a/BealeEngineering/BealeEngineering.Core/Data/SaleInvoiceNumberFormat.cs +++ b/BealeEngineering/BealeEngineering.Core/Data/SaleInvoiceFormat.cs @@ -6,7 +6,7 @@ using System.Threading.Tasks; namespace BealeEngineering.Core.Data { - public class SaleInvoiceNumberFormat + public class SaleInvoiceFormat { public string ReadInvoicePrefix() { @@ -27,5 +27,15 @@ namespace BealeEngineering.Core.Data { return 3; } + + public string ReadStatusStringNew() + { + return "New"; + } + + public string ReadStatusStringModified() + { + return "Modified"; + } } } diff --git a/BealeEngineering/BealeEngineering.Core/Data/Xero/ReadXeroInvoiceFlatFile.cs b/BealeEngineering/BealeEngineering.Core/Data/Xero/ReadXeroInvoiceFlatFile.cs index a4e11b3..d143e0f 100644 --- a/BealeEngineering/BealeEngineering.Core/Data/Xero/ReadXeroInvoiceFlatFile.cs +++ b/BealeEngineering/BealeEngineering.Core/Data/Xero/ReadXeroInvoiceFlatFile.cs @@ -72,7 +72,7 @@ namespace BealeEngineering.Core.Data.Xero.FlatFile dto = csv.GetRecords().ToList(); } FileInputCreatedDate = File.GetCreationTime(FileInputPath); - return new Logic.Adapter.XeroInvoiceFlatFile().XeroInvoiceFlatFileDTO(dto); + return new Logic.Adapter.ImportXeroInvoiceFlatFile().XeroInvoiceFlatFileDTO(dto); } } } diff --git a/BealeEngineering/BealeEngineering.Core/Logic/Adapter/ExportXeroInvoiceFlatFileDTO.cs b/BealeEngineering/BealeEngineering.Core/Logic/Adapter/ExportXeroInvoiceFlatFileDTO.cs new file mode 100644 index 0000000..3df0074 --- /dev/null +++ b/BealeEngineering/BealeEngineering.Core/Logic/Adapter/ExportXeroInvoiceFlatFileDTO.cs @@ -0,0 +1,82 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace BealeEngineering.Core.Logic.Adapter +{ + public class ExportXeroInvoiceFlatFileDTO + { + public List BySaleInvoice(List invoices) + { + var result = new Logic.Adapter.ImportXeroInvoiceFlatFile().SaleInvoice(invoices); + return ByImportXeroInvoiceFlatFile(result); + } + + public List ByImportXeroInvoiceFlatFile(List invoices) + { + //throw new NotImplementedException(); + if (invoices == null) { return null; } + + // create the invoice list + var result = new List(); + int i = 0; + int invoiceCount = invoices.Count(); + + while (i < invoiceCount) + { + int j = 0; + int invoiceLineCount = 0; + if (invoices[i].LineItemList != null) + { invoiceLineCount = invoices[i].LineItemList.Count(); } + + do + { + var dto = new Model.Export.XeroInvoiceFlatFileDTO(); + + dto.ContactName = invoices[i].ContactName; + dto.Currency = invoices[i].Currency; + if (invoices[i].DueDate == null) { dto.DueDate = invoices[i].InvoiceDate; } + else { dto.DueDate = invoices[i].DueDate.GetValueOrDefault(); } + dto.EmailAddress = invoices[i].EmailAddress; + dto.InvoiceDate = invoices[i].InvoiceDate; + dto.InvoiceNumber = invoices[i].InvoiceNumber; + dto.POAddressLine1 = invoices[i].POAddressLine1; + dto.POAddressLine2 = invoices[i].POAddressLine2; + dto.POAddressLine3 = invoices[i].POAddressLine3; + dto.POAddressLine4 = invoices[i].POAddressLine4; + dto.POCity = invoices[i].POCity; + dto.POCountry = invoices[i].POCountry; + dto.POPostalCode = invoices[i].POPostalCode; + dto.PORegion = invoices[i].PORegion; + dto.Reference = invoices[i].Reference; + dto.Total = invoices[i].Total; + + if (j < invoiceLineCount) + { + dto.AccountCode = invoices[i].LineItemList[j].AccountCode; + dto.Description = invoices[i].LineItemList[j].Description; + dto.Discount = invoices[i].LineItemList[j].Discount; + dto.InventoryItemCode = invoices[i].LineItemList[j].InventoryItemCode; + dto.Quantity = invoices[i].LineItemList[j].Quantity; + dto.TaxAmount = invoices[i].LineItemList[j].TaxAmount; + dto.TaxType = invoices[i].LineItemList[j].TaxType; + dto.TrackingName1 = invoices[i].LineItemList[j].TrackingName1; + dto.TrackingName2 = invoices[i].LineItemList[j].TrackingName2; + dto.TrackingOption1 = invoices[i].LineItemList[j].TrackingOption1; + dto.TrackingOption2 = invoices[i].LineItemList[j].TrackingOption2; + dto.UnitAmount = invoices[i].LineItemList[j].UnitAmount; + } + + result.Add(dto); + j++; + + } while (j < invoiceLineCount); + + i++; + } + return result; + } + } +} diff --git a/BealeEngineering/BealeEngineering.Core/Logic/Adapter/XeroInvoiceFlatFile.cs b/BealeEngineering/BealeEngineering.Core/Logic/Adapter/ImportXeroInvoiceFlatFile.cs similarity index 98% rename from BealeEngineering/BealeEngineering.Core/Logic/Adapter/XeroInvoiceFlatFile.cs rename to BealeEngineering/BealeEngineering.Core/Logic/Adapter/ImportXeroInvoiceFlatFile.cs index ac9b072..79c8d4a 100644 --- a/BealeEngineering/BealeEngineering.Core/Logic/Adapter/XeroInvoiceFlatFile.cs +++ b/BealeEngineering/BealeEngineering.Core/Logic/Adapter/ImportXeroInvoiceFlatFile.cs @@ -6,9 +6,9 @@ using System.Threading.Tasks; namespace BealeEngineering.Core.Logic.Adapter { - public class XeroInvoiceFlatFile + public class ImportXeroInvoiceFlatFile { - public XeroInvoiceFlatFile() + public ImportXeroInvoiceFlatFile() { // ensure XeroInvoiceFlatFile hasn't changed int propertyCount = new Model.Import.XeroInvoiceFlatFile().GetType().GetProperties().Count(); diff --git a/BealeEngineering/BealeEngineering.Core/Logic/Adapter/XeroInvoiceFlatFileDTO.cs b/BealeEngineering/BealeEngineering.Core/Logic/Adapter/ImportXeroInvoiceFlatFileDTO.cs similarity index 98% rename from BealeEngineering/BealeEngineering.Core/Logic/Adapter/XeroInvoiceFlatFileDTO.cs rename to BealeEngineering/BealeEngineering.Core/Logic/Adapter/ImportXeroInvoiceFlatFileDTO.cs index 825e5a6..021e32d 100644 --- a/BealeEngineering/BealeEngineering.Core/Logic/Adapter/XeroInvoiceFlatFileDTO.cs +++ b/BealeEngineering/BealeEngineering.Core/Logic/Adapter/ImportXeroInvoiceFlatFileDTO.cs @@ -6,9 +6,9 @@ using System.Threading.Tasks; namespace BealeEngineering.Core.Logic.Adapter { - class XeroInvoiceFlatFileDTO + class ImportXeroInvoiceFlatFileDTO { - public XeroInvoiceFlatFileDTO() + public ImportXeroInvoiceFlatFileDTO() { // ensure XeroInvoiceFlatFileDTO hasn't changed int propertyCount = new Model.Import.XeroInvoiceFlatFileDTO().GetType().GetProperties().Count(); diff --git a/BealeEngineering/BealeEngineering.Core/Logic/Client/PurchaseOrderAutoAllocate.cs b/BealeEngineering/BealeEngineering.Core/Logic/Client/PurchaseOrderAutoAllocate.cs index f0e188c..898f11c 100644 --- a/BealeEngineering/BealeEngineering.Core/Logic/Client/PurchaseOrderAutoAllocate.cs +++ b/BealeEngineering/BealeEngineering.Core/Logic/Client/PurchaseOrderAutoAllocate.cs @@ -76,7 +76,7 @@ namespace BealeEngineering.Core.Logic.Client var readPurchaseOrder = new Data.Database.Client.ReadPurchaseOrder(SqlConnectionString); readPurchaseOrder.Reference = referenceList.Distinct().ToList(); readPurchaseOrder.ReturnIsClosed = false; - var clientPoList = readPurchaseOrder.GetByFilters(); + var clientPoList = readPurchaseOrder.Read(); // create dictionary for matched items var invoiceIdToPoLineId = new Dictionary(); @@ -145,7 +145,7 @@ namespace BealeEngineering.Core.Logic.Client if (invoiceIdToPoLineId.Count > 0) { var createAllocation = new Data.Database.Client.CreatePurchaseOrderAllocation(SqlConnectionString); - InvoiceMatched = createAllocation.ByDictionary(invoiceIdToPoLineId); + InvoiceMatched = createAllocation.Create(invoiceIdToPoLineId); } IsComplete = true; } diff --git a/BealeEngineering/BealeEngineering.Core/Logic/Export/ExcelInvoiceFlatFile.cs b/BealeEngineering/BealeEngineering.Core/Logic/Export/ExcelInvoiceFlatFile.cs new file mode 100644 index 0000000..a1775f7 --- /dev/null +++ b/BealeEngineering/BealeEngineering.Core/Logic/Export/ExcelInvoiceFlatFile.cs @@ -0,0 +1,53 @@ +using System; +using System.Collections.Generic; +using System.Globalization; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using CsvHelper; + +namespace BealeEngineering.Core.Logic.Export +{ + public class ExcelInvoiceFlatFile + { + string sqlConnectionString; + + public ExcelInvoiceFlatFile(string sqlConnectionString) + { + this.sqlConnectionString = sqlConnectionString; + + FileOutputPath = + Environment.GetFolderPath(Environment.SpecialFolder.UserProfile) + + @"\Dropbox\Beale Engineering Services Ltd\BE Accounts\Xero-Export-Invoices.csv"; + } + + public int InvoicesExported { get; private set; } = 0; + + public string FileOutputPath { get; set; } + + public void Execute() + { + if (string.IsNullOrWhiteSpace(FileOutputPath)) + { throw new Exception("File path not set"); } + + // read all invoice from db + var invoiceList = new Data.Database.Sale.ReadInvoice(sqlConnectionString).Read(); + + // map into xeroinvoice dto + var xeroInvoiceList = new Logic.Adapter.ImportXeroInvoiceFlatFile().SaleInvoice(invoiceList); + if (xeroInvoiceList == null || !xeroInvoiceList.Any()) + { return; } + else { InvoicesExported = xeroInvoiceList.Count(); } + var xeroInvoiceDtoList = new Logic.Adapter.ImportXeroInvoiceFlatFileDTO().XeroInvoiceFlatFile(xeroInvoiceList); + + // create flatfile from dto + using (var writer = new StreamWriter(FileOutputPath)) + using (var csv = new CsvWriter(writer, new Data.CurrencyFormat().ReadCulture("GBP"))) + { + csv.WriteRecords(xeroInvoiceDtoList); + //csv.WriteRecords(xeroInvoiceList); + } + } + } +} diff --git a/BealeEngineering/BealeEngineering.Core/Logic/Export/XeroInvoiceFlatFile.cs b/BealeEngineering/BealeEngineering.Core/Logic/Export/XeroInvoiceFlatFile.cs index e5599dd..2a20ed8 100644 --- a/BealeEngineering/BealeEngineering.Core/Logic/Export/XeroInvoiceFlatFile.cs +++ b/BealeEngineering/BealeEngineering.Core/Logic/Export/XeroInvoiceFlatFile.cs @@ -1,11 +1,11 @@ -using System; +using CsvHelper; +using System; using System.Collections.Generic; using System.Globalization; using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using CsvHelper; namespace BealeEngineering.Core.Logic.Export { @@ -19,7 +19,7 @@ namespace BealeEngineering.Core.Logic.Export FileOutputPath = Environment.GetFolderPath(Environment.SpecialFolder.UserProfile) - + @"\Dropbox\Beale Engineering Services Ltd\BE Accounts\Xero-Export-Invoices.csv"; + + @"\Downloads\Xero-Invoices-New.csv"; } public int InvoicesExported { get; private set; } = 0; @@ -32,18 +32,24 @@ namespace BealeEngineering.Core.Logic.Export { throw new Exception("File path not set"); } // read all invoice from db - var invoiceList = new Data.Database.Sale.ReadInvoice(sqlConnectionString).Read(); + var readInvoice = new Data.Database.Sale.ReadInvoice(sqlConnectionString); + var status = new List { new Data.SaleInvoiceFormat().ReadStatusStringNew() }; + readInvoice.Status = status; + var invoiceList = readInvoice.Read(); + + if (invoiceList == null || !invoiceList.Any()) + { + return; + } + + InvoicesExported = invoiceList.Count(); // map into xeroinvoice dto - var xeroInvoiceList = new Logic.Adapter.XeroInvoiceFlatFile().SaleInvoice(invoiceList); - if (xeroInvoiceList == null || !xeroInvoiceList.Any()) - { return; } - else { InvoicesExported = xeroInvoiceList.Count(); } - var xeroInvoiceDtoList = new Logic.Adapter.XeroInvoiceFlatFileDTO().XeroInvoiceFlatFile(xeroInvoiceList); + var xeroInvoiceDtoList = new Logic.Adapter.ExportXeroInvoiceFlatFileDTO().BySaleInvoice(invoiceList); // create flatfile from dto using (var writer = new StreamWriter(FileOutputPath)) - using (var csv = new CsvWriter(writer, CultureInfo.InvariantCulture)) + using (var csv = new CsvWriter(writer, new Data.CurrencyFormat().ReadCulture("GBP"))) { csv.WriteRecords(xeroInvoiceDtoList); //csv.WriteRecords(xeroInvoiceList); diff --git a/BealeEngineering/BealeEngineering.Core/Logic/Import/XeroInvoiceFlatFile.cs b/BealeEngineering/BealeEngineering.Core/Logic/Import/XeroInvoiceFlatFile.cs index 659111e..caaf6d4 100644 --- a/BealeEngineering/BealeEngineering.Core/Logic/Import/XeroInvoiceFlatFile.cs +++ b/BealeEngineering/BealeEngineering.Core/Logic/Import/XeroInvoiceFlatFile.cs @@ -56,6 +56,45 @@ namespace BealeEngineering.Core.Logic.Import throw new Exception("Something went wrong while mapping the data."); } + // check db 'modified' invoices match incomming Xero invoices + // (need to confirm the modified invoices have been entered into Xero) + string modified = new Data.SaleInvoiceFormat().ReadStatusStringModified(); + var dbReadInvoice = new Data.Database.Sale.ReadInvoice(sqlConnectionString); + dbReadInvoice.Status = new List { modified }; + var modifiedInvoice = dbReadInvoice.Read(); + + if (modifiedInvoice != null || modifiedInvoice.Any()) + { + for (int i = 0; i < modifiedInvoice.Count(); i++) + { + // loop through Xero imports + bool isMissing = true; + for (int j = 0; j < xeroInvoiceList.Count(); j++) + { + if (modifiedInvoice[i].SaleInvoiceNumber == xeroInvoiceList[j].SaleInvoiceNumber) + { + isMissing = false; + + // compare invoice header info + if (modifiedInvoice[i].InvoiceLineList.Count() != xeroInvoiceList[j].InvoiceLineList.Count() + || modifiedInvoice[i].InvoiceTotal != xeroInvoiceList[j].InvoiceTotal + || modifiedInvoice[i].IsCreditNote != xeroInvoiceList[j].IsCreditNote + || modifiedInvoice[i].Reference != xeroInvoiceList[j].Reference) + { + throw new Exception("The database '" + modified + "' invoice '" + modifiedInvoice[i].SaleInvoiceNumber + + "' does not match the Xero version. If the Xero version is correct, " + + "manually delete the database version and retry."); + } + } + } + if (isMissing) + { + throw new Exception("The database '" + modified + "' invoice '" + modifiedInvoice[i].SaleInvoiceNumber + + "' was not found in the Xero import. If this is correct, manually delete the db version and retry."); + } + } + } + // send list to database (it will get validated in data layer) if (xeroInvoiceList.Any()) { @@ -75,6 +114,7 @@ namespace BealeEngineering.Core.Logic.Import new Data.Database.Log.UpdateDateTime(sqlConnectionString) .ByMatchString("XeroSaleInvoiceFlatFileImport", flatfileData.FileInputCreatedDate); } + /// /// Get a dictionary of contacts, referenced by unique 'Contact Name'. Any contacts not found in db are /// automatically added. diff --git a/BealeEngineering/BealeEngineering.Core/Logic/Sale/SaleInvoiceAssign.cs b/BealeEngineering/BealeEngineering.Core/Logic/Sale/SaleInvoiceAssign.cs index 99be829..8136467 100644 --- a/BealeEngineering/BealeEngineering.Core/Logic/Sale/SaleInvoiceAssign.cs +++ b/BealeEngineering/BealeEngineering.Core/Logic/Sale/SaleInvoiceAssign.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using System.Globalization; using System.Linq; using System.Text; using System.Threading.Tasks; @@ -9,6 +10,8 @@ namespace BealeEngineering.Core.Logic.Sale { public class SaleInvoiceAssign { + string statusModified = new Data.SaleInvoiceFormat().ReadStatusStringModified(); + string statusNew = new Data.SaleInvoiceFormat().ReadStatusStringNew(); string sqlConnectionString; int timeCheckMinutes = 15; DateTime timeCheckPostpone = new DateTime(); @@ -30,6 +33,7 @@ namespace BealeEngineering.Core.Logic.Sale var readInvoice = new Data.Database.Sale.ReadInvoice(sqlConnectionString); readInvoice.InvoiceNumber = new List { saleInvoiceNumber }; Model.Sale.Invoice invoice = readInvoice.Read()[0]; + int invoiceId = invoice.SaleInvoiceID; decimal? facilityNet = new Data.Database.Client.ReadPurchaseOrderLineFacility(sqlConnectionString).Read(purchaseOrderLineId); @@ -45,10 +49,11 @@ namespace BealeEngineering.Core.Logic.Sale Model.Client.PurchaseOrderHeader poHeader = new Data.Database.Client.ReadPurchaseOrder(sqlConnectionString).ByPurchaseOrderLineId(purchaseOrderLineId); + var updateInvoice = new Data.Database.Sale.UpdateInvoice(sqlConnectionString); if (facilityNet >= invoice.InvoiceNetTotal && SplitInvoice) { invoice.Reference = poHeader.ClientReference; - invoice.Status = "Modified"; + invoice.Status = statusModified; } else if (facilityNet < invoice.InvoiceNetTotal && SplitInvoice == true) { @@ -61,17 +66,18 @@ namespace BealeEngineering.Core.Logic.Sale } } - // save check values + // save check values & get currency symbol decimal invTotal = invoice.InvoiceTotal; decimal invTaxTotal = invoice.TaxTotal; + var culture = new Data.CurrencyFormat().ReadCulture(invoice.CurrencyCode); // prep second invoice var newInvoice = invoice.Copy(); - newInvoice.Status = "New"; + newInvoice.Status = statusNew; // prep first invoice invoice.Reference = poHeader.ClientReference; - invoice.Status = "Modified"; + invoice.Status = statusModified; //loop though lines to find split location int i = 0; @@ -106,9 +112,8 @@ namespace BealeEngineering.Core.Logic.Sale //create split text splitText = Environment.NewLine + Environment.NewLine - + "Line split (" + invoice.InvoiceLineList[i].Quantity.ToString() + " x " + invoice.InvoiceLineList[i].UnitAmount.ToString("F") - + " = " + (invoice.InvoiceLineList[i].Quantity * invoice.InvoiceLineList[i].UnitAmount).ToString("F") + " " - + invoice.CurrencyCode + ")" + Environment.NewLine ; + + "Line split (" + invoice.InvoiceLineList[i].Quantity.ToString("0.######") + " x " + invoice.InvoiceLineList[i].UnitAmount.ToString("C", culture) + + " = " + (invoice.InvoiceLineList[i].Quantity * invoice.InvoiceLineList[i].UnitAmount).ToString("C", culture) + ")" + Environment.NewLine ; newInvoice.InvoiceLineList[i].Quantity = 1; splitAmount2 = lineSum - (decimal)facilityNet; @@ -177,13 +182,15 @@ namespace BealeEngineering.Core.Logic.Sale throw new Exception("Invalid invoice: " + newInvoice.ValidationResults[0]); } - // update db - var updateInvoice = new Data.Database.Sale.UpdateInvoice(sqlConnectionString); - updateInvoice.ByInvoice(invoice); + // add new invoice to db updateInvoice.ByInvoice(newInvoice, true); - - scope.Complete(); } + + // update existing invoice and add link invoice to purchaseOrder line + updateInvoice.ByInvoice(invoice); + new Data.Database.Client.CreatePurchaseOrderAllocation(sqlConnectionString).Create(invoiceId, purchaseOrderLineId); + + scope.Complete(); } } diff --git a/BealeEngineering/BealeEngineering.Core/Logic/Validate/CientPurchaseOrder.cs b/BealeEngineering/BealeEngineering.Core/Logic/Validate/CientPurchaseOrder.cs new file mode 100644 index 0000000..f5dfe35 --- /dev/null +++ b/BealeEngineering/BealeEngineering.Core/Logic/Validate/CientPurchaseOrder.cs @@ -0,0 +1,36 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace BealeEngineering.Core.Logic.Validate +{ + public class CientPurchaseOrder + { + public List ValidationResults { get; private set; } = new List(); + + public bool IsValid(Model.Client.PurchaseOrder purchaseOrder) + { + ValidationResults = new List(); + + return Validator.TryValidateObject( + purchaseOrder, + new ValidationContext(purchaseOrder, null, null), + ValidationResults, + false); + } + + public bool IsValid(Model.Client.PurchaseOrderHeader purchaseOrderHeader) + { + ValidationResults = new List(); + + return Validator.TryValidateObject( + purchaseOrderHeader, + new ValidationContext(purchaseOrderHeader, null, null), + ValidationResults, + false); + } + } +} diff --git a/BealeEngineering/BealeEngineering.Core/Model/Client/PurchaseOrder.cs b/BealeEngineering/BealeEngineering.Core/Model/Client/PurchaseOrder.cs index 45d6c82..ed738cd 100644 --- a/BealeEngineering/BealeEngineering.Core/Model/Client/PurchaseOrder.cs +++ b/BealeEngineering/BealeEngineering.Core/Model/Client/PurchaseOrder.cs @@ -4,6 +4,7 @@ using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.Text; using System.Linq; +using System.ComponentModel; namespace BealeEngineering.Core.Model.Client { @@ -18,15 +19,36 @@ namespace BealeEngineering.Core.Model.Client } } - public List OrderLineList { get; set; } + public List OrderLineList { get; set; } = new List(); public class PurchaseOrderLine { - public int ClientPurchaseOrderLineID { get; set; } - public int ClientPurchaseOrderID { get; set; } + int? clientPurchaseOrderLineId = null; + + public int ClientPurchaseOrderLineID + { + get { return clientPurchaseOrderLineId.GetValueOrDefault(); } + set { clientPurchaseOrderLineId = value; } + } + + public bool ClientPurchaseOrderLineIDIsSet + { + get + { + if (clientPurchaseOrderLineId == null || clientPurchaseOrderLineId < 1) { return false; } + else { return true; } + } + } + + [Required()] public int LineNumber { get; set; } - public int ProjectJobID { get; set; } + + public string ProjectWorkNumber { get; set; } + + [Required()] public string Description { get; set; } + + [Required()] public decimal LineNetAmount { get; set; } } @@ -36,10 +58,16 @@ namespace BealeEngineering.Core.Model.Client if (OrderLineCount == 0) { - var result = new ValidationResult("Quantity must be greater than zero."); + var result = new ValidationResult("No order lines set"); results.Add(result); } - throw new NotImplementedException(); + + if (OrderTotal != OrderLineList.Sum(x => x.LineNetAmount)) + { + var result = new ValidationResult("Order total does not equal sum of line list."); + results.Add(result); + } + return results; } } } diff --git a/BealeEngineering/BealeEngineering.Core/Model/Client/PurchaseOrderAllocation.cs b/BealeEngineering/BealeEngineering.Core/Model/Client/PurchaseOrderAllocation.cs index 570f64e..b4d8291 100644 --- a/BealeEngineering/BealeEngineering.Core/Model/Client/PurchaseOrderAllocation.cs +++ b/BealeEngineering/BealeEngineering.Core/Model/Client/PurchaseOrderAllocation.cs @@ -9,11 +9,11 @@ namespace BealeEngineering.Core.Model.Client public class PurchaseOrderAllocation { public DateTime PurchaseOrderDate { get; set; } - public string JobNumber { get; set; } + public string WorkNumber { get; set; } public string ContactName { get; set; } public string ProjectTitle { get; set; } - public string JobTitle { get; set; } - public string JobDescription { get; set; } + public string WorkTitle { get; set; } + public string WorkDescription { get; set; } public string PurchaseOrderReference { get; set; } public int PurchaseOrderLineID { get; set; } public int PurchaseOrderLineNumber { get; set; } diff --git a/BealeEngineering/BealeEngineering.Core/Model/Client/PurchaseOrderHeader.cs b/BealeEngineering/BealeEngineering.Core/Model/Client/PurchaseOrderHeader.cs index 298ca3d..4bfedf0 100644 --- a/BealeEngineering/BealeEngineering.Core/Model/Client/PurchaseOrderHeader.cs +++ b/BealeEngineering/BealeEngineering.Core/Model/Client/PurchaseOrderHeader.cs @@ -10,7 +10,22 @@ namespace BealeEngineering.Core.Model.Client { public class PurchaseOrderHeader : IValidatableObject { - public int ClientPurchaseOrderID { get; set; } + int? clientPurchaseOrderID = null; + + public int ClientPurchaseOrderID + { + get { return clientPurchaseOrderID.GetValueOrDefault(); } + set { clientPurchaseOrderID = value; } + } + + public bool ClientPurchaseOrderIDIsSet + { + get + { + if (clientPurchaseOrderID == null) { return false; } + else { return true; } + } + } [Required()] public DateTime PurchaseOrderDate { get; set; } diff --git a/BealeEngineering/BealeEngineering.Core/Model/Contact/Contact.cs b/BealeEngineering/BealeEngineering.Core/Model/Contact/Contact.cs index 8ffdd40..b8a69bd 100644 --- a/BealeEngineering/BealeEngineering.Core/Model/Contact/Contact.cs +++ b/BealeEngineering/BealeEngineering.Core/Model/Contact/Contact.cs @@ -10,14 +10,21 @@ namespace BealeEngineering.Core.Model.Contact public class Contact : ValidateModel { public int ContactId { get; set; } - [Required(AllowEmptyStrings = false), StringLength(100)] + + [Required(), StringLength(100)] public string ContactName { get; set; } + [StringLength(150), EmailAddress] public string EmailAddress { get; set; } + public string PrimaryPersonFirstName { get; set; } + public string PrimaryPersonSurname { get; set; } + public string PrimaryPersonEmail { get; set; } + public Address PostalAddress { get; set; } + public bool PostalAddressIsSet { get @@ -26,48 +33,18 @@ namespace BealeEngineering.Core.Model.Contact else { return true; } } } + public override IEnumerable Validate(ValidationContext validationContext) { if (ValidationResults == null) { ValidationResults = new List(); } if (PostalAddressIsSet) { - //var lkdfj = Validator.TryValidateObject(this.PostalAddress, - //new ValidationContext(this.PostalAddress, null, null) { MemberName = "PostalAddress" }, - //ValidationResults); - - - - - - - //// this doesn't - //Contact contact = validationContext as contact; - //if (contact != null) - //{ - // // ValidationResult(" Error Message ", " MemberNames " ) - // yield return new ValidationResult("No Department and Employees information", new string[] { "DepartmentList & EmployeeList" }); - //} - - - - - //// this works!!!!!!!!!! var context = new ValidationContext(this.PostalAddress); var results = new List(); if (!Validator.TryValidateObject(this.PostalAddress, context, results)) { ValidationResults.AddRange(results); } - - - //if (!PostalAddress.IsValid()) - //{ - - // // for some reason, when an invalid property is found, it is - // // added to the list twice. - // // It works, so no point in trying to fix - // ValidationResults.AddRange(PostalAddress.ValidationResults); - //} } return ValidationResults; diff --git a/BealeEngineering/BealeEngineering.Core/Model/Export/XeroInvoiceFlatFileDTO.cs b/BealeEngineering/BealeEngineering.Core/Model/Export/XeroInvoiceFlatFileDTO.cs new file mode 100644 index 0000000..333e9fb --- /dev/null +++ b/BealeEngineering/BealeEngineering.Core/Model/Export/XeroInvoiceFlatFileDTO.cs @@ -0,0 +1,78 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace BealeEngineering.Core.Model.Export +{ + public class XeroInvoiceFlatFileDTO + { + [CsvHelper.Configuration.Attributes.Name("*ContactName")] + public string ContactName { get; set; } + + public string EmailAddress { get; set; } + + public string POAddressLine1 { get; set; } + + public string POAddressLine2 { get; set; } + + public string POAddressLine3 { get; set; } + + public string POAddressLine4 { get; set; } + + public string POCity { get; set; } + + public string PORegion { get; set; } + + public string POPostalCode { get; set; } + + public string POCountry { get; set; } + + [CsvHelper.Configuration.Attributes.Name("*InvoiceNumber")] + public string InvoiceNumber { get; set; } + + public string Reference { get; set; } + + [CsvHelper.Configuration.Attributes.Name("*InvoiceDate")] + public DateTime InvoiceDate { get; set; } + + [CsvHelper.Configuration.Attributes.Name("*DueDate")] + public DateTime DueDate { get; set; } + + public decimal Total { get; set; } + + public string InventoryItemCode { get; set; } + + [CsvHelper.Configuration.Attributes.Name("*Description")] + public string Description { get; set; } + + [CsvHelper.Configuration.Attributes.Name("*Quantity")] + public decimal Quantity { get; set; } + + [CsvHelper.Configuration.Attributes.Name("*UnitAmount")] + public decimal UnitAmount { get; set; } + + public decimal? Discount { get; set; } + + [CsvHelper.Configuration.Attributes.Name("*AccountCode")] + public string AccountCode { get; set; } + + [CsvHelper.Configuration.Attributes.Name("*TaxType")] + public string TaxType { get; set; } + + public decimal TaxAmount { get; set; } + + public string TrackingName1 { get; set; } + + public string TrackingOption1 { get; set; } + + public string TrackingName2 { get; set; } + + public string TrackingOption2 { get; set; } + + public string Currency { get; set; } + + public string BrandingTheme { get; set; } + } +} diff --git a/BealeEngineering/BealeEngineering.Core/Model/Project/Project.cs b/BealeEngineering/BealeEngineering.Core/Model/Project/Project.cs new file mode 100644 index 0000000..bca9bdd --- /dev/null +++ b/BealeEngineering/BealeEngineering.Core/Model/Project/Project.cs @@ -0,0 +1,36 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace BealeEngineering.Core.Model.Project +{ + public class Project : IValidatableObject + { + public int? ProjectNumber { get; set; } + + [Required(), StringLength(100)] + public string ProjectClient { get; set; } + + [Required(), StringLength(16)] + public string ProjectReference { get; set; } + + [Required(), StringLength(250)] + public string ProjectTitle { get; set; } + + public DateTime? DateStart { get; set; } + + public DateTime? DateEnd { get; set; } + + [Required()] + public bool? IsArchived { get; set; } + + public IEnumerable Validate(ValidationContext validationContext) + { + var results = new List(); + return results; + } + } +} diff --git a/BealeEngineering/BealeEngineering.Core/Model/Project/ProjectWork.cs b/BealeEngineering/BealeEngineering.Core/Model/Project/ProjectWork.cs new file mode 100644 index 0000000..986b6e6 --- /dev/null +++ b/BealeEngineering/BealeEngineering.Core/Model/Project/ProjectWork.cs @@ -0,0 +1,50 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace BealeEngineering.Core.Model.Project +{ + public class ProjectWork : Project, IValidatableObject + { + public ProjectWork() + { + //if (project.GetType().GetProperties().Count() != 8) + //{ + // throw new InvalidOperationException("ProjectWork constructor invalid."); + //} + + //this.DateEnd = project.DateEnd; + //this.DateStart = project.DateStart; + //this.IsArchived = project.IsArchived; + //this.ProjectClient = project.ProjectClient; + //this.ProjectNumber = project.ProjectNumber; + //this.ProjectReference = project.ProjectReference; + //this.ProjectTitle = project.ProjectTitle; + } + + public List ProjectWorkLineList { get; set; } = new List(); + + public class ProjectWorkLine : ProjectWorkItemDetail + { + + } + + public bool ProjectWorkItemListIsSet + { + get + { + if (ProjectWorkLineList == null || ProjectWorkLineList.Count == 0) { return false; } + else { return true; } + } + } + + public new IEnumerable Validate(ValidationContext validationContext) + { + var results = base.Validate(validationContext); + return results; + } + } +} diff --git a/BealeEngineering/BealeEngineering.Core/Model/Project/ProjectWorkItem.cs b/BealeEngineering/BealeEngineering.Core/Model/Project/ProjectWorkItem.cs new file mode 100644 index 0000000..d98e438 --- /dev/null +++ b/BealeEngineering/BealeEngineering.Core/Model/Project/ProjectWorkItem.cs @@ -0,0 +1,18 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace BealeEngineering.Core.Model.Project +{ + public class ProjectWorkItem : ProjectWorkItemDetail + { + public int ProjectNumber { get; set; } + + public string ProjectReference { get; set; } + + public string ProjectTitle { get; set; } + } +} diff --git a/BealeEngineering/BealeEngineering.Core/Model/Project/ProjectWorkItemDetail.cs b/BealeEngineering/BealeEngineering.Core/Model/Project/ProjectWorkItemDetail.cs new file mode 100644 index 0000000..e0bdbd8 --- /dev/null +++ b/BealeEngineering/BealeEngineering.Core/Model/Project/ProjectWorkItemDetail.cs @@ -0,0 +1,31 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace BealeEngineering.Core.Model.Project +{ + public abstract class ProjectWorkItemDetail + { + [Required(), StringLength(100)] + public string WorkItemClient { get; set; } + + [Required(), MinLength(7), MaxLength(7)] + public string WorkNumber { get; set; } + + [Required(), StringLength(250)] + public string WorkItemTitle { get; set; } + + [StringLength(500)] + public string WorkItemDescription { get; set; } + + public DateTime? WorkItemDateStart { get; set; } + + public DateTime? WorkItemDateEnd { get; set; } + + [Required()] + public bool? WorkItemIsArchived { get; set; } + } +} diff --git a/BealeEngineering/BealeEngineering.Core/Model/Sale/InvoiceHeader.cs b/BealeEngineering/BealeEngineering.Core/Model/Sale/InvoiceHeader.cs index e119db5..069e035 100644 --- a/BealeEngineering/BealeEngineering.Core/Model/Sale/InvoiceHeader.cs +++ b/BealeEngineering/BealeEngineering.Core/Model/Sale/InvoiceHeader.cs @@ -60,7 +60,7 @@ namespace BealeEngineering.Core.Model.Sale ValidationResults.Add(result); } - var prefix = new Data.SaleInvoiceNumberFormat(); + var prefix = new Data.SaleInvoiceFormat(); if (IsCreditNote && SaleInvoiceNumber.Substring(0, 3) != prefix.ReadCreditNotePrefix()) { // if this format changes, check data get next invoice number diff --git a/BealeEngineering/BealeEngineering.Core/Test/Export/FlatFile.cs b/BealeEngineering/BealeEngineering.Core/Test/Export/FlatFile.cs index 5d9f97f..895c951 100644 --- a/BealeEngineering/BealeEngineering.Core/Test/Export/FlatFile.cs +++ b/BealeEngineering/BealeEngineering.Core/Test/Export/FlatFile.cs @@ -21,7 +21,7 @@ namespace BealeEngineering.Core.Test.Export public void XeroInvoice() { - new Logic.Export.XeroInvoiceFlatFile(sqlConnectionString).Execute(); + new Logic.Export.ExcelInvoiceFlatFile(sqlConnectionString).Execute(); } } }