Permalink
Browse files

Added API Code

  • Loading branch information...
SimonDoy committed May 15, 2016
1 parent 706fe66 commit 6d9a0481ed87acf52cae79af51c8d5ae10438d9a
Showing with 31,220 additions and 5 deletions.
  1. +18 −5 .gitignore
  2. +22 −0 API/Itsp365.InvoiceFormApp.Api.sln
  3. +31 −0 API/Itsp365.InvoiceFormApp.Api/App_Start/BundleConfig.cs
  4. +13 −0 API/Itsp365.InvoiceFormApp.Api/App_Start/FilterConfig.cs
  5. +23 −0 API/Itsp365.InvoiceFormApp.Api/App_Start/RouteConfig.cs
  6. +28 −0 API/Itsp365.InvoiceFormApp.Api/App_Start/Startup.Auth.cs
  7. +29 −0 API/Itsp365.InvoiceFormApp.Api/App_Start/WebApiConfig.cs
  8. +24 −0 API/Itsp365.InvoiceFormApp.Api/Content/Site.css
  9. +6,816 −0 API/Itsp365.InvoiceFormApp.Api/Content/bootstrap.css
  10. +20 −0 API/Itsp365.InvoiceFormApp.Api/Content/bootstrap.min.css
  11. +22 −0 API/Itsp365.InvoiceFormApp.Api/Controllers/ConfigurationController.cs
  12. +31 −0 API/Itsp365.InvoiceFormApp.Api/Controllers/HomeController.cs
  13. +1 −0 API/Itsp365.InvoiceFormApp.Api/Global.asax
  14. +23 −0 API/Itsp365.InvoiceFormApp.Api/Global.asax.cs
  15. +344 −0 API/Itsp365.InvoiceFormApp.Api/Itsp365.InvoiceFormApp.Api.csproj
  16. +151 −0 API/Itsp365.InvoiceFormApp.Api/Project_Readme.html
  17. +35 −0 API/Itsp365.InvoiceFormApp.Api/Properties/AssemblyInfo.cs
  18. BIN API/Itsp365.InvoiceFormApp.Api/Scripts/_references.js
  19. +3,524 −0 API/Itsp365.InvoiceFormApp.Api/Scripts/ai.0.22.9-build00167.js
  20. +1 −0 API/Itsp365.InvoiceFormApp.Api/Scripts/ai.0.22.9-build00167.min.js
  21. +2,014 −0 API/Itsp365.InvoiceFormApp.Api/Scripts/bootstrap.js
  22. +21 −0 API/Itsp365.InvoiceFormApp.Api/Scripts/bootstrap.min.js
  23. +2,671 −0 API/Itsp365.InvoiceFormApp.Api/Scripts/jquery-1.10.2.intellisense.js
  24. +9,803 −0 API/Itsp365.InvoiceFormApp.Api/Scripts/jquery-1.10.2.js
  25. +23 −0 API/Itsp365.InvoiceFormApp.Api/Scripts/jquery-1.10.2.min.js
  26. +1 −0 API/Itsp365.InvoiceFormApp.Api/Scripts/jquery-1.10.2.min.map
  27. +1,302 −0 API/Itsp365.InvoiceFormApp.Api/Scripts/jquery.validate-vsdoc.js
  28. +1,245 −0 API/Itsp365.InvoiceFormApp.Api/Scripts/jquery.validate.js
  29. +16 −0 API/Itsp365.InvoiceFormApp.Api/Scripts/jquery.validate.min.js
  30. +429 −0 API/Itsp365.InvoiceFormApp.Api/Scripts/jquery.validate.unobtrusive.js
  31. +19 −0 API/Itsp365.InvoiceFormApp.Api/Scripts/jquery.validate.unobtrusive.min.js
  32. +1,416 −0 API/Itsp365.InvoiceFormApp.Api/Scripts/modernizr-2.6.2.js
  33. +340 −0 API/Itsp365.InvoiceFormApp.Api/Scripts/respond.js
  34. +20 −0 API/Itsp365.InvoiceFormApp.Api/Scripts/respond.min.js
  35. +7 −0 API/Itsp365.InvoiceFormApp.Api/Service References/Application Insights/ConnectedService.json
  36. +10 −0 API/Itsp365.InvoiceFormApp.Api/Service References/AzureAD/ConnectedService.json
  37. +15 −0 API/Itsp365.InvoiceFormApp.Api/Startup.cs
  38. +7 −0 API/Itsp365.InvoiceFormApp.Api/Views/Home/About.cshtml
  39. +17 −0 API/Itsp365.InvoiceFormApp.Api/Views/Home/Contact.cshtml
  40. +31 −0 API/Itsp365.InvoiceFormApp.Api/Views/Home/Index.cshtml
  41. +9 −0 API/Itsp365.InvoiceFormApp.Api/Views/Shared/Error.cshtml
  42. +53 −0 API/Itsp365.InvoiceFormApp.Api/Views/Shared/_Layout.cshtml
  43. +19 −0 API/Itsp365.InvoiceFormApp.Api/Views/Shared/_LoginPartial.cshtml
  44. +22 −0 API/Itsp365.InvoiceFormApp.Api/Views/UserProfile/Index.cshtml
  45. +11 −0 API/Itsp365.InvoiceFormApp.Api/Views/UserProfile/Relogin.cshtml
  46. +43 −0 API/Itsp365.InvoiceFormApp.Api/Views/Web.config
  47. +3 −0 API/Itsp365.InvoiceFormApp.Api/Views/_ViewStart.cshtml
  48. +30 −0 API/Itsp365.InvoiceFormApp.Api/Web.Debug.config
  49. +31 −0 API/Itsp365.InvoiceFormApp.Api/Web.Release.config
  50. +80 −0 API/Itsp365.InvoiceFormApp.Api/Web.config
  51. +77 −0 API/Itsp365.InvoiceFormApp.Api/Web.config.backup.1
  52. BIN API/Itsp365.InvoiceFormApp.Api/favicon.ico
  53. BIN API/Itsp365.InvoiceFormApp.Api/fonts/glyphicons-halflings-regular.eot
  54. +228 −0 API/Itsp365.InvoiceFormApp.Api/fonts/glyphicons-halflings-regular.svg
  55. BIN API/Itsp365.InvoiceFormApp.Api/fonts/glyphicons-halflings-regular.ttf
  56. BIN API/Itsp365.InvoiceFormApp.Api/fonts/glyphicons-halflings-regular.woff
  57. +51 −0 API/Itsp365.InvoiceFormApp.Api/packages.config
View
@@ -15,8 +15,9 @@
[Dd]ebugPublic/
[Rr]elease/
[Rr]eleases/
x64/
x86/
[Xx]64/
[Xx]86/
[Bb]uild/
bld/
[Bb]in/
[Oo]bj/
@@ -79,6 +80,7 @@ ipch/
*.opensdf
*.sdf
*.cachefile
*.VC.db
# Visual Studio profiler
*.psess
@@ -137,9 +139,11 @@ publish/
# Publish Web Output
*.[Pp]ublish.xml
*.azurePubxml
# TODO: Comment the next line if you want to checkin your web deploy settings
# but database connection strings (with potential passwords) will be unencrypted
*.pubxml
# TODO: Un-comment the next line if you do not want to checkin
# your web deploy settings because they may include unencrypted
# passwords
#*.pubxml
*.publishproj
# NuGet Packages
@@ -177,6 +181,7 @@ BundleArtifacts/
# Others
ClientBin/
[Ss]tyle[Cc]op.*
~$*
*~
*.dbmdl
@@ -229,8 +234,16 @@ FakesAssemblies/
**/*.Server/ModelManifest.xml
_Pvt_Extensions
# LightSwitch generated files
GeneratedArtifacts/
ModelManifest.xml
# Paket dependency manager
.paket/paket.exe
# FAKE - F# Make
.fake/
#Remove Visual Studio 2015 Azure Publishing Files
*.pubxml
*.pubxml.user
@@ -0,0 +1,22 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 14
VisualStudioVersion = 14.0.25123.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Itsp365.InvoiceFormApp.Api", "Itsp365.InvoiceFormApp.Api\Itsp365.InvoiceFormApp.Api.csproj", "{60EFEE54-A030-4F9A-B617-E1CAEA49CBF2}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{60EFEE54-A030-4F9A-B617-E1CAEA49CBF2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{60EFEE54-A030-4F9A-B617-E1CAEA49CBF2}.Debug|Any CPU.Build.0 = Debug|Any CPU
{60EFEE54-A030-4F9A-B617-E1CAEA49CBF2}.Release|Any CPU.ActiveCfg = Release|Any CPU
{60EFEE54-A030-4F9A-B617-E1CAEA49CBF2}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal
@@ -0,0 +1,31 @@
using System.Web;
using System.Web.Optimization;
namespace Itsp365.InvoiceFormApp.Api
{
public class BundleConfig
{
// For more information on bundling, visit http://go.microsoft.com/fwlink/?LinkId=301862
public static void RegisterBundles(BundleCollection bundles)
{
bundles.Add(new ScriptBundle("~/bundles/jquery").Include(
"~/Scripts/jquery-{version}.js"));
bundles.Add(new ScriptBundle("~/bundles/jqueryval").Include(
"~/Scripts/jquery.validate*"));
// Use the development version of Modernizr to develop with and learn from. Then, when you're
// ready for production, use the build tool at http://modernizr.com to pick only the tests you need.
bundles.Add(new ScriptBundle("~/bundles/modernizr").Include(
"~/Scripts/modernizr-*"));
bundles.Add(new ScriptBundle("~/bundles/bootstrap").Include(
"~/Scripts/bootstrap.js",
"~/Scripts/respond.js"));
bundles.Add(new StyleBundle("~/Content/css").Include(
"~/Content/bootstrap.css",
"~/Content/site.css"));
}
}
}
@@ -0,0 +1,13 @@
using System.Web;
using System.Web.Mvc;
namespace Itsp365.InvoiceFormApp.Api
{
public class FilterConfig
{
public static void RegisterGlobalFilters(GlobalFilterCollection filters)
{
filters.Add(new HandleErrorAttribute());
}
}
}
@@ -0,0 +1,23 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Web.Routing;
namespace Itsp365.InvoiceFormApp.Api
{
public class RouteConfig
{
public static void RegisterRoutes(RouteCollection routes)
{
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
routes.MapRoute(
name: "Default",
url: "{controller}/{action}/{id}",
defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional }
);
}
}
}
@@ -0,0 +1,28 @@
using System;
using System.Collections.Generic;
using System.Configuration;
using System.IdentityModel.Tokens;
using System.Linq;
using Microsoft.Owin.Security;
using Microsoft.Owin.Security.ActiveDirectory;
using Owin;
namespace Itsp365.InvoiceFormApp.Api
{
public partial class Startup
{
// For more information on configuring authentication, please visit http://go.microsoft.com/fwlink/?LinkId=301864
public void ConfigureAuth(IAppBuilder app)
{
app.UseWindowsAzureActiveDirectoryBearerAuthentication(
new WindowsAzureActiveDirectoryBearerAuthenticationOptions
{
Tenant = ConfigurationManager.AppSettings["ida:Tenant"],
TokenValidationParameters = new TokenValidationParameters
{
ValidAudience = ConfigurationManager.AppSettings["ida:Audience"]
},
});
}
}
}
@@ -0,0 +1,29 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web.Http;
using System.Web.Cors;
using System.Web.Http.Cors;
namespace Itsp365.InvoiceFormApp.Api
{
public static class WebApiConfig
{
public static void Register(HttpConfiguration config)
{
// Web API configuration and services
var corsConfiguration = new EnableCorsAttribute("http://localhost:8080,http://127.0.0.1:8080,https://itsp365invoiceformappapitest.azurewebsites.net", "*", "*");
config.EnableCors(corsConfiguration);
// Web API routes
config.MapHttpAttributeRoutes();
config.Routes.MapHttpRoute(
name: "DefaultApi",
routeTemplate: "api/{controller}/{id}",
defaults: new { id = RouteParameter.Optional }
);
}
}
}
@@ -0,0 +1,24 @@
body {
padding-top: 50px;
padding-bottom: 20px;
}
/* Set padding to keep content from hitting the edges */
.body-content {
padding-left: 15px;
padding-right: 15px;
}
/* Override the default bootstrap behavior where horizontal description lists
will truncate terms that are too long to fit in the left column
*/
.dl-horizontal dt {
white-space: normal;
}
/* Set width on the form input elements since they're 100% wide by default */
input,
select,
textarea {
max-width: 280px;
}
Oops, something went wrong.

0 comments on commit 6d9a048

Please sign in to comment.