Skip to content

Code push for C# samples into Public Git repo #45

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 3, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified qbdt/c-sharp/QBFC/InvoiceAdd.zip
Binary file not shown.
Binary file modified qbdt/c-sharp/QBFC/MCInvoiceAddQBFC.zip
Binary file not shown.
4 changes: 2 additions & 2 deletions qbdt/c-sharp/QBFC/MCInvoiceAddQBFC/Intuit_QBFC/Form1.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using Interop.QBFC14;
using Interop.QBFC15;
using MCInvoiceAddQBFC.Session_Framework;


Expand Down Expand Up @@ -491,7 +491,7 @@ private string[] parsePreferencesQueryRs(IMsgSetResponse responseMsgSet, int cou
if (prefRet.MultiCurrencyPreferences != null)
{
retVal[0] = Convert.ToString(prefRet.MultiCurrencyPreferences.IsMultiCurrencyOn.GetValue());
retVal[1] = prefRet.MultiCurrencyPreferences.HomeCurrencyRef.FullName.GetValue();
retVal[1] = prefRet.MultiCurrencyPreferences.HomeCurrencyRef?.FullName.GetValue();
}
}
return retVal;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="14.0">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
Expand All @@ -9,6 +10,28 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>IntuitQBFC</RootNamespace>
<AssemblyName>MCInvoiceAddQBFC</AssemblyName>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<FileUpgradeFlags>
</FileUpgradeFlags>
<UpgradeBackupLocation>
</UpgradeBackupLocation>
<OldToolsVersion>2.0</OldToolsVersion>
<PublishUrl>publish\</PublishUrl>
<Install>true</Install>
<InstallFrom>Disk</InstallFrom>
<UpdateEnabled>false</UpdateEnabled>
<UpdateMode>Foreground</UpdateMode>
<UpdateInterval>7</UpdateInterval>
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
<UpdatePeriodically>false</UpdatePeriodically>
<UpdateRequired>false</UpdateRequired>
<MapFileExtensions>true</MapFileExtensions>
<ApplicationRevision>0</ApplicationRevision>
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
<IsWebBootstrapper>false</IsWebBootstrapper>
<UseApplicationTrust>false</UseApplicationTrust>
<BootstrapperEnabled>true</BootstrapperEnabled>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
Expand All @@ -20,7 +43,8 @@
<WarningLevel>4</WarningLevel>
<CodeAnalysisRules>
</CodeAnalysisRules>
<PlatformTarget>x86</PlatformTarget>
<PlatformTarget>AnyCPU</PlatformTarget>
<Prefer32Bit>true</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
Expand All @@ -29,7 +53,8 @@
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<PlatformTarget>x86</PlatformTarget>
<PlatformTarget>AnyCPU</PlatformTarget>
<Prefer32Bit>true</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
<DebugSymbols>true</DebugSymbols>
Expand All @@ -38,6 +63,7 @@
<DebugType>full</DebugType>
<PlatformTarget>x86</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
<OutputPath>bin\x86\Release\</OutputPath>
Expand All @@ -46,11 +72,13 @@
<DebugType>pdbonly</DebugType>
<PlatformTarget>x86</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<ItemGroup>
<Reference Include="Interop.QBFC14, Version=14.0.0.1, Culture=neutral, PublicKeyToken=31d8aec643e18259">
<Reference Include="Interop.QBFC15, Version=15.0.0.1, Culture=neutral, PublicKeyToken=31d8aec643e18259">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\..\..\..\..\..\..\..\Program Files (x86)\Common Files\Intuit\QuickBooks\Interop.QBFC14.dll</HintPath>
<HintPath>C:\Program Files (x86)\Common Files\Intuit\QuickBooks\Interop.QBFC15.dll</HintPath>
<EmbedInteropTypes>True</EmbedInteropTypes>
</Reference>
<Reference Include="Microsoft.Vsa" />
<Reference Include="System" />
Expand Down Expand Up @@ -86,6 +114,7 @@
<DependentUpon>Resources.resx</DependentUpon>
<DesignTime>True</DesignTime>
</Compile>
<None Include="app.config" />
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
Expand Down Expand Up @@ -122,6 +151,13 @@
<Content Include="Documentation\Images\Wizard_Menu_2.png" />
<Content Include="Documentation\IntuitDocumentation.htm" />
</ItemGroup>
<ItemGroup>
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
<Visible>False</Visible>
<ProductName>.NET Framework 3.5 SP1</ProductName>
<Install>true</Install>
</BootstrapperPackage>
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// Usage governed by the QuickBooks SDK Developer's License Agreement

using System;
using Interop.QBFC14;
using Interop.QBFC15;
using System.Runtime.InteropServices;


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
using System.Text;
using System.Windows.Forms;
using System.Resources;
using Interop.QBFC14;
using Interop.QBFC15;

namespace MCInvoiceAddQBFC.Session_Framework
{
Expand Down
3 changes: 3 additions & 0 deletions qbdt/c-sharp/QBFC/MCInvoiceAddQBFC/Intuit_QBFC/app.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8"/></startup></configuration>
Binary file not shown.
6 changes: 4 additions & 2 deletions qbdt/c-sharp/QBFC/MCInvoiceAddQBFC/MCInvoiceAddQBFC.sln
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@

Microsoft Visual Studio Solution File, Format Version 9.00
# Visual Studio 2005
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 14
VisualStudioVersion = 14.0.25420.1
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MCInvoiceAddQBFC", "Intuit_QBFC\MCInvoiceAddQBFC.csproj", "{FF409377-0B37-43E2-B065-44475BBAB9E0}"
EndProject
Global
Expand Down
43 changes: 28 additions & 15 deletions qbdt/c-sharp/QBFC/QBInvoiceAdd/InputItem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
using System.ComponentModel;
using System.Windows.Forms;
using System.IO;
using Interop.QBFC14;
using Interop.QBFC15;

namespace InvoiceAdd
{
Expand Down Expand Up @@ -168,31 +168,33 @@ private void InputItem_Load(object sender, System.EventArgs e)
for(int ndx=0; ndx<=(orItemRetList.Count-1); ndx++)
{
IORItemRet orItemRet=orItemRetList.GetAt(ndx);

// IY: The ortype property returns an enum
// of the elements that can be contained in the OR object
switch(orItemRet.ortype)
// IY: The ortype property returns an enum
// of the elements that can be contained in the OR object
switch (orItemRet.ortype)
{
case ENORItemRet.orirItemServiceRet:
{
// orir prefix comes from OR + Item + Ret
IItemServiceRet ItemServiceRet = orItemRet.ItemServiceRet;
isTaxable=ItemServiceRet.SalesTaxCodeRef.FullName.GetValue();
cmboBx2_Item.Items.Add(ItemServiceRet.FullName.GetValue() + ":" + isTaxable);
isTaxable=ItemServiceRet?.SalesTaxCodeRef?.FullName?.GetValue();
SetTaxableDefaultIfEmpty(ref isTaxable);
cmboBx2_Item.Items.Add(ItemServiceRet?.FullName?.GetValue() + ":" + isTaxable);
}
break;
case ENORItemRet.orirItemInventoryRet:
{
IItemInventoryRet ItemInventoryRet = orItemRet.ItemInventoryRet;
isTaxable=ItemInventoryRet.SalesTaxCodeRef.FullName.GetValue();
cmboBx2_Item.Items.Add(ItemInventoryRet.FullName.GetValue() + ":" + isTaxable);
isTaxable=ItemInventoryRet?.SalesTaxCodeRef?.FullName?.GetValue();
SetTaxableDefaultIfEmpty(ref isTaxable);
cmboBx2_Item.Items.Add(ItemInventoryRet?.FullName?.GetValue() + ":" + isTaxable);
}
break;
case ENORItemRet.orirItemNonInventoryRet:
{
IItemNonInventoryRet ItemNonInventoryRet = orItemRet.ItemNonInventoryRet;
isTaxable=ItemNonInventoryRet.SalesTaxCodeRef.FullName.GetValue();
cmboBx2_Item.Items.Add(ItemNonInventoryRet.FullName.GetValue() + ":" + isTaxable);
isTaxable=ItemNonInventoryRet?.SalesTaxCodeRef?.FullName?.GetValue();
SetTaxableDefaultIfEmpty(ref isTaxable);
cmboBx2_Item.Items.Add(ItemNonInventoryRet?.FullName?.GetValue() + ":" + isTaxable);
}
break;
}
Expand All @@ -216,9 +218,14 @@ private void InputItem_Load(object sender, System.EventArgs e)

}


// IY: CODE FOR HANDLING DIFFERENT VERSIONS
private double QBFCLatestVersion(QBSessionManager SessionManager)
private void SetTaxableDefaultIfEmpty(ref string isTaxable)
{
if (string.IsNullOrEmpty(isTaxable))
isTaxable = "Non";
}

// IY: CODE FOR HANDLING DIFFERENT VERSIONS
private double QBFCLatestVersion(QBSessionManager SessionManager)
{
// IY: Use oldest version to ensure that we work with any QuickBooks (US)
IMsgSetRequest msgset = SessionManager.CreateMsgSetRequest("US", 1, 0);
Expand Down Expand Up @@ -321,8 +328,14 @@ public InvoiceAdd.frm1_InvoiceAdd Form1


private void btn1_OK_Click(object sender, System.EventArgs e)
{
{
if (cmboBx2_Item.SelectedItem == null)
{
MessageBox.Show("Please select an item or add items to Company File if no items are listed and try again");
return;
}
string capText = cmboBx2_Item.Text;

//MessageBox.Show("capText = " + capText);
int pos = capText.IndexOf(":",0);
//MessageBox.Show("pos = " + pos);
Expand Down
Loading