mirror of
https://github.com/stokebob/BealeEngineering.git
synced 2026-03-21 15:47:15 +00:00
Feature: Purchase order add/edit & export to Xero invoice
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -1,791 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<xs:schema id="BealeEngDataSet" targetNamespace="http://tempuri.org/BealeEngDataSet.xsd" xmlns:mstns="http://tempuri.org/BealeEngDataSet.xsd" xmlns="http://tempuri.org/BealeEngDataSet.xsd" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" xmlns:msprop="urn:schemas-microsoft-com:xml-msprop" attributeFormDefault="qualified" elementFormDefault="qualified">
|
||||
<xs:annotation>
|
||||
<xs:appinfo source="urn:schemas-microsoft-com:xml-msdatasource">
|
||||
<DataSource DefaultConnectionIndex="0" FunctionsComponentName="QueriesTableAdapter" Modifier="AutoLayout, AnsiClass, Class, Public" SchemaSerializationMode="IncludeSchema" xmlns="urn:schemas-microsoft-com:xml-msdatasource">
|
||||
<Connections>
|
||||
<Connection AppSettingsObjectName="Settings" AppSettingsPropertyName="BealeEngConnectionString" ConnectionStringObject="" IsAppSettingsProperty="true" Modifier="Assembly" Name="BealeEngConnectionString (Settings)" ParameterPrefix="@" PropertyReference="ApplicationSettings.BealeEngineering.Accounts.Properties.Settings.GlobalReference.Default.BealeEngConnectionString" Provider="System.Data.SqlClient" />
|
||||
</Connections>
|
||||
<Tables>
|
||||
<TableAdapter BaseClass="System.ComponentModel.Component" DataAccessorModifier="AutoLayout, AnsiClass, Class, Public" DataAccessorName="ClientPurchaseOrderTableAdapter" GeneratorDataComponentClassName="ClientPurchaseOrderTableAdapter" Name="ClientPurchaseOrder" UserDataComponentName="ClientPurchaseOrderTableAdapter">
|
||||
<MainSource>
|
||||
<DbSource ConnectionRef="BealeEngConnectionString (Settings)" DbObjectName="BealeEng.dbo.ClientPurchaseOrder" DbObjectType="Table" FillMethodModifier="Public" FillMethodName="Fill" GenerateMethods="Both" GenerateShortCommands="true" GeneratorGetMethodName="GetData" GeneratorSourceName="Fill" GetMethodModifier="Public" GetMethodName="GetData" QueryType="Rowset" ScalarCallRetval="System.Object, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" UseOptimisticConcurrency="true" UserGetMethodName="GetData" UserSourceName="Fill">
|
||||
<DeleteCommand>
|
||||
<DbCommand CommandType="Text" ModifiedByUser="false">
|
||||
<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))</CommandText>
|
||||
<Parameters>
|
||||
<Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="Input" ParameterName="@Original_ClientPurchaseOrderID" Precision="0" ProviderType="Int" Scale="0" Size="0" SourceColumn="ClientPurchaseOrderID" SourceColumnNullMapping="false" SourceVersion="Original" />
|
||||
<Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="Date" Direction="Input" ParameterName="@Original_PurchaseOrderDate" Precision="0" ProviderType="Date" Scale="0" Size="0" SourceColumn="PurchaseOrderDate" SourceColumnNullMapping="false" SourceVersion="Original" />
|
||||
<Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="Input" ParameterName="@Original_ContactID" Precision="0" ProviderType="Int" Scale="0" Size="0" SourceColumn="ContactID" SourceColumnNullMapping="false" SourceVersion="Original" />
|
||||
<Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="AnsiString" Direction="Input" ParameterName="@Original_ClientReference" Precision="0" ProviderType="VarChar" Scale="0" Size="0" SourceColumn="ClientReference" SourceColumnNullMapping="false" SourceVersion="Original" />
|
||||
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="Input" ParameterName="@IsNull_RequestorEmail" Precision="0" ProviderType="Int" Scale="0" Size="0" SourceColumn="RequestorEmail" SourceColumnNullMapping="true" SourceVersion="Original" />
|
||||
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="AnsiString" Direction="Input" ParameterName="@Original_RequestorEmail" Precision="0" ProviderType="VarChar" Scale="0" Size="0" SourceColumn="RequestorEmail" SourceColumnNullMapping="false" SourceVersion="Original" />
|
||||
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="Input" ParameterName="@IsNull_OrderTotal" Precision="0" ProviderType="Int" Scale="0" Size="0" SourceColumn="OrderTotal" SourceColumnNullMapping="true" SourceVersion="Original" />
|
||||
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="Decimal" Direction="Input" ParameterName="@Original_OrderTotal" Precision="9" ProviderType="Decimal" Scale="2" Size="0" SourceColumn="OrderTotal" SourceColumnNullMapping="false" SourceVersion="Original" />
|
||||
<Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="Boolean" Direction="Input" ParameterName="@Original_IsClosed" Precision="0" ProviderType="Bit" Scale="0" Size="0" SourceColumn="IsClosed" SourceColumnNullMapping="false" SourceVersion="Original" />
|
||||
</Parameters>
|
||||
</DbCommand>
|
||||
</DeleteCommand>
|
||||
<InsertCommand>
|
||||
<DbCommand CommandType="Text" ModifiedByUser="false">
|
||||
<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())</CommandText>
|
||||
<Parameters>
|
||||
<Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="Date" Direction="Input" ParameterName="@PurchaseOrderDate" Precision="0" ProviderType="Date" Scale="0" Size="0" SourceColumn="PurchaseOrderDate" SourceColumnNullMapping="false" SourceVersion="Current" />
|
||||
<Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="Input" ParameterName="@ContactID" Precision="0" ProviderType="Int" Scale="0" Size="0" SourceColumn="ContactID" SourceColumnNullMapping="false" SourceVersion="Current" />
|
||||
<Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="AnsiString" Direction="Input" ParameterName="@ClientReference" Precision="0" ProviderType="VarChar" Scale="0" Size="0" SourceColumn="ClientReference" SourceColumnNullMapping="false" SourceVersion="Current" />
|
||||
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="AnsiString" Direction="Input" ParameterName="@RequestorEmail" Precision="0" ProviderType="VarChar" Scale="0" Size="0" SourceColumn="RequestorEmail" SourceColumnNullMapping="false" SourceVersion="Current" />
|
||||
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="Decimal" Direction="Input" ParameterName="@OrderTotal" Precision="9" ProviderType="Decimal" Scale="2" Size="0" SourceColumn="OrderTotal" SourceColumnNullMapping="false" SourceVersion="Current" />
|
||||
<Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="Boolean" Direction="Input" ParameterName="@IsClosed" Precision="0" ProviderType="Bit" Scale="0" Size="0" SourceColumn="IsClosed" SourceColumnNullMapping="false" SourceVersion="Current" />
|
||||
</Parameters>
|
||||
</DbCommand>
|
||||
</InsertCommand>
|
||||
<SelectCommand>
|
||||
<DbCommand CommandType="Text" ModifiedByUser="false">
|
||||
<CommandText>SELECT ClientPurchaseOrderID, PurchaseOrderDate, ContactID, ClientReference, RequestorEmail, OrderTotal, IsClosed FROM dbo.ClientPurchaseOrder</CommandText>
|
||||
<Parameters />
|
||||
</DbCommand>
|
||||
</SelectCommand>
|
||||
<UpdateCommand>
|
||||
<DbCommand CommandType="Text" ModifiedByUser="false">
|
||||
<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)</CommandText>
|
||||
<Parameters>
|
||||
<Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="Date" Direction="Input" ParameterName="@PurchaseOrderDate" Precision="0" ProviderType="Date" Scale="0" Size="0" SourceColumn="PurchaseOrderDate" SourceColumnNullMapping="false" SourceVersion="Current" />
|
||||
<Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="Input" ParameterName="@ContactID" Precision="0" ProviderType="Int" Scale="0" Size="0" SourceColumn="ContactID" SourceColumnNullMapping="false" SourceVersion="Current" />
|
||||
<Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="AnsiString" Direction="Input" ParameterName="@ClientReference" Precision="0" ProviderType="VarChar" Scale="0" Size="0" SourceColumn="ClientReference" SourceColumnNullMapping="false" SourceVersion="Current" />
|
||||
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="AnsiString" Direction="Input" ParameterName="@RequestorEmail" Precision="0" ProviderType="VarChar" Scale="0" Size="0" SourceColumn="RequestorEmail" SourceColumnNullMapping="false" SourceVersion="Current" />
|
||||
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="Decimal" Direction="Input" ParameterName="@OrderTotal" Precision="9" ProviderType="Decimal" Scale="2" Size="0" SourceColumn="OrderTotal" SourceColumnNullMapping="false" SourceVersion="Current" />
|
||||
<Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="Boolean" Direction="Input" ParameterName="@IsClosed" Precision="0" ProviderType="Bit" Scale="0" Size="0" SourceColumn="IsClosed" SourceColumnNullMapping="false" SourceVersion="Current" />
|
||||
<Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="Input" ParameterName="@Original_ClientPurchaseOrderID" Precision="0" ProviderType="Int" Scale="0" Size="0" SourceColumn="ClientPurchaseOrderID" SourceColumnNullMapping="false" SourceVersion="Original" />
|
||||
<Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="Date" Direction="Input" ParameterName="@Original_PurchaseOrderDate" Precision="0" ProviderType="Date" Scale="0" Size="0" SourceColumn="PurchaseOrderDate" SourceColumnNullMapping="false" SourceVersion="Original" />
|
||||
<Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="Input" ParameterName="@Original_ContactID" Precision="0" ProviderType="Int" Scale="0" Size="0" SourceColumn="ContactID" SourceColumnNullMapping="false" SourceVersion="Original" />
|
||||
<Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="AnsiString" Direction="Input" ParameterName="@Original_ClientReference" Precision="0" ProviderType="VarChar" Scale="0" Size="0" SourceColumn="ClientReference" SourceColumnNullMapping="false" SourceVersion="Original" />
|
||||
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="Input" ParameterName="@IsNull_RequestorEmail" Precision="0" ProviderType="Int" Scale="0" Size="0" SourceColumn="RequestorEmail" SourceColumnNullMapping="true" SourceVersion="Original" />
|
||||
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="AnsiString" Direction="Input" ParameterName="@Original_RequestorEmail" Precision="0" ProviderType="VarChar" Scale="0" Size="0" SourceColumn="RequestorEmail" SourceColumnNullMapping="false" SourceVersion="Original" />
|
||||
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="Input" ParameterName="@IsNull_OrderTotal" Precision="0" ProviderType="Int" Scale="0" Size="0" SourceColumn="OrderTotal" SourceColumnNullMapping="true" SourceVersion="Original" />
|
||||
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="Decimal" Direction="Input" ParameterName="@Original_OrderTotal" Precision="9" ProviderType="Decimal" Scale="2" Size="0" SourceColumn="OrderTotal" SourceColumnNullMapping="false" SourceVersion="Original" />
|
||||
<Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="Boolean" Direction="Input" ParameterName="@Original_IsClosed" Precision="0" ProviderType="Bit" Scale="0" Size="0" SourceColumn="IsClosed" SourceColumnNullMapping="false" SourceVersion="Original" />
|
||||
<Parameter AllowDbNull="false" AutogeneratedName="ClientPurchaseOrderID" ColumnName="ClientPurchaseOrderID" DataSourceName="BealeEng.dbo.ClientPurchaseOrder" DataTypeServer="int" DbType="Int32" Direction="Input" ParameterName="@ClientPurchaseOrderID" Precision="0" ProviderType="Int" Scale="0" Size="4" SourceColumn="ClientPurchaseOrderID" SourceColumnNullMapping="false" SourceVersion="Current" />
|
||||
</Parameters>
|
||||
</DbCommand>
|
||||
</UpdateCommand>
|
||||
</DbSource>
|
||||
</MainSource>
|
||||
<Mappings>
|
||||
<Mapping SourceColumn="ClientPurchaseOrderID" DataSetColumn="ClientPurchaseOrderID" />
|
||||
<Mapping SourceColumn="PurchaseOrderDate" DataSetColumn="PurchaseOrderDate" />
|
||||
<Mapping SourceColumn="ContactID" DataSetColumn="ContactID" />
|
||||
<Mapping SourceColumn="ClientReference" DataSetColumn="ClientReference" />
|
||||
<Mapping SourceColumn="RequestorEmail" DataSetColumn="RequestorEmail" />
|
||||
<Mapping SourceColumn="OrderTotal" DataSetColumn="OrderTotal" />
|
||||
<Mapping SourceColumn="IsClosed" DataSetColumn="IsClosed" />
|
||||
</Mappings>
|
||||
<Sources />
|
||||
</TableAdapter>
|
||||
<TableAdapter BaseClass="System.ComponentModel.Component" DataAccessorModifier="AutoLayout, AnsiClass, Class, Public" DataAccessorName="ClientPurchaseOrderLineTableAdapter" GeneratorDataComponentClassName="ClientPurchaseOrderLineTableAdapter" Name="ClientPurchaseOrderLine" UserDataComponentName="ClientPurchaseOrderLineTableAdapter">
|
||||
<MainSource>
|
||||
<DbSource ConnectionRef="BealeEngConnectionString (Settings)" DbObjectName="BealeEng.dbo.ClientPurchaseOrderLine" DbObjectType="Table" FillMethodModifier="Public" FillMethodName="Fill" GenerateMethods="Both" GenerateShortCommands="true" GeneratorGetMethodName="GetData" GeneratorSourceName="Fill" GetMethodModifier="Public" GetMethodName="GetData" QueryType="Rowset" ScalarCallRetval="System.Object, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" UseOptimisticConcurrency="true" UserGetMethodName="GetData" UserSourceName="Fill">
|
||||
<DeleteCommand>
|
||||
<DbCommand CommandType="Text" ModifiedByUser="false">
|
||||
<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))</CommandText>
|
||||
<Parameters>
|
||||
<Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="Input" ParameterName="@Original_ClientPurchaseOrderLineID" Precision="0" ProviderType="Int" Scale="0" Size="0" SourceColumn="ClientPurchaseOrderLineID" SourceColumnNullMapping="false" SourceVersion="Original" />
|
||||
<Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="Input" ParameterName="@Original_ClientPurchaseOrderID" Precision="0" ProviderType="Int" Scale="0" Size="0" SourceColumn="ClientPurchaseOrderID" SourceColumnNullMapping="false" SourceVersion="Original" />
|
||||
<Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="Input" ParameterName="@Original_LineNumber" Precision="0" ProviderType="Int" Scale="0" Size="0" SourceColumn="LineNumber" SourceColumnNullMapping="false" SourceVersion="Original" />
|
||||
<Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="Input" ParameterName="@Original_ProjectJobID" Precision="0" ProviderType="Int" Scale="0" Size="0" SourceColumn="ProjectJobID" SourceColumnNullMapping="false" SourceVersion="Original" />
|
||||
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="Input" ParameterName="@IsNull_Description" Precision="0" ProviderType="Int" Scale="0" Size="0" SourceColumn="Description" SourceColumnNullMapping="true" SourceVersion="Original" />
|
||||
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="AnsiString" Direction="Input" ParameterName="@Original_Description" Precision="0" ProviderType="VarChar" Scale="0" Size="0" SourceColumn="Description" SourceColumnNullMapping="false" SourceVersion="Original" />
|
||||
<Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="Decimal" Direction="Input" ParameterName="@Original_LineNetAmount" Precision="9" ProviderType="Decimal" Scale="2" Size="0" SourceColumn="LineNetAmount" SourceColumnNullMapping="false" SourceVersion="Original" />
|
||||
</Parameters>
|
||||
</DbCommand>
|
||||
</DeleteCommand>
|
||||
<InsertCommand>
|
||||
<DbCommand CommandType="Text" ModifiedByUser="false">
|
||||
<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())</CommandText>
|
||||
<Parameters>
|
||||
<Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="Input" ParameterName="@ClientPurchaseOrderID" Precision="0" ProviderType="Int" Scale="0" Size="0" SourceColumn="ClientPurchaseOrderID" SourceColumnNullMapping="false" SourceVersion="Current" />
|
||||
<Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="Input" ParameterName="@LineNumber" Precision="0" ProviderType="Int" Scale="0" Size="0" SourceColumn="LineNumber" SourceColumnNullMapping="false" SourceVersion="Current" />
|
||||
<Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="Input" ParameterName="@ProjectJobID" Precision="0" ProviderType="Int" Scale="0" Size="0" SourceColumn="ProjectJobID" SourceColumnNullMapping="false" SourceVersion="Current" />
|
||||
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="AnsiString" Direction="Input" ParameterName="@Description" Precision="0" ProviderType="VarChar" Scale="0" Size="0" SourceColumn="Description" SourceColumnNullMapping="false" SourceVersion="Current" />
|
||||
<Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="Decimal" Direction="Input" ParameterName="@LineNetAmount" Precision="9" ProviderType="Decimal" Scale="2" Size="0" SourceColumn="LineNetAmount" SourceColumnNullMapping="false" SourceVersion="Current" />
|
||||
</Parameters>
|
||||
</DbCommand>
|
||||
</InsertCommand>
|
||||
<SelectCommand>
|
||||
<DbCommand CommandType="Text" ModifiedByUser="false">
|
||||
<CommandText>SELECT ClientPurchaseOrderLineID, ClientPurchaseOrderID, LineNumber, ProjectJobID, Description, LineNetAmount FROM dbo.ClientPurchaseOrderLine</CommandText>
|
||||
<Parameters />
|
||||
</DbCommand>
|
||||
</SelectCommand>
|
||||
<UpdateCommand>
|
||||
<DbCommand CommandType="Text" ModifiedByUser="false">
|
||||
<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)</CommandText>
|
||||
<Parameters>
|
||||
<Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="Input" ParameterName="@ClientPurchaseOrderID" Precision="0" ProviderType="Int" Scale="0" Size="0" SourceColumn="ClientPurchaseOrderID" SourceColumnNullMapping="false" SourceVersion="Current" />
|
||||
<Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="Input" ParameterName="@LineNumber" Precision="0" ProviderType="Int" Scale="0" Size="0" SourceColumn="LineNumber" SourceColumnNullMapping="false" SourceVersion="Current" />
|
||||
<Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="Input" ParameterName="@ProjectJobID" Precision="0" ProviderType="Int" Scale="0" Size="0" SourceColumn="ProjectJobID" SourceColumnNullMapping="false" SourceVersion="Current" />
|
||||
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="AnsiString" Direction="Input" ParameterName="@Description" Precision="0" ProviderType="VarChar" Scale="0" Size="0" SourceColumn="Description" SourceColumnNullMapping="false" SourceVersion="Current" />
|
||||
<Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="Decimal" Direction="Input" ParameterName="@LineNetAmount" Precision="9" ProviderType="Decimal" Scale="2" Size="0" SourceColumn="LineNetAmount" SourceColumnNullMapping="false" SourceVersion="Current" />
|
||||
<Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="Input" ParameterName="@Original_ClientPurchaseOrderLineID" Precision="0" ProviderType="Int" Scale="0" Size="0" SourceColumn="ClientPurchaseOrderLineID" SourceColumnNullMapping="false" SourceVersion="Original" />
|
||||
<Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="Input" ParameterName="@Original_ClientPurchaseOrderID" Precision="0" ProviderType="Int" Scale="0" Size="0" SourceColumn="ClientPurchaseOrderID" SourceColumnNullMapping="false" SourceVersion="Original" />
|
||||
<Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="Input" ParameterName="@Original_LineNumber" Precision="0" ProviderType="Int" Scale="0" Size="0" SourceColumn="LineNumber" SourceColumnNullMapping="false" SourceVersion="Original" />
|
||||
<Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="Input" ParameterName="@Original_ProjectJobID" Precision="0" ProviderType="Int" Scale="0" Size="0" SourceColumn="ProjectJobID" SourceColumnNullMapping="false" SourceVersion="Original" />
|
||||
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="Input" ParameterName="@IsNull_Description" Precision="0" ProviderType="Int" Scale="0" Size="0" SourceColumn="Description" SourceColumnNullMapping="true" SourceVersion="Original" />
|
||||
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="AnsiString" Direction="Input" ParameterName="@Original_Description" Precision="0" ProviderType="VarChar" Scale="0" Size="0" SourceColumn="Description" SourceColumnNullMapping="false" SourceVersion="Original" />
|
||||
<Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="Decimal" Direction="Input" ParameterName="@Original_LineNetAmount" Precision="9" ProviderType="Decimal" Scale="2" Size="0" SourceColumn="LineNetAmount" SourceColumnNullMapping="false" SourceVersion="Original" />
|
||||
<Parameter AllowDbNull="false" AutogeneratedName="ClientPurchaseOrderLineID" ColumnName="ClientPurchaseOrderLineID" DataSourceName="BealeEng.dbo.ClientPurchaseOrderLine" DataTypeServer="int" DbType="Int32" Direction="Input" ParameterName="@ClientPurchaseOrderLineID" Precision="0" ProviderType="Int" Scale="0" Size="4" SourceColumn="ClientPurchaseOrderLineID" SourceColumnNullMapping="false" SourceVersion="Current" />
|
||||
</Parameters>
|
||||
</DbCommand>
|
||||
</UpdateCommand>
|
||||
</DbSource>
|
||||
</MainSource>
|
||||
<Mappings>
|
||||
<Mapping SourceColumn="ClientPurchaseOrderLineID" DataSetColumn="ClientPurchaseOrderLineID" />
|
||||
<Mapping SourceColumn="ClientPurchaseOrderID" DataSetColumn="ClientPurchaseOrderID" />
|
||||
<Mapping SourceColumn="LineNumber" DataSetColumn="LineNumber" />
|
||||
<Mapping SourceColumn="ProjectJobID" DataSetColumn="ProjectJobID" />
|
||||
<Mapping SourceColumn="Description" DataSetColumn="Description" />
|
||||
<Mapping SourceColumn="LineNetAmount" DataSetColumn="LineNetAmount" />
|
||||
</Mappings>
|
||||
<Sources />
|
||||
</TableAdapter>
|
||||
<TableAdapter BaseClass="System.ComponentModel.Component" DataAccessorModifier="AutoLayout, AnsiClass, Class, Public" DataAccessorName="ClientPurchaseOrderLineSalesInvoiceTableAdapter" GeneratorDataComponentClassName="ClientPurchaseOrderLineSalesInvoiceTableAdapter" Name="ClientPurchaseOrderLineSalesInvoice" UserDataComponentName="ClientPurchaseOrderLineSalesInvoiceTableAdapter">
|
||||
<MainSource>
|
||||
<DbSource ConnectionRef="BealeEngConnectionString (Settings)" DbObjectName="BealeEng.dbo.ClientPurchaseOrderLineSalesInvoice" DbObjectType="Table" FillMethodModifier="Public" FillMethodName="Fill" GenerateMethods="Both" GenerateShortCommands="true" GeneratorGetMethodName="GetData" GeneratorSourceName="Fill" GetMethodModifier="Public" GetMethodName="GetData" QueryType="Rowset" ScalarCallRetval="System.Object, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" UseOptimisticConcurrency="true" UserGetMethodName="GetData" UserSourceName="Fill">
|
||||
<DeleteCommand>
|
||||
<DbCommand CommandType="Text" ModifiedByUser="false">
|
||||
<CommandText>DELETE FROM [dbo].[ClientPurchaseOrderLineSalesInvoice] WHERE (([ClientPurchaseOrderLineID] = @Original_ClientPurchaseOrderLineID) AND ([SaleInvoiceID] = @Original_SaleInvoiceID) AND ([IsApproved] = @Original_IsApproved))</CommandText>
|
||||
<Parameters>
|
||||
<Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="Input" ParameterName="@Original_ClientPurchaseOrderLineID" Precision="0" ProviderType="Int" Scale="0" Size="0" SourceColumn="ClientPurchaseOrderLineID" SourceColumnNullMapping="false" SourceVersion="Original" />
|
||||
<Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="Input" ParameterName="@Original_SaleInvoiceID" Precision="0" ProviderType="Int" Scale="0" Size="0" SourceColumn="SaleInvoiceID" SourceColumnNullMapping="false" SourceVersion="Original" />
|
||||
<Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="Boolean" Direction="Input" ParameterName="@Original_IsApproved" Precision="0" ProviderType="Bit" Scale="0" Size="0" SourceColumn="IsApproved" SourceColumnNullMapping="false" SourceVersion="Original" />
|
||||
</Parameters>
|
||||
</DbCommand>
|
||||
</DeleteCommand>
|
||||
<InsertCommand>
|
||||
<DbCommand CommandType="Text" ModifiedByUser="false">
|
||||
<CommandText>INSERT INTO [dbo].[ClientPurchaseOrderLineSalesInvoice] ([ClientPurchaseOrderLineID], [SaleInvoiceID], [IsApproved]) VALUES (@ClientPurchaseOrderLineID, @SaleInvoiceID, @IsApproved);
|
||||
SELECT ClientPurchaseOrderLineID, SaleInvoiceID, IsApproved FROM ClientPurchaseOrderLineSalesInvoice WHERE (SaleInvoiceID = @SaleInvoiceID)</CommandText>
|
||||
<Parameters>
|
||||
<Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="Input" ParameterName="@ClientPurchaseOrderLineID" Precision="0" ProviderType="Int" Scale="0" Size="0" SourceColumn="ClientPurchaseOrderLineID" SourceColumnNullMapping="false" SourceVersion="Current" />
|
||||
<Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="Input" ParameterName="@SaleInvoiceID" Precision="0" ProviderType="Int" Scale="0" Size="0" SourceColumn="SaleInvoiceID" SourceColumnNullMapping="false" SourceVersion="Current" />
|
||||
<Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="Boolean" Direction="Input" ParameterName="@IsApproved" Precision="0" ProviderType="Bit" Scale="0" Size="0" SourceColumn="IsApproved" SourceColumnNullMapping="false" SourceVersion="Current" />
|
||||
</Parameters>
|
||||
</DbCommand>
|
||||
</InsertCommand>
|
||||
<SelectCommand>
|
||||
<DbCommand CommandType="Text" ModifiedByUser="false">
|
||||
<CommandText>SELECT ClientPurchaseOrderLineID, SaleInvoiceID, IsApproved FROM dbo.ClientPurchaseOrderLineSalesInvoice</CommandText>
|
||||
<Parameters />
|
||||
</DbCommand>
|
||||
</SelectCommand>
|
||||
<UpdateCommand>
|
||||
<DbCommand CommandType="Text" ModifiedByUser="false">
|
||||
<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)</CommandText>
|
||||
<Parameters>
|
||||
<Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="Input" ParameterName="@ClientPurchaseOrderLineID" Precision="0" ProviderType="Int" Scale="0" Size="0" SourceColumn="ClientPurchaseOrderLineID" SourceColumnNullMapping="false" SourceVersion="Current" />
|
||||
<Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="Input" ParameterName="@SaleInvoiceID" Precision="0" ProviderType="Int" Scale="0" Size="0" SourceColumn="SaleInvoiceID" SourceColumnNullMapping="false" SourceVersion="Current" />
|
||||
<Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="Boolean" Direction="Input" ParameterName="@IsApproved" Precision="0" ProviderType="Bit" Scale="0" Size="0" SourceColumn="IsApproved" SourceColumnNullMapping="false" SourceVersion="Current" />
|
||||
<Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="Input" ParameterName="@Original_ClientPurchaseOrderLineID" Precision="0" ProviderType="Int" Scale="0" Size="0" SourceColumn="ClientPurchaseOrderLineID" SourceColumnNullMapping="false" SourceVersion="Original" />
|
||||
<Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="Input" ParameterName="@Original_SaleInvoiceID" Precision="0" ProviderType="Int" Scale="0" Size="0" SourceColumn="SaleInvoiceID" SourceColumnNullMapping="false" SourceVersion="Original" />
|
||||
<Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="Boolean" Direction="Input" ParameterName="@Original_IsApproved" Precision="0" ProviderType="Bit" Scale="0" Size="0" SourceColumn="IsApproved" SourceColumnNullMapping="false" SourceVersion="Original" />
|
||||
</Parameters>
|
||||
</DbCommand>
|
||||
</UpdateCommand>
|
||||
</DbSource>
|
||||
</MainSource>
|
||||
<Mappings>
|
||||
<Mapping SourceColumn="ClientPurchaseOrderLineID" DataSetColumn="ClientPurchaseOrderLineID" />
|
||||
<Mapping SourceColumn="SaleInvoiceID" DataSetColumn="SaleInvoiceID" />
|
||||
<Mapping SourceColumn="IsApproved" DataSetColumn="IsApproved" />
|
||||
</Mappings>
|
||||
<Sources />
|
||||
</TableAdapter>
|
||||
<TableAdapter BaseClass="System.ComponentModel.Component" DataAccessorModifier="AutoLayout, AnsiClass, Class, Public" DataAccessorName="ContactTableAdapter" GeneratorDataComponentClassName="ContactTableAdapter" Name="Contact" UserDataComponentName="ContactTableAdapter">
|
||||
<MainSource>
|
||||
<DbSource ConnectionRef="BealeEngConnectionString (Settings)" DbObjectName="BealeEng.dbo.Contact" DbObjectType="Table" FillMethodModifier="Public" FillMethodName="Fill" GenerateMethods="Both" GenerateShortCommands="true" GeneratorGetMethodName="GetData" GeneratorSourceName="Fill" GetMethodModifier="Public" GetMethodName="GetData" QueryType="Rowset" ScalarCallRetval="System.Object, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" UseOptimisticConcurrency="true" UserGetMethodName="GetData" UserSourceName="Fill">
|
||||
<DeleteCommand>
|
||||
<DbCommand CommandType="Text" ModifiedByUser="false">
|
||||
<CommandText>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)))</CommandText>
|
||||
<Parameters>
|
||||
<Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="Input" ParameterName="@Original_ContactID" Precision="0" ProviderType="Int" Scale="0" Size="0" SourceColumn="ContactID" SourceColumnNullMapping="false" SourceVersion="Original" />
|
||||
<Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="AnsiString" Direction="Input" ParameterName="@Original_ContactName" Precision="0" ProviderType="VarChar" Scale="0" Size="0" SourceColumn="ContactName" SourceColumnNullMapping="false" SourceVersion="Original" />
|
||||
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="Input" ParameterName="@IsNull_EmailAddress" Precision="0" ProviderType="Int" Scale="0" Size="0" SourceColumn="EmailAddress" SourceColumnNullMapping="true" SourceVersion="Original" />
|
||||
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="AnsiString" Direction="Input" ParameterName="@Original_EmailAddress" Precision="0" ProviderType="VarChar" Scale="0" Size="0" SourceColumn="EmailAddress" SourceColumnNullMapping="false" SourceVersion="Original" />
|
||||
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="Input" ParameterName="@IsNull_PrimaryPersonFirstName" Precision="0" ProviderType="Int" Scale="0" Size="0" SourceColumn="PrimaryPersonFirstName" SourceColumnNullMapping="true" SourceVersion="Original" />
|
||||
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="AnsiString" Direction="Input" ParameterName="@Original_PrimaryPersonFirstName" Precision="0" ProviderType="VarChar" Scale="0" Size="0" SourceColumn="PrimaryPersonFirstName" SourceColumnNullMapping="false" SourceVersion="Original" />
|
||||
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="Input" ParameterName="@IsNull_PrimaryPersonSurname" Precision="0" ProviderType="Int" Scale="0" Size="0" SourceColumn="PrimaryPersonSurname" SourceColumnNullMapping="true" SourceVersion="Original" />
|
||||
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="AnsiString" Direction="Input" ParameterName="@Original_PrimaryPersonSurname" Precision="0" ProviderType="VarChar" Scale="0" Size="0" SourceColumn="PrimaryPersonSurname" SourceColumnNullMapping="false" SourceVersion="Original" />
|
||||
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="Input" ParameterName="@IsNull_PrimaryPersonEmail" Precision="0" ProviderType="Int" Scale="0" Size="0" SourceColumn="PrimaryPersonEmail" SourceColumnNullMapping="true" SourceVersion="Original" />
|
||||
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="AnsiString" Direction="Input" ParameterName="@Original_PrimaryPersonEmail" Precision="0" ProviderType="VarChar" Scale="0" Size="0" SourceColumn="PrimaryPersonEmail" SourceColumnNullMapping="false" SourceVersion="Original" />
|
||||
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="Input" ParameterName="@IsNull_POAddressLine1" Precision="0" ProviderType="Int" Scale="0" Size="0" SourceColumn="POAddressLine1" SourceColumnNullMapping="true" SourceVersion="Original" />
|
||||
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="AnsiString" Direction="Input" ParameterName="@Original_POAddressLine1" Precision="0" ProviderType="VarChar" Scale="0" Size="0" SourceColumn="POAddressLine1" SourceColumnNullMapping="false" SourceVersion="Original" />
|
||||
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="Input" ParameterName="@IsNull_POAddressLine2" Precision="0" ProviderType="Int" Scale="0" Size="0" SourceColumn="POAddressLine2" SourceColumnNullMapping="true" SourceVersion="Original" />
|
||||
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="AnsiString" Direction="Input" ParameterName="@Original_POAddressLine2" Precision="0" ProviderType="VarChar" Scale="0" Size="0" SourceColumn="POAddressLine2" SourceColumnNullMapping="false" SourceVersion="Original" />
|
||||
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="Input" ParameterName="@IsNull_POAddressLine3" Precision="0" ProviderType="Int" Scale="0" Size="0" SourceColumn="POAddressLine3" SourceColumnNullMapping="true" SourceVersion="Original" />
|
||||
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="AnsiString" Direction="Input" ParameterName="@Original_POAddressLine3" Precision="0" ProviderType="VarChar" Scale="0" Size="0" SourceColumn="POAddressLine3" SourceColumnNullMapping="false" SourceVersion="Original" />
|
||||
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="Input" ParameterName="@IsNull_POAddressLine4" Precision="0" ProviderType="Int" Scale="0" Size="0" SourceColumn="POAddressLine4" SourceColumnNullMapping="true" SourceVersion="Original" />
|
||||
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="AnsiString" Direction="Input" ParameterName="@Original_POAddressLine4" Precision="0" ProviderType="VarChar" Scale="0" Size="0" SourceColumn="POAddressLine4" SourceColumnNullMapping="false" SourceVersion="Original" />
|
||||
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="Input" ParameterName="@IsNull_POAddressCity" Precision="0" ProviderType="Int" Scale="0" Size="0" SourceColumn="POAddressCity" SourceColumnNullMapping="true" SourceVersion="Original" />
|
||||
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="AnsiString" Direction="Input" ParameterName="@Original_POAddressCity" Precision="0" ProviderType="VarChar" Scale="0" Size="0" SourceColumn="POAddressCity" SourceColumnNullMapping="false" SourceVersion="Original" />
|
||||
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="Input" ParameterName="@IsNull_POAddressRegion" Precision="0" ProviderType="Int" Scale="0" Size="0" SourceColumn="POAddressRegion" SourceColumnNullMapping="true" SourceVersion="Original" />
|
||||
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="AnsiString" Direction="Input" ParameterName="@Original_POAddressRegion" Precision="0" ProviderType="VarChar" Scale="0" Size="0" SourceColumn="POAddressRegion" SourceColumnNullMapping="false" SourceVersion="Original" />
|
||||
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="Input" ParameterName="@IsNull_POAddressPostalCode" Precision="0" ProviderType="Int" Scale="0" Size="0" SourceColumn="POAddressPostalCode" SourceColumnNullMapping="true" SourceVersion="Original" />
|
||||
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="AnsiString" Direction="Input" ParameterName="@Original_POAddressPostalCode" Precision="0" ProviderType="VarChar" Scale="0" Size="0" SourceColumn="POAddressPostalCode" SourceColumnNullMapping="false" SourceVersion="Original" />
|
||||
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="Input" ParameterName="@IsNull_POAddressCountry" Precision="0" ProviderType="Int" Scale="0" Size="0" SourceColumn="POAddressCountry" SourceColumnNullMapping="true" SourceVersion="Original" />
|
||||
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="AnsiString" Direction="Input" ParameterName="@Original_POAddressCountry" Precision="0" ProviderType="VarChar" Scale="0" Size="0" SourceColumn="POAddressCountry" SourceColumnNullMapping="false" SourceVersion="Original" />
|
||||
</Parameters>
|
||||
</DbCommand>
|
||||
</DeleteCommand>
|
||||
<InsertCommand>
|
||||
<DbCommand CommandType="Text" ModifiedByUser="false">
|
||||
<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())</CommandText>
|
||||
<Parameters>
|
||||
<Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="AnsiString" Direction="Input" ParameterName="@ContactName" Precision="0" ProviderType="VarChar" Scale="0" Size="0" SourceColumn="ContactName" SourceColumnNullMapping="false" SourceVersion="Current" />
|
||||
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="AnsiString" Direction="Input" ParameterName="@EmailAddress" Precision="0" ProviderType="VarChar" Scale="0" Size="0" SourceColumn="EmailAddress" SourceColumnNullMapping="false" SourceVersion="Current" />
|
||||
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="AnsiString" Direction="Input" ParameterName="@PrimaryPersonFirstName" Precision="0" ProviderType="VarChar" Scale="0" Size="0" SourceColumn="PrimaryPersonFirstName" SourceColumnNullMapping="false" SourceVersion="Current" />
|
||||
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="AnsiString" Direction="Input" ParameterName="@PrimaryPersonSurname" Precision="0" ProviderType="VarChar" Scale="0" Size="0" SourceColumn="PrimaryPersonSurname" SourceColumnNullMapping="false" SourceVersion="Current" />
|
||||
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="AnsiString" Direction="Input" ParameterName="@PrimaryPersonEmail" Precision="0" ProviderType="VarChar" Scale="0" Size="0" SourceColumn="PrimaryPersonEmail" SourceColumnNullMapping="false" SourceVersion="Current" />
|
||||
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="AnsiString" Direction="Input" ParameterName="@POAddressLine1" Precision="0" ProviderType="VarChar" Scale="0" Size="0" SourceColumn="POAddressLine1" SourceColumnNullMapping="false" SourceVersion="Current" />
|
||||
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="AnsiString" Direction="Input" ParameterName="@POAddressLine2" Precision="0" ProviderType="VarChar" Scale="0" Size="0" SourceColumn="POAddressLine2" SourceColumnNullMapping="false" SourceVersion="Current" />
|
||||
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="AnsiString" Direction="Input" ParameterName="@POAddressLine3" Precision="0" ProviderType="VarChar" Scale="0" Size="0" SourceColumn="POAddressLine3" SourceColumnNullMapping="false" SourceVersion="Current" />
|
||||
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="AnsiString" Direction="Input" ParameterName="@POAddressLine4" Precision="0" ProviderType="VarChar" Scale="0" Size="0" SourceColumn="POAddressLine4" SourceColumnNullMapping="false" SourceVersion="Current" />
|
||||
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="AnsiString" Direction="Input" ParameterName="@POAddressCity" Precision="0" ProviderType="VarChar" Scale="0" Size="0" SourceColumn="POAddressCity" SourceColumnNullMapping="false" SourceVersion="Current" />
|
||||
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="AnsiString" Direction="Input" ParameterName="@POAddressRegion" Precision="0" ProviderType="VarChar" Scale="0" Size="0" SourceColumn="POAddressRegion" SourceColumnNullMapping="false" SourceVersion="Current" />
|
||||
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="AnsiString" Direction="Input" ParameterName="@POAddressPostalCode" Precision="0" ProviderType="VarChar" Scale="0" Size="0" SourceColumn="POAddressPostalCode" SourceColumnNullMapping="false" SourceVersion="Current" />
|
||||
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="AnsiString" Direction="Input" ParameterName="@POAddressCountry" Precision="0" ProviderType="VarChar" Scale="0" Size="0" SourceColumn="POAddressCountry" SourceColumnNullMapping="false" SourceVersion="Current" />
|
||||
</Parameters>
|
||||
</DbCommand>
|
||||
</InsertCommand>
|
||||
<SelectCommand>
|
||||
<DbCommand CommandType="Text" ModifiedByUser="false">
|
||||
<CommandText>SELECT ContactID, ContactName, EmailAddress, PrimaryPersonFirstName, PrimaryPersonSurname, PrimaryPersonEmail, POAddressLine1, POAddressLine2, POAddressLine3, POAddressLine4, POAddressCity, POAddressRegion, POAddressPostalCode, POAddressCountry FROM dbo.Contact</CommandText>
|
||||
<Parameters />
|
||||
</DbCommand>
|
||||
</SelectCommand>
|
||||
<UpdateCommand>
|
||||
<DbCommand CommandType="Text" ModifiedByUser="false">
|
||||
<CommandText>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)</CommandText>
|
||||
<Parameters>
|
||||
<Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="AnsiString" Direction="Input" ParameterName="@ContactName" Precision="0" ProviderType="VarChar" Scale="0" Size="0" SourceColumn="ContactName" SourceColumnNullMapping="false" SourceVersion="Current" />
|
||||
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="AnsiString" Direction="Input" ParameterName="@EmailAddress" Precision="0" ProviderType="VarChar" Scale="0" Size="0" SourceColumn="EmailAddress" SourceColumnNullMapping="false" SourceVersion="Current" />
|
||||
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="AnsiString" Direction="Input" ParameterName="@PrimaryPersonFirstName" Precision="0" ProviderType="VarChar" Scale="0" Size="0" SourceColumn="PrimaryPersonFirstName" SourceColumnNullMapping="false" SourceVersion="Current" />
|
||||
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="AnsiString" Direction="Input" ParameterName="@PrimaryPersonSurname" Precision="0" ProviderType="VarChar" Scale="0" Size="0" SourceColumn="PrimaryPersonSurname" SourceColumnNullMapping="false" SourceVersion="Current" />
|
||||
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="AnsiString" Direction="Input" ParameterName="@PrimaryPersonEmail" Precision="0" ProviderType="VarChar" Scale="0" Size="0" SourceColumn="PrimaryPersonEmail" SourceColumnNullMapping="false" SourceVersion="Current" />
|
||||
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="AnsiString" Direction="Input" ParameterName="@POAddressLine1" Precision="0" ProviderType="VarChar" Scale="0" Size="0" SourceColumn="POAddressLine1" SourceColumnNullMapping="false" SourceVersion="Current" />
|
||||
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="AnsiString" Direction="Input" ParameterName="@POAddressLine2" Precision="0" ProviderType="VarChar" Scale="0" Size="0" SourceColumn="POAddressLine2" SourceColumnNullMapping="false" SourceVersion="Current" />
|
||||
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="AnsiString" Direction="Input" ParameterName="@POAddressLine3" Precision="0" ProviderType="VarChar" Scale="0" Size="0" SourceColumn="POAddressLine3" SourceColumnNullMapping="false" SourceVersion="Current" />
|
||||
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="AnsiString" Direction="Input" ParameterName="@POAddressLine4" Precision="0" ProviderType="VarChar" Scale="0" Size="0" SourceColumn="POAddressLine4" SourceColumnNullMapping="false" SourceVersion="Current" />
|
||||
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="AnsiString" Direction="Input" ParameterName="@POAddressCity" Precision="0" ProviderType="VarChar" Scale="0" Size="0" SourceColumn="POAddressCity" SourceColumnNullMapping="false" SourceVersion="Current" />
|
||||
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="AnsiString" Direction="Input" ParameterName="@POAddressRegion" Precision="0" ProviderType="VarChar" Scale="0" Size="0" SourceColumn="POAddressRegion" SourceColumnNullMapping="false" SourceVersion="Current" />
|
||||
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="AnsiString" Direction="Input" ParameterName="@POAddressPostalCode" Precision="0" ProviderType="VarChar" Scale="0" Size="0" SourceColumn="POAddressPostalCode" SourceColumnNullMapping="false" SourceVersion="Current" />
|
||||
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="AnsiString" Direction="Input" ParameterName="@POAddressCountry" Precision="0" ProviderType="VarChar" Scale="0" Size="0" SourceColumn="POAddressCountry" SourceColumnNullMapping="false" SourceVersion="Current" />
|
||||
<Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="Input" ParameterName="@Original_ContactID" Precision="0" ProviderType="Int" Scale="0" Size="0" SourceColumn="ContactID" SourceColumnNullMapping="false" SourceVersion="Original" />
|
||||
<Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="AnsiString" Direction="Input" ParameterName="@Original_ContactName" Precision="0" ProviderType="VarChar" Scale="0" Size="0" SourceColumn="ContactName" SourceColumnNullMapping="false" SourceVersion="Original" />
|
||||
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="Input" ParameterName="@IsNull_EmailAddress" Precision="0" ProviderType="Int" Scale="0" Size="0" SourceColumn="EmailAddress" SourceColumnNullMapping="true" SourceVersion="Original" />
|
||||
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="AnsiString" Direction="Input" ParameterName="@Original_EmailAddress" Precision="0" ProviderType="VarChar" Scale="0" Size="0" SourceColumn="EmailAddress" SourceColumnNullMapping="false" SourceVersion="Original" />
|
||||
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="Input" ParameterName="@IsNull_PrimaryPersonFirstName" Precision="0" ProviderType="Int" Scale="0" Size="0" SourceColumn="PrimaryPersonFirstName" SourceColumnNullMapping="true" SourceVersion="Original" />
|
||||
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="AnsiString" Direction="Input" ParameterName="@Original_PrimaryPersonFirstName" Precision="0" ProviderType="VarChar" Scale="0" Size="0" SourceColumn="PrimaryPersonFirstName" SourceColumnNullMapping="false" SourceVersion="Original" />
|
||||
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="Input" ParameterName="@IsNull_PrimaryPersonSurname" Precision="0" ProviderType="Int" Scale="0" Size="0" SourceColumn="PrimaryPersonSurname" SourceColumnNullMapping="true" SourceVersion="Original" />
|
||||
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="AnsiString" Direction="Input" ParameterName="@Original_PrimaryPersonSurname" Precision="0" ProviderType="VarChar" Scale="0" Size="0" SourceColumn="PrimaryPersonSurname" SourceColumnNullMapping="false" SourceVersion="Original" />
|
||||
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="Input" ParameterName="@IsNull_PrimaryPersonEmail" Precision="0" ProviderType="Int" Scale="0" Size="0" SourceColumn="PrimaryPersonEmail" SourceColumnNullMapping="true" SourceVersion="Original" />
|
||||
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="AnsiString" Direction="Input" ParameterName="@Original_PrimaryPersonEmail" Precision="0" ProviderType="VarChar" Scale="0" Size="0" SourceColumn="PrimaryPersonEmail" SourceColumnNullMapping="false" SourceVersion="Original" />
|
||||
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="Input" ParameterName="@IsNull_POAddressLine1" Precision="0" ProviderType="Int" Scale="0" Size="0" SourceColumn="POAddressLine1" SourceColumnNullMapping="true" SourceVersion="Original" />
|
||||
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="AnsiString" Direction="Input" ParameterName="@Original_POAddressLine1" Precision="0" ProviderType="VarChar" Scale="0" Size="0" SourceColumn="POAddressLine1" SourceColumnNullMapping="false" SourceVersion="Original" />
|
||||
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="Input" ParameterName="@IsNull_POAddressLine2" Precision="0" ProviderType="Int" Scale="0" Size="0" SourceColumn="POAddressLine2" SourceColumnNullMapping="true" SourceVersion="Original" />
|
||||
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="AnsiString" Direction="Input" ParameterName="@Original_POAddressLine2" Precision="0" ProviderType="VarChar" Scale="0" Size="0" SourceColumn="POAddressLine2" SourceColumnNullMapping="false" SourceVersion="Original" />
|
||||
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="Input" ParameterName="@IsNull_POAddressLine3" Precision="0" ProviderType="Int" Scale="0" Size="0" SourceColumn="POAddressLine3" SourceColumnNullMapping="true" SourceVersion="Original" />
|
||||
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="AnsiString" Direction="Input" ParameterName="@Original_POAddressLine3" Precision="0" ProviderType="VarChar" Scale="0" Size="0" SourceColumn="POAddressLine3" SourceColumnNullMapping="false" SourceVersion="Original" />
|
||||
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="Input" ParameterName="@IsNull_POAddressLine4" Precision="0" ProviderType="Int" Scale="0" Size="0" SourceColumn="POAddressLine4" SourceColumnNullMapping="true" SourceVersion="Original" />
|
||||
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="AnsiString" Direction="Input" ParameterName="@Original_POAddressLine4" Precision="0" ProviderType="VarChar" Scale="0" Size="0" SourceColumn="POAddressLine4" SourceColumnNullMapping="false" SourceVersion="Original" />
|
||||
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="Input" ParameterName="@IsNull_POAddressCity" Precision="0" ProviderType="Int" Scale="0" Size="0" SourceColumn="POAddressCity" SourceColumnNullMapping="true" SourceVersion="Original" />
|
||||
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="AnsiString" Direction="Input" ParameterName="@Original_POAddressCity" Precision="0" ProviderType="VarChar" Scale="0" Size="0" SourceColumn="POAddressCity" SourceColumnNullMapping="false" SourceVersion="Original" />
|
||||
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="Input" ParameterName="@IsNull_POAddressRegion" Precision="0" ProviderType="Int" Scale="0" Size="0" SourceColumn="POAddressRegion" SourceColumnNullMapping="true" SourceVersion="Original" />
|
||||
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="AnsiString" Direction="Input" ParameterName="@Original_POAddressRegion" Precision="0" ProviderType="VarChar" Scale="0" Size="0" SourceColumn="POAddressRegion" SourceColumnNullMapping="false" SourceVersion="Original" />
|
||||
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="Input" ParameterName="@IsNull_POAddressPostalCode" Precision="0" ProviderType="Int" Scale="0" Size="0" SourceColumn="POAddressPostalCode" SourceColumnNullMapping="true" SourceVersion="Original" />
|
||||
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="AnsiString" Direction="Input" ParameterName="@Original_POAddressPostalCode" Precision="0" ProviderType="VarChar" Scale="0" Size="0" SourceColumn="POAddressPostalCode" SourceColumnNullMapping="false" SourceVersion="Original" />
|
||||
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="Input" ParameterName="@IsNull_POAddressCountry" Precision="0" ProviderType="Int" Scale="0" Size="0" SourceColumn="POAddressCountry" SourceColumnNullMapping="true" SourceVersion="Original" />
|
||||
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="AnsiString" Direction="Input" ParameterName="@Original_POAddressCountry" Precision="0" ProviderType="VarChar" Scale="0" Size="0" SourceColumn="POAddressCountry" SourceColumnNullMapping="false" SourceVersion="Original" />
|
||||
<Parameter AllowDbNull="false" AutogeneratedName="ContactID" ColumnName="ContactID" DataSourceName="BealeEng.dbo.Contact" DataTypeServer="int" DbType="Int32" Direction="Input" ParameterName="@ContactID" Precision="0" ProviderType="Int" Scale="0" Size="4" SourceColumn="ContactID" SourceColumnNullMapping="false" SourceVersion="Current" />
|
||||
</Parameters>
|
||||
</DbCommand>
|
||||
</UpdateCommand>
|
||||
</DbSource>
|
||||
</MainSource>
|
||||
<Mappings>
|
||||
<Mapping SourceColumn="ContactID" DataSetColumn="ContactID" />
|
||||
<Mapping SourceColumn="ContactName" DataSetColumn="ContactName" />
|
||||
<Mapping SourceColumn="EmailAddress" DataSetColumn="EmailAddress" />
|
||||
<Mapping SourceColumn="PrimaryPersonFirstName" DataSetColumn="PrimaryPersonFirstName" />
|
||||
<Mapping SourceColumn="PrimaryPersonSurname" DataSetColumn="PrimaryPersonSurname" />
|
||||
<Mapping SourceColumn="PrimaryPersonEmail" DataSetColumn="PrimaryPersonEmail" />
|
||||
<Mapping SourceColumn="POAddressLine1" DataSetColumn="POAddressLine1" />
|
||||
<Mapping SourceColumn="POAddressLine2" DataSetColumn="POAddressLine2" />
|
||||
<Mapping SourceColumn="POAddressLine3" DataSetColumn="POAddressLine3" />
|
||||
<Mapping SourceColumn="POAddressLine4" DataSetColumn="POAddressLine4" />
|
||||
<Mapping SourceColumn="POAddressCity" DataSetColumn="POAddressCity" />
|
||||
<Mapping SourceColumn="POAddressRegion" DataSetColumn="POAddressRegion" />
|
||||
<Mapping SourceColumn="POAddressPostalCode" DataSetColumn="POAddressPostalCode" />
|
||||
<Mapping SourceColumn="POAddressCountry" DataSetColumn="POAddressCountry" />
|
||||
</Mappings>
|
||||
<Sources />
|
||||
</TableAdapter>
|
||||
<TableAdapter BaseClass="System.ComponentModel.Component" DataAccessorModifier="AutoLayout, AnsiClass, Class, Public" DataAccessorName="ProjectTableAdapter" GeneratorDataComponentClassName="ProjectTableAdapter" Name="Project" UserDataComponentName="ProjectTableAdapter">
|
||||
<MainSource>
|
||||
<DbSource ConnectionRef="BealeEngConnectionString (Settings)" DbObjectName="BealeEng.dbo.Project" DbObjectType="Table" FillMethodModifier="Public" FillMethodName="Fill" GenerateMethods="Both" GenerateShortCommands="true" GeneratorGetMethodName="GetData" GeneratorSourceName="Fill" GetMethodModifier="Public" GetMethodName="GetData" QueryType="Rowset" ScalarCallRetval="System.Object, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" UseOptimisticConcurrency="true" UserGetMethodName="GetData" UserSourceName="Fill">
|
||||
<DeleteCommand>
|
||||
<DbCommand CommandType="Text" ModifiedByUser="false">
|
||||
<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))</CommandText>
|
||||
<Parameters>
|
||||
<Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="Input" ParameterName="@Original_ProjectID" Precision="0" ProviderType="Int" Scale="0" Size="0" SourceColumn="ProjectID" SourceColumnNullMapping="false" SourceVersion="Original" />
|
||||
<Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="Input" ParameterName="@Original_ContactID" Precision="0" ProviderType="Int" Scale="0" Size="0" SourceColumn="ContactID" SourceColumnNullMapping="false" SourceVersion="Original" />
|
||||
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="Input" ParameterName="@IsNull_ProjectRef" Precision="0" ProviderType="Int" Scale="0" Size="0" SourceColumn="ProjectRef" SourceColumnNullMapping="true" SourceVersion="Original" />
|
||||
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="AnsiString" Direction="Input" ParameterName="@Original_ProjectRef" Precision="0" ProviderType="VarChar" Scale="0" Size="0" SourceColumn="ProjectRef" SourceColumnNullMapping="false" SourceVersion="Original" />
|
||||
<Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="AnsiString" Direction="Input" ParameterName="@Original_ProjectTitle" Precision="0" ProviderType="VarChar" Scale="0" Size="0" SourceColumn="ProjectTitle" SourceColumnNullMapping="false" SourceVersion="Original" />
|
||||
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="Input" ParameterName="@IsNull_DateStart" Precision="0" ProviderType="Int" Scale="0" Size="0" SourceColumn="DateStart" SourceColumnNullMapping="true" SourceVersion="Original" />
|
||||
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="Date" Direction="Input" ParameterName="@Original_DateStart" Precision="0" ProviderType="Date" Scale="0" Size="0" SourceColumn="DateStart" SourceColumnNullMapping="false" SourceVersion="Original" />
|
||||
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="Input" ParameterName="@IsNull_DateEnd" Precision="0" ProviderType="Int" Scale="0" Size="0" SourceColumn="DateEnd" SourceColumnNullMapping="true" SourceVersion="Original" />
|
||||
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="Date" Direction="Input" ParameterName="@Original_DateEnd" Precision="0" ProviderType="Date" Scale="0" Size="0" SourceColumn="DateEnd" SourceColumnNullMapping="false" SourceVersion="Original" />
|
||||
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="Input" ParameterName="@IsNull_ClientName" Precision="0" ProviderType="Int" Scale="0" Size="0" SourceColumn="ClientName" SourceColumnNullMapping="true" SourceVersion="Original" />
|
||||
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="AnsiString" Direction="Input" ParameterName="@Original_ClientName" Precision="0" ProviderType="VarChar" Scale="0" Size="0" SourceColumn="ClientName" SourceColumnNullMapping="false" SourceVersion="Original" />
|
||||
<Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="Boolean" Direction="Input" ParameterName="@Original_IsArchived" Precision="0" ProviderType="Bit" Scale="0" Size="0" SourceColumn="IsArchived" SourceColumnNullMapping="false" SourceVersion="Original" />
|
||||
</Parameters>
|
||||
</DbCommand>
|
||||
</DeleteCommand>
|
||||
<InsertCommand>
|
||||
<DbCommand CommandType="Text" ModifiedByUser="false">
|
||||
<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)</CommandText>
|
||||
<Parameters>
|
||||
<Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="Input" ParameterName="@ProjectID" Precision="0" ProviderType="Int" Scale="0" Size="0" SourceColumn="ProjectID" SourceColumnNullMapping="false" SourceVersion="Current" />
|
||||
<Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="Input" ParameterName="@ContactID" Precision="0" ProviderType="Int" Scale="0" Size="0" SourceColumn="ContactID" SourceColumnNullMapping="false" SourceVersion="Current" />
|
||||
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="AnsiString" Direction="Input" ParameterName="@ProjectRef" Precision="0" ProviderType="VarChar" Scale="0" Size="0" SourceColumn="ProjectRef" SourceColumnNullMapping="false" SourceVersion="Current" />
|
||||
<Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="AnsiString" Direction="Input" ParameterName="@ProjectTitle" Precision="0" ProviderType="VarChar" Scale="0" Size="0" SourceColumn="ProjectTitle" SourceColumnNullMapping="false" SourceVersion="Current" />
|
||||
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="Date" Direction="Input" ParameterName="@DateStart" Precision="0" ProviderType="Date" Scale="0" Size="0" SourceColumn="DateStart" SourceColumnNullMapping="false" SourceVersion="Current" />
|
||||
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="Date" Direction="Input" ParameterName="@DateEnd" Precision="0" ProviderType="Date" Scale="0" Size="0" SourceColumn="DateEnd" SourceColumnNullMapping="false" SourceVersion="Current" />
|
||||
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="AnsiString" Direction="Input" ParameterName="@ClientName" Precision="0" ProviderType="VarChar" Scale="0" Size="0" SourceColumn="ClientName" SourceColumnNullMapping="false" SourceVersion="Current" />
|
||||
<Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="Boolean" Direction="Input" ParameterName="@IsArchived" Precision="0" ProviderType="Bit" Scale="0" Size="0" SourceColumn="IsArchived" SourceColumnNullMapping="false" SourceVersion="Current" />
|
||||
</Parameters>
|
||||
</DbCommand>
|
||||
</InsertCommand>
|
||||
<SelectCommand>
|
||||
<DbCommand CommandType="Text" ModifiedByUser="false">
|
||||
<CommandText>SELECT ProjectID, ContactID, ProjectRef, ProjectTitle, DateStart, DateEnd, ClientName, IsArchived FROM dbo.Project</CommandText>
|
||||
<Parameters />
|
||||
</DbCommand>
|
||||
</SelectCommand>
|
||||
<UpdateCommand>
|
||||
<DbCommand CommandType="Text" ModifiedByUser="false">
|
||||
<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)</CommandText>
|
||||
<Parameters>
|
||||
<Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="Input" ParameterName="@ProjectID" Precision="0" ProviderType="Int" Scale="0" Size="0" SourceColumn="ProjectID" SourceColumnNullMapping="false" SourceVersion="Current" />
|
||||
<Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="Input" ParameterName="@ContactID" Precision="0" ProviderType="Int" Scale="0" Size="0" SourceColumn="ContactID" SourceColumnNullMapping="false" SourceVersion="Current" />
|
||||
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="AnsiString" Direction="Input" ParameterName="@ProjectRef" Precision="0" ProviderType="VarChar" Scale="0" Size="0" SourceColumn="ProjectRef" SourceColumnNullMapping="false" SourceVersion="Current" />
|
||||
<Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="AnsiString" Direction="Input" ParameterName="@ProjectTitle" Precision="0" ProviderType="VarChar" Scale="0" Size="0" SourceColumn="ProjectTitle" SourceColumnNullMapping="false" SourceVersion="Current" />
|
||||
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="Date" Direction="Input" ParameterName="@DateStart" Precision="0" ProviderType="Date" Scale="0" Size="0" SourceColumn="DateStart" SourceColumnNullMapping="false" SourceVersion="Current" />
|
||||
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="Date" Direction="Input" ParameterName="@DateEnd" Precision="0" ProviderType="Date" Scale="0" Size="0" SourceColumn="DateEnd" SourceColumnNullMapping="false" SourceVersion="Current" />
|
||||
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="AnsiString" Direction="Input" ParameterName="@ClientName" Precision="0" ProviderType="VarChar" Scale="0" Size="0" SourceColumn="ClientName" SourceColumnNullMapping="false" SourceVersion="Current" />
|
||||
<Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="Boolean" Direction="Input" ParameterName="@IsArchived" Precision="0" ProviderType="Bit" Scale="0" Size="0" SourceColumn="IsArchived" SourceColumnNullMapping="false" SourceVersion="Current" />
|
||||
<Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="Input" ParameterName="@Original_ProjectID" Precision="0" ProviderType="Int" Scale="0" Size="0" SourceColumn="ProjectID" SourceColumnNullMapping="false" SourceVersion="Original" />
|
||||
<Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="Input" ParameterName="@Original_ContactID" Precision="0" ProviderType="Int" Scale="0" Size="0" SourceColumn="ContactID" SourceColumnNullMapping="false" SourceVersion="Original" />
|
||||
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="Input" ParameterName="@IsNull_ProjectRef" Precision="0" ProviderType="Int" Scale="0" Size="0" SourceColumn="ProjectRef" SourceColumnNullMapping="true" SourceVersion="Original" />
|
||||
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="AnsiString" Direction="Input" ParameterName="@Original_ProjectRef" Precision="0" ProviderType="VarChar" Scale="0" Size="0" SourceColumn="ProjectRef" SourceColumnNullMapping="false" SourceVersion="Original" />
|
||||
<Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="AnsiString" Direction="Input" ParameterName="@Original_ProjectTitle" Precision="0" ProviderType="VarChar" Scale="0" Size="0" SourceColumn="ProjectTitle" SourceColumnNullMapping="false" SourceVersion="Original" />
|
||||
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="Input" ParameterName="@IsNull_DateStart" Precision="0" ProviderType="Int" Scale="0" Size="0" SourceColumn="DateStart" SourceColumnNullMapping="true" SourceVersion="Original" />
|
||||
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="Date" Direction="Input" ParameterName="@Original_DateStart" Precision="0" ProviderType="Date" Scale="0" Size="0" SourceColumn="DateStart" SourceColumnNullMapping="false" SourceVersion="Original" />
|
||||
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="Input" ParameterName="@IsNull_DateEnd" Precision="0" ProviderType="Int" Scale="0" Size="0" SourceColumn="DateEnd" SourceColumnNullMapping="true" SourceVersion="Original" />
|
||||
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="Date" Direction="Input" ParameterName="@Original_DateEnd" Precision="0" ProviderType="Date" Scale="0" Size="0" SourceColumn="DateEnd" SourceColumnNullMapping="false" SourceVersion="Original" />
|
||||
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="Input" ParameterName="@IsNull_ClientName" Precision="0" ProviderType="Int" Scale="0" Size="0" SourceColumn="ClientName" SourceColumnNullMapping="true" SourceVersion="Original" />
|
||||
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="AnsiString" Direction="Input" ParameterName="@Original_ClientName" Precision="0" ProviderType="VarChar" Scale="0" Size="0" SourceColumn="ClientName" SourceColumnNullMapping="false" SourceVersion="Original" />
|
||||
<Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="Boolean" Direction="Input" ParameterName="@Original_IsArchived" Precision="0" ProviderType="Bit" Scale="0" Size="0" SourceColumn="IsArchived" SourceColumnNullMapping="false" SourceVersion="Original" />
|
||||
</Parameters>
|
||||
</DbCommand>
|
||||
</UpdateCommand>
|
||||
</DbSource>
|
||||
</MainSource>
|
||||
<Mappings>
|
||||
<Mapping SourceColumn="ProjectID" DataSetColumn="ProjectID" />
|
||||
<Mapping SourceColumn="ContactID" DataSetColumn="ContactID" />
|
||||
<Mapping SourceColumn="ProjectRef" DataSetColumn="ProjectRef" />
|
||||
<Mapping SourceColumn="ProjectTitle" DataSetColumn="ProjectTitle" />
|
||||
<Mapping SourceColumn="DateStart" DataSetColumn="DateStart" />
|
||||
<Mapping SourceColumn="DateEnd" DataSetColumn="DateEnd" />
|
||||
<Mapping SourceColumn="ClientName" DataSetColumn="ClientName" />
|
||||
<Mapping SourceColumn="IsArchived" DataSetColumn="IsArchived" />
|
||||
</Mappings>
|
||||
<Sources />
|
||||
</TableAdapter>
|
||||
<TableAdapter BaseClass="System.ComponentModel.Component" DataAccessorModifier="AutoLayout, AnsiClass, Class, Public" DataAccessorName="ProjectJobTableAdapter" GeneratorDataComponentClassName="ProjectJobTableAdapter" Name="ProjectJob" UserDataComponentName="ProjectJobTableAdapter">
|
||||
<MainSource>
|
||||
<DbSource ConnectionRef="BealeEngConnectionString (Settings)" DbObjectName="BealeEng.dbo.ProjectJob" DbObjectType="Table" FillMethodModifier="Public" FillMethodName="Fill" GenerateMethods="Both" GenerateShortCommands="true" GeneratorGetMethodName="GetData" GeneratorSourceName="Fill" GetMethodModifier="Public" GetMethodName="GetData" QueryType="Rowset" ScalarCallRetval="System.Object, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" UseOptimisticConcurrency="true" UserGetMethodName="GetData" UserSourceName="Fill">
|
||||
<DeleteCommand>
|
||||
<DbCommand CommandType="Text" ModifiedByUser="false">
|
||||
<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))</CommandText>
|
||||
<Parameters>
|
||||
<Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="Input" ParameterName="@Original_ProjectJobID" Precision="0" ProviderType="Int" Scale="0" Size="0" SourceColumn="ProjectJobID" SourceColumnNullMapping="false" SourceVersion="Original" />
|
||||
<Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="Input" ParameterName="@Original_ProjectID" Precision="0" ProviderType="Int" Scale="0" Size="0" SourceColumn="ProjectID" SourceColumnNullMapping="false" SourceVersion="Original" />
|
||||
<Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="Input" ParameterName="@Original_ContactID" Precision="0" ProviderType="Int" Scale="0" Size="0" SourceColumn="ContactID" SourceColumnNullMapping="false" SourceVersion="Original" />
|
||||
<Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="StringFixedLength" Direction="Input" ParameterName="@Original_JobNumber" Precision="0" ProviderType="NChar" Scale="0" Size="0" SourceColumn="JobNumber" SourceColumnNullMapping="false" SourceVersion="Original" />
|
||||
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="Input" ParameterName="@IsNull_JobTitle" Precision="0" ProviderType="Int" Scale="0" Size="0" SourceColumn="JobTitle" SourceColumnNullMapping="true" SourceVersion="Original" />
|
||||
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="String" Direction="Input" ParameterName="@Original_JobTitle" Precision="0" ProviderType="NVarChar" Scale="0" Size="0" SourceColumn="JobTitle" SourceColumnNullMapping="false" SourceVersion="Original" />
|
||||
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="Input" ParameterName="@IsNull_JobDescription" Precision="0" ProviderType="Int" Scale="0" Size="0" SourceColumn="JobDescription" SourceColumnNullMapping="true" SourceVersion="Original" />
|
||||
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="String" Direction="Input" ParameterName="@Original_JobDescription" Precision="0" ProviderType="NVarChar" Scale="0" Size="0" SourceColumn="JobDescription" SourceColumnNullMapping="false" SourceVersion="Original" />
|
||||
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="Input" ParameterName="@IsNull_DateStart" Precision="0" ProviderType="Int" Scale="0" Size="0" SourceColumn="DateStart" SourceColumnNullMapping="true" SourceVersion="Original" />
|
||||
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="Date" Direction="Input" ParameterName="@Original_DateStart" Precision="0" ProviderType="Date" Scale="0" Size="0" SourceColumn="DateStart" SourceColumnNullMapping="false" SourceVersion="Original" />
|
||||
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="Input" ParameterName="@IsNull_DateEnd" Precision="0" ProviderType="Int" Scale="0" Size="0" SourceColumn="DateEnd" SourceColumnNullMapping="true" SourceVersion="Original" />
|
||||
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="Date" Direction="Input" ParameterName="@Original_DateEnd" Precision="0" ProviderType="Date" Scale="0" Size="0" SourceColumn="DateEnd" SourceColumnNullMapping="false" SourceVersion="Original" />
|
||||
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="Input" ParameterName="@IsNull_ShareBob" Precision="0" ProviderType="Int" Scale="0" Size="0" SourceColumn="ShareBob" SourceColumnNullMapping="true" SourceVersion="Original" />
|
||||
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="Decimal" Direction="Input" ParameterName="@Original_ShareBob" Precision="9" ProviderType="Decimal" Scale="8" Size="0" SourceColumn="ShareBob" SourceColumnNullMapping="false" SourceVersion="Original" />
|
||||
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="Input" ParameterName="@IsNull_ShareJohn" Precision="0" ProviderType="Int" Scale="0" Size="0" SourceColumn="ShareJohn" SourceColumnNullMapping="true" SourceVersion="Original" />
|
||||
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="Decimal" Direction="Input" ParameterName="@Original_ShareJohn" Precision="9" ProviderType="Decimal" Scale="8" Size="0" SourceColumn="ShareJohn" SourceColumnNullMapping="false" SourceVersion="Original" />
|
||||
<Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="Boolean" Direction="Input" ParameterName="@Original_IsArchived" Precision="0" ProviderType="Bit" Scale="0" Size="0" SourceColumn="IsArchived" SourceColumnNullMapping="false" SourceVersion="Original" />
|
||||
</Parameters>
|
||||
</DbCommand>
|
||||
</DeleteCommand>
|
||||
<InsertCommand>
|
||||
<DbCommand CommandType="Text" ModifiedByUser="false">
|
||||
<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())</CommandText>
|
||||
<Parameters>
|
||||
<Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="Input" ParameterName="@ProjectID" Precision="0" ProviderType="Int" Scale="0" Size="0" SourceColumn="ProjectID" SourceColumnNullMapping="false" SourceVersion="Current" />
|
||||
<Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="Input" ParameterName="@ContactID" Precision="0" ProviderType="Int" Scale="0" Size="0" SourceColumn="ContactID" SourceColumnNullMapping="false" SourceVersion="Current" />
|
||||
<Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="StringFixedLength" Direction="Input" ParameterName="@JobNumber" Precision="0" ProviderType="NChar" Scale="0" Size="0" SourceColumn="JobNumber" SourceColumnNullMapping="false" SourceVersion="Current" />
|
||||
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="String" Direction="Input" ParameterName="@JobTitle" Precision="0" ProviderType="NVarChar" Scale="0" Size="0" SourceColumn="JobTitle" SourceColumnNullMapping="false" SourceVersion="Current" />
|
||||
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="String" Direction="Input" ParameterName="@JobDescription" Precision="0" ProviderType="NVarChar" Scale="0" Size="0" SourceColumn="JobDescription" SourceColumnNullMapping="false" SourceVersion="Current" />
|
||||
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="Date" Direction="Input" ParameterName="@DateStart" Precision="0" ProviderType="Date" Scale="0" Size="0" SourceColumn="DateStart" SourceColumnNullMapping="false" SourceVersion="Current" />
|
||||
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="Date" Direction="Input" ParameterName="@DateEnd" Precision="0" ProviderType="Date" Scale="0" Size="0" SourceColumn="DateEnd" SourceColumnNullMapping="false" SourceVersion="Current" />
|
||||
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="Decimal" Direction="Input" ParameterName="@ShareBob" Precision="9" ProviderType="Decimal" Scale="8" Size="0" SourceColumn="ShareBob" SourceColumnNullMapping="false" SourceVersion="Current" />
|
||||
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="Decimal" Direction="Input" ParameterName="@ShareJohn" Precision="9" ProviderType="Decimal" Scale="8" Size="0" SourceColumn="ShareJohn" SourceColumnNullMapping="false" SourceVersion="Current" />
|
||||
<Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="Boolean" Direction="Input" ParameterName="@IsArchived" Precision="0" ProviderType="Bit" Scale="0" Size="0" SourceColumn="IsArchived" SourceColumnNullMapping="false" SourceVersion="Current" />
|
||||
</Parameters>
|
||||
</DbCommand>
|
||||
</InsertCommand>
|
||||
<SelectCommand>
|
||||
<DbCommand CommandType="Text" ModifiedByUser="false">
|
||||
<CommandText>SELECT ProjectJobID, ProjectID, ContactID, JobNumber, JobTitle, JobDescription, DateStart, DateEnd, ShareBob, ShareJohn, IsArchived FROM dbo.ProjectJob</CommandText>
|
||||
<Parameters />
|
||||
</DbCommand>
|
||||
</SelectCommand>
|
||||
<UpdateCommand>
|
||||
<DbCommand CommandType="Text" ModifiedByUser="false">
|
||||
<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)</CommandText>
|
||||
<Parameters>
|
||||
<Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="Input" ParameterName="@ProjectID" Precision="0" ProviderType="Int" Scale="0" Size="0" SourceColumn="ProjectID" SourceColumnNullMapping="false" SourceVersion="Current" />
|
||||
<Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="Input" ParameterName="@ContactID" Precision="0" ProviderType="Int" Scale="0" Size="0" SourceColumn="ContactID" SourceColumnNullMapping="false" SourceVersion="Current" />
|
||||
<Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="StringFixedLength" Direction="Input" ParameterName="@JobNumber" Precision="0" ProviderType="NChar" Scale="0" Size="0" SourceColumn="JobNumber" SourceColumnNullMapping="false" SourceVersion="Current" />
|
||||
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="String" Direction="Input" ParameterName="@JobTitle" Precision="0" ProviderType="NVarChar" Scale="0" Size="0" SourceColumn="JobTitle" SourceColumnNullMapping="false" SourceVersion="Current" />
|
||||
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="String" Direction="Input" ParameterName="@JobDescription" Precision="0" ProviderType="NVarChar" Scale="0" Size="0" SourceColumn="JobDescription" SourceColumnNullMapping="false" SourceVersion="Current" />
|
||||
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="Date" Direction="Input" ParameterName="@DateStart" Precision="0" ProviderType="Date" Scale="0" Size="0" SourceColumn="DateStart" SourceColumnNullMapping="false" SourceVersion="Current" />
|
||||
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="Date" Direction="Input" ParameterName="@DateEnd" Precision="0" ProviderType="Date" Scale="0" Size="0" SourceColumn="DateEnd" SourceColumnNullMapping="false" SourceVersion="Current" />
|
||||
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="Decimal" Direction="Input" ParameterName="@ShareBob" Precision="9" ProviderType="Decimal" Scale="8" Size="0" SourceColumn="ShareBob" SourceColumnNullMapping="false" SourceVersion="Current" />
|
||||
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="Decimal" Direction="Input" ParameterName="@ShareJohn" Precision="9" ProviderType="Decimal" Scale="8" Size="0" SourceColumn="ShareJohn" SourceColumnNullMapping="false" SourceVersion="Current" />
|
||||
<Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="Boolean" Direction="Input" ParameterName="@IsArchived" Precision="0" ProviderType="Bit" Scale="0" Size="0" SourceColumn="IsArchived" SourceColumnNullMapping="false" SourceVersion="Current" />
|
||||
<Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="Input" ParameterName="@Original_ProjectJobID" Precision="0" ProviderType="Int" Scale="0" Size="0" SourceColumn="ProjectJobID" SourceColumnNullMapping="false" SourceVersion="Original" />
|
||||
<Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="Input" ParameterName="@Original_ProjectID" Precision="0" ProviderType="Int" Scale="0" Size="0" SourceColumn="ProjectID" SourceColumnNullMapping="false" SourceVersion="Original" />
|
||||
<Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="Input" ParameterName="@Original_ContactID" Precision="0" ProviderType="Int" Scale="0" Size="0" SourceColumn="ContactID" SourceColumnNullMapping="false" SourceVersion="Original" />
|
||||
<Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="StringFixedLength" Direction="Input" ParameterName="@Original_JobNumber" Precision="0" ProviderType="NChar" Scale="0" Size="0" SourceColumn="JobNumber" SourceColumnNullMapping="false" SourceVersion="Original" />
|
||||
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="Input" ParameterName="@IsNull_JobTitle" Precision="0" ProviderType="Int" Scale="0" Size="0" SourceColumn="JobTitle" SourceColumnNullMapping="true" SourceVersion="Original" />
|
||||
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="String" Direction="Input" ParameterName="@Original_JobTitle" Precision="0" ProviderType="NVarChar" Scale="0" Size="0" SourceColumn="JobTitle" SourceColumnNullMapping="false" SourceVersion="Original" />
|
||||
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="Input" ParameterName="@IsNull_JobDescription" Precision="0" ProviderType="Int" Scale="0" Size="0" SourceColumn="JobDescription" SourceColumnNullMapping="true" SourceVersion="Original" />
|
||||
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="String" Direction="Input" ParameterName="@Original_JobDescription" Precision="0" ProviderType="NVarChar" Scale="0" Size="0" SourceColumn="JobDescription" SourceColumnNullMapping="false" SourceVersion="Original" />
|
||||
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="Input" ParameterName="@IsNull_DateStart" Precision="0" ProviderType="Int" Scale="0" Size="0" SourceColumn="DateStart" SourceColumnNullMapping="true" SourceVersion="Original" />
|
||||
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="Date" Direction="Input" ParameterName="@Original_DateStart" Precision="0" ProviderType="Date" Scale="0" Size="0" SourceColumn="DateStart" SourceColumnNullMapping="false" SourceVersion="Original" />
|
||||
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="Input" ParameterName="@IsNull_DateEnd" Precision="0" ProviderType="Int" Scale="0" Size="0" SourceColumn="DateEnd" SourceColumnNullMapping="true" SourceVersion="Original" />
|
||||
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="Date" Direction="Input" ParameterName="@Original_DateEnd" Precision="0" ProviderType="Date" Scale="0" Size="0" SourceColumn="DateEnd" SourceColumnNullMapping="false" SourceVersion="Original" />
|
||||
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="Input" ParameterName="@IsNull_ShareBob" Precision="0" ProviderType="Int" Scale="0" Size="0" SourceColumn="ShareBob" SourceColumnNullMapping="true" SourceVersion="Original" />
|
||||
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="Decimal" Direction="Input" ParameterName="@Original_ShareBob" Precision="9" ProviderType="Decimal" Scale="8" Size="0" SourceColumn="ShareBob" SourceColumnNullMapping="false" SourceVersion="Original" />
|
||||
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="Input" ParameterName="@IsNull_ShareJohn" Precision="0" ProviderType="Int" Scale="0" Size="0" SourceColumn="ShareJohn" SourceColumnNullMapping="true" SourceVersion="Original" />
|
||||
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="Decimal" Direction="Input" ParameterName="@Original_ShareJohn" Precision="9" ProviderType="Decimal" Scale="8" Size="0" SourceColumn="ShareJohn" SourceColumnNullMapping="false" SourceVersion="Original" />
|
||||
<Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="Boolean" Direction="Input" ParameterName="@Original_IsArchived" Precision="0" ProviderType="Bit" Scale="0" Size="0" SourceColumn="IsArchived" SourceColumnNullMapping="false" SourceVersion="Original" />
|
||||
<Parameter AllowDbNull="false" AutogeneratedName="ProjectJobID" ColumnName="ProjectJobID" DataSourceName="BealeEng.dbo.ProjectJob" DataTypeServer="int" DbType="Int32" Direction="Input" ParameterName="@ProjectJobID" Precision="0" ProviderType="Int" Scale="0" Size="4" SourceColumn="ProjectJobID" SourceColumnNullMapping="false" SourceVersion="Current" />
|
||||
</Parameters>
|
||||
</DbCommand>
|
||||
</UpdateCommand>
|
||||
</DbSource>
|
||||
</MainSource>
|
||||
<Mappings>
|
||||
<Mapping SourceColumn="ProjectJobID" DataSetColumn="ProjectJobID" />
|
||||
<Mapping SourceColumn="ProjectID" DataSetColumn="ProjectID" />
|
||||
<Mapping SourceColumn="ContactID" DataSetColumn="ContactID" />
|
||||
<Mapping SourceColumn="JobNumber" DataSetColumn="JobNumber" />
|
||||
<Mapping SourceColumn="JobTitle" DataSetColumn="JobTitle" />
|
||||
<Mapping SourceColumn="JobDescription" DataSetColumn="JobDescription" />
|
||||
<Mapping SourceColumn="DateStart" DataSetColumn="DateStart" />
|
||||
<Mapping SourceColumn="DateEnd" DataSetColumn="DateEnd" />
|
||||
<Mapping SourceColumn="ShareBob" DataSetColumn="ShareBob" />
|
||||
<Mapping SourceColumn="ShareJohn" DataSetColumn="ShareJohn" />
|
||||
<Mapping SourceColumn="IsArchived" DataSetColumn="IsArchived" />
|
||||
</Mappings>
|
||||
<Sources />
|
||||
</TableAdapter>
|
||||
</Tables>
|
||||
<Sources />
|
||||
</DataSource>
|
||||
</xs:appinfo>
|
||||
</xs:annotation>
|
||||
<xs:element name="BealeEngDataSet" msdata:IsDataSet="true" msdata:UseCurrentLocale="true" msprop:EnableTableAdapterManager="True" msprop:Generator_DataSetName="BealeEngDataSet" msprop:Generator_UserDSName="BealeEngDataSet">
|
||||
<xs:complexType>
|
||||
<xs:choice minOccurs="0" maxOccurs="unbounded">
|
||||
<xs:element name="ClientPurchaseOrder" msprop:Generator_TableClassName="ClientPurchaseOrderDataTable" msprop:Generator_TableVarName="tableClientPurchaseOrder" msprop:Generator_TablePropName="ClientPurchaseOrder" msprop:Generator_RowDeletingName="ClientPurchaseOrderRowDeleting" msprop:Generator_RowChangingName="ClientPurchaseOrderRowChanging" msprop:Generator_RowEvHandlerName="ClientPurchaseOrderRowChangeEventHandler" msprop:Generator_RowDeletedName="ClientPurchaseOrderRowDeleted" msprop:Generator_UserTableName="ClientPurchaseOrder" msprop:Generator_RowChangedName="ClientPurchaseOrderRowChanged" msprop:Generator_RowEvArgName="ClientPurchaseOrderRowChangeEvent" msprop:Generator_RowClassName="ClientPurchaseOrderRow">
|
||||
<xs:complexType>
|
||||
<xs:sequence>
|
||||
<xs:element name="ClientPurchaseOrderID" msdata:ReadOnly="true" msdata:AutoIncrement="true" msdata:AutoIncrementSeed="-1" msdata:AutoIncrementStep="-1" msprop:Generator_ColumnVarNameInTable="columnClientPurchaseOrderID" msprop:Generator_ColumnPropNameInRow="ClientPurchaseOrderID" msprop:Generator_ColumnPropNameInTable="ClientPurchaseOrderIDColumn" msprop:Generator_UserColumnName="ClientPurchaseOrderID" type="xs:int" />
|
||||
<xs:element name="PurchaseOrderDate" msprop:Generator_ColumnVarNameInTable="columnPurchaseOrderDate" msprop:Generator_ColumnPropNameInRow="PurchaseOrderDate" msprop:Generator_ColumnPropNameInTable="PurchaseOrderDateColumn" msprop:Generator_UserColumnName="PurchaseOrderDate" type="xs:dateTime" />
|
||||
<xs:element name="ContactID" msprop:Generator_ColumnVarNameInTable="columnContactID" msprop:Generator_ColumnPropNameInRow="ContactID" msprop:Generator_ColumnPropNameInTable="ContactIDColumn" msprop:Generator_UserColumnName="ContactID" type="xs:int" />
|
||||
<xs:element name="ClientReference" msprop:Generator_ColumnVarNameInTable="columnClientReference" msprop:Generator_ColumnPropNameInRow="ClientReference" msprop:Generator_ColumnPropNameInTable="ClientReferenceColumn" msprop:Generator_UserColumnName="ClientReference">
|
||||
<xs:simpleType>
|
||||
<xs:restriction base="xs:string">
|
||||
<xs:maxLength value="50" />
|
||||
</xs:restriction>
|
||||
</xs:simpleType>
|
||||
</xs:element>
|
||||
<xs:element name="RequestorEmail" msprop:Generator_ColumnVarNameInTable="columnRequestorEmail" msprop:Generator_ColumnPropNameInRow="RequestorEmail" msprop:Generator_ColumnPropNameInTable="RequestorEmailColumn" msprop:Generator_UserColumnName="RequestorEmail" minOccurs="0">
|
||||
<xs:simpleType>
|
||||
<xs:restriction base="xs:string">
|
||||
<xs:maxLength value="150" />
|
||||
</xs:restriction>
|
||||
</xs:simpleType>
|
||||
</xs:element>
|
||||
<xs:element name="OrderTotal" msprop:Generator_ColumnVarNameInTable="columnOrderTotal" msprop:Generator_ColumnPropNameInRow="OrderTotal" msprop:Generator_ColumnPropNameInTable="OrderTotalColumn" msprop:Generator_UserColumnName="OrderTotal" type="xs:decimal" minOccurs="0" />
|
||||
<xs:element name="IsClosed" msprop:Generator_ColumnVarNameInTable="columnIsClosed" msprop:Generator_ColumnPropNameInRow="IsClosed" msprop:Generator_ColumnPropNameInTable="IsClosedColumn" msprop:Generator_UserColumnName="IsClosed" type="xs:boolean" />
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
<xs:element name="ClientPurchaseOrderLine" msprop:Generator_TableClassName="ClientPurchaseOrderLineDataTable" msprop:Generator_TableVarName="tableClientPurchaseOrderLine" msprop:Generator_TablePropName="ClientPurchaseOrderLine" msprop:Generator_RowDeletingName="ClientPurchaseOrderLineRowDeleting" msprop:Generator_RowChangingName="ClientPurchaseOrderLineRowChanging" msprop:Generator_RowEvHandlerName="ClientPurchaseOrderLineRowChangeEventHandler" msprop:Generator_RowDeletedName="ClientPurchaseOrderLineRowDeleted" msprop:Generator_UserTableName="ClientPurchaseOrderLine" msprop:Generator_RowChangedName="ClientPurchaseOrderLineRowChanged" msprop:Generator_RowEvArgName="ClientPurchaseOrderLineRowChangeEvent" msprop:Generator_RowClassName="ClientPurchaseOrderLineRow">
|
||||
<xs:complexType>
|
||||
<xs:sequence>
|
||||
<xs:element name="ClientPurchaseOrderLineID" msdata:ReadOnly="true" msdata:AutoIncrement="true" msdata:AutoIncrementSeed="-1" msdata:AutoIncrementStep="-1" msprop:Generator_ColumnVarNameInTable="columnClientPurchaseOrderLineID" msprop:Generator_ColumnPropNameInRow="ClientPurchaseOrderLineID" msprop:Generator_ColumnPropNameInTable="ClientPurchaseOrderLineIDColumn" msprop:Generator_UserColumnName="ClientPurchaseOrderLineID" type="xs:int" />
|
||||
<xs:element name="ClientPurchaseOrderID" msprop:Generator_ColumnVarNameInTable="columnClientPurchaseOrderID" msprop:Generator_ColumnPropNameInRow="ClientPurchaseOrderID" msprop:Generator_ColumnPropNameInTable="ClientPurchaseOrderIDColumn" msprop:Generator_UserColumnName="ClientPurchaseOrderID" type="xs:int" />
|
||||
<xs:element name="LineNumber" msprop:Generator_ColumnVarNameInTable="columnLineNumber" msprop:Generator_ColumnPropNameInRow="LineNumber" msprop:Generator_ColumnPropNameInTable="LineNumberColumn" msprop:Generator_UserColumnName="LineNumber" type="xs:int" />
|
||||
<xs:element name="ProjectJobID" msprop:Generator_ColumnVarNameInTable="columnProjectJobID" msprop:Generator_ColumnPropNameInRow="ProjectJobID" msprop:Generator_ColumnPropNameInTable="ProjectJobIDColumn" msprop:Generator_UserColumnName="ProjectJobID" type="xs:int" />
|
||||
<xs:element name="Description" msprop:Generator_ColumnVarNameInTable="columnDescription" msprop:Generator_ColumnPropNameInRow="Description" msprop:Generator_ColumnPropNameInTable="DescriptionColumn" msprop:Generator_UserColumnName="Description" minOccurs="0">
|
||||
<xs:simpleType>
|
||||
<xs:restriction base="xs:string">
|
||||
<xs:maxLength value="250" />
|
||||
</xs:restriction>
|
||||
</xs:simpleType>
|
||||
</xs:element>
|
||||
<xs:element name="LineNetAmount" msprop:Generator_ColumnVarNameInTable="columnLineNetAmount" msprop:Generator_ColumnPropNameInRow="LineNetAmount" msprop:Generator_ColumnPropNameInTable="LineNetAmountColumn" msprop:Generator_UserColumnName="LineNetAmount" type="xs:decimal" />
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
<xs:element name="ClientPurchaseOrderLineSalesInvoice" msprop:Generator_TableClassName="ClientPurchaseOrderLineSalesInvoiceDataTable" msprop:Generator_TableVarName="tableClientPurchaseOrderLineSalesInvoice" msprop:Generator_TablePropName="ClientPurchaseOrderLineSalesInvoice" msprop:Generator_RowDeletingName="ClientPurchaseOrderLineSalesInvoiceRowDeleting" msprop:Generator_RowChangingName="ClientPurchaseOrderLineSalesInvoiceRowChanging" msprop:Generator_RowEvHandlerName="ClientPurchaseOrderLineSalesInvoiceRowChangeEventHandler" msprop:Generator_RowDeletedName="ClientPurchaseOrderLineSalesInvoiceRowDeleted" msprop:Generator_UserTableName="ClientPurchaseOrderLineSalesInvoice" msprop:Generator_RowChangedName="ClientPurchaseOrderLineSalesInvoiceRowChanged" msprop:Generator_RowEvArgName="ClientPurchaseOrderLineSalesInvoiceRowChangeEvent" msprop:Generator_RowClassName="ClientPurchaseOrderLineSalesInvoiceRow">
|
||||
<xs:complexType>
|
||||
<xs:sequence>
|
||||
<xs:element name="ClientPurchaseOrderLineID" msprop:Generator_ColumnVarNameInTable="columnClientPurchaseOrderLineID" msprop:Generator_ColumnPropNameInRow="ClientPurchaseOrderLineID" msprop:Generator_ColumnPropNameInTable="ClientPurchaseOrderLineIDColumn" msprop:Generator_UserColumnName="ClientPurchaseOrderLineID" type="xs:int" />
|
||||
<xs:element name="SaleInvoiceID" msprop:Generator_ColumnVarNameInTable="columnSaleInvoiceID" msprop:Generator_ColumnPropNameInRow="SaleInvoiceID" msprop:Generator_ColumnPropNameInTable="SaleInvoiceIDColumn" msprop:Generator_UserColumnName="SaleInvoiceID" type="xs:int" />
|
||||
<xs:element name="IsApproved" msprop:Generator_ColumnVarNameInTable="columnIsApproved" msprop:Generator_ColumnPropNameInRow="IsApproved" msprop:Generator_ColumnPropNameInTable="IsApprovedColumn" msprop:Generator_UserColumnName="IsApproved" type="xs:boolean" />
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
<xs:element name="Contact" msprop:Generator_TableClassName="ContactDataTable" msprop:Generator_TableVarName="tableContact" msprop:Generator_TablePropName="Contact" msprop:Generator_RowDeletingName="ContactRowDeleting" msprop:Generator_RowChangingName="ContactRowChanging" msprop:Generator_RowEvHandlerName="ContactRowChangeEventHandler" msprop:Generator_RowDeletedName="ContactRowDeleted" msprop:Generator_UserTableName="Contact" msprop:Generator_RowChangedName="ContactRowChanged" msprop:Generator_RowEvArgName="ContactRowChangeEvent" msprop:Generator_RowClassName="ContactRow">
|
||||
<xs:complexType>
|
||||
<xs:sequence>
|
||||
<xs:element name="ContactID" msdata:ReadOnly="true" msdata:AutoIncrement="true" msdata:AutoIncrementSeed="-1" msdata:AutoIncrementStep="-1" msprop:Generator_ColumnVarNameInTable="columnContactID" msprop:Generator_ColumnPropNameInRow="ContactID" msprop:Generator_ColumnPropNameInTable="ContactIDColumn" msprop:Generator_UserColumnName="ContactID" type="xs:int" />
|
||||
<xs:element name="ContactName" msprop:Generator_ColumnVarNameInTable="columnContactName" msprop:Generator_ColumnPropNameInRow="ContactName" msprop:Generator_ColumnPropNameInTable="ContactNameColumn" msprop:Generator_UserColumnName="ContactName">
|
||||
<xs:simpleType>
|
||||
<xs:restriction base="xs:string">
|
||||
<xs:maxLength value="100" />
|
||||
</xs:restriction>
|
||||
</xs:simpleType>
|
||||
</xs:element>
|
||||
<xs:element name="EmailAddress" msprop:Generator_ColumnVarNameInTable="columnEmailAddress" msprop:Generator_ColumnPropNameInRow="EmailAddress" msprop:Generator_ColumnPropNameInTable="EmailAddressColumn" msprop:Generator_UserColumnName="EmailAddress" minOccurs="0">
|
||||
<xs:simpleType>
|
||||
<xs:restriction base="xs:string">
|
||||
<xs:maxLength value="150" />
|
||||
</xs:restriction>
|
||||
</xs:simpleType>
|
||||
</xs:element>
|
||||
<xs:element name="PrimaryPersonFirstName" msprop:Generator_ColumnVarNameInTable="columnPrimaryPersonFirstName" msprop:Generator_ColumnPropNameInRow="PrimaryPersonFirstName" msprop:Generator_ColumnPropNameInTable="PrimaryPersonFirstNameColumn" msprop:Generator_UserColumnName="PrimaryPersonFirstName" minOccurs="0">
|
||||
<xs:simpleType>
|
||||
<xs:restriction base="xs:string">
|
||||
<xs:maxLength value="100" />
|
||||
</xs:restriction>
|
||||
</xs:simpleType>
|
||||
</xs:element>
|
||||
<xs:element name="PrimaryPersonSurname" msprop:Generator_ColumnVarNameInTable="columnPrimaryPersonSurname" msprop:Generator_ColumnPropNameInRow="PrimaryPersonSurname" msprop:Generator_ColumnPropNameInTable="PrimaryPersonSurnameColumn" msprop:Generator_UserColumnName="PrimaryPersonSurname" minOccurs="0">
|
||||
<xs:simpleType>
|
||||
<xs:restriction base="xs:string">
|
||||
<xs:maxLength value="100" />
|
||||
</xs:restriction>
|
||||
</xs:simpleType>
|
||||
</xs:element>
|
||||
<xs:element name="PrimaryPersonEmail" msprop:Generator_ColumnVarNameInTable="columnPrimaryPersonEmail" msprop:Generator_ColumnPropNameInRow="PrimaryPersonEmail" msprop:Generator_ColumnPropNameInTable="PrimaryPersonEmailColumn" msprop:Generator_UserColumnName="PrimaryPersonEmail" minOccurs="0">
|
||||
<xs:simpleType>
|
||||
<xs:restriction base="xs:string">
|
||||
<xs:maxLength value="100" />
|
||||
</xs:restriction>
|
||||
</xs:simpleType>
|
||||
</xs:element>
|
||||
<xs:element name="POAddressLine1" msprop:Generator_ColumnVarNameInTable="columnPOAddressLine1" msprop:Generator_ColumnPropNameInRow="POAddressLine1" msprop:Generator_ColumnPropNameInTable="POAddressLine1Column" msprop:Generator_UserColumnName="POAddressLine1" minOccurs="0">
|
||||
<xs:simpleType>
|
||||
<xs:restriction base="xs:string">
|
||||
<xs:maxLength value="100" />
|
||||
</xs:restriction>
|
||||
</xs:simpleType>
|
||||
</xs:element>
|
||||
<xs:element name="POAddressLine2" msprop:Generator_ColumnVarNameInTable="columnPOAddressLine2" msprop:Generator_ColumnPropNameInRow="POAddressLine2" msprop:Generator_ColumnPropNameInTable="POAddressLine2Column" msprop:Generator_UserColumnName="POAddressLine2" minOccurs="0">
|
||||
<xs:simpleType>
|
||||
<xs:restriction base="xs:string">
|
||||
<xs:maxLength value="100" />
|
||||
</xs:restriction>
|
||||
</xs:simpleType>
|
||||
</xs:element>
|
||||
<xs:element name="POAddressLine3" msprop:Generator_ColumnVarNameInTable="columnPOAddressLine3" msprop:Generator_ColumnPropNameInRow="POAddressLine3" msprop:Generator_ColumnPropNameInTable="POAddressLine3Column" msprop:Generator_UserColumnName="POAddressLine3" minOccurs="0">
|
||||
<xs:simpleType>
|
||||
<xs:restriction base="xs:string">
|
||||
<xs:maxLength value="100" />
|
||||
</xs:restriction>
|
||||
</xs:simpleType>
|
||||
</xs:element>
|
||||
<xs:element name="POAddressLine4" msprop:Generator_ColumnVarNameInTable="columnPOAddressLine4" msprop:Generator_ColumnPropNameInRow="POAddressLine4" msprop:Generator_ColumnPropNameInTable="POAddressLine4Column" msprop:Generator_UserColumnName="POAddressLine4" minOccurs="0">
|
||||
<xs:simpleType>
|
||||
<xs:restriction base="xs:string">
|
||||
<xs:maxLength value="100" />
|
||||
</xs:restriction>
|
||||
</xs:simpleType>
|
||||
</xs:element>
|
||||
<xs:element name="POAddressCity" msprop:Generator_ColumnVarNameInTable="columnPOAddressCity" msprop:Generator_ColumnPropNameInRow="POAddressCity" msprop:Generator_ColumnPropNameInTable="POAddressCityColumn" msprop:Generator_UserColumnName="POAddressCity" minOccurs="0">
|
||||
<xs:simpleType>
|
||||
<xs:restriction base="xs:string">
|
||||
<xs:maxLength value="100" />
|
||||
</xs:restriction>
|
||||
</xs:simpleType>
|
||||
</xs:element>
|
||||
<xs:element name="POAddressRegion" msprop:Generator_ColumnVarNameInTable="columnPOAddressRegion" msprop:Generator_ColumnPropNameInRow="POAddressRegion" msprop:Generator_ColumnPropNameInTable="POAddressRegionColumn" msprop:Generator_UserColumnName="POAddressRegion" minOccurs="0">
|
||||
<xs:simpleType>
|
||||
<xs:restriction base="xs:string">
|
||||
<xs:maxLength value="100" />
|
||||
</xs:restriction>
|
||||
</xs:simpleType>
|
||||
</xs:element>
|
||||
<xs:element name="POAddressPostalCode" msprop:Generator_ColumnVarNameInTable="columnPOAddressPostalCode" msprop:Generator_ColumnPropNameInRow="POAddressPostalCode" msprop:Generator_ColumnPropNameInTable="POAddressPostalCodeColumn" msprop:Generator_UserColumnName="POAddressPostalCode" minOccurs="0">
|
||||
<xs:simpleType>
|
||||
<xs:restriction base="xs:string">
|
||||
<xs:maxLength value="50" />
|
||||
</xs:restriction>
|
||||
</xs:simpleType>
|
||||
</xs:element>
|
||||
<xs:element name="POAddressCountry" msprop:Generator_ColumnVarNameInTable="columnPOAddressCountry" msprop:Generator_ColumnPropNameInRow="POAddressCountry" msprop:Generator_ColumnPropNameInTable="POAddressCountryColumn" msprop:Generator_UserColumnName="POAddressCountry" minOccurs="0">
|
||||
<xs:simpleType>
|
||||
<xs:restriction base="xs:string">
|
||||
<xs:maxLength value="100" />
|
||||
</xs:restriction>
|
||||
</xs:simpleType>
|
||||
</xs:element>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
<xs:element name="Project" msprop:Generator_TableClassName="ProjectDataTable" msprop:Generator_TableVarName="tableProject" msprop:Generator_TablePropName="Project" msprop:Generator_RowDeletingName="ProjectRowDeleting" msprop:Generator_RowChangingName="ProjectRowChanging" msprop:Generator_RowEvHandlerName="ProjectRowChangeEventHandler" msprop:Generator_RowDeletedName="ProjectRowDeleted" msprop:Generator_UserTableName="Project" msprop:Generator_RowChangedName="ProjectRowChanged" msprop:Generator_RowEvArgName="ProjectRowChangeEvent" msprop:Generator_RowClassName="ProjectRow">
|
||||
<xs:complexType>
|
||||
<xs:sequence>
|
||||
<xs:element name="ProjectID" msprop:Generator_ColumnVarNameInTable="columnProjectID" msprop:Generator_ColumnPropNameInRow="ProjectID" msprop:Generator_ColumnPropNameInTable="ProjectIDColumn" msprop:Generator_UserColumnName="ProjectID" type="xs:int" />
|
||||
<xs:element name="ContactID" msprop:Generator_ColumnVarNameInTable="columnContactID" msprop:Generator_ColumnPropNameInRow="ContactID" msprop:Generator_ColumnPropNameInTable="ContactIDColumn" msprop:Generator_UserColumnName="ContactID" type="xs:int" />
|
||||
<xs:element name="ProjectRef" msprop:Generator_ColumnVarNameInTable="columnProjectRef" msprop:Generator_ColumnPropNameInRow="ProjectRef" msprop:Generator_ColumnPropNameInTable="ProjectRefColumn" msprop:Generator_UserColumnName="ProjectRef" minOccurs="0">
|
||||
<xs:simpleType>
|
||||
<xs:restriction base="xs:string">
|
||||
<xs:maxLength value="16" />
|
||||
</xs:restriction>
|
||||
</xs:simpleType>
|
||||
</xs:element>
|
||||
<xs:element name="ProjectTitle" msprop:Generator_ColumnVarNameInTable="columnProjectTitle" msprop:Generator_ColumnPropNameInRow="ProjectTitle" msprop:Generator_ColumnPropNameInTable="ProjectTitleColumn" msprop:Generator_UserColumnName="ProjectTitle">
|
||||
<xs:simpleType>
|
||||
<xs:restriction base="xs:string">
|
||||
<xs:maxLength value="250" />
|
||||
</xs:restriction>
|
||||
</xs:simpleType>
|
||||
</xs:element>
|
||||
<xs:element name="DateStart" msprop:Generator_ColumnVarNameInTable="columnDateStart" msprop:Generator_ColumnPropNameInRow="DateStart" msprop:Generator_ColumnPropNameInTable="DateStartColumn" msprop:Generator_UserColumnName="DateStart" type="xs:dateTime" minOccurs="0" />
|
||||
<xs:element name="DateEnd" msprop:Generator_ColumnVarNameInTable="columnDateEnd" msprop:Generator_ColumnPropNameInRow="DateEnd" msprop:Generator_ColumnPropNameInTable="DateEndColumn" msprop:Generator_UserColumnName="DateEnd" type="xs:dateTime" minOccurs="0" />
|
||||
<xs:element name="ClientName" msprop:Generator_ColumnVarNameInTable="columnClientName" msprop:Generator_ColumnPropNameInRow="ClientName" msprop:Generator_ColumnPropNameInTable="ClientNameColumn" msprop:Generator_UserColumnName="ClientName" minOccurs="0">
|
||||
<xs:simpleType>
|
||||
<xs:restriction base="xs:string">
|
||||
<xs:maxLength value="50" />
|
||||
</xs:restriction>
|
||||
</xs:simpleType>
|
||||
</xs:element>
|
||||
<xs:element name="IsArchived" msprop:Generator_ColumnVarNameInTable="columnIsArchived" msprop:Generator_ColumnPropNameInRow="IsArchived" msprop:Generator_ColumnPropNameInTable="IsArchivedColumn" msprop:Generator_UserColumnName="IsArchived" type="xs:boolean" />
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
<xs:element name="ProjectJob" msprop:Generator_TableClassName="ProjectJobDataTable" msprop:Generator_TableVarName="tableProjectJob" msprop:Generator_TablePropName="ProjectJob" msprop:Generator_RowDeletingName="ProjectJobRowDeleting" msprop:Generator_RowChangingName="ProjectJobRowChanging" msprop:Generator_RowEvHandlerName="ProjectJobRowChangeEventHandler" msprop:Generator_RowDeletedName="ProjectJobRowDeleted" msprop:Generator_UserTableName="ProjectJob" msprop:Generator_RowChangedName="ProjectJobRowChanged" msprop:Generator_RowEvArgName="ProjectJobRowChangeEvent" msprop:Generator_RowClassName="ProjectJobRow">
|
||||
<xs:complexType>
|
||||
<xs:sequence>
|
||||
<xs:element name="ProjectJobID" msdata:ReadOnly="true" msdata:AutoIncrement="true" msdata:AutoIncrementSeed="-1" msdata:AutoIncrementStep="-1" msprop:Generator_ColumnVarNameInTable="columnProjectJobID" msprop:Generator_ColumnPropNameInRow="ProjectJobID" msprop:Generator_ColumnPropNameInTable="ProjectJobIDColumn" msprop:Generator_UserColumnName="ProjectJobID" type="xs:int" />
|
||||
<xs:element name="ProjectID" msprop:Generator_ColumnVarNameInTable="columnProjectID" msprop:Generator_ColumnPropNameInRow="ProjectID" msprop:Generator_ColumnPropNameInTable="ProjectIDColumn" msprop:Generator_UserColumnName="ProjectID" type="xs:int" />
|
||||
<xs:element name="ContactID" msprop:Generator_ColumnVarNameInTable="columnContactID" msprop:Generator_ColumnPropNameInRow="ContactID" msprop:Generator_ColumnPropNameInTable="ContactIDColumn" msprop:Generator_UserColumnName="ContactID" type="xs:int" />
|
||||
<xs:element name="JobNumber" msprop:Generator_ColumnVarNameInTable="columnJobNumber" msprop:Generator_ColumnPropNameInRow="JobNumber" msprop:Generator_ColumnPropNameInTable="JobNumberColumn" msprop:Generator_UserColumnName="JobNumber">
|
||||
<xs:simpleType>
|
||||
<xs:restriction base="xs:string">
|
||||
<xs:maxLength value="7" />
|
||||
</xs:restriction>
|
||||
</xs:simpleType>
|
||||
</xs:element>
|
||||
<xs:element name="JobTitle" msprop:Generator_ColumnVarNameInTable="columnJobTitle" msprop:Generator_ColumnPropNameInRow="JobTitle" msprop:Generator_ColumnPropNameInTable="JobTitleColumn" msprop:Generator_UserColumnName="JobTitle" minOccurs="0">
|
||||
<xs:simpleType>
|
||||
<xs:restriction base="xs:string">
|
||||
<xs:maxLength value="250" />
|
||||
</xs:restriction>
|
||||
</xs:simpleType>
|
||||
</xs:element>
|
||||
<xs:element name="JobDescription" msprop:Generator_ColumnVarNameInTable="columnJobDescription" msprop:Generator_ColumnPropNameInRow="JobDescription" msprop:Generator_ColumnPropNameInTable="JobDescriptionColumn" msprop:Generator_UserColumnName="JobDescription" minOccurs="0">
|
||||
<xs:simpleType>
|
||||
<xs:restriction base="xs:string">
|
||||
<xs:maxLength value="500" />
|
||||
</xs:restriction>
|
||||
</xs:simpleType>
|
||||
</xs:element>
|
||||
<xs:element name="DateStart" msprop:Generator_ColumnVarNameInTable="columnDateStart" msprop:Generator_ColumnPropNameInRow="DateStart" msprop:Generator_ColumnPropNameInTable="DateStartColumn" msprop:Generator_UserColumnName="DateStart" type="xs:dateTime" minOccurs="0" />
|
||||
<xs:element name="DateEnd" msprop:Generator_ColumnVarNameInTable="columnDateEnd" msprop:Generator_ColumnPropNameInRow="DateEnd" msprop:Generator_ColumnPropNameInTable="DateEndColumn" msprop:Generator_UserColumnName="DateEnd" type="xs:dateTime" minOccurs="0" />
|
||||
<xs:element name="ShareBob" msprop:Generator_ColumnVarNameInTable="columnShareBob" msprop:Generator_ColumnPropNameInRow="ShareBob" msprop:Generator_ColumnPropNameInTable="ShareBobColumn" msprop:Generator_UserColumnName="ShareBob" type="xs:decimal" minOccurs="0" />
|
||||
<xs:element name="ShareJohn" msprop:Generator_ColumnVarNameInTable="columnShareJohn" msprop:Generator_ColumnPropNameInRow="ShareJohn" msprop:Generator_ColumnPropNameInTable="ShareJohnColumn" msprop:Generator_UserColumnName="ShareJohn" type="xs:decimal" minOccurs="0" />
|
||||
<xs:element name="IsArchived" msprop:Generator_ColumnVarNameInTable="columnIsArchived" msprop:Generator_ColumnPropNameInRow="IsArchived" msprop:Generator_ColumnPropNameInTable="IsArchivedColumn" msprop:Generator_UserColumnName="IsArchived" type="xs:boolean" />
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
</xs:choice>
|
||||
</xs:complexType>
|
||||
<xs:unique name="Constraint1" msdata:PrimaryKey="true">
|
||||
<xs:selector xpath=".//mstns:ClientPurchaseOrder" />
|
||||
<xs:field xpath="mstns:ClientPurchaseOrderID" />
|
||||
</xs:unique>
|
||||
<xs:unique name="ClientPurchaseOrderLine_Constraint1" msdata:ConstraintName="Constraint1" msdata:PrimaryKey="true">
|
||||
<xs:selector xpath=".//mstns:ClientPurchaseOrderLine" />
|
||||
<xs:field xpath="mstns:ClientPurchaseOrderLineID" />
|
||||
</xs:unique>
|
||||
<xs:unique name="ClientPurchaseOrderLineSalesInvoice_Constraint1" msdata:ConstraintName="Constraint1" msdata:PrimaryKey="true">
|
||||
<xs:selector xpath=".//mstns:ClientPurchaseOrderLineSalesInvoice" />
|
||||
<xs:field xpath="mstns:SaleInvoiceID" />
|
||||
</xs:unique>
|
||||
<xs:unique name="Contact_Constraint1" msdata:ConstraintName="Constraint1" msdata:PrimaryKey="true">
|
||||
<xs:selector xpath=".//mstns:Contact" />
|
||||
<xs:field xpath="mstns:ContactID" />
|
||||
</xs:unique>
|
||||
<xs:unique name="Project_Constraint1" msdata:ConstraintName="Constraint1" msdata:PrimaryKey="true">
|
||||
<xs:selector xpath=".//mstns:Project" />
|
||||
<xs:field xpath="mstns:ProjectID" />
|
||||
</xs:unique>
|
||||
<xs:unique name="ProjectJob_Constraint1" msdata:ConstraintName="Constraint1" msdata:PrimaryKey="true">
|
||||
<xs:selector xpath=".//mstns:ProjectJob" />
|
||||
<xs:field xpath="mstns:ProjectJobID" />
|
||||
</xs:unique>
|
||||
</xs:element>
|
||||
<xs:annotation>
|
||||
<xs:appinfo>
|
||||
<msdata:Relationship name="FK_ClientPurchaseOrder_Contact" msdata:parent="Contact" msdata:child="ClientPurchaseOrder" msdata:parentkey="ContactID" msdata:childkey="ContactID" msprop:Generator_UserChildTable="ClientPurchaseOrder" msprop:Generator_ChildPropName="GetClientPurchaseOrderRows" msprop:Generator_UserRelationName="FK_ClientPurchaseOrder_Contact" msprop:Generator_RelationVarName="relationFK_ClientPurchaseOrder_Contact" msprop:Generator_UserParentTable="Contact" msprop:Generator_ParentPropName="ContactRow" />
|
||||
<msdata:Relationship name="FK_ClientPurchaseOrderLine_ClientPurchaseOrder" msdata:parent="ClientPurchaseOrder" msdata:child="ClientPurchaseOrderLine" msdata:parentkey="ClientPurchaseOrderID" msdata:childkey="ClientPurchaseOrderID" msprop:Generator_UserChildTable="ClientPurchaseOrderLine" msprop:Generator_ChildPropName="GetClientPurchaseOrderLineRows" msprop:Generator_UserRelationName="FK_ClientPurchaseOrderLine_ClientPurchaseOrder" msprop:Generator_ParentPropName="ClientPurchaseOrderRow" msprop:Generator_RelationVarName="relationFK_ClientPurchaseOrderLine_ClientPurchaseOrder" msprop:Generator_UserParentTable="ClientPurchaseOrder" />
|
||||
<msdata:Relationship name="FK_ClientPurchaseOrderLineSalesInvoice_ClientPurchaseOrderLine" msdata:parent="ClientPurchaseOrderLine" msdata:child="ClientPurchaseOrderLineSalesInvoice" msdata:parentkey="ClientPurchaseOrderLineID" msdata:childkey="ClientPurchaseOrderLineID" msprop:Generator_UserChildTable="ClientPurchaseOrderLineSalesInvoice" msprop:Generator_ChildPropName="GetClientPurchaseOrderLineSalesInvoiceRows" msprop:Generator_UserRelationName="FK_ClientPurchaseOrderLineSalesInvoice_ClientPurchaseOrderLine" msprop:Generator_ParentPropName="ClientPurchaseOrderLineRow" msprop:Generator_RelationVarName="relationFK_ClientPurchaseOrderLineSalesInvoice_ClientPurchaseOrderLine" msprop:Generator_UserParentTable="ClientPurchaseOrderLine" />
|
||||
<msdata:Relationship name="FK_Project_Contact" msdata:parent="Contact" msdata:child="Project" msdata:parentkey="ContactID" msdata:childkey="ContactID" msprop:Generator_UserChildTable="Project" msprop:Generator_ChildPropName="GetProjectRows" msprop:Generator_UserRelationName="FK_Project_Contact" msprop:Generator_ParentPropName="ContactRow" msprop:Generator_RelationVarName="relationFK_Project_Contact" msprop:Generator_UserParentTable="Contact" />
|
||||
<msdata:Relationship name="FK_ProjectJob_Contact" msdata:parent="Contact" msdata:child="ProjectJob" msdata:parentkey="ContactID" msdata:childkey="ContactID" msprop:Generator_UserChildTable="ProjectJob" msprop:Generator_ChildPropName="GetProjectJobRows" msprop:Generator_UserRelationName="FK_ProjectJob_Contact" msprop:Generator_ParentPropName="ContactRow" msprop:Generator_RelationVarName="relationFK_ProjectJob_Contact" msprop:Generator_UserParentTable="Contact" />
|
||||
<msdata:Relationship name="FK_ProjectJob_Project" msdata:parent="Project" msdata:child="ProjectJob" msdata:parentkey="ProjectID" msdata:childkey="ProjectID" msprop:Generator_UserChildTable="ProjectJob" msprop:Generator_ChildPropName="GetProjectJobRows" msprop:Generator_UserRelationName="FK_ProjectJob_Project" msprop:Generator_ParentPropName="ProjectRow" msprop:Generator_RelationVarName="relationFK_ProjectJob_Project" msprop:Generator_UserParentTable="Project" />
|
||||
</xs:appinfo>
|
||||
</xs:annotation>
|
||||
</xs:schema>
|
||||
@@ -75,10 +75,11 @@
|
||||
<Reference Include="System.Xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="BealeEngDataSet.Designer.cs">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DesignTime>True</DesignTime>
|
||||
<DependentUpon>BealeEngDataSet.xsd</DependentUpon>
|
||||
<Compile Include="ContactSelect.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="ContactSelect.Designer.cs">
|
||||
<DependentUpon>ContactSelect.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="frmClientPurchaseOrder.cs">
|
||||
<SubType>Form</SubType>
|
||||
@@ -92,6 +93,7 @@
|
||||
<Compile Include="frmMain.Designer.cs">
|
||||
<DependentUpon>frmMain.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Helper\FormDirtyTracker.cs" />
|
||||
<Compile Include="Program.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="frmSaleInvoice.cs">
|
||||
@@ -100,6 +102,9 @@
|
||||
<Compile Include="frmSaleInvoice.Designer.cs">
|
||||
<DependentUpon>frmSaleInvoice.cs</DependentUpon>
|
||||
</Compile>
|
||||
<EmbeddedResource Include="ContactSelect.resx">
|
||||
<DependentUpon>ContactSelect.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="frmClientPurchaseOrder.resx">
|
||||
<DependentUpon>frmClientPurchaseOrder.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
@@ -118,21 +123,16 @@
|
||||
<EmbeddedResource Include="frmSaleInvoice.resx">
|
||||
<DependentUpon>frmSaleInvoice.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<None Include="BealeEngDataSet.xsc">
|
||||
<DependentUpon>BealeEngDataSet.xsd</DependentUpon>
|
||||
</None>
|
||||
<None Include="BealeEngDataSet.xsd">
|
||||
<Generator>MSDataSetGenerator</Generator>
|
||||
<LastGenOutput>BealeEngDataSet.Designer.cs</LastGenOutput>
|
||||
<SubType>Designer</SubType>
|
||||
</None>
|
||||
<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\BealeEngineering.Core.Model.Contact.Address.datasource" />
|
||||
<None Include="Properties\DataSources\BealeEngineering.Core.Model.Contact.Contact.datasource" />
|
||||
<None Include="Properties\DataSources\BealeEngineering.Core.Model.Project.Project.datasource" />
|
||||
<None Include="Properties\DataSources\BealeEngineering.Core.Model.Project.ProjectWork+ProjectWorkItem.datasource" />
|
||||
<None Include="Properties\DataSources\BealeEngineering.Core.Model.Project.ProjectWork.datasource" />
|
||||
<None Include="Properties\DataSources\BealeEngineering.Core.Model.Project.ProjectWorkItem.datasource" />
|
||||
<None Include="Properties\DataSources\BealeEngineering.Core.Model.Sale.Invoice.datasource" />
|
||||
<None Include="Properties\DataSources\BealeEngineering.Core.Model.Sale.InvoiceHeader.datasource" />
|
||||
<None Include="Properties\DataSources\Form1.datasource" />
|
||||
@@ -167,5 +167,6 @@
|
||||
<Install>false</Install>
|
||||
</BootstrapperPackage>
|
||||
</ItemGroup>
|
||||
<ItemGroup />
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
</Project>
|
||||
101
BealeEngineering/BealeEngineering.Accounts/ContactSelect.Designer.cs
generated
Normal file
101
BealeEngineering/BealeEngineering.Accounts/ContactSelect.Designer.cs
generated
Normal file
@@ -0,0 +1,101 @@
|
||||
namespace BealeEngineering.Accounts
|
||||
{
|
||||
partial class ContactSelect
|
||||
{
|
||||
/// <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();
|
||||
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;
|
||||
}
|
||||
}
|
||||
43
BealeEngineering/BealeEngineering.Accounts/ContactSelect.cs
Normal file
43
BealeEngineering/BealeEngineering.Accounts/ContactSelect.cs
Normal file
@@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
123
BealeEngineering/BealeEngineering.Accounts/ContactSelect.resx
Normal file
123
BealeEngineering/BealeEngineering.Accounts/ContactSelect.resx
Normal file
@@ -0,0 +1,123 @@
|
||||
<?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="contactBindingSource.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>17, 17</value>
|
||||
</metadata>
|
||||
</root>
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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="Address" Version="1.0" xmlns="urn:schemas-microsoft-com:xml-msdatasource">
|
||||
<TypeInfo>BealeEngineering.Core.Model.Contact.Address, BealeEngineering.Core, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null</TypeInfo>
|
||||
</GenericObjectDataSource>
|
||||
@@ -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="Contact" Version="1.0" xmlns="urn:schemas-microsoft-com:xml-msdatasource">
|
||||
<TypeInfo>BealeEngineering.Core.Model.Contact.Contact, BealeEngineering.Core, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null</TypeInfo>
|
||||
</GenericObjectDataSource>
|
||||
@@ -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="Project" Version="1.0" xmlns="urn:schemas-microsoft-com:xml-msdatasource">
|
||||
<TypeInfo>BealeEngineering.Core.Model.Project.Project, BealeEngineering.Core, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null</TypeInfo>
|
||||
</GenericObjectDataSource>
|
||||
@@ -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="ProjectWork+ProjectWorkItem" Version="1.0" xmlns="urn:schemas-microsoft-com:xml-msdatasource">
|
||||
<TypeInfo>BealeEngineering.Core.Model.Project.ProjectWork+ProjectWorkItem, BealeEngineering.Core, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null</TypeInfo>
|
||||
</GenericObjectDataSource>
|
||||
@@ -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="ProjectWork" Version="1.0" xmlns="urn:schemas-microsoft-com:xml-msdatasource">
|
||||
<TypeInfo>BealeEngineering.Core.Model.Project.ProjectWork, BealeEngineering.Core, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null</TypeInfo>
|
||||
</GenericObjectDataSource>
|
||||
@@ -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="ProjectWorkItem" Version="1.0" xmlns="urn:schemas-microsoft-com:xml-msdatasource">
|
||||
<TypeInfo>BealeEngineering.Core.Model.Project.ProjectWorkItem, BealeEngineering.Core, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null</TypeInfo>
|
||||
</GenericObjectDataSource>
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -132,16 +132,16 @@
|
||||
<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">
|
||||
<metadata name="label1.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>False</value>
|
||||
</metadata>
|
||||
<metadata name="facility.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</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>
|
||||
File diff suppressed because it is too large
Load Diff
@@ -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)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -120,24 +120,6 @@
|
||||
<metadata name="invoiceHeaderBindingSource1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>834, 24</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>
|
||||
<metadata name="invoiceHeaderBindingSource1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>834, 24</value>
|
||||
</metadata>
|
||||
<metadata name="TotalAndCurrency.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="bindingSourceSaleInvoice.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>435, 24</value>
|
||||
</metadata>
|
||||
<metadata name="TotalAndCurrency.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="bindingSourceSaleInvoice.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>435, 24</value>
|
||||
</metadata>
|
||||
@@ -147,4 +129,43 @@
|
||||
<metadata name="invoiceHeaderBindingSource.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>626, 24</value>
|
||||
</metadata>
|
||||
<metadata name="purchaseOrderBindingSource.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>17, 63</value>
|
||||
</metadata>
|
||||
<metadata name="purchaseOrderBindingSource.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>17, 63</value>
|
||||
</metadata>
|
||||
<metadata name="TotalAndCurrency.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="TotalAndCurrency.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="WorkNumber.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>
|
||||
<metadata name="PurchaseOrderLineID.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="WorkNumber.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>
|
||||
<metadata name="projectWorkItemBindingSource.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>228, 63</value>
|
||||
</metadata>
|
||||
<metadata name="projectWorkItemBindingSource.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>228, 63</value>
|
||||
</metadata>
|
||||
<metadata name="$this.TrayHeight" type="System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>93</value>
|
||||
</metadata>
|
||||
</root>
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
@@ -144,8 +144,8 @@
|
||||
<metadata name="statusLabel.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>False</value>
|
||||
</metadata>
|
||||
<metadata name="bsInvoice.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>69, 24</value>
|
||||
<metadata name="taxTotalLabel.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>False</value>
|
||||
</metadata>
|
||||
<metadata name="bsInvoice.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>69, 24</value>
|
||||
@@ -153,7 +153,4 @@
|
||||
<metadata name="invoiceLineListBindingSource.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>186, 27</value>
|
||||
</metadata>
|
||||
<metadata name="taxTotalLabel.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>False</value>
|
||||
</metadata>
|
||||
</root>
|
||||
@@ -60,25 +60,35 @@
|
||||
<Reference Include="System.Xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Data\CurrencyFormat.cs" />
|
||||
<Compile Include="Data\Database\Client\CreatePurchaseOrder.cs" />
|
||||
<Compile Include="Data\Database\Client\CreatePurchaseOrderAllocation.cs" />
|
||||
<Compile Include="Data\Database\Client\ReadPurchaseOrder.cs" />
|
||||
<Compile Include="Data\Database\Client\ReadPurchaseOrderAllocation.cs" />
|
||||
<Compile Include="Data\Database\Client\ReadPurchaseOrderLineFacility.cs" />
|
||||
<Compile Include="Data\Database\Client\ReadSaleInvoiceAllocation.cs" />
|
||||
<Compile Include="Data\Database\Client\UpdatePurchaseOrder.cs" />
|
||||
<Compile Include="Data\Database\Contact\ReadContactList.cs" />
|
||||
<Compile Include="Data\Database\Contact\UpdateContact.cs" />
|
||||
<Compile Include="Data\Database\Log\ReadDateTime.cs" />
|
||||
<Compile Include="Data\Database\Log\UpdateDateTime.cs" />
|
||||
<Compile Include="Data\Database\Project\ReadProject.cs" />
|
||||
<Compile Include="Data\Database\Project\ReadProjectWork.cs" />
|
||||
<Compile Include="Data\Database\Project\ReadProjectWorkItem.cs" />
|
||||
<Compile Include="Data\Database\Sale\CreateInvoice.cs" />
|
||||
<Compile Include="Data\Database\Sale\ReadNextInvoiceNumber.cs" />
|
||||
<Compile Include="Data\Database\Sale\UpdateInvoice.cs" />
|
||||
<Compile Include="Data\SaleInvoiceNumberFormat.cs" />
|
||||
<Compile Include="Data\SaleInvoiceFormat.cs" />
|
||||
<Compile Include="Logic\Adapter\Contact.cs" />
|
||||
<Compile Include="Logic\Adapter\ExportXeroInvoiceFlatFileDTO.cs" />
|
||||
<Compile Include="Logic\Adapter\SaleInvoice.cs" />
|
||||
<Compile Include="Logic\Adapter\XeroInvoiceFlatFile.cs" />
|
||||
<Compile Include="Logic\Adapter\XeroInvoiceFlatFileDTO.cs" />
|
||||
<Compile Include="Logic\Adapter\ImportXeroInvoiceFlatFile.cs" />
|
||||
<Compile Include="Logic\Adapter\ImportXeroInvoiceFlatFileDTO.cs" />
|
||||
<Compile Include="Logic\Export\ExcelInvoiceFlatFile.cs" />
|
||||
<Compile Include="Logic\Export\XeroInvoiceFlatFile.cs" />
|
||||
<Compile Include="Logic\Prototype\ObjectExtensions.cs" />
|
||||
<Compile Include="Logic\Sale\SaleInvoiceAssign.cs" />
|
||||
<Compile Include="Logic\Validate\CientPurchaseOrder.cs" />
|
||||
<Compile Include="Model\Client\PurchaseOrderAllocation.cs" />
|
||||
<Compile Include="Model\Contact\Address.cs" />
|
||||
<Compile Include="Data\Database\Contact\CreateContact.cs" />
|
||||
@@ -96,8 +106,13 @@
|
||||
<Compile Include="Model\Client\PurchaseOrder.cs" />
|
||||
<Compile Include="Model\Client\PurchaseOrderHeader.cs" />
|
||||
<Compile Include="Model\Contact\Contact.cs" />
|
||||
<Compile Include="Model\Export\XeroInvoiceFlatFileDTO.cs" />
|
||||
<Compile Include="Model\Import\XeroInvoiceFlatFile.cs" />
|
||||
<Compile Include="Model\Import\XeroInvoiceFlatFileDTO.cs" />
|
||||
<Compile Include="Model\Project\Project.cs" />
|
||||
<Compile Include="Model\Project\ProjectWork.cs" />
|
||||
<Compile Include="Model\Project\ProjectWorkItem.cs" />
|
||||
<Compile Include="Model\Project\ProjectWorkItemDetail.cs" />
|
||||
<Compile Include="Model\Sale\Invoice.cs" />
|
||||
<Compile Include="Model\Sale\InvoiceHeader.cs" />
|
||||
<Compile Include="Model\ValidateModel.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<string, string> dictionarySymbol = new Dictionary<string, string>();
|
||||
Dictionary<string, string> dictionaryCulture = new Dictionary<string, string>();
|
||||
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.");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -14,7 +14,14 @@ namespace BealeEngineering.Core.Data.Database.Client
|
||||
{
|
||||
|
||||
}
|
||||
public int ByDictionary(Dictionary<int, int> saleInvoiceIdToPoLineId)
|
||||
public int Create(int saleInvoiceId, int purchaseOrderLineId)
|
||||
{
|
||||
var value = new Dictionary<int, int>();
|
||||
value.Add(saleInvoiceId, purchaseOrderLineId);
|
||||
return Create(value);
|
||||
}
|
||||
|
||||
public int Create(Dictionary<int, int> 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;
|
||||
}
|
||||
|
||||
@@ -16,6 +16,21 @@ namespace BealeEngineering.Core.Data.Database.Client
|
||||
|
||||
}
|
||||
|
||||
public new Model.Client.PurchaseOrder ByPurchaseOrderId(int orderId)
|
||||
{
|
||||
var orderIdList = new List<int> { orderId };
|
||||
var result = ByPurchaseOrderId(orderIdList);
|
||||
|
||||
if (result == null || !result.Any())
|
||||
{
|
||||
return null;
|
||||
}
|
||||
else
|
||||
{
|
||||
return result[0];
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Any filters set will be ignored
|
||||
/// </summary>
|
||||
@@ -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<Model.Client.PurchaseOrder> GetByFilters()
|
||||
public new List<Model.Client.PurchaseOrder> 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);
|
||||
|
||||
|
||||
@@ -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))
|
||||
|
||||
@@ -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<int> { orderId };
|
||||
var result = ByPurchaseOrderId(orderIdList);
|
||||
|
||||
if (result == null || !result.Any())
|
||||
{
|
||||
return null;
|
||||
}
|
||||
else
|
||||
{
|
||||
return result[0];
|
||||
}
|
||||
}
|
||||
|
||||
public List<Model.Client.PurchaseOrderHeader> ByPurchaseOrderId(List<int> orderIdList)
|
||||
{
|
||||
ClientPurchaseOrderIdList = orderIdList;
|
||||
try
|
||||
{
|
||||
return GetByFilters();
|
||||
return Read();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
@@ -144,7 +159,7 @@ namespace BealeEngineering.Core.Data.Database.Client
|
||||
}
|
||||
}
|
||||
|
||||
public List<Model.Client.PurchaseOrderHeader> GetByFilters()
|
||||
public List<Model.Client.PurchaseOrderHeader> Read()
|
||||
{
|
||||
// build the sql string and dapper parameters
|
||||
var parameters = new DynamicParameters();
|
||||
|
||||
@@ -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<int>();
|
||||
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();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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<string> Read()
|
||||
{
|
||||
var result = new List<string>();
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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.");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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<int> { projectNumber });
|
||||
|
||||
if (result == null) { return null; }
|
||||
else { return result[0]; }
|
||||
}
|
||||
|
||||
public List<Model.Project.ProjectWork> ByProjectNumber(List<int> 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<Model.Project.ProjectWork> Read()
|
||||
{
|
||||
string sqlWhere = "";
|
||||
if (!ReturnIsArchived)
|
||||
{
|
||||
sqlWhere += @"
|
||||
WHERE Project.IsArchived = 0";
|
||||
}
|
||||
|
||||
sqlWhere += @"
|
||||
ORDER BY ProjectNumber";
|
||||
|
||||
var parameters = new DynamicParameters();
|
||||
return Execute(sqlWhere, parameters);
|
||||
}
|
||||
|
||||
private List<Model.Project.ProjectWork> 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<int, Model.Project.ProjectWork>();
|
||||
|
||||
return conn.Query<Model.Project.ProjectWork, Model.Project.ProjectWork.ProjectWorkLine, Model.Project.ProjectWork>
|
||||
(
|
||||
sqlString,
|
||||
(project, workItemList) =>
|
||||
{
|
||||
Model.Project.ProjectWork workEntry;
|
||||
|
||||
if (!workDictionary.TryGetValue((int)project.ProjectNumber, out workEntry))
|
||||
{
|
||||
workEntry = project;
|
||||
workEntry.ProjectWorkLineList = new List<Model.Project.ProjectWork.ProjectWorkLine>();
|
||||
workDictionary.Add((int)workEntry.ProjectNumber, workEntry);
|
||||
}
|
||||
|
||||
workEntry.ProjectWorkLineList.Add(workItemList);
|
||||
return workEntry;
|
||||
},
|
||||
parameters,
|
||||
splitOn: "WorkItemClient")
|
||||
.Distinct()
|
||||
.ToList();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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<int> { projectNumber });
|
||||
|
||||
if (result == null) { return null; }
|
||||
else { return result[0]; }
|
||||
}
|
||||
|
||||
public List<Model.Project.Project> ByProjectNumber(List<int> 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<Model.Project.Project> Read()
|
||||
{
|
||||
string sqlWhere = "";
|
||||
if (!ReturnIsArchived)
|
||||
{
|
||||
sqlWhere += @"
|
||||
WHERE Project.IsArchived = 0";
|
||||
}
|
||||
|
||||
sqlWhere += @"
|
||||
ORDER BY ProjectNumber";
|
||||
|
||||
var parameters = new DynamicParameters();
|
||||
return Execute(sqlWhere, parameters);
|
||||
}
|
||||
|
||||
private List<Model.Project.Project> 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<Model.Project.Project>(sqlString).ToList();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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<string> { projectNumber });
|
||||
|
||||
if (result == null) { return null; }
|
||||
else { return result[0]; }
|
||||
}
|
||||
|
||||
public List<Model.Project.ProjectWorkItem> ByWorkNumber(List<string> 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<Model.Project.ProjectWorkItem> Read()
|
||||
{
|
||||
string sqlWhere = "";
|
||||
if (!ReturnIsArchived)
|
||||
{
|
||||
sqlWhere += @"
|
||||
WHERE ProjectWork.IsArchived = 0";
|
||||
}
|
||||
|
||||
sqlWhere += @"
|
||||
ORDER BY WorkNumber";
|
||||
|
||||
var parameters = new DynamicParameters();
|
||||
return Execute(sqlWhere, parameters);
|
||||
}
|
||||
|
||||
private List<Model.Project.ProjectWorkItem> 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<Model.Project.ProjectWorkItem>(sqlString, parameters).ToList();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -81,6 +81,17 @@ namespace BealeEngineering.Core.Data.Database.Sale
|
||||
}
|
||||
}
|
||||
|
||||
public List<string> 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<int> { 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<Model.Sale.InvoiceHeader> Read()
|
||||
|
||||
@@ -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(@"
|
||||
|
||||
@@ -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";
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -72,7 +72,7 @@ namespace BealeEngineering.Core.Data.Xero.FlatFile
|
||||
dto = csv.GetRecords<Model.Import.XeroInvoiceFlatFileDTO>().ToList();
|
||||
}
|
||||
FileInputCreatedDate = File.GetCreationTime(FileInputPath);
|
||||
return new Logic.Adapter.XeroInvoiceFlatFile().XeroInvoiceFlatFileDTO(dto);
|
||||
return new Logic.Adapter.ImportXeroInvoiceFlatFile().XeroInvoiceFlatFileDTO(dto);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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<Model.Export.XeroInvoiceFlatFileDTO> BySaleInvoice(List<Model.Sale.Invoice> invoices)
|
||||
{
|
||||
var result = new Logic.Adapter.ImportXeroInvoiceFlatFile().SaleInvoice(invoices);
|
||||
return ByImportXeroInvoiceFlatFile(result);
|
||||
}
|
||||
|
||||
public List<Model.Export.XeroInvoiceFlatFileDTO> ByImportXeroInvoiceFlatFile(List<Model.Import.XeroInvoiceFlatFile> invoices)
|
||||
{
|
||||
//throw new NotImplementedException();
|
||||
if (invoices == null) { return null; }
|
||||
|
||||
// create the invoice list
|
||||
var result = new List<Model.Export.XeroInvoiceFlatFileDTO>();
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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();
|
||||
@@ -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();
|
||||
@@ -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<int, int>();
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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<string> { 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);
|
||||
|
||||
@@ -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<string> { 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);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get a dictionary of contacts, referenced by unique 'Contact Name'. Any contacts not found in db are
|
||||
/// automatically added.
|
||||
|
||||
@@ -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<string> { 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();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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<ValidationResult> ValidationResults { get; private set; } = new List<ValidationResult>();
|
||||
|
||||
public bool IsValid(Model.Client.PurchaseOrder purchaseOrder)
|
||||
{
|
||||
ValidationResults = new List<ValidationResult>();
|
||||
|
||||
return Validator.TryValidateObject(
|
||||
purchaseOrder,
|
||||
new ValidationContext(purchaseOrder, null, null),
|
||||
ValidationResults,
|
||||
false);
|
||||
}
|
||||
|
||||
public bool IsValid(Model.Client.PurchaseOrderHeader purchaseOrderHeader)
|
||||
{
|
||||
ValidationResults = new List<ValidationResult>();
|
||||
|
||||
return Validator.TryValidateObject(
|
||||
purchaseOrderHeader,
|
||||
new ValidationContext(purchaseOrderHeader, null, null),
|
||||
ValidationResults,
|
||||
false);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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<PurchaseOrderLine> OrderLineList { get; set; }
|
||||
public List<PurchaseOrderLine> OrderLineList { get; set; } = new List<PurchaseOrderLine>();
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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; }
|
||||
|
||||
@@ -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; }
|
||||
|
||||
@@ -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<ValidationResult> Validate(ValidationContext validationContext)
|
||||
{
|
||||
if (ValidationResults == null) { ValidationResults = new List<ValidationResult>(); }
|
||||
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<ValidationResult>();
|
||||
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;
|
||||
|
||||
@@ -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; }
|
||||
}
|
||||
}
|
||||
@@ -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<ValidationResult> Validate(ValidationContext validationContext)
|
||||
{
|
||||
var results = new List<ValidationResult>();
|
||||
return results;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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<ProjectWorkLine> ProjectWorkLineList { get; set; } = new List<ProjectWorkLine>();
|
||||
|
||||
public class ProjectWorkLine : ProjectWorkItemDetail
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public bool ProjectWorkItemListIsSet
|
||||
{
|
||||
get
|
||||
{
|
||||
if (ProjectWorkLineList == null || ProjectWorkLineList.Count == 0) { return false; }
|
||||
else { return true; }
|
||||
}
|
||||
}
|
||||
|
||||
public new IEnumerable<ValidationResult> Validate(ValidationContext validationContext)
|
||||
{
|
||||
var results = base.Validate(validationContext);
|
||||
return results;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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; }
|
||||
}
|
||||
}
|
||||
@@ -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; }
|
||||
}
|
||||
}
|
||||
@@ -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
|
||||
|
||||
@@ -21,7 +21,7 @@ namespace BealeEngineering.Core.Test.Export
|
||||
|
||||
public void XeroInvoice()
|
||||
{
|
||||
new Logic.Export.XeroInvoiceFlatFile(sqlConnectionString).Execute();
|
||||
new Logic.Export.ExcelInvoiceFlatFile(sqlConnectionString).Execute();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user