├── QbAdd-inDotNetWeb
├── Global.asax
├── Images
│ ├── Close.png
│ ├── AddinIcon.png
│ ├── Button16x16.png
│ ├── Button32x32.png
│ └── Button80x80.png
├── Scripts
│ ├── _references.js
│ ├── _officeintellisense.js
│ └── FabricUI
│ │ └── MessageBanner.js
├── Home.css
├── Close.aspx.cs
├── OAuthManager.aspx
├── Close.aspx.designer.cs
├── OAuthManager.aspx.designer.cs
├── packages.config
├── Global.asax.cs
├── Functions
│ ├── FunctionFile.html
│ └── FunctionFile.js
├── App_Start
│ └── WebApiConfig.cs
├── Close.aspx
├── Web.Debug.config
├── Web.Release.config
├── Properties
│ └── AssemblyInfo.cs
├── Web.config
├── OAuthManager.aspx.cs
├── Controllers
│ └── QuickBooksController.cs
├── Home.html
├── Home.js
└── QbAdd-inDotNetWeb.csproj
├── readme-images
├── readme_image_chart.PNG
├── readme_image_error.PNG
├── readme_command_image.PNG
├── readme_image_action.PNG
├── readme_image_signin.PNG
├── readme_image_authorize.PNG
├── readme_image_expenses.PNG
└── readme_image_taskpane.PNG
├── QbAdd-inDotNet
├── app.config
├── QbAdd-inDotNetManifest
│ ├── SharePointProjectItem.spdata
│ └── QbAdd-inDotNet.xml
└── QbAdd-inDotNet.csproj
├── QbAdd-inDotNet.yml
├── LICENSE
├── QbAdd-inDotNet.sln
├── README-Localized
├── README-zh-cn.md
├── README-zh-tw.md
├── README-ja-jp.md
├── README-pt-br.md
├── README-de-de.md
├── README-ru-ru.md
├── README-es-es.md
└── README-fr-fr.md
├── .gitignore
└── README.md
/QbAdd-inDotNetWeb/Global.asax:
--------------------------------------------------------------------------------
1 | <%@ Application Codebehind="Global.asax.cs" Inherits="QbAdd_inDotNetWeb.WebApiApplication" Language="C#" %>
2 |
--------------------------------------------------------------------------------
/QbAdd-inDotNetWeb/Images/Close.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OfficeDev/Excel-Add-in-ASPNET-QuickBooks/HEAD/QbAdd-inDotNetWeb/Images/Close.png
--------------------------------------------------------------------------------
/readme-images/readme_image_chart.PNG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OfficeDev/Excel-Add-in-ASPNET-QuickBooks/HEAD/readme-images/readme_image_chart.PNG
--------------------------------------------------------------------------------
/readme-images/readme_image_error.PNG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OfficeDev/Excel-Add-in-ASPNET-QuickBooks/HEAD/readme-images/readme_image_error.PNG
--------------------------------------------------------------------------------
/QbAdd-inDotNetWeb/Images/AddinIcon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OfficeDev/Excel-Add-in-ASPNET-QuickBooks/HEAD/QbAdd-inDotNetWeb/Images/AddinIcon.png
--------------------------------------------------------------------------------
/readme-images/readme_command_image.PNG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OfficeDev/Excel-Add-in-ASPNET-QuickBooks/HEAD/readme-images/readme_command_image.PNG
--------------------------------------------------------------------------------
/readme-images/readme_image_action.PNG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OfficeDev/Excel-Add-in-ASPNET-QuickBooks/HEAD/readme-images/readme_image_action.PNG
--------------------------------------------------------------------------------
/readme-images/readme_image_signin.PNG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OfficeDev/Excel-Add-in-ASPNET-QuickBooks/HEAD/readme-images/readme_image_signin.PNG
--------------------------------------------------------------------------------
/QbAdd-inDotNetWeb/Images/Button16x16.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OfficeDev/Excel-Add-in-ASPNET-QuickBooks/HEAD/QbAdd-inDotNetWeb/Images/Button16x16.png
--------------------------------------------------------------------------------
/QbAdd-inDotNetWeb/Images/Button32x32.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OfficeDev/Excel-Add-in-ASPNET-QuickBooks/HEAD/QbAdd-inDotNetWeb/Images/Button32x32.png
--------------------------------------------------------------------------------
/QbAdd-inDotNetWeb/Images/Button80x80.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OfficeDev/Excel-Add-in-ASPNET-QuickBooks/HEAD/QbAdd-inDotNetWeb/Images/Button80x80.png
--------------------------------------------------------------------------------
/QbAdd-inDotNetWeb/Scripts/_references.js:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OfficeDev/Excel-Add-in-ASPNET-QuickBooks/HEAD/QbAdd-inDotNetWeb/Scripts/_references.js
--------------------------------------------------------------------------------
/readme-images/readme_image_authorize.PNG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OfficeDev/Excel-Add-in-ASPNET-QuickBooks/HEAD/readme-images/readme_image_authorize.PNG
--------------------------------------------------------------------------------
/readme-images/readme_image_expenses.PNG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OfficeDev/Excel-Add-in-ASPNET-QuickBooks/HEAD/readme-images/readme_image_expenses.PNG
--------------------------------------------------------------------------------
/readme-images/readme_image_taskpane.PNG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OfficeDev/Excel-Add-in-ASPNET-QuickBooks/HEAD/readme-images/readme_image_taskpane.PNG
--------------------------------------------------------------------------------
/QbAdd-inDotNetWeb/Home.css:
--------------------------------------------------------------------------------
1 | /* Page-specific styling */
2 |
3 | html {
4 | position: relative;
5 | min-height: 100%;
6 | }
7 | body {
8 | margin: 0 0 40px; /* bottom = footer height */
9 | }
10 | .footer {
11 | position: absolute;
12 | left: 0;
13 | bottom: 0;
14 | height: 40px;
15 | width: 100%;
16 | }
17 |
18 | .padding {
19 | padding: 15px;
20 | }
--------------------------------------------------------------------------------
/QbAdd-inDotNetWeb/Close.aspx.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Web;
5 | using System.Web.UI;
6 | using System.Web.UI.WebControls;
7 |
8 | namespace QbAdd_inDotNetWeb
9 | {
10 | public partial class Close : System.Web.UI.Page
11 | {
12 | protected void Page_Load(object sender, EventArgs e)
13 | {
14 |
15 | }
16 | }
17 | }
--------------------------------------------------------------------------------
/QbAdd-inDotNet/app.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/QbAdd-inDotNet/QbAdd-inDotNetManifest/SharePointProjectItem.spdata:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/QbAdd-inDotNet.yml:
--------------------------------------------------------------------------------
1 | ### YamlMime:Sample
2 | sample:
3 | - name: Excel Add-in with ASP.NET and QuickBooks
4 | path: ''
5 | description: This Excel Add-in demonstrates how to connect to QuickBooks, gets sample expense data from a sandbox account provided by QuickBooks, Sandbox Company_US_1, and imports the sample data into a spreadsheet. The add-in also provides a button to create a chart from the sample data.
6 | readme: ''
7 | generateZip: FALSE
8 | isLive: TRUE
9 | technologies:
10 | - Office Add-in
11 | azureDeploy: ''
12 | author: rick-kirkham
13 | platforms:
14 | - .NET
15 | languages:
16 | - JavaScript
17 | extensions:
18 | products:
19 | - Excel
20 | scenarios: []
21 |
--------------------------------------------------------------------------------
/QbAdd-inDotNetWeb/OAuthManager.aspx:
--------------------------------------------------------------------------------
1 | <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="OAuthManager.aspx.cs" Inherits="QbAdd_inDotNetWeb.OAuthManager" %>
2 |
3 |
4 |
8 |
9 |
10 |
11 |
12 |
13 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/QbAdd-inDotNetWeb/Close.aspx.designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // This code was generated by a tool.
4 | //
5 | // Changes to this file may cause incorrect behavior and will be lost if
6 | // the code is regenerated.
7 | //
8 | //------------------------------------------------------------------------------
9 |
10 | namespace QbAdd_inDotNetWeb {
11 |
12 |
13 | public partial class Close {
14 |
15 | ///
16 | /// form1 control.
17 | ///
18 | ///
19 | /// Auto-generated field.
20 | /// To modify move field declaration from designer file to code-behind file.
21 | ///
22 | protected global::System.Web.UI.HtmlControls.HtmlForm form1;
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/QbAdd-inDotNetWeb/OAuthManager.aspx.designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // This code was generated by a tool.
4 | //
5 | // Changes to this file may cause incorrect behavior and will be lost if
6 | // the code is regenerated.
7 | //
8 | //------------------------------------------------------------------------------
9 |
10 | namespace QbAdd_inDotNetWeb
11 | {
12 |
13 |
14 | public partial class OAuthManager
15 | {
16 |
17 | ///
18 | /// form1 control.
19 | ///
20 | ///
21 | /// Auto-generated field.
22 | /// To modify move field declaration from designer file to code-behind file.
23 | ///
24 | protected global::System.Web.UI.HtmlControls.HtmlForm form1;
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/QbAdd-inDotNetWeb/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/QbAdd-inDotNetWeb/Global.asax.cs:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) Microsoft. All rights reserved. Licensed under the MIT license.
3 | * See LICENSE in the project root for license information.
4 | */
5 |
6 | using System;
7 | using System.Collections.Generic;
8 | using System.Linq;
9 | using System.Web;
10 | using System.Web.Http;
11 | using System.Web.Routing;
12 |
13 | namespace QbAdd_inDotNetWeb
14 | {
15 | public class WebApiApplication : System.Web.HttpApplication
16 | {
17 |
18 | ///
19 | /// Configure the Web API
20 | ///
21 | protected void Application_Start()
22 | {
23 | GlobalConfiguration.Configure(WebApiConfig.Register);
24 | }
25 |
26 | ///
27 | /// Sets the session state behavior for the current HTTP session to Required
28 | ///
29 | protected void Application_PostAuthorizeRequest()
30 | {
31 | HttpContext.Current.SetSessionStateBehavior(System.Web.SessionState.SessionStateBehavior.Required);
32 |
33 | }
34 |
35 | }
36 | }
--------------------------------------------------------------------------------
/QbAdd-inDotNetWeb/Functions/FunctionFile.html:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright (c) 2016 Mimi Sasouvanh
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/QbAdd-inDotNetWeb/App_Start/WebApiConfig.cs:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) Microsoft. All rights reserved. Licensed under the MIT license.
3 | * See LICENSE in the project root for license information.
4 | */
5 |
6 | using System;
7 | using System.Collections.Generic;
8 | using System.Linq;
9 | using System.Web.Http;
10 | using System.Web.SessionState;
11 | using System.Web.Routing;
12 | using System.Web;
13 | using System.Web.Http.WebHost;
14 |
15 | namespace QbAdd_inDotNetWeb
16 | {
17 | public static class WebApiConfig
18 | {
19 | ///
20 | /// Web API configuration and service
21 | ///
22 | ///
23 | public static void Register(HttpConfiguration config)
24 | {
25 | // Web API routes
26 | config.MapHttpAttributeRoutes();
27 |
28 | // Routes the request to the action
29 | config.Routes.MapHttpRoute(
30 | name: "ActionApi",
31 | routeTemplate: "api/{action}/{id}",
32 | defaults: new { id = RouteParameter.Optional, controller = "QuickBooks"}
33 | );
34 |
35 | }
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/QbAdd-inDotNetWeb/Close.aspx:
--------------------------------------------------------------------------------
1 | <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Close.aspx.cs" Inherits="QbAdd_inDotNetWeb.Close" %>
2 |
3 |
4 |
8 |
9 |
10 | Close
11 |
12 |
13 |
14 |
24 |
25 |
26 |
28 |
29 |
30 |
--------------------------------------------------------------------------------
/QbAdd-inDotNetWeb/Web.Debug.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
17 |
18 |
29 |
30 |
--------------------------------------------------------------------------------
/QbAdd-inDotNetWeb/Web.Release.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
17 |
18 |
19 |
30 |
31 |
--------------------------------------------------------------------------------
/QbAdd-inDotNetWeb/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // General Information about an assembly is controlled through the following
6 | // set of attributes. Change these attribute values to modify the information
7 | // associated with an assembly.
8 | [assembly: AssemblyTitle("QbAdd_inDotNetWeb")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("")]
12 | [assembly: AssemblyProduct("QbAdd_inDotNetWeb")]
13 | [assembly: AssemblyCopyright("Copyright © 2016")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // Setting ComVisible to false makes the types in this assembly not visible
18 | // to COM components. If you need to access a type in this assembly from
19 | // COM, set the ComVisible attribute to true on that type.
20 | [assembly: ComVisible(false)]
21 |
22 | // The following GUID is for the ID of the typelib if this project is exposed to COM
23 | [assembly: Guid("3c0cb03a-bf1d-405e-909d-2991838f5644")]
24 |
25 | // Version information for an assembly consists of the following four values:
26 | //
27 | // Major Version
28 | // Minor Version
29 | // Build Number
30 | // Revision
31 | //
32 | // You can specify all the values or you can default the Revision and Build Numbers
33 | // by using the '*' as shown below:
34 | [assembly: AssemblyVersion("1.0.0.0")]
35 | [assembly: AssemblyFileVersion("1.0.0.0")]
36 |
--------------------------------------------------------------------------------
/QbAdd-inDotNetWeb/Functions/FunctionFile.js:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) Microsoft. All rights reserved. Licensed under the MIT license.
3 | * See LICENSE in the project root for license information.
4 | */
5 |
6 | function addChart(event) {
7 |
8 | // Run a batch operation against the Excel object model
9 | Excel.run(function (ctx) {
10 |
11 | // Create a proxy object for the selected range and load its address and values properties
12 | var sourceRange = ctx.workbook.getSelectedRange().load("address");
13 |
14 |
15 | // Run the queued-up commands, and return a promise to indicate task completion
16 | return ctx.sync()
17 | .then(function () {
18 | var sheet = ctx.workbook.worksheets.getActiveWorksheet();
19 | // Get the table
20 | var masterTable = ctx.workbook.tables.getItem("ExpensesTable");
21 |
22 | // Queue a command to add the new chart
23 | var chartDataRangeColumn1 = masterTable.columns.getItemAt(0).getDataBodyRange();
24 | var chartDataRangeColumn2 = masterTable.columns.getItemAt(1).getDataBodyRange();
25 |
26 | // Insert the chart in the sheet and format the chart
27 | var chartDataRange = chartDataRangeColumn1.getBoundingRect(chartDataRangeColumn2);
28 | var chart = sheet.charts.add("Line", chartDataRange, Excel.ChartSeriesBy.auto);
29 | chart.setPosition(sourceRange.address);
30 | chart.title.text = "Expense Trends";
31 | chart.title.format.font.color = "#41AEBD";
32 | chart.series.getItemAt(0).format.line.color = "#2E81AD";
33 | })
34 | });
35 | }
36 |
--------------------------------------------------------------------------------
/QbAdd-inDotNet.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio 14
4 | VisualStudioVersion = 14.0.24720.0
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "QbAdd-inDotNet", "QbAdd-inDotNet\QbAdd-inDotNet.csproj", "{7DB530C3-EF66-4B05-820C-10DA83FF6E66}"
7 | EndProject
8 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "QbAdd-inDotNetWeb", "QbAdd-inDotNetWeb\QbAdd-inDotNetWeb.csproj", "{3C0CB03A-BF1D-405E-909D-2991838F5644}"
9 | EndProject
10 | Global
11 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
12 | Debug|Any CPU = Debug|Any CPU
13 | Release|Any CPU = Release|Any CPU
14 | EndGlobalSection
15 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
16 | {7DB530C3-EF66-4B05-820C-10DA83FF6E66}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
17 | {7DB530C3-EF66-4B05-820C-10DA83FF6E66}.Debug|Any CPU.Build.0 = Debug|Any CPU
18 | {7DB530C3-EF66-4B05-820C-10DA83FF6E66}.Debug|Any CPU.Deploy.0 = Debug|Any CPU
19 | {7DB530C3-EF66-4B05-820C-10DA83FF6E66}.Release|Any CPU.ActiveCfg = Release|Any CPU
20 | {7DB530C3-EF66-4B05-820C-10DA83FF6E66}.Release|Any CPU.Build.0 = Release|Any CPU
21 | {7DB530C3-EF66-4B05-820C-10DA83FF6E66}.Release|Any CPU.Deploy.0 = Release|Any CPU
22 | {3C0CB03A-BF1D-405E-909D-2991838F5644}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
23 | {3C0CB03A-BF1D-405E-909D-2991838F5644}.Debug|Any CPU.Build.0 = Debug|Any CPU
24 | {3C0CB03A-BF1D-405E-909D-2991838F5644}.Release|Any CPU.ActiveCfg = Release|Any CPU
25 | {3C0CB03A-BF1D-405E-909D-2991838F5644}.Release|Any CPU.Build.0 = Release|Any CPU
26 | EndGlobalSection
27 | GlobalSection(SolutionProperties) = preSolution
28 | HideSolutionNode = FALSE
29 | EndGlobalSection
30 | EndGlobal
31 |
--------------------------------------------------------------------------------
/QbAdd-inDotNetWeb/Scripts/_officeintellisense.js:
--------------------------------------------------------------------------------
1 | // This file is generated by Visual Studio to enable IntelliSense for the Office JavaScript Object Model.
2 |
3 | var Office = new function() {
4 | this._appContext = 1;
5 | this._showAll = true;
6 | this._setContext = {
7 |
8 | };
9 | }
10 |
11 | // 1 Excel appContext = 001
12 | // 2 Word appContext = 010
13 | // 3 Word + Excel appContext = 011
14 | // 4 Project appContext = 100
15 | // 5 Project + Excel appContext = 101
16 | // 6 Project + Word appContext = 110
17 | // 7 Project + Word + Excel appContext = 111
18 | // 8 Outlook read-form appContext = 1000
19 | // 16 PowerPoint appContext = 10000
20 | // 17 PowerPoint + Excel appContext = 10001
21 | // 18 PowerPoint + Word appContext = 10010
22 | // 19 PowerPoint + Word + Excel appContext = 10011
23 | // 20 PowerPoint + Project appContext = 10100
24 | // 21 PowerPoint + Project + Excel appContext = 10101
25 | // 22 PowerPoint + Project + Word appContext = 10110
26 | // 23 PowerPoint + Project + Word + Excel appContext = 10111
27 | // 32 Outlook compose-form appContext = 100000
28 | // 40 Outlook read-form + Outlook compose form appContext = 101000
29 | // 64 Access appContext = 1000000
30 | // 65 Access + Excel appContext = 1000001
31 | // 66 Access + Word appContext = 1000010
32 | // 67 Access + Word + Excel appContext = 1000011
33 | // 68 Access + Project appContext = 1000100
34 | // 69 Access + Project + Excel appContext = 1000101
35 | // 70 Access + Project + Word appContext = 1000110
36 | // 71 Access + Project + Word + Excel appContext = 1000111
37 | // 80 Access + PowerPoint appContext = 1010000
38 | // 81 Access + PowerPoint + Excel appContext = 1010001
39 | // 82 Access + PowerPoint + Word appContext = 1010010
40 | // 83 Access + PowerPoint + Word + Excel appContext = 1010011
41 | // 84 Access + PowerPoint + Project appContext = 1010100
42 | // 85 Access + PowerPoint + Project + Excel appContext = 1010101
43 | // 86 Access + PowerPoint + Project + Word appContext = 1010110
44 | // 87 Access + PowerPoint + Project + Word + Excel appContext = 1010111
45 |
--------------------------------------------------------------------------------
/QbAdd-inDotNetWeb/Web.config:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
--------------------------------------------------------------------------------
/QbAdd-inDotNet/QbAdd-inDotNet.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Debug
6 | AnyCPU
7 | {7DB530C3-EF66-4B05-820C-10DA83FF6E66}
8 | Library
9 | Properties
10 | QbAdd_inDotNet
11 | QbAdd-inDotNet
12 | v4.5
13 | 15.0
14 | 512
15 | {C1CDDADD-2546-481F-9697-4EA41081F2FC};{14822709-B5A1-4724-98CA-57A101D1B079};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}
16 | False
17 | {2c578f0a-a428-4eb9-8cd8-70f4137bf9c3}
18 | {e9f214e3-f72c-43df-bdce-a029eca741c4}
19 | {df576295-94f3-4f57-b414-e2cb7c9d63f3}
20 | {be62f9bb-4f09-477f-915e-2082d3d7a106}
21 | {92eba772-1f46-4088-ab32-d797b2412a1b}
22 | OfficeApp
23 | 14.0
24 | 14.0
25 | qbaddin - Web Deploy
26 |
27 |
28 | true
29 | full
30 | false
31 | bin\Debug\
32 | DEBUG;TRACE
33 | prompt
34 | 4
35 | false
36 |
37 |
38 | pdbonly
39 | true
40 | bin\Release\
41 | TRACE
42 | prompt
43 | 4
44 | false
45 |
46 |
47 |
48 |
49 | {39d49db5-0937-4976-8f8e-9a6e80c228cd}
50 |
51 |
52 | manifest-oemanifest
53 |
54 |
55 |
56 |
57 | {3C0CB03A-BF1D-405E-909D-2991838F5644}
58 | QbAdd-inDotNetWeb
59 | True
60 | Web
61 | SharePointWebProjectOutput
62 | QbAdd-inDotNetWeb
63 | False
64 |
65 |
66 |
67 | 10.0
68 | $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)
69 |
70 |
71 |
--------------------------------------------------------------------------------
/QbAdd-inDotNetWeb/OAuthManager.aspx.cs:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) Microsoft. All rights reserved. Licensed under the MIT license.
3 | * See LICENSE in the project root for license information.
4 | */
5 |
6 | using System;
7 | using System.Collections.Generic;
8 | using System.Linq;
9 | using System.Web;
10 | using System.Web.UI;
11 | using System.Web.UI.WebControls;
12 |
13 | using System.Configuration;
14 | using DevDefined.OAuth.Consumer;
15 | using DevDefined.OAuth.Framework;
16 |
17 |
18 | namespace QbAdd_inDotNetWeb
19 | {
20 | public partial class OAuthManager : System.Web.UI.Page
21 | {
22 | ///
23 | /// Stores configuration settings for OAuth.
24 | ///
25 | private string requestTokenUrl = ConfigurationManager.AppSettings["RequestTokenUrl"];
26 | private string accessTokenUrl = ConfigurationManager.AppSettings["AccessTokenUrl"];
27 | private string authorizeUrl = ConfigurationManager.AppSettings["AuthorizeUrl"];
28 | private string oauthUrl = ConfigurationManager.AppSettings["OauthLink"];
29 | private string consumerKey = ConfigurationManager.AppSettings["ConsumerKey"];
30 | private string consumerSecret = ConfigurationManager.AppSettings["ConsumerSecret"];
31 | private string oauthCallbackUrl = "https://localhost:44300/OauthManager.aspx";
32 |
33 | protected void Page_Load(object sender, EventArgs e)
34 | {
35 | if (Request.QueryString.Count > 0)
36 | {
37 | List queryKeys = new List(Request.QueryString.AllKeys);
38 | if (queryKeys.Contains("connect"))
39 | {
40 | FireAuth();
41 | }
42 | if (queryKeys.Contains("oauth_token"))
43 | {
44 | ReadToken();
45 | }
46 | }
47 |
48 | }
49 |
50 | ///
51 | /// Starts the authentication process.
52 | ///
53 | private void FireAuth()
54 | {
55 |
56 | IOAuthSession session = CreateSession();
57 | IToken requestToken = session.GetRequestToken();
58 | HttpContext.Current.Session["requestToken"] = requestToken;
59 | var authUrl = string.Format("{0}?oauth_token={1}&oauth_callback={2}", authorizeUrl, requestToken.Token, UriUtility.UrlEncode(oauthCallbackUrl));
60 | HttpContext.Current.Session["oauthLink"] = authUrl;
61 |
62 | HttpContext.Current.Response.Redirect(authUrl);
63 | }
64 |
65 | ///
66 | /// Gets the token for the current session.
67 | ///
68 | private void ReadToken()
69 | {
70 | HttpContext.Current.Session["oauthToken"] = Request.QueryString["oauth_token"].ToString(); ;
71 | HttpContext.Current.Session["oauthVerifyer"] = Request.QueryString["oauth_verifier"].ToString();
72 | HttpContext.Current.Session["realm"] = Request.QueryString["realmId"].ToString();
73 | HttpContext.Current.Session["dataSource"] = Request.QueryString["dataSource"].ToString();
74 | //Stored in a session for demo purposes.
75 | //Production applications should securely store the access token.
76 | IOAuthSession clientSession = CreateSession();
77 | IToken accessToken = clientSession.ExchangeRequestTokenForAccessToken((IToken)HttpContext.Current.Session["requestToken"], HttpContext.Current.Session["oauthVerifyer"].ToString());
78 | HttpContext.Current.Session["accessToken"] = accessToken.Token;
79 | HttpContext.Current.Session["accessTokenSecret"] = accessToken.TokenSecret;
80 |
81 | }
82 |
83 | ///
84 | /// Creates a new OAuth session.
85 | ///
86 | ///
87 | protected IOAuthSession CreateSession()
88 | {
89 | var consumerContext = new OAuthConsumerContext
90 | {
91 | ConsumerKey = consumerKey,
92 | ConsumerSecret = consumerSecret,
93 | SignatureMethod = SignatureMethod.HmacSha1
94 | };
95 | return new OAuthSession(consumerContext,
96 | requestTokenUrl,
97 | oauthUrl,
98 | accessTokenUrl);
99 | }
100 |
101 |
102 |
103 | }
104 | }
--------------------------------------------------------------------------------
/QbAdd-inDotNetWeb/Controllers/QuickBooksController.cs:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) Microsoft. All rights reserved. Licensed under the MIT license.
3 | * See LICENSE in the project root for license information.
4 | */
5 |
6 | using System;
7 | using System.Collections.Generic;
8 | using System.Linq;
9 | using System.Net;
10 | using System.Net.Http;
11 | using System.Web.Http;
12 |
13 | using System.Web;
14 | using System.Configuration;
15 | using Intuit.Ipp.Core;
16 | using Intuit.Ipp.Data;
17 | using Intuit.Ipp.DataService;
18 | using Intuit.Ipp.Security;
19 |
20 |
21 | namespace QbAdd_inDotNetWeb
22 | {
23 | ///
24 | /// Controller which connects to QuickBooks and gets expenses.
25 | /// This flow will make use of Data Service SDK V2 to create an OAuthRequest and connect
26 | /// to Customer Data under the service context and store data in a list.
27 | ///
28 | public class QuickBooksController : ApiController
29 | {
30 |
31 | private String realmId, accessToken, accessTokenSecret, consumerKey, consumerSecret;
32 |
33 | ///
34 | /// Within an OAuth session, pass a token to QuickBooks, and issue a query to make a GET call
35 | /// for Customer expenses.
36 | /// Puts the data returned from the service into an array.
37 | ///
38 | ///
39 | /// A collection of Purchases
40 | [HttpGet]
41 | public IEnumerable GetExpenses(int n)
42 | {
43 | consumerKey = ConfigurationManager.AppSettings["consumerKey"].ToString();
44 | consumerSecret = ConfigurationManager.AppSettings["consumerSecret"].ToString();
45 |
46 | realmId = HttpContext.Current.Session["realm"].ToString();
47 | accessToken = HttpContext.Current.Session["accessToken"].ToString();
48 | accessTokenSecret = HttpContext.Current.Session["accessTokenSecret"].ToString();
49 |
50 | IntuitServicesType intuitServicesType = IntuitServicesType.QBO;
51 | OAuthRequestValidator oauthValidator = new OAuthRequestValidator(accessToken, accessTokenSecret, consumerKey, consumerSecret);
52 | ServiceContext context = new ServiceContext(realmId, intuitServicesType, oauthValidator);
53 | context.IppConfiguration.BaseUrl.Qbo = ConfigurationManager.AppSettings["ServiceContext.BaseUrl.Qbo"].ToString();
54 |
55 | DataService dataService = new DataService(context);
56 | List expenses = dataService.FindAll(new Purchase(), 1, n).ToList();
57 | return expenses;
58 | }
59 |
60 | ///
61 | /// Helper method to set token values for the current HTTP session.
62 | ///
63 | ///
64 | ///
65 | ///
66 | /// An HTTP response message
67 | [HttpGet]
68 | public HttpResponseMessage SetToken(string token, string secret, string realm)
69 | {
70 | HttpContext.Current.Session["accessToken"] = token;
71 | HttpContext.Current.Session["accessTokenSecret"] = secret;
72 | HttpContext.Current.Session["realm"] = realm;
73 |
74 | return Request.CreateResponse(HttpStatusCode.OK, "Success");
75 | }
76 |
77 | ///
78 | /// Helper method to get the token values for the current HTTP session.
79 | ///
80 | /// An HTTP response message
81 | public HttpResponseMessage GetToken()
82 | {
83 | HttpStatusCode code = HttpStatusCode.NotFound;
84 | string message = "NotFound";
85 | if (null != HttpContext.Current.Session["accessToken"] && "" != HttpContext.Current.Session["accessToken"].ToString())
86 | {
87 | code = HttpStatusCode.OK;
88 | message = "Success";
89 | }
90 |
91 | return Request.CreateResponse(code, message);
92 | }
93 |
94 | ///
95 | /// Helper method to clear cached token for the current session.
96 | ///
97 | ///
98 | [HttpGet]
99 | public HttpResponseMessage ClearToken()
100 | {
101 | HttpContext.Current.Session["accessToken"] = "";
102 | HttpContext.Current.Session["accessTokenSecret"] = "";
103 |
104 | return Request.CreateResponse(HttpStatusCode.OK, "Success");
105 | }
106 | }
107 | }
--------------------------------------------------------------------------------
/README-Localized/README-zh-cn.md:
--------------------------------------------------------------------------------
1 | # 集成了 ASP.NET 和 QuickBooks 的 Excel 外接程序
2 |
3 | 你的 Excel 外接程序可以连接到诸如 QuickBooks 的服务,并将数据导入到你的 Excel 电子表格。此 Excel 外接程序演示如何连接到 QuickBooks、从由 QuickBooks 提供的沙盒帐户“**沙盒 Company_US_1**”获取示例支出数据,以及将示例数据导入到电子表格。外接程序还提供了从示例数据创建图表的按钮。
4 |
5 | ## 目录
6 |
7 | * [先决条件](#prerequisites)
8 | * [配置项目](#configure-the-project)
9 | * [运行项目](#run-the-project)
10 | * [了解代码](#understand-the-code)
11 | * [连接到 Office 365](#connect-to-office-365)
12 | * [问题和意见](#questions-and-comments)
13 | * [其他资源](#additional-resources)
14 |
15 | ## 先决条件
16 |
17 | * [QuickBooks 开发者](https://developer.intuit.com/)帐户
18 | * [Visual Studio 2015](https://www.visualstudio.com/downloads/download-visual-studio-vs.aspx)
19 | * [Visual Studio 的 Office 开发者工具](https://www.visualstudio.com/en-us/features/office-tools-vs.aspx)
20 |
21 | ## 配置项目
22 |
23 | 在 developer.intuit.com 配置你的应用以便开始使用。
24 |
25 | 1. 转到 https://developer.intuit.com/ 并注册开发人员帐户,然后登录。
26 | 2. 在右上角,选择“**我的应用**”,然后选择一个应用或单击“**创建新应用**”。
27 | 3. 选择应用后,依次选择“**开发**” | “**密钥**”,然后将“**OAuth 使用者密钥**”和“**OAuth 使用者密码**”复制到你稍后可以访问的位置。
28 | 4. 下载示例或将示例克隆到你的本地计算机。
29 | 5. 在 Visual Studio 中,打开解决方案文件 **QbAdd-inDotNet.sln**。
30 | 6. 在 Visual Studio 中,打开 **Web.config**,然后插入 `ConsumerKey` 和 `ConsumerSecret` 的值,如下所示。
31 |
32 | ```
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 | ```
45 |
46 | ## 运行项目
47 |
48 | 1. 按 F5 键,运行项目。
49 |
50 | 2. 通过在 Excel 的功能区中选择命令按钮启动外接程序。

51 |
52 | 3. 单击“**连接到 QuickBooks**”,启动 QuickBooks 登录窗口。

53 |
54 | 4. 如果 Visual Studio 中打开了错误窗口,单击“**继续**”,返回到 Excel。此错误与示例无关。

55 |
56 | 5. 使用 QuickBooks 开发者帐户登录 QuickBooks。

57 |
58 | 6. 单击“**授权**”,允许 QuickBooks 将数据发送到外接程序。

任务窗格会显示两个可供选择的操作。

59 |
60 | 8. 选择“**获取费用**”,将费用从 QuickBooks 导入电子表格。

61 |
62 | 9. 选择“**创建图表**”,插入图表。

63 |
64 | ## 了解代码
65 |
66 | * [Home.html](QbAdd-inDotNetWeb/Home.html) - 定义启动时和用户登录后的任务窗格页面。
67 | * [Home.js](QbAdd-inDotNetWeb/Home.js) - 处理与登录、退出、获取费用和插入图表相关的用户交互。此时,调用 `dialogDisplayAsync` API 打开对话框窗口,以供用户登录 QuickBooks。
68 | * [QbAdd-inDotNet.xml](QbAdd-inDotNet/QbAdd-inDotNetManifest/QbAdd-inDotNet.xml) - 加载项的清单文件。
69 | * [QuickBooksController.cs](QbAdd-inDotNetWeb/Controllers/QuickBooksController.cs) - 从 QuickBooks 获取费用数据。
70 | * [FunctionFile.js](QbAdd-inDotNetWeb/Functions/FunctionFile.js) - 向 Excel 添加图表。
71 | * [OAuthManager.aspx.cs](QbAdd-inDotNetWeb/OAuthManager.aspx.cs) - 处理使用对话框 API 登录 QuickBooks。
72 |
73 | ## 问题和意见
74 |
75 | 我们乐于倾听你有关*带有 ASP.NET 和 QuickBooks 的 Excel 外接程序*示例的反馈。你可以在该存储库中的“*问题*”部分将反馈发送给我们。与 Office 365 开发相关的问题一般应发布到 [Stack Overflow](http://stackoverflow.com/questions/tagged/Office365+API)。确保你的问题使用了 [Office365] 和 [API] 标记。
76 |
77 | ## 其他资源
78 |
79 | * [Office 365 API 文档](http://msdn.microsoft.com/office/office365/howto/platform-development-overview)
80 | * [Microsoft Office 365 API 工具](https://visualstudiogallery.msdn.microsoft.com/a15b85e6-69a7-4fdf-adda-a38066bb5155)
81 | * [Office 开发人员中心](http://dev.office.com/)
82 | * [Office 365 API 入门项目和代码示例](http://msdn.microsoft.com/en-us/office/office365/howto/starter-projects-and-code-samples)
83 |
84 | ## 版权
85 | 版权所有 (c) 2016 Microsoft。保留所有权利。
86 |
87 |
88 | 此项目已采用 [Microsoft 开放源代码行为准则](https://opensource.microsoft.com/codeofconduct/)。有关详细信息,请参阅[行为准则 FAQ](https://opensource.microsoft.com/codeofconduct/faq/)。如有其他任何问题或意见,也可联系 [opencode@microsoft.com](mailto:opencode@microsoft.com)。
89 |
--------------------------------------------------------------------------------
/README-Localized/README-zh-tw.md:
--------------------------------------------------------------------------------
1 | # Excel 增益集與 ASP.NET 和 QuickBooks
2 |
3 | 您的 Excel 增益集可以連接到像是 QuickBooks 的服務,並且將資料匯入至 Excel 試算表。這個 Excel 增益集將示範如何連接至 QuickBooks、從 QuickBooks 提供的沙箱帳戶取得範例費用資料,**Sandbox Company_US_1**,並且將範例資料匯入至試算表。增益集也提供按鈕以根據範例資料建立圖表。
4 |
5 | ## 目錄
6 |
7 | * [必要條件](#prerequisites)
8 | * [設定專案](#configure-the-project)
9 | * [執行專案](#run-the-project)
10 | * [瞭解程式碼](#understand-the-code)
11 | * [連線至 Office 365](#connect-to-office-365)
12 | * [問題和建議](#questions-and-comments)
13 | * [其他資源](#additional-resources)
14 |
15 | ## 必要條件
16 |
17 | * [QuickBooks 開發人員](https://developer.intuit.com/)帳戶
18 | * [Visual Studio 2015](https://www.visualstudio.com/downloads/download-visual-studio-vs.aspx)
19 | * [Visual Studio 的 Office 開發人員工具](https://www.visualstudio.com/en-us/features/office-tools-vs.aspx)
20 |
21 | ## 設定專案
22 |
23 | 在 developer.intuit.com 設定您的應用程式以開始使用。
24 |
25 | 1. 移至 https://developer.intuit.com/ 並且註冊開發人員帳戶,然後登入。
26 | 2. 在右上角,選擇 **[我的應用程式]**,並選取應用程式,或者按一下 **[建立新應用程式]**。
27 | 3. 一旦選取應用程式,選擇 **[開發** | **金鑰]**,並複製 **[OAuth 家庭用戶金鑰]** 和 **[OAuth 家庭用戶密碼]**,將其放置在您稍後可以存取的位置。
28 | 4. 下載或複製範例到本機電腦。
29 | 5. 在 Visual Studio 中開啟解決方案檔案 **QbAdd-inDotNet.sln**。
30 | 6. 在 Visual Studio 中,開啟 **Web.config** 並插入 `ConsumerKey` 和 `ConsumerSecret` 的值,如下所示。
31 |
32 | ```
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 | ```
45 |
46 | ## 執行專案
47 |
48 | 1. 按下 F5 以執行專案。
49 |
50 | 2. 從 Excel 中的功能區選取指令按鈕,來啟動增益集。

51 |
52 | 3. 按一下 **[連線到 QuickBooks]**,來啟動 QuickBooks 的登入視窗。

53 |
54 | 4. 如果 Visual Studio 中有錯誤視窗開啟,請按一下 **[繼續]**,並且瀏覽回 Excel。這個錯誤與範例不相關。

55 |
56 | 5. 使用您的 QuickBooks 開發人員帳戶來登入 QuickBooks。

57 |
58 | 6. 按一下 **[授權]**,以便讓 QuickBooks 將資料傳送至增益集。

工作窗格將會顯示兩個動作以供選擇。
選取 [動作工作窗格]
59 |
60 | 8. 選擇 **[取得費用]**,即可將費用從 QuickBooks 匯入到試算表。

61 |
62 | 9. 選擇 **[建立圖表]**,即可插入圖表。

63 |
64 | ## 瞭解程式碼
65 |
66 | * [Home.html](QbAdd-inDotNetWeb/Home.html) - 定義啟動時,以及使用者登入之後的工作窗格頁面。
67 | * [Home.js](QbAdd-inDotNetWeb/Home.js) - 處理登入、登出、取得費用以及插入圖表的使用者互動。在這裡,會呼叫 `dialogDisplayAsync` API 以開啟對話方塊視窗,讓使用者登入 QuickBooks。
68 | * [QbAdd-inDotNet.xml](QbAdd-inDotNet/QbAdd-inDotNetManifest/QbAdd-inDotNet.xml) - 增益集的資訊清單檔。
69 | * [QuickBooksController.cs](QbAdd-inDotNetWeb/Controllers/QuickBooksController.cs) - 從 QuickBooks 取得費用資料。
70 | * [FunctionFile.js](QbAdd-inDotNetWeb/Functions/FunctionFile.js) - 將圖表新增至 Excel。
71 | * [OAuthManager.aspx.cs](QbAdd-inDotNetWeb/OAuthManager.aspx.cs) - 從對話方塊 API 處理登入至 QuickBooks。
72 |
73 | ## 問題和建議
74 |
75 | 我們樂於獲得您關於 *Excel 增益集與 ASPNET 和 QuickBooks* 範例的意見反應。您可以在此儲存機制的 [問題]** 區段中,將您的意見反應傳送給我們。請在 [Stack Overflow](http://stackoverflow.com/questions/tagged/Office365+API) 提出有關 Office 365 開發的一般問題。務必以 [Office365] 和 [API] 標記您的問題。
76 |
77 | ## 其他資源
78 |
79 | * [Office 365 API 文件](http://msdn.microsoft.com/office/office365/howto/platform-development-overview)
80 | * [Microsoft Office 365 API 工具](https://visualstudiogallery.msdn.microsoft.com/a15b85e6-69a7-4fdf-adda-a38066bb5155)
81 | * [Office 開發人員中心](http://dev.office.com/)
82 | * [Office 365 API 入門專案和程式碼範例](http://msdn.microsoft.com/en-us/office/office365/howto/starter-projects-and-code-samples)
83 |
84 | ## 著作權
85 | Copyright (c) 2016 Microsoft.著作權所有,並保留一切權利。
86 |
87 |
88 | 此專案已採用 [Microsoft 開放原始碼管理辦法](https://opensource.microsoft.com/codeofconduct/)。如需詳細資訊,請參閱[管理辦法常見問題集](https://opensource.microsoft.com/codeofconduct/faq/),如果有其他問題或意見,請連絡 [opencode@microsoft.com](mailto:opencode@microsoft.com)。
89 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | ## Ignore Visual Studio temporary files, build results, and
2 | ## files generated by popular Visual Studio add-ons.
3 |
4 | # User-specific files
5 | *.suo
6 | *.user
7 | *.userosscache
8 | *.sln.docstates
9 |
10 | # User-specific files (MonoDevelop/Xamarin Studio)
11 | *.userprefs
12 |
13 | # Build results
14 | [Dd]ebug/
15 | [Dd]ebugPublic/
16 | [Rr]elease/
17 | [Rr]eleases/
18 | x64/
19 | x86/
20 | bld/
21 | [Bb]in/
22 | [Oo]bj/
23 |
24 | # Visual Studio 2015 cache/options directory
25 | .vs/
26 | # Uncomment if you have tasks that create the project's static files in wwwroot
27 | #wwwroot/
28 |
29 | # MSTest test Results
30 | [Tt]est[Rr]esult*/
31 | [Bb]uild[Ll]og.*
32 |
33 | # NUNIT
34 | *.VisualState.xml
35 | TestResult.xml
36 |
37 | # Build Results of an ATL Project
38 | [Dd]ebugPS/
39 | [Rr]eleasePS/
40 | dlldata.c
41 |
42 | # DNX
43 | project.lock.json
44 | artifacts/
45 |
46 | *_i.c
47 | *_p.c
48 | *_i.h
49 | *.ilk
50 | *.meta
51 | *.obj
52 | *.pch
53 | *.pdb
54 | *.pgc
55 | *.pgd
56 | *.rsp
57 | *.sbr
58 | *.tlb
59 | *.tli
60 | *.tlh
61 | *.tmp
62 | *.tmp_proj
63 | *.log
64 | *.vspscc
65 | *.vssscc
66 | .builds
67 | *.pidb
68 | *.svclog
69 | *.scc
70 |
71 | # Chutzpah Test files
72 | _Chutzpah*
73 |
74 | # Visual C++ cache files
75 | ipch/
76 | *.aps
77 | *.ncb
78 | *.opendb
79 | *.opensdf
80 | *.sdf
81 | *.cachefile
82 |
83 | # Visual Studio profiler
84 | *.psess
85 | *.vsp
86 | *.vspx
87 | *.sap
88 |
89 | # TFS 2012 Local Workspace
90 | $tf/
91 |
92 | # Guidance Automation Toolkit
93 | *.gpState
94 |
95 | # ReSharper is a .NET coding add-in
96 | _ReSharper*/
97 | *.[Rr]e[Ss]harper
98 | *.DotSettings.user
99 |
100 | # JustCode is a .NET coding add-in
101 | .JustCode
102 |
103 | # TeamCity is a build add-in
104 | _TeamCity*
105 |
106 | # DotCover is a Code Coverage Tool
107 | *.dotCover
108 |
109 | # NCrunch
110 | _NCrunch_*
111 | .*crunch*.local.xml
112 | nCrunchTemp_*
113 |
114 | # MightyMoose
115 | *.mm.*
116 | AutoTest.Net/
117 |
118 | # Web workbench (sass)
119 | .sass-cache/
120 |
121 | # Installshield output folder
122 | [Ee]xpress/
123 |
124 | # DocProject is a documentation generator add-in
125 | DocProject/buildhelp/
126 | DocProject/Help/*.HxT
127 | DocProject/Help/*.HxC
128 | DocProject/Help/*.hhc
129 | DocProject/Help/*.hhk
130 | DocProject/Help/*.hhp
131 | DocProject/Help/Html2
132 | DocProject/Help/html
133 |
134 | # Click-Once directory
135 | publish/
136 |
137 | # Publish Web Output
138 | *.[Pp]ublish.xml
139 | *.azurePubxml
140 | # TODO: Comment the next line if you want to checkin your web deploy settings
141 | # but database connection strings (with potential passwords) will be unencrypted
142 | *.pubxml
143 | *.publishproj
144 |
145 | # NuGet Packages
146 | *.nupkg
147 | # The packages folder can be ignored because of Package Restore
148 | **/packages/*
149 | # except build/, which is used as an MSBuild target.
150 | !**/packages/build/
151 | # Uncomment if necessary however generally it will be regenerated when needed
152 | #!**/packages/repositories.config
153 | # NuGet v3's project.json files produces more ignoreable files
154 | *.nuget.props
155 | *.nuget.targets
156 |
157 | # Microsoft Azure Build Output
158 | csx/
159 | *.build.csdef
160 |
161 | # Microsoft Azure Emulator
162 | ecf/
163 | rcf/
164 |
165 | # Microsoft Azure ApplicationInsights config file
166 | ApplicationInsights.config
167 |
168 | # Windows Store app package directory
169 | AppPackages/
170 | BundleArtifacts/
171 |
172 | # Visual Studio cache files
173 | # files ending in .cache can be ignored
174 | *.[Cc]ache
175 | # but keep track of directories ending in .cache
176 | !*.[Cc]ache/
177 |
178 | # Others
179 | ClientBin/
180 | ~$*
181 | *~
182 | *.dbmdl
183 | *.dbproj.schemaview
184 | *.pfx
185 | *.publishsettings
186 | node_modules/
187 | orleans.codegen.cs
188 |
189 | # RIA/Silverlight projects
190 | Generated_Code/
191 |
192 | # Backup & report files from converting an old project file
193 | # to a newer Visual Studio version. Backup files are not needed,
194 | # because we have git ;-)
195 | _UpgradeReport_Files/
196 | Backup*/
197 | UpgradeLog*.XML
198 | UpgradeLog*.htm
199 |
200 | # SQL Server files
201 | *.mdf
202 | *.ldf
203 |
204 | # Business Intelligence projects
205 | *.rdl.data
206 | *.bim.layout
207 | *.bim_*.settings
208 |
209 | # Microsoft Fakes
210 | FakesAssemblies/
211 |
212 | # GhostDoc plugin setting file
213 | *.GhostDoc.xml
214 |
215 | # Node.js Tools for Visual Studio
216 | .ntvs_analysis.dat
217 |
218 | # Visual Studio 6 build log
219 | *.plg
220 |
221 | # Visual Studio 6 workspace options file
222 | *.opt
223 |
224 | # Visual Studio LightSwitch build output
225 | **/*.HTMLClient/GeneratedArtifacts
226 | **/*.DesktopClient/GeneratedArtifacts
227 | **/*.DesktopClient/ModelManifest.xml
228 | **/*.Server/GeneratedArtifacts
229 | **/*.Server/ModelManifest.xml
230 | _Pvt_Extensions
231 |
232 | # Paket dependency manager
233 | .paket/paket.exe
234 |
235 | # FAKE - F# Make
236 | .fake/
237 |
--------------------------------------------------------------------------------
/README-Localized/README-ja-jp.md:
--------------------------------------------------------------------------------
1 | # ASP.NET と QuickBooks を使用する Excel アドイン
2 |
3 | Excel アドインで、QuickBooks のようなサービスに接続して、Excel スプレッドシートにデータをインポートできます。この Excel アドインでは、QuickBooks に接続し、QuickBooks が提供するサンドボックス アカウント (**Sandbox Company_US_1**) からサンプルの支出データを取得し、サンプル データをスプレッドシートにインポートする方法を示します。アドインには、サンプル データからグラフを作成するためのボタンも用意されています。
4 |
5 | ## 目次
6 |
7 | * [前提条件](#prerequisites)
8 | * [プロジェクトを構成する](#configure-the-project)
9 | * [プロジェクトを実行する](#run-the-project)
10 | * [コードを理解する](#understand-the-code)
11 | * [Office 365 に接続する](#connect-to-office-365)
12 | * [質問とコメント](#questions-and-comments)
13 | * [その他のリソース](#additional-resources)
14 |
15 | ## 前提条件
16 |
17 | * [QuickBooks 開発者](https://developer.intuit.com/)アカウント
18 | * [Visual Studio 2015](https://www.visualstudio.com/downloads/download-visual-studio-vs.aspx)
19 | * [Office Developer Tools for Visual Studio](https://www.visualstudio.com/en-us/features/office-tools-vs.aspx)
20 |
21 | ## プロジェクトを構成する
22 |
23 | Developer.intuit.com でアプリを構成することから始めます。
24 |
25 | 1. Https://developer.intuit.com/ にアクセスし、開発者アカウントを新規登録して、サインインします。
26 | 2. 右上隅にある **[マイ アプリ]** を選択してアプリを選択するか、**[新しいアプリの作成]** をクリックします。
27 | 3. アプリを選択したら、**[開発]** | **[キー]** を選択し、**OAuth コンシューマー キー**と **OAuth コンシューマー シークレット**を後でアクセスできる場所にコピーします。
28 | 4. サンプルをローカル マシンにダウンロードするか、クローンを作成します。
29 | 5. ソリューション ファイル **QbAdd-inDotNet.sln** を Visual Studio で開きます。
30 | 6. Visual Studio で **Web.config** を開き、`ConsumerKey` と `ConsumerSecret` の値を次のように挿入します。
31 |
32 | ```
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 | ```
45 |
46 | ## プロジェクトを実行する
47 |
48 | 1. F5 キーを押してプロジェクトを実行します。
49 |
50 | 2. Excel のリボンからコマンド ボタンを選択して、アドインを起動します。

51 |
52 | 3. **[QuickBooks に接続する]** をクリックして、QuickBooks のサインイン ウィンドウを起動します。

53 |
54 | 4. Visual Studio でエラー ウィンドウが開いた場合は、**[続行]** をクリックして、Excel に戻ります。このエラーは、サンプルとは関係ありません。

55 |
56 | 5. QuickBooks 開発者アカウントで QuickBooks にサインインします。

57 |
58 | 6. **[承認]** をクリックして、QuickBooks がデータをアドインに送信できるようにします。

作業ウィンドウには、選択できる操作が 2 つ表示されます。

59 |
60 | 8. **[支出の取得]** を選択して、QuickBooks から経費をスプレッドシートにインポートします。

61 |
62 | 9. **[グラフの作成]** を選択して、グラフを挿入します。

63 |
64 | ## コードを理解する
65 |
66 | * [Home.html](QbAdd-inDotNetWeb/Home.html) - 起動時と、ユーザーがログインした後の作業ウィンドウ ページを定義します。
67 | * [Home.js](QbAdd-inDotNetWeb/Home.js) - サインイン、サインアウト、支出の取得、グラフの挿入といったユーザーの操作を処理します。ここで、`dialogDisplayAsync` API が呼び出され、ユーザーが QuickBooks にサインインするためのダイアログ ウィンドウが開きます。
68 | * [QbAdd-inDotNet.xml](QbAdd-inDotNet/QbAdd-inDotNetManifest/QbAdd-inDotNet.xml) - アドインのマニフェスト ファイル。
69 | * [QuickBooksController.cs](QbAdd-inDotNetWeb/Controllers/QuickBooksController.cs) - QuickBooks から支出データを取得します。
70 | * [FunctionFile.js](QbAdd-inDotNetWeb/Functions/FunctionFile.js) - Excel にグラフを追加します。
71 | * [OAuthManager.aspx.cs](QbAdd-inDotNetWeb/OAuthManager.aspx.cs) - ダイアログ API から QuickBooks へのサインインを処理します。
72 |
73 | ## 質問とコメント
74 |
75 | *ASPNET および QuickBooks を使用した Excel アドイン*のサンプルに関するフィードバックをお寄せください。フィードバックは、このリポジトリの「*問題*」セクションで送信できます。Office 365 開発全般の質問につきましては、「[スタック オーバーフロー](http://stackoverflow.com/questions/tagged/Office365+API)」に投稿してください。質問には、必ず [Office365] と [API] のタグを付けてください。
76 |
77 | ## 追加リソース
78 |
79 | * [Office 365 API ドキュメント](http://msdn.microsoft.com/office/office365/howto/platform-development-overview)
80 | * [Microsoft Office 365 API ツール](https://visualstudiogallery.msdn.microsoft.com/a15b85e6-69a7-4fdf-adda-a38066bb5155)
81 | * [Office デベロッパー センター](http://dev.office.com/)
82 | * [Office 365 API スタート プロジェクトとコード サンプル](http://msdn.microsoft.com/en-us/office/office365/howto/starter-projects-and-code-samples)
83 |
84 | ## 著作権
85 | Copyright (c) 2016 Microsoft.All rights reserved.
86 |
87 |
88 | このプロジェクトでは、[Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/) が採用されています。詳細については、「[Code of Conduct の FAQ](https://opensource.microsoft.com/codeofconduct/faq/)」を参照してください。また、その他の質問やコメントがあれば、[opencode@microsoft.com](mailto:opencode@microsoft.com) までお問い合わせください。
89 |
--------------------------------------------------------------------------------
/QbAdd-inDotNetWeb/Home.html:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
8 |
9 |
10 |
11 | QuickBooks Add-in .Net
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
44 |
45 |
46 |
47 |
48 |
WELCOME
49 |
This add-in connects Excel with your Quickbooks online account. Please sign in to get started.
50 |
51 |
52 |
53 |
54 |
55 |
56 |
Select an action below:
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
82 |
83 |
84 |
97 |
98 |
--------------------------------------------------------------------------------
/QbAdd-inDotNetWeb/Scripts/FabricUI/MessageBanner.js:
--------------------------------------------------------------------------------
1 | // Copyright (c) Microsoft. All rights reserved. Licensed under the MIT license. See LICENSE in the project root for license information.
2 |
3 | /**
4 | * MessageBanner component
5 | *
6 | * A component to display error messages
7 | *
8 | */
9 |
10 | /**
11 | * @namespace fabric
12 | */
13 | var fabric = fabric || {};
14 | /**
15 | *
16 | * @param {HTMLElement} container - The target container for an instance of MessageBanner
17 | * @constructor
18 | */
19 | fabric.MessageBanner = function (container) {
20 | this.container = container;
21 | this.init();
22 | };
23 |
24 | fabric.MessageBanner.prototype = (function () {
25 |
26 | var _clipper;
27 | var _bufferSize;
28 | var _textContainerMaxWidth = 700;
29 | var _clientWidth;
30 | var _textWidth;
31 | var _initTextWidth;
32 | var _chevronButton;
33 | var _errorBanner;
34 | var _actionButton;
35 | var _closeButton;
36 | var _bufferElementsWidth = 88;
37 | var _bufferElementsWidthSmall = 35;
38 | var SMALL_BREAK_POINT = 480;
39 |
40 | /**
41 | * Sets styles on resize
42 | */
43 | var _onResize = function () {
44 | _clientWidth = _errorBanner.offsetWidth;
45 | if (window.innerWidth >= SMALL_BREAK_POINT) {
46 | _resizeRegular();
47 | } else {
48 | _resizeSmall();
49 | }
50 | };
51 |
52 | /**
53 | * Resize above 480 pixel breakpoint
54 | */
55 | var _resizeRegular = function () {
56 | if ((_clientWidth - _bufferSize) > _initTextWidth && _initTextWidth < _textContainerMaxWidth) {
57 | _textWidth = "auto";
58 | _chevronButton.className = "ms-MessageBanner-expand";
59 | _collapse();
60 | } else {
61 | _textWidth = Math.min((_clientWidth - _bufferSize), _textContainerMaxWidth) + "px";
62 | if (_chevronButton.className.indexOf("is-visible") === -1) {
63 | _chevronButton.className += " is-visible";
64 | }
65 | }
66 | _clipper.style.width = _textWidth;
67 | };
68 |
69 | /**
70 | * Resize below 480 pixel breakpoint
71 | */
72 | var _resizeSmall = function () {
73 | if (_clientWidth - (_bufferElementsWidthSmall + _closeButton.offsetWidth) > _initTextWidth) {
74 | _textWidth = "auto";
75 | _collapse();
76 | } else {
77 | _textWidth = (_clientWidth - (_bufferElementsWidthSmall + _closeButton.offsetWidth)) + "px";
78 | }
79 | _clipper.style.width = _textWidth;
80 | };
81 | /**
82 | * Caches elements and values of the component
83 | */
84 | var _cacheDOM = function (context) {
85 | _errorBanner = context.container;
86 | _clipper = context.container.querySelector('.ms-MessageBanner-clipper');
87 | _chevronButton = context.container.querySelector('.ms-MessageBanner-expand');
88 | _actionButton = context.container.querySelector('.ms-MessageBanner-action');
89 | _bufferSize = _actionButton.offsetWidth + _bufferElementsWidth;
90 | _closeButton = context.container.querySelector('.ms-MessageBanner-close');
91 | };
92 |
93 | /**
94 | * Expands component to show full error message
95 | */
96 | var _expand = function () {
97 | var icon = _chevronButton.querySelector('.ms-Icon');
98 | _errorBanner.className += " is-expanded";
99 | icon.className = "ms-Icon ms-Icon--chevronsUp";
100 | };
101 |
102 | /**
103 | * Collapses component to only show truncated message
104 | */
105 | var _collapse = function () {
106 | var icon = _chevronButton.querySelector('.ms-Icon');
107 | _errorBanner.className = "ms-MessageBanner";
108 | icon.className = "ms-Icon ms-Icon--chevronsDown";
109 | };
110 |
111 | var _toggleExpansion = function () {
112 | if (_errorBanner.className.indexOf("is-expanded") > -1) {
113 | _collapse();
114 | } else {
115 | _expand();
116 | }
117 | };
118 |
119 | /**
120 | * Hides banner when close button is clicked
121 | */
122 | var _hideBanner = function () {
123 | if (_errorBanner.className.indexOf("hide") === -1) {
124 | _errorBanner.className += " hide";
125 | setTimeout(function () {
126 | _errorBanner.className = "ms-MessageBanner is-hidden";
127 | }, 500);
128 | }
129 | };
130 |
131 | /**
132 | * Shows banner if the banner is hidden
133 | */
134 | var _showBanner = function () {
135 | _errorBanner.className = "ms-MessageBanner";
136 | };
137 |
138 | /**
139 | * Sets handlers for resize and button click events
140 | */
141 | var _setListeners = function () {
142 | window.addEventListener('resize', _onResize, false);
143 | _chevronButton.addEventListener("click", _toggleExpansion, false);
144 | _closeButton.addEventListener("click", _hideBanner, false);
145 | };
146 |
147 | /**
148 | * Initializes component
149 | */
150 | var init = function () {
151 | _cacheDOM(this);
152 | _setListeners();
153 | _clientWidth = _errorBanner.offsetWidth;
154 | _initTextWidth = _clipper.offsetWidth;
155 | _onResize(null);
156 | };
157 |
158 | return {
159 | init: init,
160 | showBanner: _showBanner,
161 | hideBanner: _hideBanner,
162 | toggleExpansion: _toggleExpansion
163 | };
164 | }());
165 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # [ARCHIVED] Excel Add-in with ASP.NET and QuickBooks
2 |
3 | **Note:** This repo is archived and no longer actively maintained. Security vulnerabilities may exist in the project, or its dependencies. If you plan to reuse or run any code from this repo, be sure to perform appropriate security checks on the code or dependencies first. Do not use this project as the starting point of a production Office Add-in. Always start your production code by using the Office/SharePoint development workload in Visual Studio, or the [Yeoman generator for Office Add-ins](https://github.com/OfficeDev/generator-office), and follow security best practices as you develop the add-in.
4 |
5 | Your Excel Add-in can connect to a service like QuickBooks and import data into your Excel spreadsheet.
6 | This Excel Add-in demonstrates how to connect to QuickBooks, gets sample expense data from a sandbox account provided by QuickBooks, **Sandbox Company_US_1**, and imports the sample data into a spreadsheet. The add-in also provides a button to create a chart from the sample data.
7 |
8 | ## Table of Contents
9 |
10 | * [Prerequisites](#prerequisites)
11 | * [Configure the project](#configure-the-project)
12 | * [Run the project](#run-the-project)
13 | * [Understand the code](#understand-the-code)
14 | * [Connect to Office 365](#connect-to-office-365)
15 | * [Questions and comments](#questions-and-comments)
16 | * [Additional resources](#additional-resources)
17 |
18 | ## Prerequisites
19 |
20 | * A [QuickBooks developer](https://developer.intuit.com/) account
21 | * [Visual Studio 2015](https://www.visualstudio.com/downloads/download-visual-studio-vs.aspx)
22 | * [Office Developer Tools for Visual Studio](https://www.visualstudio.com/en-us/features/office-tools-vs.aspx)
23 |
24 | ## Configure the project
25 |
26 | Configure your app at developer.intuit.com to get started.
27 |
28 | 1. Go to https://developer.intuit.com/ and sign up for a developer account, and then sign in.
29 | 2. In the upper right hand corner, choose **My Apps** and select an app or click **Create new app**.
30 | 3. Once the app is selected, choose **Development** | **Keys**, and copy **OAuth Consumer Key** and **OAuth Consumer Secret** to a place where you can access them later.
31 | 4. Download or clone the sample to your local machine.
32 | 5. Open the solution file **QbAdd-inDotNet.sln** in Visual Studio.
33 | 6. In Visual Studio, open **Web.config** and insert the values for `ConsumerKey` and `ConsumerSecret`, like this.
34 |
35 | ```
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 | ```
48 |
49 | ## Run the project
50 |
51 | 1. Press F5 to run the project.
52 |
53 | 2. Launch the add-in by selecting the command button from the ribbon in Excel.

54 |
55 | 3. Click **Connect to QuickBooks** to launch the QuickBooks sign-in window.

56 |
57 | 4. If an error window opens in Visual Studio, click **Continue** and navigate back to Excel. This error is unrelated to the sample.

58 |
59 | 5. Sign in to QuickBooks with your QuickBooks developer account.

60 |
61 | 6. Click **Authorize** to allow QuickBooks to send data to the add-in.

The task pane will display two actions to choose from.

62 |
63 | 8. Choose **Get Expenses** to import expenses from QuickBooks into a spreadsheet.

64 |
65 | 9. Choose **Create Chart** to insert a chart.

66 |
67 | ## Understand the code
68 |
69 | * [Home.html](QbAdd-inDotNetWeb/Home.html) - Defines the task pane page on start up, and after the user has logged in.
70 | * [Home.js](QbAdd-inDotNetWeb/Home.js) - Handles user interaction for sign in, sign out, get expenses, and insert chart. Here, the `dialogDisplayAsync` API is called to open a dialog window for the user to sign in to QuickBooks.
71 | * [QbAdd-inDotNet.xml](QbAdd-inDotNet/QbAdd-inDotNetManifest/QbAdd-inDotNet.xml) - The manifest file for the add-in.
72 | * [QuickBooksController.cs](QbAdd-inDotNetWeb/Controllers/QuickBooksController.cs) - Gets expense data from QuickBooks.
73 | * [FunctionFile.js](QbAdd-inDotNetWeb/Functions/FunctionFile.js) - Adds a chart to Excel.
74 | * [OAuthManager.aspx.cs](QbAdd-inDotNetWeb/OAuthManager.aspx.cs) - Handles sign in to QuickBooks from the dialog API.
75 |
76 | ## Questions and comments
77 |
78 | We'd love to get your feedback on the *Excel Add-in with ASPNET and QuickBooks* sample. You can send your feedback to us in the *Issues* section of this repository.
79 | Questions about Office 365 development in general should be posted to [Stack Overflow](http://stackoverflow.com/questions/tagged/Office365+API). Make sure that your questions are tagged with [Office365] and [API].
80 |
81 | ## Additional resources
82 |
83 | * [Office 365 APIs documentation](http://msdn.microsoft.com/office/office365/howto/platform-development-overview)
84 | * [Microsoft Office 365 API Tools](https://visualstudiogallery.msdn.microsoft.com/a15b85e6-69a7-4fdf-adda-a38066bb5155)
85 | * [Office Dev Center](http://dev.office.com/)
86 | * [Office 365 APIs starter projects and code samples](http://msdn.microsoft.com/en-us/office/office365/howto/starter-projects-and-code-samples)
87 |
88 | ## Copyright
89 | Copyright (c) 2016 Microsoft. All rights reserved.
90 |
91 |
92 | This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information, see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.
93 |
--------------------------------------------------------------------------------
/README-Localized/README-pt-br.md:
--------------------------------------------------------------------------------
1 | # Suplemento do Excel com o ASP.NET e QuickBooks
2 |
3 | O Suplemento do Excel pode se conectar a um serviço, como o QuickBooks, e importar dados para sua planilha do Excel. Esse Suplemento do Excel demonstra como se conectar ao QuickBooks, obtém dados de exemplos de despesas de uma conta de área restrita fornecidos pelo QuickBooks, **Área Restrita Company_US_1**, e importa os dados de exemplo para uma planilha. O suplemento também fornece um botão para criar um gráfico usando os dados de exemplo.
4 |
5 | ## Sumário
6 |
7 | * [Pré-requisitos](#prerequisites)
8 | * [Configurar o projeto](#configure-the-project)
9 | * [Executar o projeto](#run-the-project)
10 | * [Compreender o código](#understand-the-code)
11 | * [Conectar-se ao Office 365](#connect-to-office-365)
12 | * [Perguntas e comentários](#questions-and-comments)
13 | * [Recursos adicionais](#additional-resources)
14 |
15 | ## Pré-requisitos
16 |
17 | * Uma conta de [desenvolvedor do QuickBooks](https://developer.intuit.com/)
18 | * [Visual Studio 2015](https://www.visualstudio.com/downloads/download-visual-studio-vs.aspx)
19 | * [Office Developer Tools para Visual Studio](https://www.visualstudio.com/en-us/features/office-tools-vs.aspx)
20 |
21 | ## Configurar o projeto
22 |
23 | Configure seu aplicativo na página developer.intuit.com para começar.
24 |
25 | 1. Acesse https://developer.intuit.com/, inscreva-se para uma conta de desenvolvedor e entre.
26 | 2. No canto superior direito, escolha **Meus Aplicativos** e escolha um aplicativo ou clique em **Criar novo aplicativo**.
27 | 3. Assim que o aplicativo for selecionado, escolha **Chaves de** | **Desenvolvimento** e copie a **Chave do Consumidor OAuth** e o **Segredo do Consumidor OAuth** para um local onde elas possam ser acessadas posteriormente.
28 | 4. Baixe ou clone o exemplo para o computador local.
29 | 5. Abra o arquivo de solução **QbAdd inDotNet.sln** no Visual Studio.
30 | 6. No Visual Studio, abra **Web.config** e insira os valores para `ConsumerKey` e `ConsumerSecret`, dessa forma.
31 |
32 | ```
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 | ```
45 |
46 | ## Executar o projeto
47 |
48 | 1. Pressione F5 para executar o projeto.
49 |
50 | 2. Inicie o suplemento selecionando o botão de comando da faixa de opções no Excel

51 |
52 | 3. Clique em **Conectar-se ao QuickBooks** para iniciar a janela de entrada do QuickBooks.

53 |
54 | 4. Se uma janela de erro for exibida no Visual Studio, clique em **Continuar** e navegue para o Excel. Este erro não está relacionado ao exemplo.

55 |
56 | 5. Entre no QuickBooks com sua senha de desenvolvedor do QuickBooks.

57 |
58 | 6. Clique em **Autorizar** para permitir que o QuickBooks envie dados ao suplemento.

O painel de tarefas exibirá duas ações à sua escolha.

59 |
60 | 8. Escolha **Obter despesas** para importar as despesas do QuickBooks para uma planilha.

61 |
62 | 9. Escolha **Criar Gráfico** para inserir um gráfico.

63 |
64 | ## Compreender o código
65 |
66 | * [Home.HTML](QbAdd-inDotNetWeb/Home.html) – define a página do painel de tarefas na inicialização e depois que o usuário tiver feito logon.
67 | * [Home.js](QbAdd-inDotNetWeb/Home.js) – trata da interação do usuário para entrar, sair, obter despesas e inserir gráfico. Aqui, a API `dialogDisplayAsync` é chamada para abrir uma janela de diálogo para o usuário entrar no QuickBooks.
68 | * [QbAdd-inDotNet.xml](QbAdd-inDotNet/QbAdd-inDotNetManifest/QbAdd-inDotNet.xml) – o arquivo de manifesto do suplemento.
69 | * [QuickBooksController.cs](QbAdd-inDotNetWeb/Controllers/QuickBooksController.cs) – obtém dados de despesas a partir do QuickBooks.
70 | * [FunctionFile.js](QbAdd-inDotNetWeb/Functions/FunctionFile.js) – adiciona um gráfico ao Excel.
71 | * [OAuthManager.aspx.cs](QbAdd-inDotNetWeb/OAuthManager.aspx.cs) – trata das entradas no QuickBooks realizadas a partir da API de diálogo.
72 |
73 | ## Perguntas e comentários
74 |
75 | Adoraríamos receber seus comentários sobre o exemplo do *Suplemento do Excel com o ASPNET e QuickBooks*. Você pode enviar comentários na seção *Problemas* deste repositório. As perguntas sobre o desenvolvimento do Office 365 em geral devem ser postadas no [Stack Overflow](http://stackoverflow.com/questions/tagged/Office365+API). Não deixe de marcar as perguntas com [Office365] e [API].
76 |
77 | ## Recursos adicionais
78 |
79 | * [Documentação de APIs do Office 365](http://msdn.microsoft.com/office/office365/howto/platform-development-overview)
80 | * [Ferramentas de API do Microsoft Office 365](https://visualstudiogallery.msdn.microsoft.com/a15b85e6-69a7-4fdf-adda-a38066bb5155)
81 | * [Centro de Desenvolvimento do Office](http://dev.office.com/)
82 | * [Exemplos de código e projetos iniciais de APIs do Office 365](http://msdn.microsoft.com/en-us/office/office365/howto/starter-projects-and-code-samples)
83 |
84 | ## Copyright
85 | Copyright © 2016 Microsoft. Todos os direitos reservados.
86 |
87 |
88 | Este projeto adotou o [Código de Conduta de Software Livre da Microsoft](https://opensource.microsoft.com/codeofconduct/). Para saber mais, confira as [Perguntas frequentes sobre o Código de Conduta](https://opensource.microsoft.com/codeofconduct/faq/) ou contate [opencode@microsoft.com](mailto:opencode@microsoft.com) se tiver outras dúvidas ou comentários.
89 |
--------------------------------------------------------------------------------
/README-Localized/README-de-de.md:
--------------------------------------------------------------------------------
1 | # Excel-Add-In mit ASP.NET und QuickBooks
2 |
3 | Excel-Add-Ins können eine Verbindung mit einem Dienst wie QuickBooks herstellen und Daten in eine Excel-Tabelle importieren. Dieses Excel-Add-In veranschaulicht das Herstellen einer Verbindung mit QuickBooks, ruft Beispielausgabedaten aus einem von QuickBooks bereitgestellten Sandkastenkonto **Sandbox Company_US_1**, und importiert die Beispieldaten in eine Tabelle. Das Add-In stellt auch eine Schaltfläche zum Erstellen eines Diagramms aus den Beispieldaten bereit.
4 |
5 | ## Inhalt
6 |
7 | * [Voraussetzungen](#prerequisites)
8 | * [Konfigurieren des Projekts](#configure-the-project)
9 | * [Ausführen des Projekts](#run-the-project)
10 | * [Grundlegendes zum Code](#understand-the-code)
11 | * [Verbinden mit Office 365](#connect-to-office-365)
12 | * [Fragen und Kommentare](#questions-and-comments)
13 | * [Zusätzliche Ressourcen](#additional-resources)
14 |
15 | ## Voraussetzungen
16 |
17 | * Ein [QuickBooks-Entwickler](https://developer.intuit.com/)konto
18 | * [Visual Studio 2015](https://www.visualstudio.com/downloads/download-visual-studio-vs.aspx)
19 | * [Office Developer Tools für Visual Studio](https://www.visualstudio.com/en-us/features/office-tools-vs.aspx)
20 |
21 | ## Konfigurieren des Projekts
22 |
23 | Konfigurieren Sie zunächst Ihre App unter developer.intuit.com.
24 |
25 | 1. Rufen Sie https://developer.intuit.com/ auf, registrieren Sie sich für ein Entwicklerkonto, und melden Sie sich dann mit diesem an.
26 | 2. Wählen Sie in der oberen rechten Ecke **Meine Apps**, und wählen Sie eine App aus, oder klicken Sie auf **Neue App erstellen**.
27 | 3. Wählen Sie, nachdem die App ausgewählt ist, **Entwicklung** | **Schlüssel**, und kopieren Sie den **OAuth-Consumerschlüssel** und den **Geheimen OAuth-Consumerschlüssel** an einen Ort, auf den Sie später zugreifen können.
28 | 4. Laden Sie das Beispiel auf Ihrem lokalen Computer herunter, oder klonen Sie dieses.
29 | 5. Öffnen Sie die Projektmappe **QbAdd-inDotNet.sln** in Visual Studio.
30 | 6. Öffnen Sie in Visual Studio **Web.config**, und fügen Sie die Werte für `ConsumerKey` und `ConsumerSecret` wie folgt ein.
31 |
32 | ```
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 | ```
45 |
46 | ## Ausführen des Projekts
47 |
48 | 1. Drücken Sie F5, um das Projekt auszuführen.
49 |
50 | 2. Starten Sie das Add-in, indem Sie im Menüband in Excel die Befehlsschaltfläche auswählen.

51 |
52 | 3. Klicken Sie auf **Mit QuickBooks** verbinden, um das Anmeldefenster für QuickBooks zu öffnen.

53 |
54 | 4. Wenn ein Fehlerfenster in Visual Studio geöffnet wird, klicken Sie auf **Weiter**, und navigieren Sie wieder zu Excel. Dieser Fehler tritt nicht im Zusammenhang mit dem Beispiel auf.

55 |
56 | 5. Melden Sie sich mit Ihrem QuickBooks-Entwicklerkonto bei QuickBooks an.

57 |
58 | 6. Klicken Sie auf **Autorisieren**, um QuickBooks das Senden von Daten an das Add-In zu ermöglichen.

Im Aufgabenbereich werden zwei Aktionen zur Auswahl angezeigt.

59 |
60 | 8. Wählen Sie **Ausgaben abrufen** aus, um Ausgaben vonQuickBooks in eine Tabelle zu importieren.

61 |
62 | 9. Wählen Sie **Diagramm erstellen** aus, um ein Diagramm einzufügen.

63 |
64 | ## Grundlegendes zum Code
65 |
66 | * [Home.HTML](QbAdd-inDotNetWeb/Home.html) Definiert die Aufgabenbereichsseite, die beim Start und nach Anmeldung des Benutzers angezeigt wird.
67 | * [Home.js](QbAdd-inDotNetWeb/Home.js) Verarbeitet die Benutzerinteraktion für Registrierung, Anmeldung, Abrufen von Ausgaben und Einfügen von Diagrammen. Hier wird die `dialogDisplayAsync`-API aufgerufen, um ein Dialogfeld für den Benutzer zur Anmeldung bei QuickBooks zu öffnen.
68 | * [QbAdd-inDotNet.xml](QbAdd-inDotNet/QbAdd-inDotNetManifest/QbAdd-inDotNet.xml) Die Manifestdatei für das Add-In.
69 | * [QuickBooksController.cs](QbAdd-inDotNetWeb/Controllers/QuickBooksController.cs) Ruft Ausgabedaten aus QuickBooks ab.
70 | * [FunctionFile.js](QbAdd-inDotNetWeb/Functions/FunctionFile.js) Fügt ein Diagramm in Excel hinzu.
71 | * [OAuthManager.aspx.cs](QbAdd-inDotNetWeb/OAuthManager.aspx.cs) Verarbeitet die Anmeldung bei QuickBooks über die Dialogfeld-API.
72 |
73 | ## Fragen und Kommentare
74 |
75 | Wir freuen uns auf Ihr Feedback zu dem Beispiel *Excel-Add-In mit ASPNET und QuickBooks* Sie können uns Ihr Feedback über den Abschnitt *Probleme* dieses Repositorys senden. Allgemeine Fragen zur Office 365-Entwicklung sollten in [Stack Overflow](http://stackoverflow.com/questions/tagged/Office365+API) gestellt werden. Stellen Sie sicher, dass Ihre Fragen mit [Office365] und [API] markiert sind.
76 |
77 | ## Zusätzliche Ressourcen
78 |
79 | * [Dokumentation zu Office 365-APIs](http://msdn.microsoft.com/office/office365/howto/platform-development-overview)
80 | * [Microsoft Office 365 API-Tools](https://visualstudiogallery.msdn.microsoft.com/a15b85e6-69a7-4fdf-adda-a38066bb5155)
81 | * [Office Dev Center](http://dev.office.com/)
82 | * [Office 365 APIs – Startprojekte und Codebeispiele](http://msdn.microsoft.com/en-us/office/office365/howto/starter-projects-and-code-samples)
83 |
84 | ## Copyright
85 | Copyright (c) 2016 Microsoft. Alle Rechte vorbehalten.
86 |
87 |
88 | In diesem Projekt wurden die [Microsoft Open Source-Verhaltensregeln](https://opensource.microsoft.com/codeofconduct/) übernommen. Weitere Informationen finden Sie unter [Häufig gestellte Fragen zu Verhaltensregeln](https://opensource.microsoft.com/codeofconduct/faq/), oder richten Sie Ihre Fragen oder Kommentare an [opencode@microsoft.com](mailto:opencode@microsoft.com).
89 |
--------------------------------------------------------------------------------
/README-Localized/README-ru-ru.md:
--------------------------------------------------------------------------------
1 | # Надстройка Excel на базе ASP.NET для QuickBooks
2 |
3 | Надстройка Excel может подключаться к таким службам, как QuickBooks, и импортировать данные на лист Excel. Надстройка Excel, предложенная на этой странице, подключается к QuickBooks, получает образец данных о расходах из тестовой учетной записи **Sandbox Company_US_1**, предоставленной QuickBooks, и импортирует эти данные на лист. Кроме того, в этой надстройке предусмотрена кнопка создания диаграммы из образца данных.
4 |
5 | ## Содержание
6 |
7 | * [Необходимые компоненты](#prerequisites)
8 | * [Настройка проекта](#configure-the-project)
9 | * [Запуск проекта](#run-the-project)
10 | * [Разбор кода](#understand-the-code)
11 | * [Подключение к Office 365](#connect-to-office-365)
12 | * [Вопросы и комментарии](#questions-and-comments)
13 | * [Дополнительные ресурсы](#additional-resources)
14 |
15 | ## Необходимые компоненты
16 |
17 | * Учетная запись [разработчика решений для QuickBooks](https://developer.intuit.com/).
18 | * [Visual Studio 2015](https://www.visualstudio.com/downloads/download-visual-studio-vs.aspx).
19 | * [Инструменты разработчика Office для Visual Studio](https://www.visualstudio.com/en-us/features/office-tools-vs.aspx).
20 |
21 | ## Настройка проекта
22 |
23 | Для начала настройте приложение на сайте developer.intuit.com.
24 |
25 | 1. Перейдите по адресу https://developer.intuit.com/ и зарегистрируйтесь для получения учетной записи разработчика, а затем выполните вход.
26 | 2. В правом верхнем углу щелкните команду **My Apps** (Мои приложения), а затем выберите приложение или нажмите кнопку **Create new app** (Создать приложение).
27 | 3. Выбрав приложение, выберите элементы **Development** (Разработка) > **Keys** (Ключи) и скопируйте данные в полях **OAuth Consumer Key** (Ключ клиента OAuth) и **OAuth Consumer Secret** (Секрет клиента OAuth) для дальнейшего использования.
28 | 4. Скачайте или клонируйте пример на локальный компьютер.
29 | 5. Откройте файл решения **QbAdd-inDotNet.sln** в Visual Studio.
30 | 6. В Visual Studio откройте файл **Web.config** и вставьте значения `ConsumerKey` и `ConsumerSecret`, как показано ниже.
31 |
32 | ```
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 | ```
45 |
46 | ## Запуск проекта
47 |
48 | 1. Нажмите клавишу F5, чтобы запустить проект.
49 |
50 | 2. Запустите надстройку, нажав соответствующую кнопку на ленте в Excel.

51 |
52 | 3. Нажмите кнопку **Connect to QuickBooks** (Подключиться к QuickBooks), чтобы открыть окно входа QuickBooks.

53 |
54 | 4. Если в Visual Studio появится окно ошибки, нажмите кнопку **Продолжить** и вернитесь к Excel. Эта ошибка не связана с образцом.

55 |
56 | 5. Войдите в QuickBooks с помощью учетной записи разработчика решений для QuickBooks.

57 |
58 | 6. Нажмите кнопку **Authorize** (Авторизация), чтобы позволить QuickBooks отправлять данные в надстройку.

В области задач отобразятся два действия на выбор.

59 |
60 | 8. Нажмите кнопку **Get Expenses** (Получить данные о расходах), чтобы импортировать данные о расходах из QuickBooks в электронную таблицу.

61 |
62 | 9. Нажмите кнопку **Create Chart** (Создать диаграмму), чтобы вставить диаграмму.

63 |
64 | ## Разбор кода
65 |
66 | * Файл [Home.html](QbAdd-inDotNetWeb/Home.html) определяет страницу области задач при запуске и после входа пользователя.
67 | * Файл [Home.js](QbAdd-inDotNetWeb/Home.js) обрабатывает действия пользователя для входа, выхода, получения данных о расходах и вставки диаграммы. В этом файле вызывается API `dialogDisplayAsync`, чтобы открыть диалоговое окно входа в QuickBooks.
68 | * Файл [QbAdd-inDotNet.xml](QbAdd-inDotNet/QbAdd-inDotNetManifest/QbAdd-inDotNet.xml) — файл манифеста надстройки.
69 | * Файл [QuickBooksController.cs](QbAdd-inDotNetWeb/Controllers/QuickBooksController.cs) получает данные о расходах из QuickBooks.
70 | * Файл [FunctionFile.js](QbAdd-inDotNetWeb/Functions/FunctionFile.js) добавляет диаграмму в Excel.
71 | * Файл [OAuthManager.aspx.cs](QbAdd-inDotNetWeb/OAuthManager.aspx.cs) выполняет вход в QuickBooks из API диалоговых окон.
72 |
73 | ## Вопросы и комментарии
74 |
75 | Будем рады получить ваши отзывы об образце *надстройки Excel на базе ASP.NET для QuickBooks*. Своими мыслями можете поделиться на вкладке *Issues* (Проблемы) этого репозитория. Общие вопросы о разработке решений для Office 365 следует задавать на сайте [Stack Overflow](http://stackoverflow.com/questions/tagged/Office365+API). Помечайте свои вопросы тегами [Office365] и [API].
76 |
77 | ## Дополнительные ресурсы
78 |
79 | * [Документация по API-интерфейсам Office 365](http://msdn.microsoft.com/office/office365/howto/platform-development-overview)
80 | * [Средства для интеграции API-интерфейсов Microsoft Office 365](https://visualstudiogallery.msdn.microsoft.com/a15b85e6-69a7-4fdf-adda-a38066bb5155)
81 | * [Центр разработчика Office](http://dev.office.com/)
82 | * [Проекты API Office 365 и примеры кода для начинающих](http://msdn.microsoft.com/en-us/office/office365/howto/starter-projects-and-code-samples)
83 |
84 | ## Авторское право
85 | (c) Корпорация Майкрософт (Microsoft Corporation), 2016. Все права защищены.
86 |
87 |
88 | Этот проект соответствует [правилам поведения Майкрософт, касающимся обращения с открытым кодом](https://opensource.microsoft.com/codeofconduct/). Дополнительную информацию см. в разделе [часто задаваемых вопросов по правилам поведения](https://opensource.microsoft.com/codeofconduct/faq/). Если у вас возникли вопросы или замечания, напишите нам по адресу [opencode@microsoft.com](mailto:opencode@microsoft.com).
89 |
--------------------------------------------------------------------------------
/README-Localized/README-es-es.md:
--------------------------------------------------------------------------------
1 | # Complemento de Excel con ASP.NET y QuickBooks
2 |
3 | El complemento de Excel puede conectarse a un servicio como QuickBooks e importar datos en la hoja de cálculo de Excel. Este complemento de Excel muestra cómo conectarse a QuickBooks, obtiene datos de gastos de ejemplo de una cuenta de espacio aislado proporcionada por QuickBooks, **Sandbox Company_US_1**, e importa los datos de ejemplo en una hoja de cálculo. El complemento proporciona también un botón para crear un gráfico a partir de los datos de ejemplo.
4 |
5 | ## Tabla de contenido
6 |
7 | * [Requisitos previos](#prerequisites)
8 | * [Configurar el proyecto](#configure-the-project)
9 | * [Ejecutar el proyecto](#run-the-project)
10 | * [Entender el código](#understand-the-code)
11 | * [Conectarse a Office 365](#connect-to-office-365)
12 | * [Preguntas y comentarios](#questions-and-comments)
13 | * [Recursos adicionales](#additional-resources)
14 |
15 | ## Requisitos previos
16 |
17 | * Una cuenta de [desarrollador de QuickBooks](https://developer.intuit.com/)
18 | * [Visual Studio 2015](https://www.visualstudio.com/downloads/download-visual-studio-vs.aspx)
19 | * [Office Developer Tools para Visual Studio](https://www.visualstudio.com/en-us/features/office-tools-vs.aspx)
20 |
21 | ## Configurar el proyecto
22 |
23 | Configure la aplicación en developer.intuit.com para comenzar.
24 |
25 | 1. Vaya a https://developer.intuit.com/ y regístrese para obtener una cuenta de desarrollador y, después, inicie sesión.
26 | 2. En la esquina superior derecha, elija **Mis aplicaciones** y seleccione una aplicación o haga clic en **Crear nueva aplicación**.
27 | 3. Una vez que haya seleccionado la aplicación, elija **Desarrollo** | **Claves** y copie la **clave de consumidor OAuth** y el **secreto de consumidor OAuth** en un lugar desde el que pueda acceder a ellos más tarde.
28 | 4. Descargue o copie el ejemplo en el equipo local.
29 | 5. Abra el archivo de la solución **QbAdd-inDotNet.sln** en Visual Studio.
30 | 6. En Visual Studio, abra **Web.config** e inserte los valores de `ConsumerKey` y `ConsumerSecret`, de esta forma.
31 |
32 | ```
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 | ```
45 |
46 | ## Ejecutar el proyecto
47 |
48 | 1. Pulse F5 para ejecutar el proyecto.
49 |
50 | 2. Inicie el complemento seleccionando el botón de comando de la cinta de opciones en Excel.

51 |
52 | 3. Haga clic en **Conectarse a QuickBooks** para que se abra la ventana de inicio de sesión de QuickBooks.

53 |
54 | 4. Si se abre una ventana de error en Visual Studio, haga clic en **Continuar** y vuelva a Excel. Este error no está relacionado con el ejemplo.

55 |
56 | 5. Inicie sesión en QuickBooks con su cuenta de desarrollador de QuickBooks.

57 |
58 | 6. Haga clic en **Autorizar** para permitir que QuickBooks envíe datos al complemento.

El panel de tareas mostrará dos acciones para elegir.

59 |
60 | 8. Elija **Obtener gastos** para importar los gastos de QuickBooks en una hoja de cálculo.

61 |
62 | 9. Elija **Crear gráfico** para insertar un gráfico.

63 |
64 | ## Entender el código
65 |
66 | * [Home.html](QbAdd-inDotNetWeb/Home.html): define la página del panel de tareas en el inicio y después de que el usuario haya iniciado sesión.
67 | * [Home.js](QbAdd-inDotNetWeb/Home.js): identifica la interacción del usuario para iniciar sesión, cerrar sesión, obtener los gastos e insertar gráficos. En este caso, se llama a la API de `dialogDisplayAsync` para que se abra una ventana de diálogo para que el usuario inicie sesión en QuickBooks.
68 | * [QbAdd-inDotNet.xml](QbAdd-inDotNet/QbAdd-inDotNetManifest/QbAdd-inDotNet.xml): el archivo de manifiesto del complemento.
69 | * [QuickBooksController.cs](QbAdd-inDotNetWeb/Controllers/QuickBooksController.cs): obtiene datos de gastos de QuickBooks.
70 | * [FunctionFile.js](QbAdd-inDotNetWeb/Functions/FunctionFile.js): agrega un gráfico a Excel.
71 | * [OAuthManager.aspx.cs](QbAdd-inDotNetWeb/OAuthManager.aspx.cs): controla el inicio de sesión en QuickBooks de la API de cuadros de diálogo.
72 |
73 | ## Preguntas y comentarios
74 |
75 | Nos encantaría recibir sus comentarios sobre el ejemplo del *complemento de Excel con ASPNET y QuickBooks*. Puede enviarnos comentarios a través de la sección *Problemas* de este repositorio. Las preguntas generales sobre desarrollo en Office 365 deben publicarse en [Stack Overflow](http://stackoverflow.com/questions/tagged/Office365+API). Asegúrese de que sus preguntas se etiquetan con [Office365] y [API].
76 |
77 | ## Recursos adicionales
78 |
79 | * [Documentación de las API de Office 365](http://msdn.microsoft.com/office/office365/howto/platform-development-overview)
80 | * [Herramientas de API de Microsoft Office 365](https://visualstudiogallery.msdn.microsoft.com/a15b85e6-69a7-4fdf-adda-a38066bb5155)
81 | * [Centro de desarrollo de Office](http://dev.office.com/)
82 | * [Proyectos de inicio y ejemplos de código de las API de Office 365](http://msdn.microsoft.com/en-us/office/office365/howto/starter-projects-and-code-samples)
83 |
84 | ## Copyright
85 | Copyright (c) 2016 Microsoft. Todos los derechos reservados.
86 |
87 |
88 | Este proyecto ha adoptado el [Código de conducta de código abierto de Microsoft](https://opensource.microsoft.com/codeofconduct/). Para obtener más información, consulte las [preguntas más frecuentes sobre el Código de conducta](https://opensource.microsoft.com/codeofconduct/faq/) o póngase en contacto con [opencode@microsoft.com](mailto:opencode@microsoft.com) si tiene otras preguntas o comentarios.
89 |
--------------------------------------------------------------------------------
/README-Localized/README-fr-fr.md:
--------------------------------------------------------------------------------
1 | # Complément Excel avec ASP.NET et QuickBooks
2 |
3 | Votre complément Excel peut se connecter à un service tel que QuickBooks et importer des données dans votre feuille de calcul Excel. Ce complément Excel indique comment se connecter à QuickBooks, obtient des exemples de données de dépenses auprès d’un compte sandbox fourni par QuickBooks, **Sandbox Company_US_1**, et importe les exemples de données dans une feuille de calcul. Le complément fournit également un bouton permettant de créer un graphique à partir des exemples de données.
4 |
5 | ## Sommaire
6 |
7 | * [Conditions préalables](#prerequisites)
8 | * [Configuration du projet](#configure-the-project)
9 | * [Exécution du projet](#run-the-project)
10 | * [Présentation du code](#understand-the-code)
11 | * [Connexion à Office 365](#connect-to-office-365)
12 | * [Questions et commentaires](#questions-and-comments)
13 | * [Ressources supplémentaires](#additional-resources)
14 |
15 | ## Conditions préalables
16 |
17 | * Compte de [développeur QuickBooks](https://developer.intuit.com/)
18 | * [Visual Studio 2015](https://www.visualstudio.com/downloads/download-visual-studio-vs.aspx)
19 | * [Outils de développement Office pour Visual Studio](https://www.visualstudio.com/en-us/features/office-tools-vs.aspx)
20 |
21 | ## Configurer le projet
22 |
23 | Pour commencer, configurez votre application à l’adresse developer.intuit.com.
24 |
25 | 1. Accédez à https://developer.intuit.com/, inscrivez-vous pour obtenir un compte de développeur, puis connectez-vous.
26 | 2. Dans le coin supérieur droit, sélectionnez **Mes applications**, puis choisissez une application ou cliquez sur **Créer une application**.
27 | 3. Après avoir sélectionné l’application, choisissez **Développement** | **Clés**, puis copiez la **clé de consommateur OAuth** et le **secret de consommateur OAuth** dans un emplacement auquel vous pourrez accéder ultérieurement.
28 | 4. Téléchargez ou clonez l’exemple sur votre ordinateur local.
29 | 5. Ouvrez le fichier de solution **QbAdd-inDotNet.sln** dans Visual Studio.
30 | 6. Dans Visual Studio, ouvrez **Web.config** et insérez les valeurs de `ConsumerKey` et `ConsumerSecret`, comme suit.
31 |
32 | ```
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 | ```
45 |
46 | ## Exécuter le projet
47 |
48 | 1. Appuyez sur F5 pour exécuter le projet.
49 |
50 | 2. Lancez le complément en sélectionnant le bouton de commande dans le ruban dans Excel.

51 |
52 | 3. Cliquez sur **Se connecter à QuickBooks** pour lancer la fenêtre de connexion QuickBooks.

53 |
54 | 4. Si une fenêtre d’erreur s’ouvre dans Visual Studio, cliquez sur **Continuer** et revenez dans Excel. Cette erreur n’est pas liée à l’exemple.

55 |
56 | 5. Connectez-vous à QuickBooks avec votre compte de développeur QuickBooks.

57 |
58 | 6. Cliquez sur **Autoriser** pour autoriser QuickBooks à envoyer des données au complément.

Le volet Office affiche deux actions entre lesquelles choisir.

59 |
60 | 8. Choisissez **Obtention des dépenses** pour importer des dépenses de QuickBooks dans une feuille de calcul.

61 |
62 | 9. Choisissez **Créer un graphique** pour insérer un graphique.

63 |
64 | ## Comprendre le code
65 |
66 | * [Home.HTML](QbAdd-inDotNetWeb/Home.html) : définit la page de volet Office lors du démarrage et après la connexion de l’utilisateur.
67 | * [Home.js](QbAdd-inDotNetWeb/Home.js) : gère les interactions de l’utilisateur pour la connexion, la déconnexion, l’obtention des dépenses et l’insertion de graphiques. Dans ce cas, l’API `dialogDisplayAsync` est appelée pour ouvrir une fenêtre de dialogue afin que l’utilisateur se connecte à QuickBooks.
68 | * [QbAdd-inDotNet.xml](QbAdd-inDotNet/QbAdd-inDotNetManifest/QbAdd-inDotNet.xml) : fichier manifeste pour le complément.
69 | * [QuickBooksController.cs](QbAdd-inDotNetWeb/Controllers/QuickBooksController.cs) : récupère les données de dépenses auprès de QuickBooks.
70 | * [FunctionFile.js](QbAdd-inDotNetWeb/Functions/FunctionFile.js) : ajoute un graphique dans Excel.
71 | * [OAuthManager.aspx.cs](QbAdd-inDotNetWeb/OAuthManager.aspx.cs) : gère la connexion à QuickBooks à partir de l’API de boîte de dialogue.
72 |
73 | ## Questions et commentaires
74 |
75 | Nous aimerions recevoir vos commentaires sur l’exemple *Complément Excel avec ASP.NET et QuickBooks*. Vous pouvez nous envoyer vos commentaires via la section *Problèmes* de ce référentiel. Si vous avez des questions sur le développement d’Office 365, envoyez-les sur [Stack Overflow](http://stackoverflow.com/questions/tagged/Office365+API). Veillez à poser vos questions avec les balises [API] et [Office365].
76 |
77 | ## Ressources supplémentaires
78 |
79 | * [Documentation sur les API Office 365](http://msdn.microsoft.com/office/office365/howto/platform-development-overview)
80 | * [Outils d’API Microsoft Office 365](https://visualstudiogallery.msdn.microsoft.com/a15b85e6-69a7-4fdf-adda-a38066bb5155)
81 | * [Centre de développement Office](http://dev.office.com/)
82 | * [Projets de démarrage et exemples de code des API Office 365](http://msdn.microsoft.com/en-us/office/office365/howto/starter-projects-and-code-samples)
83 |
84 | ## Copyright
85 | Copyright (c) 2016 Microsoft. Tous droits réservés.
86 |
87 |
88 | Ce projet a adopté le [code de conduite Open Source de Microsoft](https://opensource.microsoft.com/codeofconduct/). Pour plus d’informations, reportez-vous à la [FAQ relative au code de conduite](https://opensource.microsoft.com/codeofconduct/faq/) ou contactez [opencode@microsoft.com](mailto:opencode@microsoft.com) pour toute question ou tout commentaire.
89 |
--------------------------------------------------------------------------------
/QbAdd-inDotNetWeb/Home.js:
--------------------------------------------------------------------------------
1 | ///
2 |
3 | /*
4 | * Copyright (c) Microsoft. All rights reserved. Licensed under the MIT license.
5 | * See LICENSE in the project root for license information.
6 | */
7 |
8 | (function () {
9 | "use strict";
10 |
11 | var accessToken = {};
12 | var dlg;
13 | var messageBanner = null;
14 |
15 | Office.initialize = function (reason) {
16 | $(document).ready(function () {
17 |
18 | $('#btnSignIn').click(signIn);
19 | $('#btnSignOut').click(signOut);
20 |
21 | $('#btnGetExpenses').click(getExpenses);
22 | $('#btnCreateChart').click(addChart);
23 |
24 | $("#welcomePanel").show();
25 | $("#actionsPanel").hide();
26 |
27 | // Initialize the FabricUI notification mechanism and hide it
28 | messageBanner = new fabric.MessageBanner($(".ms-MessageBanner")[0]);
29 | messageBanner.hideBanner();
30 |
31 | checkSignIn();
32 | });
33 | };
34 |
35 | function signIn() {
36 | var signInUrl = "https://appcenter.intuit.com/Connect/SessionStart?datasources=quickbooks&grantUrl="
37 | + encodeURIComponent("https://localhost:44300/OAuthManager.aspx?connect=true");
38 | Office.context.ui.displayDialogAsync(signInUrl,
39 | { height: 70, width: 40},
40 | function (result) {
41 | dlg = result.value;
42 | dlg.addEventHandler("dialogMessageReceived", processMessage);
43 | });
44 | }
45 |
46 | function processMessage(arg) {
47 |
48 | //Work around for Mac:
49 | try {
50 | dlg.close();
51 | OSF.ClientHostController.closeDialog();
52 | } catch (e) { }
53 |
54 | accessToken = JSON.parse(arg.message);
55 |
56 | $.get("/api/setToken?" + $.param(accessToken))
57 | .done(function (data) {
58 | console.log(data);
59 | });
60 |
61 | $("#welcomePanel").hide();
62 | $("#actionsPanel").show();
63 |
64 |
65 | }
66 |
67 | function signOut() {
68 | $.get("/api/clearToken", function (data, status) {
69 | accessToken = null;
70 | $("#welcomePanel").show();
71 | $("#actionsPanel").hide();
72 | });
73 | }
74 |
75 | function checkSignIn() {
76 | if (typeof accessToken.token == "undefined") {
77 | $.get("api/getToken", function (data, status) {
78 | $("#welcomePanel").hide();
79 | $("#actionsPanel").fadeIn("slow");
80 | });
81 | }
82 | }
83 |
84 |
85 | function getExpenses() {
86 | var url = "/api/getExpenses?n=100";
87 |
88 | $.get(url, function (data, status) {
89 | var tableBody = getFormattedArray(data);
90 | addExpensesSheet(tableBody);
91 | });
92 | }
93 |
94 |
95 | // Import sample transactions into the workbook
96 | function addExpensesSheet(tableBody) {
97 |
98 | // Run a batch operation against the Excel object model
99 | Excel.run(function (ctx) {
100 |
101 | // Add a new worksheet to store the transactions
102 | var dataSheet = ctx.workbook.worksheets.add("Expenses");
103 |
104 | // Fill white color in the sheet for improved look
105 | dataSheet.getRange("A2:M1000").format.fill.color = "white";
106 |
107 | // Add Sheet Title
108 | var range = dataSheet.getRange("B1:E1");
109 | range.values = "Contoso Expenses";
110 | range.format.font.name = "Corbel";
111 | range.format.font.size = 30;
112 | range.format.font.color = "white";
113 | range.merge();
114 | // Fill color in the brand bar
115 | dataSheet.getRange("A1:M1").format.fill.color = "#41AEBD";
116 |
117 | // Queue a command to add a new table
118 | var startRowNumber = 2;
119 | var masterTableAddress = 'Expenses!B' + startRowNumber + ':G' + (startRowNumber + tableBody.length).toString();
120 | var masterTable = ctx.workbook.tables.add(masterTableAddress, true);
121 | masterTable.name = "ExpensesTable";
122 |
123 | // Queue a command to get the newly added table
124 | masterTable.getHeaderRowRange().values = [["DATE", "AMOUNT", "MERCHANT", "CATEGORY", "TYPEOFDAY", "MONTH"]];
125 |
126 | masterTable.getDataBodyRange().formulas = tableBody;
127 | masterTable.columns.getItem("AMOUNT").getRange().numberFormat = '_($* #,##0.00_);_($* (#,##0.00);_($* "-"??_);_(@_)';
128 |
129 | // Format the table header and data rows
130 | range = dataSheet.getRange('Expenses!B' + startRowNumber + ':G' + startRowNumber);
131 | range.format.font.name = "Corbel";
132 | range.format.font.size = 10;
133 | range.format.font.bold = true;
134 | range.format.font.color = "black";
135 |
136 | range = dataSheet.getRange(masterTableAddress);
137 | range.format.font.name = "Corbel";
138 | range.format.font.size = 10;
139 | range.format.borders.getItem('EdgeBottom').style = 'Continuous';
140 | range.format.borders.getItem('EdgeTop').style = 'Continuous';
141 |
142 | // Sort by most recent transactions at the top (Date, descending order)
143 | var sortRange = masterTable.getDataBodyRange().getColumn(0).getUsedRange();
144 | sortRange.sort.apply([
145 | {
146 | key: 0,
147 | ascending: false,
148 | },
149 | ]);
150 |
151 | // Auto-fit columns and rows
152 | dataSheet.getUsedRange().getEntireColumn().format.autofitColumns();
153 | dataSheet.getUsedRange().getEntireRow().format.autofitRows();
154 |
155 | // Set the sheet as active
156 | dataSheet.activate();
157 |
158 | // Run the queued-up commands, and return a promise to indicate task completion
159 | return ctx.sync();
160 | }).catch(errorHandler);
161 |
162 | }
163 |
164 | function getFormattedArray(expenses) {
165 | var result = [];
166 |
167 | $.each(expenses, function (i, item) {
168 | //var tmpDate = new Date(item.txnDateField);
169 | //var date = tmpDate.getMonth()+1 + "/" + tmpDate.getDate() + "/" + tmpDate.getFullYear();
170 | var date = item.txnDateField.substr(0, 10);
171 | var type = "Unspecified";
172 | switch (item.paymentTypeField) {
173 | case 0:
174 | type = "Cash";
175 | break;
176 | case 1:
177 | type = "Check";
178 | break;
179 | case 2:
180 | type = "Credit Card";
181 | break;
182 | }
183 | var payee = "";
184 | if (item.entityRefField)
185 | payee = item.entityRefField.nameField;
186 | var cat = "";
187 | if (item.lineField.length > 0) {
188 | switch (item.lineField[0].detailTypeField) {
189 | case 5:
190 | cat = item.lineField[0].itemField.accountRefField.nameField;
191 | break;
192 | case "itemBasedExpenseLineDetailField":
193 | cat = item.lineField[0].itemBasedExpenseLineDetailField.itemRefField.nameField;
194 | break;
195 |
196 | }
197 | }
198 | var amount = item.totalAmtField;
199 |
200 | result.push([date, amount, payee, cat, '=IF(OR((TEXT([DATE], "dddd") = "Saturday"), (TEXT([DATE], "dddd") = "Sunday")), "Weekend", "Weekday")', '=TEXT([DATE], "mmm - yyyy")']);
201 | });
202 |
203 | return result;
204 | }
205 |
206 | // Helper function for treating errors
207 | function errorHandler(error) {
208 | // Always be sure to catch any accumulated errors that bubble up from the Excel.run execution
209 | showNotification("Error", error);
210 | console.log("Error: " + error);
211 | if (error instanceof OfficeExtension.Error) {
212 | console.log("Debug info: " + JSON.stringify(error.debugInfo));
213 | }
214 | }
215 |
216 | // Helper function for displaying notifications
217 | function showNotification(header, content) {
218 | $("#notificationHeader").text(header);
219 | $("#notificationBody").text(content);
220 | messageBanner.showBanner();
221 | messageBanner.toggleExpansion();
222 | }
223 | })();
224 |
--------------------------------------------------------------------------------
/QbAdd-inDotNet/QbAdd-inDotNetManifest/QbAdd-inDotNet.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
9 |
10 |
11 |
12 |
13 | 3cb7e6fb-7d08-49a8-838d-8b51cc2e1da3
14 |
15 |
16 | 1.0.0.0
17 | Rolando Jimenez
18 | en-US
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 | https://appcenter.intuit.com/
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 | ReadWriteDocument
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 | ButtonId1
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 |
110 |
111 |
143 |
144 |
145 |
146 |
147 |
148 |
149 |
150 |
151 |
152 |
153 |
154 |
155 |
156 |
157 |
158 |
159 |
160 |
161 |
162 |
163 |
164 |
165 |
166 |
167 |
168 |
169 |
170 |
171 |
172 |
173 |
174 |
175 |
176 |
177 |
178 |
--------------------------------------------------------------------------------
/QbAdd-inDotNetWeb/QbAdd-inDotNetWeb.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Debug
8 | AnyCPU
9 |
10 |
11 | 2.0
12 | {3C0CB03A-BF1D-405E-909D-2991838F5644}
13 | {349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}
14 | Library
15 | Properties
16 | QbAdd_inDotNetWeb
17 | QbAdd-inDotNetWeb
18 | v4.5
19 | true
20 | 44300
21 |
22 |
23 |
24 |
25 |
26 |
27 | 15.0
28 |
29 |
30 | true
31 | full
32 | false
33 | bin\
34 | DEBUG;TRACE
35 | prompt
36 | 4
37 |
38 |
39 | pdbonly
40 | true
41 | bin\
42 | TRACE
43 | prompt
44 | 4
45 |
46 |
47 |
48 | ..\packages\DevDefined.OAuth.0.2\lib\DevDefined.OAuth.dll
49 | True
50 |
51 |
52 | ..\packages\IppDotNetSdkForQuickBooksApiV3.2.4.0\lib\Intuit.Ipp.Core.dll
53 | True
54 |
55 |
56 | ..\packages\IppDotNetSdkForQuickBooksApiV3.2.4.0\lib\Intuit.Ipp.Data.dll
57 | True
58 |
59 |
60 | ..\packages\IppDotNetSdkForQuickBooksApiV3.2.4.0\lib\Intuit.Ipp.DataService.dll
61 | True
62 |
63 |
64 | ..\packages\IppDotNetSdkForQuickBooksApiV3.2.4.0\lib\Intuit.Ipp.Diagnostics.dll
65 | True
66 |
67 |
68 | ..\packages\IppDotNetSdkForQuickBooksApiV3.2.4.0\lib\Intuit.Ipp.Exception.dll
69 | True
70 |
71 |
72 | ..\packages\IppDotNetSdkForQuickBooksApiV3.2.4.0\lib\Intuit.Ipp.GlobalTaxService.dll
73 | True
74 |
75 |
76 | ..\packages\IppDotNetSdkForQuickBooksApiV3.2.4.0\lib\Intuit.Ipp.LinqExtender.dll
77 | True
78 |
79 |
80 | ..\packages\IppDotNetSdkForQuickBooksApiV3.2.4.0\lib\Intuit.Ipp.PlatformService.dll
81 | True
82 |
83 |
84 | ..\packages\IppDotNetSdkForQuickBooksApiV3.2.4.0\lib\Intuit.Ipp.QueryFilter.dll
85 | True
86 |
87 |
88 | ..\packages\IppDotNetSdkForQuickBooksApiV3.2.4.0\lib\Intuit.Ipp.ReportService.dll
89 | True
90 |
91 |
92 | ..\packages\IppDotNetSdkForQuickBooksApiV3.2.4.0\lib\Intuit.Ipp.Retry.dll
93 | True
94 |
95 |
96 | ..\packages\IppDotNetSdkForQuickBooksApiV3.2.4.0\lib\Intuit.Ipp.Security.dll
97 | True
98 |
99 |
100 | ..\packages\IppDotNetSdkForQuickBooksApiV3.2.4.0\lib\Intuit.Ipp.Utility.dll
101 | True
102 |
103 |
104 | ..\packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.1.0.1\lib\net45\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.dll
105 | True
106 |
107 |
108 |
109 | ..\packages\Microsoft.Web.Infrastructure.1.0.0.0\lib\net40\Microsoft.Web.Infrastructure.dll
110 | True
111 |
112 |
113 | ..\packages\Newtonsoft.Json.8.0.3\lib\net45\Newtonsoft.Json.dll
114 | True
115 |
116 |
117 |
118 | ..\packages\Microsoft.AspNet.WebApi.Client.5.2.3\lib\net45\System.Net.Http.Formatting.dll
119 | True
120 |
121 |
122 |
123 |
124 |
125 |
126 |
127 |
128 |
129 |
130 |
131 | ..\packages\Microsoft.AspNet.WebApi.Core.5.2.3\lib\net45\System.Web.Http.dll
132 | True
133 |
134 |
135 | ..\packages\Microsoft.AspNet.WebApi.WebHost.5.2.3\lib\net45\System.Web.Http.WebHost.dll
136 | True
137 |
138 |
139 |
140 |
141 |
142 |
143 |
144 |
145 |
146 |
147 |
148 |
149 |
150 |
151 |
152 | Web.config
153 |
154 |
155 | Web.config
156 |
157 |
158 |
159 |
160 |
161 |
162 |
163 |
164 |
165 |
166 |
167 |
168 |
169 |
170 |
171 |
172 |
173 |
174 |
175 |
176 |
177 |
178 |
179 | Designer
180 |
181 |
182 |
183 |
184 |
185 | Global.asax
186 |
187 |
188 | OAuthManager.aspx
189 | ASPXCodeBehind
190 |
191 |
192 | OAuthManager.aspx
193 |
194 |
195 |
196 |
197 | Close.aspx
198 | ASPXCodeBehind
199 |
200 |
201 | Close.aspx
202 |
203 |
204 |
205 |
206 |
207 |
208 | 10.0
209 | $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)
210 |
211 |
212 |
213 |
214 |
215 |
216 |
217 |
218 | True
219 | True
220 | 1117
221 | /
222 | http://localhost:1117/
223 | False
224 | False
225 |
226 |
227 | False
228 |
229 |
230 |
231 |
232 |
233 |
234 | This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.
235 |
236 |
237 |
238 |
239 |
240 | del %25LOCALAPPDATA%25\Microsoft\Office\16.0\Wef\AppCommands /q
241 |
242 |
249 |
--------------------------------------------------------------------------------