Client purchase order form added

This commit is contained in:
2020-02-13 12:19:39 +00:00
parent 7210812458
commit a0c4349040
20 changed files with 963 additions and 240 deletions

View File

@@ -12,6 +12,22 @@
<FileAlignment>512</FileAlignment>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<Deterministic>true</Deterministic>
<IsWebBootstrapper>false</IsWebBootstrapper>
<PublishUrl>C:\Users\Bobbie\Desktop\jjjjjjjjjjjjjjjjjjjjjj\</PublishUrl>
<Install>true</Install>
<InstallFrom>Disk</InstallFrom>
<UpdateEnabled>false</UpdateEnabled>
<UpdateMode>Foreground</UpdateMode>
<UpdateInterval>7</UpdateInterval>
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
<UpdatePeriodically>false</UpdatePeriodically>
<UpdateRequired>false</UpdateRequired>
<MapFileExtensions>true</MapFileExtensions>
<ApplicationRevision>1</ApplicationRevision>
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
<UseApplicationTrust>false</UseApplicationTrust>
<PublishWizardCompleted>true</PublishWizardCompleted>
<BootstrapperEnabled>true</BootstrapperEnabled>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
@@ -32,6 +48,18 @@
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup>
<ManifestCertificateThumbprint>2380E7895746C9FBBC0797D8269D9B8D56612ECE</ManifestCertificateThumbprint>
</PropertyGroup>
<PropertyGroup>
<ManifestKeyFile>BealeEngineering.Accounts_TemporaryKey.pfx</ManifestKeyFile>
</PropertyGroup>
<PropertyGroup>
<GenerateManifests>true</GenerateManifests>
</PropertyGroup>
<PropertyGroup>
<SignManifests>true</SignManifests>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Configuration" />
@@ -52,6 +80,12 @@
<DesignTime>True</DesignTime>
<DependentUpon>BealeEngDataSet.xsd</DependentUpon>
</Compile>
<Compile Include="frmClientPurchaseOrder.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="frmClientPurchaseOrder.Designer.cs">
<DependentUpon>frmClientPurchaseOrder.cs</DependentUpon>
</Compile>
<Compile Include="Form1.cs">
<SubType>Form</SubType>
</Compile>
@@ -60,6 +94,9 @@
</Compile>
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<EmbeddedResource Include="frmClientPurchaseOrder.resx">
<DependentUpon>frmClientPurchaseOrder.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Form1.resx">
<DependentUpon>Form1.cs</DependentUpon>
</EmbeddedResource>
@@ -83,6 +120,9 @@
<None Include="BealeEngDataSet.xss">
<DependentUpon>BealeEngDataSet.xsd</DependentUpon>
</None>
<None Include="BealeEngineering.Accounts_TemporaryKey.pfx" />
<None Include="Properties\DataSources\BealeEngineering.Core.Model.Client.PurchaseOrder+PurchaseOrderLine.datasource" />
<None Include="Properties\DataSources\BealeEngineering.Core.Model.Client.PurchaseOrder.datasource" />
<None Include="Properties\DataSources\BealeEngineering.Core.Model.Client.PurchaseOrderAllocation.datasource" />
<None Include="Properties\DataSources\Form1.datasource" />
<None Include="Properties\Settings.settings">
@@ -104,5 +144,17 @@
<Name>BealeEngineering.Core</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<BootstrapperPackage Include=".NETFramework,Version=v4.7.2">
<Visible>False</Visible>
<ProductName>Microsoft .NET Framework 4.7.2 %28x86 and x64%29</ProductName>
<Install>true</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
<Visible>False</Visible>
<ProductName>.NET Framework 3.5 SP1</ProductName>
<Install>false</Install>
</BootstrapperPackage>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>

View File

@@ -29,42 +29,39 @@
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle3 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle4 = 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.button2 = new System.Windows.Forms.Button();
this.btnAutoMatch = new System.Windows.Forms.Button();
this.btnOpenPurchaseOrder = new System.Windows.Forms.Button();
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.textBox1 = new System.Windows.Forms.TextBox();
this.txtUnallocatedCount = new System.Windows.Forms.TextBox();
this.dataGridView1 = new System.Windows.Forms.DataGridView();
this.purchaseOrderAllocationBindingSource = 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.testToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.testItToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.exportToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.xeroInvoiceToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem();
this.contactNameDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.projectTitleDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.purchaseOrderDateDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.purchaseOrderReferenceDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.purchaseOrderLineNumberDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.purchaseOrderLineDescriptionDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.purchaseOrderLineNetAmountDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.jobNumberDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.invoicedAmountDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.purchaseOrderLineFacilityDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.purchaseOrderIsClosedDataGridViewCheckBoxColumn = new System.Windows.Forms.DataGridViewCheckBoxColumn();
this.jobTitleDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.jobDescriptionDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.purchaseOrderAllocationBindingSource = new System.Windows.Forms.BindingSource(this.components);
this.testToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.testItToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
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.PurchaseOrderIsClosed = new System.Windows.Forms.DataGridViewCheckBoxColumn();
this.PurchaseOrderLineID = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.tabControl1.SuspendLayout();
this.tabPage1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.splitContainer3)).BeginInit();
@@ -72,8 +69,8 @@
this.splitContainer3.Panel2.SuspendLayout();
this.splitContainer3.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).BeginInit();
this.menuStrip1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.purchaseOrderAllocationBindingSource)).BeginInit();
this.menuStrip1.SuspendLayout();
this.SuspendLayout();
//
// tabControl1
@@ -106,7 +103,9 @@
//
// splitContainer3.Panel1
//
this.splitContainer3.Panel1.Controls.Add(this.button2);
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);
@@ -121,15 +120,37 @@
this.splitContainer3.SplitterDistance = 93;
this.splitContainer3.TabIndex = 0;
//
// button2
// btnAutoMatch
//
this.button2.Location = new System.Drawing.Point(197, 56);
this.button2.Name = "button2";
this.button2.Size = new System.Drawing.Size(76, 20);
this.button2.TabIndex = 9;
this.button2.Text = "Refresh";
this.button2.UseVisualStyleBackColor = true;
this.button2.Click += new System.EventHandler(this.button2_Click);
this.btnAutoMatch.Location = new System.Drawing.Point(198, 56);
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);
//
// btnOpenPurchaseOrder
//
this.btnOpenPurchaseOrder.Anchor = System.Windows.Forms.AnchorStyles.Right;
this.btnOpenPurchaseOrder.Location = new System.Drawing.Point(521, 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);
//
// btnAddPurchaseOrder
//
this.btnAddPurchaseOrder.Anchor = System.Windows.Forms.AnchorStyles.Right;
this.btnAddPurchaseOrder.Location = new System.Drawing.Point(325, 56);
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.UseVisualStyleBackColor = true;
this.btnAddPurchaseOrder.Click += new System.EventHandler(this.btnAddPurchaseOrder_Click);
//
// button1
//
@@ -187,19 +208,18 @@
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.contactNameDataGridViewTextBoxColumn,
this.projectTitleDataGridViewTextBoxColumn,
this.purchaseOrderDateDataGridViewTextBoxColumn,
this.purchaseOrderReferenceDataGridViewTextBoxColumn,
this.purchaseOrderLineNumberDataGridViewTextBoxColumn,
this.purchaseOrderLineDescriptionDataGridViewTextBoxColumn,
this.purchaseOrderLineNetAmountDataGridViewTextBoxColumn,
this.jobNumberDataGridViewTextBoxColumn,
this.invoicedAmountDataGridViewTextBoxColumn,
this.purchaseOrderLineFacilityDataGridViewTextBoxColumn,
this.purchaseOrderIsClosedDataGridViewCheckBoxColumn,
this.jobTitleDataGridViewTextBoxColumn,
this.jobDescriptionDataGridViewTextBoxColumn});
this.ContactName,
this.ProjectTitle,
this.PurchaseOrderDate,
this.PurchaseOrderReference,
this.PurchaseOrderLineNumber,
this.PurchaseOrderLineDescription,
this.PurchaseOrderLineNetAmount,
this.InvoicedAmount,
this.PurchaseOrderLineFacility,
this.JobNumber,
this.PurchaseOrderIsClosed,
this.PurchaseOrderLineID});
this.dataGridView1.DataSource = this.purchaseOrderAllocationBindingSource;
this.dataGridView1.Dock = System.Windows.Forms.DockStyle.Fill;
this.dataGridView1.Location = new System.Drawing.Point(0, 0);
@@ -212,6 +232,11 @@
this.dataGridView1.CellContentClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.dataGridView1_CellContentClick);
this.dataGridView1.CellDoubleClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.dataGridView1_CellDoubleClick);
//
// purchaseOrderAllocationBindingSource
//
this.purchaseOrderAllocationBindingSource.AllowNew = false;
this.purchaseOrderAllocationBindingSource.DataSource = typeof(BealeEngineering.Core.Model.Client.PurchaseOrderAllocation);
//
// menuStrip1
//
this.menuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
@@ -246,6 +271,21 @@
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.xeroInvoiceToolStripMenuItem1});
this.exportToolStripMenuItem.Name = "exportToolStripMenuItem";
this.exportToolStripMenuItem.Size = new System.Drawing.Size(53, 20);
this.exportToolStripMenuItem.Text = "Export";
//
// xeroInvoiceToolStripMenuItem1
//
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);
//
// testToolStripMenuItem
//
this.testToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
@@ -261,167 +301,124 @@
this.testItToolStripMenuItem.Text = "Test it!";
this.testItToolStripMenuItem.Click += new System.EventHandler(this.testItToolStripMenuItem_Click);
//
// exportToolStripMenuItem
// ContactName
//
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.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;
//
// xeroInvoiceToolStripMenuItem1
// ProjectTitle
//
this.xeroInvoiceToolStripMenuItem1.Name = "xeroInvoiceToolStripMenuItem1";
this.xeroInvoiceToolStripMenuItem1.Size = new System.Drawing.Size(180, 22);
this.xeroInvoiceToolStripMenuItem1.Text = "Xero Invoice";
this.xeroInvoiceToolStripMenuItem1.Click += new System.EventHandler(this.xeroInvoiceToolStripMenuItem1_Click);
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;
//
// contactNameDataGridViewTextBoxColumn
// PurchaseOrderDate
//
this.contactNameDataGridViewTextBoxColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
this.contactNameDataGridViewTextBoxColumn.DataPropertyName = "ContactName";
this.contactNameDataGridViewTextBoxColumn.FillWeight = 150F;
this.contactNameDataGridViewTextBoxColumn.HeaderText = "Client";
this.contactNameDataGridViewTextBoxColumn.Name = "contactNameDataGridViewTextBoxColumn";
this.contactNameDataGridViewTextBoxColumn.ReadOnly = true;
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;
//
// projectTitleDataGridViewTextBoxColumn
// PurchaseOrderReference
//
this.projectTitleDataGridViewTextBoxColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
this.projectTitleDataGridViewTextBoxColumn.DataPropertyName = "ProjectTitle";
this.projectTitleDataGridViewTextBoxColumn.FillWeight = 200F;
this.projectTitleDataGridViewTextBoxColumn.HeaderText = "Project";
this.projectTitleDataGridViewTextBoxColumn.Name = "projectTitleDataGridViewTextBoxColumn";
this.projectTitleDataGridViewTextBoxColumn.ReadOnly = true;
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;
//
// purchaseOrderDateDataGridViewTextBoxColumn
// PurchaseOrderLineNumber
//
this.purchaseOrderDateDataGridViewTextBoxColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
this.purchaseOrderDateDataGridViewTextBoxColumn.DataPropertyName = "PurchaseOrderDate";
this.purchaseOrderDateDataGridViewTextBoxColumn.FillWeight = 30.59646F;
this.purchaseOrderDateDataGridViewTextBoxColumn.HeaderText = "PO Date";
this.purchaseOrderDateDataGridViewTextBoxColumn.MinimumWidth = 80;
this.purchaseOrderDateDataGridViewTextBoxColumn.Name = "purchaseOrderDateDataGridViewTextBoxColumn";
this.purchaseOrderDateDataGridViewTextBoxColumn.ReadOnly = true;
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;
//
// purchaseOrderReferenceDataGridViewTextBoxColumn
// PurchaseOrderLineDescription
//
this.purchaseOrderReferenceDataGridViewTextBoxColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
this.purchaseOrderReferenceDataGridViewTextBoxColumn.DataPropertyName = "PurchaseOrderReference";
this.purchaseOrderReferenceDataGridViewTextBoxColumn.FillWeight = 30.59646F;
this.purchaseOrderReferenceDataGridViewTextBoxColumn.HeaderText = "PO Number";
this.purchaseOrderReferenceDataGridViewTextBoxColumn.MinimumWidth = 100;
this.purchaseOrderReferenceDataGridViewTextBoxColumn.Name = "purchaseOrderReferenceDataGridViewTextBoxColumn";
this.purchaseOrderReferenceDataGridViewTextBoxColumn.ReadOnly = true;
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;
//
// purchaseOrderLineNumberDataGridViewTextBoxColumn
// PurchaseOrderLineNetAmount
//
this.purchaseOrderLineNumberDataGridViewTextBoxColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
this.purchaseOrderLineNumberDataGridViewTextBoxColumn.DataPropertyName = "PurchaseOrderLineNumber";
this.purchaseOrderLineNumberDataGridViewTextBoxColumn.FillWeight = 30.59646F;
this.purchaseOrderLineNumberDataGridViewTextBoxColumn.HeaderText = "Line No.";
this.purchaseOrderLineNumberDataGridViewTextBoxColumn.MinimumWidth = 50;
this.purchaseOrderLineNumberDataGridViewTextBoxColumn.Name = "purchaseOrderLineNumberDataGridViewTextBoxColumn";
this.purchaseOrderLineNumberDataGridViewTextBoxColumn.ReadOnly = true;
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;
//
// purchaseOrderLineDescriptionDataGridViewTextBoxColumn
// InvoicedAmount
//
this.purchaseOrderLineDescriptionDataGridViewTextBoxColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
this.purchaseOrderLineDescriptionDataGridViewTextBoxColumn.DataPropertyName = "PurchaseOrderLineDescription";
this.purchaseOrderLineDescriptionDataGridViewTextBoxColumn.FillWeight = 300F;
this.purchaseOrderLineDescriptionDataGridViewTextBoxColumn.HeaderText = "Description";
this.purchaseOrderLineDescriptionDataGridViewTextBoxColumn.Name = "purchaseOrderLineDescriptionDataGridViewTextBoxColumn";
this.purchaseOrderLineDescriptionDataGridViewTextBoxColumn.ReadOnly = true;
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;
//
// purchaseOrderLineNetAmountDataGridViewTextBoxColumn
// PurchaseOrderLineFacility
//
this.purchaseOrderLineNetAmountDataGridViewTextBoxColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
this.purchaseOrderLineNetAmountDataGridViewTextBoxColumn.DataPropertyName = "PurchaseOrderLineNetAmount";
dataGridViewCellStyle1.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleRight;
dataGridViewCellStyle1.Format = "C2";
dataGridViewCellStyle1.NullValue = null;
this.purchaseOrderLineNetAmountDataGridViewTextBoxColumn.DefaultCellStyle = dataGridViewCellStyle1;
this.purchaseOrderLineNetAmountDataGridViewTextBoxColumn.FillWeight = 50F;
this.purchaseOrderLineNetAmountDataGridViewTextBoxColumn.HeaderText = "Line Amount";
this.purchaseOrderLineNetAmountDataGridViewTextBoxColumn.MinimumWidth = 80;
this.purchaseOrderLineNetAmountDataGridViewTextBoxColumn.Name = "purchaseOrderLineNetAmountDataGridViewTextBoxColumn";
this.purchaseOrderLineNetAmountDataGridViewTextBoxColumn.ReadOnly = true;
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;
//
// jobNumberDataGridViewTextBoxColumn
// JobNumber
//
this.jobNumberDataGridViewTextBoxColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
this.jobNumberDataGridViewTextBoxColumn.DataPropertyName = "JobNumber";
dataGridViewCellStyle2.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleRight;
dataGridViewCellStyle2.Format = "C2";
dataGridViewCellStyle2.NullValue = null;
this.jobNumberDataGridViewTextBoxColumn.DefaultCellStyle = dataGridViewCellStyle2;
this.jobNumberDataGridViewTextBoxColumn.FillWeight = 30.59646F;
this.jobNumberDataGridViewTextBoxColumn.HeaderText = "Job Number";
this.jobNumberDataGridViewTextBoxColumn.MinimumWidth = 80;
this.jobNumberDataGridViewTextBoxColumn.Name = "jobNumberDataGridViewTextBoxColumn";
this.jobNumberDataGridViewTextBoxColumn.ReadOnly = true;
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;
//
// invoicedAmountDataGridViewTextBoxColumn
// PurchaseOrderIsClosed
//
this.invoicedAmountDataGridViewTextBoxColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
this.invoicedAmountDataGridViewTextBoxColumn.DataPropertyName = "InvoicedAmount";
dataGridViewCellStyle3.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleRight;
dataGridViewCellStyle3.Format = "C2";
dataGridViewCellStyle3.NullValue = null;
this.invoicedAmountDataGridViewTextBoxColumn.DefaultCellStyle = dataGridViewCellStyle3;
this.invoicedAmountDataGridViewTextBoxColumn.FillWeight = 50F;
this.invoicedAmountDataGridViewTextBoxColumn.HeaderText = "Invoiced";
this.invoicedAmountDataGridViewTextBoxColumn.MinimumWidth = 80;
this.invoicedAmountDataGridViewTextBoxColumn.Name = "invoicedAmountDataGridViewTextBoxColumn";
this.invoicedAmountDataGridViewTextBoxColumn.ReadOnly = true;
this.PurchaseOrderIsClosed.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.None;
this.PurchaseOrderIsClosed.DataPropertyName = "PurchaseOrderIsClosed";
this.PurchaseOrderIsClosed.FillWeight = 30.59646F;
this.PurchaseOrderIsClosed.HeaderText = "Archived";
this.PurchaseOrderIsClosed.MinimumWidth = 50;
this.PurchaseOrderIsClosed.Name = "PurchaseOrderIsClosed";
this.PurchaseOrderIsClosed.ReadOnly = true;
this.PurchaseOrderIsClosed.Width = 60;
//
// purchaseOrderLineFacilityDataGridViewTextBoxColumn
// PurchaseOrderLineID
//
this.purchaseOrderLineFacilityDataGridViewTextBoxColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
this.purchaseOrderLineFacilityDataGridViewTextBoxColumn.DataPropertyName = "PurchaseOrderLineFacility";
dataGridViewCellStyle4.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleRight;
dataGridViewCellStyle4.Format = "C2";
dataGridViewCellStyle4.NullValue = null;
this.purchaseOrderLineFacilityDataGridViewTextBoxColumn.DefaultCellStyle = dataGridViewCellStyle4;
this.purchaseOrderLineFacilityDataGridViewTextBoxColumn.FillWeight = 50F;
this.purchaseOrderLineFacilityDataGridViewTextBoxColumn.HeaderText = "Facility";
this.purchaseOrderLineFacilityDataGridViewTextBoxColumn.MinimumWidth = 80;
this.purchaseOrderLineFacilityDataGridViewTextBoxColumn.Name = "purchaseOrderLineFacilityDataGridViewTextBoxColumn";
this.purchaseOrderLineFacilityDataGridViewTextBoxColumn.ReadOnly = true;
//
// purchaseOrderIsClosedDataGridViewCheckBoxColumn
//
this.purchaseOrderIsClosedDataGridViewCheckBoxColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.None;
this.purchaseOrderIsClosedDataGridViewCheckBoxColumn.DataPropertyName = "PurchaseOrderIsClosed";
this.purchaseOrderIsClosedDataGridViewCheckBoxColumn.FillWeight = 30.59646F;
this.purchaseOrderIsClosedDataGridViewCheckBoxColumn.HeaderText = "Archived";
this.purchaseOrderIsClosedDataGridViewCheckBoxColumn.MinimumWidth = 50;
this.purchaseOrderIsClosedDataGridViewCheckBoxColumn.Name = "purchaseOrderIsClosedDataGridViewCheckBoxColumn";
this.purchaseOrderIsClosedDataGridViewCheckBoxColumn.ReadOnly = true;
this.purchaseOrderIsClosedDataGridViewCheckBoxColumn.Width = 60;
//
// jobTitleDataGridViewTextBoxColumn
//
this.jobTitleDataGridViewTextBoxColumn.DataPropertyName = "JobTitle";
this.jobTitleDataGridViewTextBoxColumn.HeaderText = "JobTitle";
this.jobTitleDataGridViewTextBoxColumn.Name = "jobTitleDataGridViewTextBoxColumn";
this.jobTitleDataGridViewTextBoxColumn.ReadOnly = true;
this.jobTitleDataGridViewTextBoxColumn.Visible = false;
//
// jobDescriptionDataGridViewTextBoxColumn
//
this.jobDescriptionDataGridViewTextBoxColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
this.jobDescriptionDataGridViewTextBoxColumn.DataPropertyName = "JobDescription";
this.jobDescriptionDataGridViewTextBoxColumn.FillWeight = 300F;
this.jobDescriptionDataGridViewTextBoxColumn.HeaderText = "Description";
this.jobDescriptionDataGridViewTextBoxColumn.Name = "jobDescriptionDataGridViewTextBoxColumn";
this.jobDescriptionDataGridViewTextBoxColumn.ReadOnly = true;
this.jobDescriptionDataGridViewTextBoxColumn.Visible = false;
//
// purchaseOrderAllocationBindingSource
//
this.purchaseOrderAllocationBindingSource.AllowNew = false;
this.purchaseOrderAllocationBindingSource.DataSource = typeof(BealeEngineering.Core.Model.Client.PurchaseOrderAllocation);
this.PurchaseOrderLineID.DataPropertyName = "PurchaseOrderLineID";
this.PurchaseOrderLineID.HeaderText = "PurchaseOrderLineID";
this.PurchaseOrderLineID.Name = "PurchaseOrderLineID";
this.PurchaseOrderLineID.ReadOnly = true;
this.PurchaseOrderLineID.Visible = false;
//
// Form1
//
@@ -442,9 +439,9 @@
((System.ComponentModel.ISupportInitialize)(this.splitContainer3)).EndInit();
this.splitContainer3.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.purchaseOrderAllocationBindingSource)).EndInit();
this.menuStrip1.ResumeLayout(false);
this.menuStrip1.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.purchaseOrderAllocationBindingSource)).EndInit();
this.ResumeLayout(false);
this.PerformLayout();
@@ -455,7 +452,6 @@
private System.Windows.Forms.TabControl tabControl1;
private System.Windows.Forms.TabPage tabPage1;
private System.Windows.Forms.SplitContainer splitContainer3;
private System.Windows.Forms.Button button2;
private System.Windows.Forms.Button button1;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Label label2;
@@ -468,21 +464,23 @@
private System.Windows.Forms.ToolStripMenuItem xeroInvoiceToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem testToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem testItToolStripMenuItem;
private System.Windows.Forms.DataGridViewTextBoxColumn contactNameDataGridViewTextBoxColumn;
private System.Windows.Forms.DataGridViewTextBoxColumn projectTitleDataGridViewTextBoxColumn;
private System.Windows.Forms.DataGridViewTextBoxColumn purchaseOrderDateDataGridViewTextBoxColumn;
private System.Windows.Forms.DataGridViewTextBoxColumn purchaseOrderReferenceDataGridViewTextBoxColumn;
private System.Windows.Forms.DataGridViewTextBoxColumn purchaseOrderLineNumberDataGridViewTextBoxColumn;
private System.Windows.Forms.DataGridViewTextBoxColumn purchaseOrderLineDescriptionDataGridViewTextBoxColumn;
private System.Windows.Forms.DataGridViewTextBoxColumn purchaseOrderLineNetAmountDataGridViewTextBoxColumn;
private System.Windows.Forms.DataGridViewTextBoxColumn jobNumberDataGridViewTextBoxColumn;
private System.Windows.Forms.DataGridViewTextBoxColumn invoicedAmountDataGridViewTextBoxColumn;
private System.Windows.Forms.DataGridViewTextBoxColumn purchaseOrderLineFacilityDataGridViewTextBoxColumn;
private System.Windows.Forms.DataGridViewCheckBoxColumn purchaseOrderIsClosedDataGridViewCheckBoxColumn;
private System.Windows.Forms.DataGridViewTextBoxColumn jobTitleDataGridViewTextBoxColumn;
private System.Windows.Forms.DataGridViewTextBoxColumn jobDescriptionDataGridViewTextBoxColumn;
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.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.DataGridViewCheckBoxColumn PurchaseOrderIsClosed;
private System.Windows.Forms.DataGridViewTextBoxColumn PurchaseOrderLineID;
}
}

View File

@@ -27,7 +27,6 @@ namespace BealeEngineering.Accounts
private void Form1_Load(object sender, EventArgs e)
{
UpdateTable();
button2_Click(null, null);
}
private void button1_Click(object sender, EventArgs e)
@@ -37,23 +36,40 @@ namespace BealeEngineering.Accounts
private void UpdateTable()
{
// update text box
var dataRead = new Core.Data.Database.Client.ReadSaleInvoiceAllocation(sqlConnectionString);
txtUnallocatedCount.Text = dataRead.GetUnallocatedInvoiceCount().ToString();
var readData = new Core.Data.Database.Client.ReadPurchaseOrderAllocation(sqlConnectionString);
var data = readData.Read();
//dataGridView1.Rows.AddRange()
purchaseOrderAllocationBindingSource.DataSource = data;
//dataGridView1.DataSource = data;
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);
// high light over invoiced lines
int facilityIndex = dataGridView1.Columns["PurchaseOrderLineFacility"].Index;
int lineAmountIndex = dataGridView1.Columns["PurchaseOrderLineNetAmount"].Index;
for (var i = 0; i < dataGridView1.Rows.Count; i++)
{
decimal facility = (decimal)dataGridView1[9, i].Value;
decimal facility = (decimal)dataGridView1[facilityIndex, i].Value;
decimal lineAmount = (decimal)dataGridView1[lineAmountIndex, i].Value;
if (facility == 0)
{
// code to grey out line
dataGridView1.Rows[i].DefaultCellStyle.ForeColor = Color.Gray;
dataGridView1.Rows[i].DefaultCellStyle.BackColor = Color.White;
}
else if (facility == lineAmount)
{
// code to green
dataGridView1.Rows[i].DefaultCellStyle.ForeColor = Color.Green;
dataGridView1.Rows[i].DefaultCellStyle.BackColor = Color.White;
}
else if (facility < 0)
{
// red line
@@ -100,12 +116,6 @@ namespace BealeEngineering.Accounts
}
private void button2_Click(object sender, EventArgs e)
{
var dataRead = new Core.Data.Database.Client.ReadSaleInvoiceAllocation(sqlConnectionString);
txtUnallocatedCount.Text = dataRead.GetUnallocatedInvoiceCount().ToString();
}
private void splitContainer1_Panel1_Paint(object sender, PaintEventArgs e)
{
@@ -176,5 +186,46 @@ namespace BealeEngineering.Accounts
MessageBox.Show(dialogText);
}
}
private void btnAutoMatch_Click(object sender, EventArgs e)
{
string dialogText = "Autoallocate unmatched invoices to purchase order lines?";
DialogResult dialogResult = MessageBox.Show(dialogText, "Auto allocate", MessageBoxButtons.OKCancel);
if (dialogResult == DialogResult.OK)
{
var autoMatch = new Core.Logic.Client.PurchaseOrderAutoAllocate(sqlConnectionString);
autoMatch.Execute();
dialogText = "Operation complete." + Environment.NewLine + Environment.NewLine
+ autoMatch.InvoiceMatched + " invoice(s) matched" + Environment.NewLine
+ autoMatch.InvoiceUnmatched + " invoice(s) unmatched" + Environment.NewLine
+ autoMatch.InvoiceProcessed + " invoice(s) processed" + Environment.NewLine;
MessageBox.Show(dialogText);
}
UpdateTable();
}
private void purchaseOrderAllocationBindingSource_CurrentChanged(object sender, EventArgs e)
{
}
private void btnAddPurchaseOrder_Click(object sender, EventArgs e)
{
var frmCLient = new frmClientPurchaseOrder(null);
frmCLient.ShowDialog();
}
private void btnOpenPurchaseOrder_Click(object sender, EventArgs e)
{
int idIndex = dataGridView1.Columns["PurchaseOrderLineID"].Index;
int lineId = (int)dataGridView1[idIndex, dataGridView1.CurrentCell.RowIndex].Value;
var po = new Core.Data.Database.Client.ReadPurchaseOrder(sqlConnectionString).ByPurchaseOrderLineId(lineId);
var frmPo = new frmClientPurchaseOrder(po);
frmPo.ShowDialog();
}
}
}

View File

@@ -117,6 +117,12 @@
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="PurchaseOrderIsClosed.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="PurchaseOrderLineID.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="purchaseOrderAllocationBindingSource.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>24, 20</value>
</metadata>

View File

@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
This file is automatically generated by Visual Studio .Net. It is
used to store generic object data source configuration information.
Renaming the file extension or editing the content of this file may
cause the file to be unrecognizable by the program.
-->
<GenericObjectDataSource DisplayName="PurchaseOrder+PurchaseOrderLine" Version="1.0" xmlns="urn:schemas-microsoft-com:xml-msdatasource">
<TypeInfo>BealeEngineering.Core.Model.Client.PurchaseOrder+PurchaseOrderLine, BealeEngineering.Core, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null</TypeInfo>
</GenericObjectDataSource>

View File

@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
This file is automatically generated by Visual Studio .Net. It is
used to store generic object data source configuration information.
Renaming the file extension or editing the content of this file may
cause the file to be unrecognizable by the program.
-->
<GenericObjectDataSource DisplayName="PurchaseOrder" Version="1.0" xmlns="urn:schemas-microsoft-com:xml-msdatasource">
<TypeInfo>BealeEngineering.Core.Model.Client.PurchaseOrder, BealeEngineering.Core, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null</TypeInfo>
</GenericObjectDataSource>

View File

@@ -0,0 +1,328 @@
namespace BealeEngineering.Accounts
{
partial class frmClientPurchaseOrder
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
System.Windows.Forms.Label clientReferenceLabel;
System.Windows.Forms.Label orderTotalLabel;
System.Windows.Forms.Label requestorEmailLabel;
System.Windows.Forms.Label purchaseOrderDateLabel;
System.Windows.Forms.Label contactNameLabel;
System.Windows.Forms.Label isClosedLabel;
this.dataGridView1 = new System.Windows.Forms.DataGridView();
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();
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();
((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();
this.SuspendLayout();
//
// clientReferenceLabel
//
clientReferenceLabel.AutoSize = true;
clientReferenceLabel.Location = new System.Drawing.Point(83, 113);
clientReferenceLabel.Name = "clientReferenceLabel";
clientReferenceLabel.Size = new System.Drawing.Size(89, 13);
clientReferenceLabel.TabIndex = 12;
clientReferenceLabel.Text = "Client Reference:";
//
// orderTotalLabel
//
orderTotalLabel.AutoSize = true;
orderTotalLabel.Location = new System.Drawing.Point(109, 165);
orderTotalLabel.Name = "orderTotalLabel";
orderTotalLabel.Size = new System.Drawing.Size(63, 13);
orderTotalLabel.TabIndex = 14;
orderTotalLabel.Text = "Order Total:";
//
// requestorEmailLabel
//
requestorEmailLabel.AutoSize = true;
requestorEmailLabel.Location = new System.Drawing.Point(85, 139);
requestorEmailLabel.Name = "requestorEmailLabel";
requestorEmailLabel.Size = new System.Drawing.Size(87, 13);
requestorEmailLabel.TabIndex = 15;
requestorEmailLabel.Text = "Requestor Email:";
//
// purchaseOrderDateLabel
//
purchaseOrderDateLabel.AutoSize = true;
purchaseOrderDateLabel.Location = new System.Drawing.Point(62, 88);
purchaseOrderDateLabel.Name = "purchaseOrderDateLabel";
purchaseOrderDateLabel.Size = new System.Drawing.Size(110, 13);
purchaseOrderDateLabel.TabIndex = 16;
purchaseOrderDateLabel.Text = "Purchase Order Date:";
//
// contactNameLabel
//
contactNameLabel.AutoSize = true;
contactNameLabel.Location = new System.Drawing.Point(94, 61);
contactNameLabel.Name = "contactNameLabel";
contactNameLabel.Size = new System.Drawing.Size(78, 13);
contactNameLabel.TabIndex = 17;
contactNameLabel.Text = "Contact Name:";
//
// isClosedLabel
//
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:";
//
// dataGridView1
//
this.dataGridView1.AllowUserToOrderColumns = true;
this.dataGridView1.AutoGenerateColumns = false;
this.dataGridView1.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.dataGridView1.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
this.lineNumber,
this.description,
this.lineNetAmount,
this.clientPurchaseOrderLineIDDataGridViewTextBoxColumn,
this.clientPurchaseOrderIDDataGridViewTextBoxColumn,
this.projectJobIDDataGridViewTextBoxColumn});
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.TabIndex = 14;
//
// 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";
//
// description
//
this.description.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
this.description.DataPropertyName = "Description";
this.description.HeaderText = "Description";
this.description.Name = "description";
//
// lineNetAmount
//
this.lineNetAmount.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.None;
this.lineNetAmount.DataPropertyName = "LineNetAmount";
this.lineNetAmount.HeaderText = "Line Amount";
this.lineNetAmount.MinimumWidth = 100;
this.lineNetAmount.Name = "lineNetAmount";
//
// clientPurchaseOrderLineIDDataGridViewTextBoxColumn
//
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);
//
// frmClientPurchaseOrder
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(823, 749);
this.Controls.Add(this.splitContainer1);
this.Name = "frmClientPurchaseOrder";
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);
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.BindingSource purchaseOrderBindingSource;
private System.Windows.Forms.TextBox requestorEmailTextBox;
private System.Windows.Forms.TextBox orderTotalTextBox;
private System.Windows.Forms.TextBox clientReferenceTextBox;
private System.Windows.Forms.BindingSource orderLineListBindingSource;
private System.Windows.Forms.CheckBox isClosedCheckBox;
private System.Windows.Forms.TextBox contactNameTextBox;
private System.Windows.Forms.Button btnAdd;
}
}

View File

@@ -0,0 +1,41 @@
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 frmClientPurchaseOrder : Form
{
public frmClientPurchaseOrder(Core.Model.Client.PurchaseOrder purchaseOrder)
{
InitializeComponent();
if (purchaseOrder != null)
{
purchaseOrderBindingSource.DataSource = purchaseOrder;
orderLineListBindingSource.DataSource = purchaseOrder.OrderLineList;
}
}
private void label1_Click(object sender, EventArgs e)
{
}
private void orderTotalTextBox_TextChanged(object sender, EventArgs e)
{
}
private void btnAdd_Click(object sender, EventArgs e)
{
}
}
}

View File

@@ -0,0 +1,147 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="clientReferenceLabel.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</metadata>
<metadata name="orderTotalLabel.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</metadata>
<metadata name="requestorEmailLabel.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</metadata>
<metadata name="purchaseOrderDateLabel.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</metadata>
<metadata name="contactNameLabel.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</metadata>
<metadata name="isClosedLabel.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</metadata>
<metadata name="orderLineListBindingSource.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>253, 29</value>
</metadata>
<metadata name="purchaseOrderBindingSource.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>37, 27</value>
</metadata>
<metadata name="purchaseOrderBindingSource.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>37, 27</value>
</metadata>
</root>

View File

@@ -15,16 +15,11 @@ namespace BealeEngineering.Core.Data.Database.Client
{
}
public List<Model.Client.PurchaseOrderHeader> PurchaseOrderHeader { get; set; }
public bool PurchaseOrderHeaderIsSet
{
get
{
if (PurchaseOrderHeader == null || !PurchaseOrderHeader.Any()) { return false; }
else { return true; }
}
}
public new List<Model.Client.PurchaseOrder> GetByClientPurchaseOrderId(List<int> orderIdList)
/// <summary>
/// Any filters set will be ignored
/// </summary>
public new List<Model.Client.PurchaseOrder> ByPurchaseOrderId(List<int> orderIdList)
{
ClientPurchaseOrderIdList = orderIdList;
try
@@ -40,6 +35,29 @@ namespace BealeEngineering.Core.Data.Database.Client
ClientPurchaseOrderIdList = null;
}
}
/// <summary>
/// Any filters set will be ignored
/// </summary>
public Model.Client.PurchaseOrder ByPurchaseOrderLineId(int orderLineId)
{
purchaseOrderLineId = orderLineId;
try
{
var result = GetByFilters();
if (result == null) { return null; }
else { return result[0]; }
}
catch (Exception ex)
{
throw ex;
}
finally
{
purchaseOrderLineId = null;
}
}
public new List<Model.Client.PurchaseOrder> GetByFilters()
{
// build the sql string and dapper parameters
@@ -48,6 +66,7 @@ namespace BealeEngineering.Core.Data.Database.Client
SELECT ClientPurchaseOrder.ClientPurchaseOrderID
,ClientPurchaseOrder.PurchaseOrderDate
,ClientPurchaseOrder.ContactID
,Contact.ContactName
,ClientPurchaseOrder.ClientReference
,ClientPurchaseOrder.RequestorEmail
,ClientPurchaseOrder.OrderTotal
@@ -58,8 +77,9 @@ namespace BealeEngineering.Core.Data.Database.Client
,ClientPurchaseOrderLine.Description
,ClientPurchaseOrderLine.LineNetAmount
FROM ClientPurchaseOrder
LEFT OUTER JOIN ClientPurchaseOrderLine ON ClientPurchaseOrder.ClientPurchaseOrderID = ClientPurchaseOrderLine.ClientPurchaseOrderID";
INNER JOIN Contact ON ClientPurchaseOrder.ContactID = Contact.ContactID
LEFT OUTER JOIN ClientPurchaseOrderLine ON ClientPurchaseOrder.ClientPurchaseOrderID = ClientPurchaseOrderLine.ClientPurchaseOrderID
";
AddSqlWhereString(ref sqlString, ref parameters);
sqlString = sqlString + @"

View File

@@ -26,6 +26,7 @@ namespace BealeEngineering.Core.Data.Database.Client
,ProjectJob.JobTitle
,ProjectJob.JobDescription
,ClientPurchaseOrder.ClientReference AS PurchaseOrderReference
,ClientPurchaseOrderLine.ClientPurchaseOrderLineID AS PurchaseOrderLineID
,ClientPurchaseOrderLine.LineNumber AS PurchaseOrderLineNumber
,ClientPurchaseOrderLine.Description AS PurchaseOrderLineDescription
,ClientPurchaseOrderLine.LineNetAmount AS PurchaseOrderLineNetAmount
@@ -55,7 +56,6 @@ namespace BealeEngineering.Core.Data.Database.Client
var purchaseOrders = conn.Query<Model.Client.PurchaseOrderAllocation>(sqlString, parameters).ToList();
return purchaseOrders;
}
}
}
}

View File

@@ -10,14 +10,18 @@ namespace BealeEngineering.Core.Data.Database.Client
{
public class ReadPurchaseOrderHeader : Connection
{
protected int? purchaseOrderLineId = null;
public ReadPurchaseOrderHeader(string sqlConnectionString) : base(sqlConnectionString)
{
}
/// <summary>
/// Setting this will override he other filters, within the sql statement.
/// Any filters set will be ignored
/// </summary>
protected List<int> ClientPurchaseOrderIdList { get; set; }
private bool ClientPurchaseOrderIdListIsSet
{
get
@@ -26,7 +30,9 @@ namespace BealeEngineering.Core.Data.Database.Client
else { return true; }
}
}
public DateTime DateFrom { get; set; }
public bool DateFromIsSet
{
get
@@ -35,7 +41,9 @@ namespace BealeEngineering.Core.Data.Database.Client
else { return true; }
}
}
public DateTime DateTo { get; set; }
public bool DateToIsSet
{
get
@@ -44,7 +52,9 @@ namespace BealeEngineering.Core.Data.Database.Client
else { return true; }
}
}
public List<string> Reference { get; set; }
public bool ReferenceIsSet
{
get
@@ -53,8 +63,10 @@ namespace BealeEngineering.Core.Data.Database.Client
else { return true; }
}
}
public bool ReturnIsClosed { get; set; } = true;
public List<Model.Client.PurchaseOrderHeader> GetByClientPurchaseOrderId(List<int> orderIdList)
public List<Model.Client.PurchaseOrderHeader> ByPurchaseOrderId(List<int> orderIdList)
{
ClientPurchaseOrderIdList = orderIdList;
try
@@ -70,6 +82,7 @@ namespace BealeEngineering.Core.Data.Database.Client
ClientPurchaseOrderIdList = null;
}
}
protected void AddSqlWhereString(ref string sqlString, ref DynamicParameters parameters)
{
if (string.IsNullOrWhiteSpace(sqlString))
@@ -85,6 +98,13 @@ namespace BealeEngineering.Core.Data.Database.Client
parameters.Add("@purchaseOrderId", ClientPurchaseOrderIdList);
}
else if (purchaseOrderLineId != null)
{
sqlString = sqlString + @"
AND ClientPurchaseOrderLine.ClientPurchaseOrderLineID = @lineId";
parameters.Add("@lineId", (int)purchaseOrderLineId);
}
else
{
if (DateFromIsSet)
@@ -117,19 +137,22 @@ namespace BealeEngineering.Core.Data.Database.Client
}
}
}
public List<Model.Client.PurchaseOrderHeader> GetByFilters()
{
// build the sql string and dapper parameters
var parameters = new DynamicParameters();
string sqlString = @"
SELECT ClientPurchaseOrderID
,PurchaseOrderDate
,ContactID
,ClientReference
,RequestorEmail
,OrderTotal
,IsClosed
FROM ClientPurchaseOrder";
SELECT ClientPurchaseOrder.ClientPurchaseOrderID
,ClientPurchaseOrder.PurchaseOrderDate
,ClientPurchaseOrder.ClientReference
,ClientPurchaseOrder.RequestorEmail
,ClientPurchaseOrder.OrderTotal
,ClientPurchaseOrder.IsClosed
,Contact.ContactName
FROM ClientPurchaseOrder
INNER JOIN Contact ON ClientPurchaseOrder.ContactID = Contact.ContactID
";
AddSqlWhereString(ref sqlString, ref parameters);

View File

@@ -91,7 +91,7 @@ namespace BealeEngineering.Core.Logic.Client
// match contact ID
foreach (var po in clientPoList)
{
if (po.Contact.ContactName == lookupList[i].Item1.ContactName)
if (po.ContactName == lookupList[i].Item1.ContactName)
{
// match PO reference
string reference = lookupList[i].Item2;

View File

@@ -1,7 +1,9 @@
using BealeEngineering.Core.Logic.Utilities;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Text;
using System.Linq;
namespace BealeEngineering.Core.Model.Client
{
@@ -15,7 +17,9 @@ namespace BealeEngineering.Core.Model.Client
else { return OrderLineList.Count; }
}
}
public List<PurchaseOrderLine> OrderLineList { get; set; }
public class PurchaseOrderLine
{
public int ClientPurchaseOrderLineID { get; set; }
@@ -25,5 +29,17 @@ namespace BealeEngineering.Core.Model.Client
public string Description { get; set; }
public decimal LineNetAmount { get; set; }
}
public override IEnumerable<ValidationResult> Validate(ValidationContext validationContext)
{
var results = base.Validate(validationContext).ToList();
if (OrderLineCount == 0)
{
var result = new ValidationResult("Quantity must be greater than zero.");
results.Add(result);
}
throw new NotImplementedException();
}
}
}

View File

@@ -15,6 +15,7 @@ namespace BealeEngineering.Core.Model.Client
public string JobTitle { get; set; }
public string JobDescription { get; set; }
public string PurchaseOrderReference { get; set; }
public int PurchaseOrderLineID { get; set; }
public int PurchaseOrderLineNumber { get; set; }
public string PurchaseOrderLineDescription { get; set; }
public decimal PurchaseOrderLineNetAmount { get; set; }

View File

@@ -1,20 +1,39 @@
using BealeEngineering.Core.Logic.Utilities;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace BealeEngineering.Core.Model.Client
{
public class PurchaseOrderHeader
public class PurchaseOrderHeader : IValidatableObject
{
public int ClientPurchaseOrderID { get; set; }
[Required()]
public DateTime PurchaseOrderDate { get; set; }
public Model.Contact.Contact Contact { get; set; }
[Required(), StringLength(100)]
public string ContactName { get; set; }
[Required(), StringLength(50)]
public string ClientReference { get; set; }
[EmailAddress()]
public string RequestorEmail { get; set; }
[Required()]
public decimal OrderTotal { get; set; }
[Required()]
public bool IsClosed { get; set; }
public virtual IEnumerable<ValidationResult> Validate(ValidationContext validationContext)
{
var results = new List<ValidationResult>();
return results;
}
}
}

View File

@@ -87,7 +87,7 @@ namespace BealeEngineering.Core.Model.Sale
ValidationResults.Add(result);
}
lineTotal = lineTotal + line.LineAmount ;
lineTotal = lineTotal + line.LineAmount;
lineTaxTotal = lineTaxTotal + line.TaxAmount;
}
if (lineTotal + lineTaxTotal != InvoiceTotal)

View File

@@ -11,10 +11,10 @@ namespace BealeEngineering.Core.Model.Sale
{
public int SaleInvoiceID { get; set; }
[Required(AllowEmptyStrings = false)]
[Required()]
public string ContactName { get; set; }
[Required(AllowEmptyStrings = false), StringLength(50)]
[Required(), StringLength(50)]
public string SaleInvoiceNumber { get; set; }
[Required()]
@@ -25,8 +25,7 @@ namespace BealeEngineering.Core.Model.Sale
[StringLength(50)]
public string Reference { get; set; }
[Required(AllowEmptyStrings = false)]
[StringLength(3, MinimumLength = 3)]
[Required(), StringLength(3, MinimumLength = 3)]
public string CurrencyCode { get; set; }
[Required()]

View File

@@ -10,6 +10,7 @@ namespace BealeEngineering.Core.Model
public abstract class ValidateModel : IValidatableObject
{
public List<ValidationResult> ValidationResults { get; protected set; }
public bool IsValid()
{
ValidationResults = new List<ValidationResult>();
@@ -19,6 +20,7 @@ namespace BealeEngineering.Core.Model
else
{ return false; }
}
/// <summary>
/// Standard checks on class properties. Use 'override' if you wish to add additional checks in a derived classes
/// </summary>

View File

@@ -22,7 +22,7 @@ namespace BealeEngineering.Core.Test.Client
public void GetPurchaseOrderById()
{
var inst = new Core.Data.Database.Client.ReadPurchaseOrder(SqlConnectionString);
var newList = inst.GetByClientPurchaseOrderId(PurchaseOrderIdList);
var newList = inst.ByPurchaseOrderId(PurchaseOrderIdList);
}
public void AllocateInvoicesToPurchaseOrders()
{