This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="container"> | |
<div class="row"> | |
<div ng-show="loggedIn && showInvoiceList" class="col-md-10 col-sd-3"> | |
<div class="table-responsive"> | |
<table class="table table-striped"> | |
<thead> | |
<th>Date</th> | |
<th>Invoice Reference</th> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="container"> | |
<div class="row"> | |
<div class="col-md-4 col-sd-12"> | |
<button class="btn btn-default" type="button" title="Edit" ng-click="editInvoice()">Edit</button> | |
<span ng-show="error">Error: {{error}}</span> | |
</div> | |
</div> | |
<form> | |
<div id="invoiceDiv" class="row"> | |
<h2>Invoice: {{invoice.reference}}</h2> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
var invoiceFormApp = angular.module('itspInvoiceFormApp', | |
[ | |
'ngRoute', 'invoiceControllersModule', 'dataModelService', 'AdalAngular', 'applicationConstantsModule', 'configurationServiceModule', 'settingsController', 'invoiceDataService' | |
]); | |
var appStart = function($routeProvider, $httpProvider, adalProvider, applicationConstants, configurationServiceProvider) { | |
$routeProvider.when('/invoices/add', { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict' | |
var invoiceControllersModule = angular.module('invoiceControllersModule', ['invoiceDataService']); | |
invoiceControllersModule.controller('listInvoicesController', ['$scope', '$location', 'adalAuthenticationService', 'invoiceDataService', function ($scope, $location, adalService, invoiceDataService) { | |
$scope.invoices = []; | |
$scope.error=""; | |
$scope.showInvoiceList=function(){ | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
var invoiceDataServiceModule = angular.module('invoiceDataService', ['AdalAngular', 'configurationServiceModule']); | |
invoiceDataServiceModule.service('invoiceDataService', ['$http', '$q', 'configurationService', 'adalAuthenticationService', invoiceDataServiceFactory]); | |
function invoiceDataServiceFactory($http, $q, configurationService, adalService) | |
{ | |
var invoiceDataServiceDefinition={}; | |
invoiceDataServiceDefinition.getInvoices=function getInvoices(){ | |
var url=configurationService.settings.apiUrl + "/invoice"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
GlobalConfiguration.Configuration.Formatters.Remove(config.Formatters.XmlFormatter); | |
var jsonFormatter = GlobalConfiguration.Configuration.Formatters.JsonFormatter; | |
jsonFormatter.UseDataContractJsonSerializer = false; | |
jsonFormatter.SerializerSettings.ContractResolver = new CamelCasePropertyNamesContractResolver(); | |
GlobalConfiguration.Configuration.Formatters.Add(jsonFormatter); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.\Update-SPContentTypeDocumentTemplate.ps1 –Url https://sharepoint -ContentTypeName "Policy Document" -DocumentTemplatePath "c:\dev\documents\policydocumenttemplate.dotx" -DocumentTemplateFileName "policydocumenttemplatev2.dotx" -UpdateChildren |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
param | |
( | |
[Parameter(Mandatory=$true, HelpMessage='Url for Site Collection hosting content type')] | |
[string]$Url = "https://sharepoint.ithinksharepoint.com", | |
[Parameter(Mandatory=$true, HelpMessage='Name of the Content Type to apply document template to')] | |
[string]$ContentTypeName = "Policy Document", | |
[Parameter(Mandatory=$true, HelpMessage='File path of the document template to upload')] | |
[string]$DocumentTemplatePath = "", | |
[Parameter(Mandatory=$false, HelpMessage='Filename to store the file in SharePoint as')] | |
[string]$DocumentTemplateFileName = "", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class InvoiceForm | |
{ | |
public InvoiceForm() | |
{ | |
this.InvoiceLines = new List<InvoiceLine>(); | |
} | |
public long Id { get; set; } | |
public string Reference { get; set; } | |
public string CompanyName { get; set; } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class InvoiceRepository | |
{ | |
private static InvoiceRepository _instance = null; | |
private List<InvoiceForm> _repository; | |
private InvoiceRepository() | |
{ | |
_repository = new List<InvoiceForm>(); | |
var invoice = new InvoiceForm(); | |
invoice.Id = 1; |