Skip to content

Commit 8aa9f96

Browse files
Merge pull request #45 from IntuitDeveloper/CPP_32bit_Samples
Code push for C# samples into Public Git repo
2 parents 69b3fc5 + c70563b commit 8aa9f96

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

67 files changed

+2083
-555
lines changed

qbdt/c-sharp/QBFC/InvoiceAdd.zip

6.45 KB
Binary file not shown.
27.8 KB
Binary file not shown.

qbdt/c-sharp/QBFC/MCInvoiceAddQBFC/Intuit_QBFC/Form1.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
using System.Drawing;
1010
using System.Text;
1111
using System.Windows.Forms;
12-
using Interop.QBFC14;
12+
using Interop.QBFC15;
1313
using MCInvoiceAddQBFC.Session_Framework;
1414

1515

@@ -491,7 +491,7 @@ private string[] parsePreferencesQueryRs(IMsgSetResponse responseMsgSet, int cou
491491
if (prefRet.MultiCurrencyPreferences != null)
492492
{
493493
retVal[0] = Convert.ToString(prefRet.MultiCurrencyPreferences.IsMultiCurrencyOn.GetValue());
494-
retVal[1] = prefRet.MultiCurrencyPreferences.HomeCurrencyRef.FullName.GetValue();
494+
retVal[1] = prefRet.MultiCurrencyPreferences.HomeCurrencyRef?.FullName.GetValue();
495495
}
496496
}
497497
return retVal;

qbdt/c-sharp/QBFC/MCInvoiceAddQBFC/Intuit_QBFC/MCInvoiceAddQBFC.csproj

Lines changed: 41 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="14.0">
23
<PropertyGroup>
34
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
45
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
@@ -9,6 +10,28 @@
910
<AppDesignerFolder>Properties</AppDesignerFolder>
1011
<RootNamespace>IntuitQBFC</RootNamespace>
1112
<AssemblyName>MCInvoiceAddQBFC</AssemblyName>
13+
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
14+
<FileUpgradeFlags>
15+
</FileUpgradeFlags>
16+
<UpgradeBackupLocation>
17+
</UpgradeBackupLocation>
18+
<OldToolsVersion>2.0</OldToolsVersion>
19+
<PublishUrl>publish\</PublishUrl>
20+
<Install>true</Install>
21+
<InstallFrom>Disk</InstallFrom>
22+
<UpdateEnabled>false</UpdateEnabled>
23+
<UpdateMode>Foreground</UpdateMode>
24+
<UpdateInterval>7</UpdateInterval>
25+
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
26+
<UpdatePeriodically>false</UpdatePeriodically>
27+
<UpdateRequired>false</UpdateRequired>
28+
<MapFileExtensions>true</MapFileExtensions>
29+
<ApplicationRevision>0</ApplicationRevision>
30+
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
31+
<IsWebBootstrapper>false</IsWebBootstrapper>
32+
<UseApplicationTrust>false</UseApplicationTrust>
33+
<BootstrapperEnabled>true</BootstrapperEnabled>
34+
<TargetFrameworkProfile />
1235
</PropertyGroup>
1336
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
1437
<DebugSymbols>true</DebugSymbols>
@@ -20,7 +43,8 @@
2043
<WarningLevel>4</WarningLevel>
2144
<CodeAnalysisRules>
2245
</CodeAnalysisRules>
23-
<PlatformTarget>x86</PlatformTarget>
46+
<PlatformTarget>AnyCPU</PlatformTarget>
47+
<Prefer32Bit>true</Prefer32Bit>
2448
</PropertyGroup>
2549
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
2650
<DebugType>pdbonly</DebugType>
@@ -29,7 +53,8 @@
2953
<DefineConstants>TRACE</DefineConstants>
3054
<ErrorReport>prompt</ErrorReport>
3155
<WarningLevel>4</WarningLevel>
32-
<PlatformTarget>x86</PlatformTarget>
56+
<PlatformTarget>AnyCPU</PlatformTarget>
57+
<Prefer32Bit>true</Prefer32Bit>
3358
</PropertyGroup>
3459
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
3560
<DebugSymbols>true</DebugSymbols>
@@ -38,6 +63,7 @@
3863
<DebugType>full</DebugType>
3964
<PlatformTarget>x86</PlatformTarget>
4065
<ErrorReport>prompt</ErrorReport>
66+
<Prefer32Bit>false</Prefer32Bit>
4167
</PropertyGroup>
4268
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
4369
<OutputPath>bin\x86\Release\</OutputPath>
@@ -46,11 +72,13 @@
4672
<DebugType>pdbonly</DebugType>
4773
<PlatformTarget>x86</PlatformTarget>
4874
<ErrorReport>prompt</ErrorReport>
75+
<Prefer32Bit>false</Prefer32Bit>
4976
</PropertyGroup>
5077
<ItemGroup>
51-
<Reference Include="Interop.QBFC14, Version=14.0.0.1, Culture=neutral, PublicKeyToken=31d8aec643e18259">
78+
<Reference Include="Interop.QBFC15, Version=15.0.0.1, Culture=neutral, PublicKeyToken=31d8aec643e18259">
5279
<SpecificVersion>False</SpecificVersion>
53-
<HintPath>..\..\..\..\..\..\..\..\..\..\..\Program Files (x86)\Common Files\Intuit\QuickBooks\Interop.QBFC14.dll</HintPath>
80+
<HintPath>C:\Program Files (x86)\Common Files\Intuit\QuickBooks\Interop.QBFC15.dll</HintPath>
81+
<EmbedInteropTypes>True</EmbedInteropTypes>
5482
</Reference>
5583
<Reference Include="Microsoft.Vsa" />
5684
<Reference Include="System" />
@@ -86,6 +114,7 @@
86114
<DependentUpon>Resources.resx</DependentUpon>
87115
<DesignTime>True</DesignTime>
88116
</Compile>
117+
<None Include="app.config" />
89118
<None Include="Properties\Settings.settings">
90119
<Generator>SettingsSingleFileGenerator</Generator>
91120
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
@@ -122,6 +151,13 @@
122151
<Content Include="Documentation\Images\Wizard_Menu_2.png" />
123152
<Content Include="Documentation\IntuitDocumentation.htm" />
124153
</ItemGroup>
154+
<ItemGroup>
155+
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
156+
<Visible>False</Visible>
157+
<ProductName>.NET Framework 3.5 SP1</ProductName>
158+
<Install>true</Install>
159+
</BootstrapperPackage>
160+
</ItemGroup>
125161
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
126162
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
127163
Other similar extension points exist, see Microsoft.Common.targets.

qbdt/c-sharp/QBFC/MCInvoiceAddQBFC/Intuit_QBFC/Properties/Resources.Designer.cs

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

qbdt/c-sharp/QBFC/MCInvoiceAddQBFC/Intuit_QBFC/Properties/Settings.Designer.cs

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

qbdt/c-sharp/QBFC/MCInvoiceAddQBFC/Intuit_QBFC/SessionFramework/Defaults.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// Usage governed by the QuickBooks SDK Developer's License Agreement
44

55
using System;
6-
using Interop.QBFC14;
6+
using Interop.QBFC15;
77
using System.Runtime.InteropServices;
88

99

qbdt/c-sharp/QBFC/MCInvoiceAddQBFC/Intuit_QBFC/SessionFramework/SessionManager.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
using System.Text;
99
using System.Windows.Forms;
1010
using System.Resources;
11-
using Interop.QBFC14;
11+
using Interop.QBFC15;
1212

1313
namespace MCInvoiceAddQBFC.Session_Framework
1414
{
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<configuration>
3+
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8"/></startup></configuration>
Binary file not shown.

qbdt/c-sharp/QBFC/MCInvoiceAddQBFC/MCInvoiceAddQBFC.sln

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11

2-
Microsoft Visual Studio Solution File, Format Version 9.00
3-
# Visual Studio 2005
2+
Microsoft Visual Studio Solution File, Format Version 12.00
3+
# Visual Studio 14
4+
VisualStudioVersion = 14.0.25420.1
5+
MinimumVisualStudioVersion = 10.0.40219.1
46
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MCInvoiceAddQBFC", "Intuit_QBFC\MCInvoiceAddQBFC.csproj", "{FF409377-0B37-43E2-B065-44475BBAB9E0}"
57
EndProject
68
Global

qbdt/c-sharp/QBFC/QBInvoiceAdd/InputItem.cs

Lines changed: 28 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
using System.ComponentModel;
55
using System.Windows.Forms;
66
using System.IO;
7-
using Interop.QBFC14;
7+
using Interop.QBFC15;
88

99
namespace InvoiceAdd
1010
{
@@ -168,31 +168,33 @@ private void InputItem_Load(object sender, System.EventArgs e)
168168
for(int ndx=0; ndx<=(orItemRetList.Count-1); ndx++)
169169
{
170170
IORItemRet orItemRet=orItemRetList.GetAt(ndx);
171-
172-
// IY: The ortype property returns an enum
173-
// of the elements that can be contained in the OR object
174-
switch(orItemRet.ortype)
171+
// IY: The ortype property returns an enum
172+
// of the elements that can be contained in the OR object
173+
switch (orItemRet.ortype)
175174
{
176175
case ENORItemRet.orirItemServiceRet:
177176
{
178177
// orir prefix comes from OR + Item + Ret
179178
IItemServiceRet ItemServiceRet = orItemRet.ItemServiceRet;
180-
isTaxable=ItemServiceRet.SalesTaxCodeRef.FullName.GetValue();
181-
cmboBx2_Item.Items.Add(ItemServiceRet.FullName.GetValue() + ":" + isTaxable);
179+
isTaxable=ItemServiceRet?.SalesTaxCodeRef?.FullName?.GetValue();
180+
SetTaxableDefaultIfEmpty(ref isTaxable);
181+
cmboBx2_Item.Items.Add(ItemServiceRet?.FullName?.GetValue() + ":" + isTaxable);
182182
}
183183
break;
184184
case ENORItemRet.orirItemInventoryRet:
185185
{
186186
IItemInventoryRet ItemInventoryRet = orItemRet.ItemInventoryRet;
187-
isTaxable=ItemInventoryRet.SalesTaxCodeRef.FullName.GetValue();
188-
cmboBx2_Item.Items.Add(ItemInventoryRet.FullName.GetValue() + ":" + isTaxable);
187+
isTaxable=ItemInventoryRet?.SalesTaxCodeRef?.FullName?.GetValue();
188+
SetTaxableDefaultIfEmpty(ref isTaxable);
189+
cmboBx2_Item.Items.Add(ItemInventoryRet?.FullName?.GetValue() + ":" + isTaxable);
189190
}
190191
break;
191192
case ENORItemRet.orirItemNonInventoryRet:
192193
{
193194
IItemNonInventoryRet ItemNonInventoryRet = orItemRet.ItemNonInventoryRet;
194-
isTaxable=ItemNonInventoryRet.SalesTaxCodeRef.FullName.GetValue();
195-
cmboBx2_Item.Items.Add(ItemNonInventoryRet.FullName.GetValue() + ":" + isTaxable);
195+
isTaxable=ItemNonInventoryRet?.SalesTaxCodeRef?.FullName?.GetValue();
196+
SetTaxableDefaultIfEmpty(ref isTaxable);
197+
cmboBx2_Item.Items.Add(ItemNonInventoryRet?.FullName?.GetValue() + ":" + isTaxable);
196198
}
197199
break;
198200
}
@@ -216,9 +218,14 @@ private void InputItem_Load(object sender, System.EventArgs e)
216218

217219
}
218220

219-
220-
// IY: CODE FOR HANDLING DIFFERENT VERSIONS
221-
private double QBFCLatestVersion(QBSessionManager SessionManager)
221+
private void SetTaxableDefaultIfEmpty(ref string isTaxable)
222+
{
223+
if (string.IsNullOrEmpty(isTaxable))
224+
isTaxable = "Non";
225+
}
226+
227+
// IY: CODE FOR HANDLING DIFFERENT VERSIONS
228+
private double QBFCLatestVersion(QBSessionManager SessionManager)
222229
{
223230
// IY: Use oldest version to ensure that we work with any QuickBooks (US)
224231
IMsgSetRequest msgset = SessionManager.CreateMsgSetRequest("US", 1, 0);
@@ -321,8 +328,14 @@ public InvoiceAdd.frm1_InvoiceAdd Form1
321328

322329

323330
private void btn1_OK_Click(object sender, System.EventArgs e)
324-
{
331+
{
332+
if (cmboBx2_Item.SelectedItem == null)
333+
{
334+
MessageBox.Show("Please select an item or add items to Company File if no items are listed and try again");
335+
return;
336+
}
325337
string capText = cmboBx2_Item.Text;
338+
326339
//MessageBox.Show("capText = " + capText);
327340
int pos = capText.IndexOf(":",0);
328341
//MessageBox.Show("pos = " + pos);

0 commit comments

Comments
 (0)