Skip to content

Commit

Permalink
Merge pull request #16 from robsur/master
Browse files Browse the repository at this point in the history
Added new functionality for Labels
  • Loading branch information
saarsoo committed Mar 17, 2016
2 parents 71a87e9 + fabb4af commit cdc26ed
Show file tree
Hide file tree
Showing 12 changed files with 349 additions and 2 deletions.
14 changes: 13 additions & 1 deletion FortnoxAPILibrary/Connectors/InvoiceConnector.cs
Expand Up @@ -67,6 +67,12 @@ public class InvoiceConnector : FinancialYearBasedEntityConnector<Invoice, Invoi
[FilterProperty]
public string OurReference { get; set; }

/// <summary>
/// Use with Find() to limit the search result
/// </summary>
[FilterProperty]
public string InvoiceDate { get; set; }

/// <summary>
/// Use with Find() to limit the search result
/// </summary>
Expand All @@ -79,6 +85,12 @@ public class InvoiceConnector : FinancialYearBasedEntityConnector<Invoice, Invoi
[FilterProperty]
public string YourReference { get; set; }

/// <summary>
/// Use with Find() to limit the search result
/// </summary>
[FilterProperty]
public string Label { get; set; }

private bool sentSet = false;
private bool sent;
/// <summary>
Expand All @@ -98,7 +110,7 @@ public bool Sent
}
}

private bool notCompletedSet = false;
private bool notCompletedSet = false;
private bool notcompleted;
/// <summary>
/// Use with Find() to limit the search result
Expand Down
61 changes: 61 additions & 0 deletions FortnoxAPILibrary/Connectors/LabelConnector.cs
@@ -0,0 +1,61 @@
using System.Collections.Generic;

namespace FortnoxAPILibrary.Connectors {
/// <remarks/>
public class LabelConnector : EntityConnector<Label, Labels, Sort.By.Label> {
/// <summary>
/// Use with Find() to limit the search result
/// </summary>
[FilterProperty]
public string Id { get; set; }

/// <remarks/>
public LabelConnector() {
base.Resource = "labels";
}

/// <summary>
/// Gets a Label by ID
/// </summary>
/// <param name="labelId"></param>
/// <returns></returns>
public Label Get(string labelId) {
return base.BaseGet(labelId);
}

/// <summary>
/// Updates a label
/// </summary>
/// <param name="label"></param>
/// <returns></returns>
public Label Update(Label label) {
return base.BaseUpdate(label, label.Id);
}

/// <summary>
/// Create a new label
/// </summary>
/// <param name="label">The label entity to create</param>
/// <returns>The created label.</returns>
public Label Create(Label label) {
return base.BaseCreate(label);
}

/// <summary>
/// Delete a label
/// </summary>
/// <param name="labelid">The label id to delete</param>
/// <returns>If the label was deleted. </returns>
public void Delete(string labelid) {
base.BaseDelete(labelid);
}

/// <summary>
/// Gets a list of labels
/// </summary>
/// <returns>A list of labels</returns>
public Labels Find() {
return base.BaseFind();
}
}
}
6 changes: 6 additions & 0 deletions FortnoxAPILibrary/Connectors/OfferConnector.cs
Expand Up @@ -48,6 +48,12 @@ public class OfferConnector : FinancialYearBasedEntityConnector<Offer, Offers, S
[FilterProperty]
public string YourReference { get; set; }

/// <summary>
/// Use with Find() to limit the search result
/// </summary>
[FilterProperty]
public string Label { get; set; }


private bool sentSet = false;
private bool sent;
Expand Down
6 changes: 6 additions & 0 deletions FortnoxAPILibrary/Connectors/OrderConnector.cs
Expand Up @@ -61,6 +61,12 @@ public class OrderConnector : FinancialYearBasedEntityConnector<Order, Orders, S
[FilterProperty]
public string YourReference { get; set; }

/// <summary>
/// Use with Find() to limit the search result
/// </summary>
[FilterProperty]
public string Label { get; set; }

private bool sentSet = false;
private bool sent;
/// <summary>
Expand Down
12 changes: 12 additions & 0 deletions FortnoxAPILibrary/Entities/Articles.cs
Expand Up @@ -124,6 +124,8 @@ public partial class ArticleSubset

private string unitField;

private string vATField;

private string webshopArticleField;

/// <remarks/>
Expand Down Expand Up @@ -288,6 +290,16 @@ public string Unit
}
}

/// <remarks/>
public string VAT {
get {
return this.vATField;
}
set {
this.vATField = value;
}
}

/// <remarks/>
[System.Xml.Serialization.XmlAttributeAttribute()]
public string url
Expand Down
34 changes: 34 additions & 0 deletions FortnoxAPILibrary/Entities/Invoice.cs
Expand Up @@ -106,6 +106,8 @@ public partial class Invoice

private List<InvoiceRow> invoiceRowsField;

private List<Label> labelsField;

private InvoiceConnector.InvoiceType invoiceTypeField;

private string languageField;
Expand Down Expand Up @@ -186,6 +188,7 @@ public partial class Invoice
public Invoice()
{
this.InvoiceRows = new List<InvoiceRow>();
this.Labels = new List<Label>();
}

/// <remarks/>
Expand Down Expand Up @@ -719,6 +722,16 @@ public List<InvoiceRow> InvoiceRows
}
}

/// <remarks/>
public List<Label> Labels {
get {
return this.labelsField;
}
set {
this.labelsField = value;
}
}

/// <remarks/>
public InvoiceConnector.InvoiceType InvoiceType
{
Expand Down Expand Up @@ -1709,4 +1722,25 @@ public string VAT
}
}
}

/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "2.0.50727.3038")]
[System.SerializableAttribute()]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true)]
public partial class Label
{
private string idField;

/// <remarks/>
public string Id {
get {
return this.idField;
}
set {
this.idField = value;
}
}
}
}
49 changes: 49 additions & 0 deletions FortnoxAPILibrary/Entities/Label.cs
@@ -0,0 +1,49 @@
//------------------------------------------------------------------------------
// <auto-generated>
// Denna kod har genererats av ett verktyg.
// Körtidsversion:2.0.50727.5466
//
// Ändringar i denna fil kan orsaka fel och kommer att förloras om
// koden återgenereras.
// </auto-generated>
//------------------------------------------------------------------------------

using System.Xml.Serialization;

//
// This source code was auto-generated by xsd, Version=2.0.50727.1432.
//

namespace FortnoxAPILibrary {
/// <remarks/>
public partial class Label {


private string descriptionField;

private string urlField = "";


/// <remarks/>
public string Description {
get {
return this.descriptionField;
}
set {
this.descriptionField = value;
}
}

/// <summary>This field is Read-Only in Fortnox</summary>
[System.ComponentModel.ReadOnly(true)]
[System.Xml.Serialization.XmlAttributeAttribute()]
public string url {
get {
return this.urlField;
}
set {
this.urlField = value;
}
}
}
}
126 changes: 126 additions & 0 deletions FortnoxAPILibrary/Entities/Labels.cs
@@ -0,0 +1,126 @@
//------------------------------------------------------------------------------
// <auto-generated>
// Denna kod har genererats av ett verktyg.
// Körtidsversion:2.0.50727.5466
//
// Ändringar i denna fil kan orsaka fel och kommer att förloras om
// koden återgenereras.
// </auto-generated>
//------------------------------------------------------------------------------

using System.Xml.Serialization;
using System.Collections.Generic;

//
// This source code was auto-generated by xsd, Version=2.0.50727.1432.
//

namespace FortnoxAPILibrary {
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "2.0.50727.1432")]
[System.SerializableAttribute()]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true)]
[System.Xml.Serialization.XmlRootAttribute(Namespace = "", IsNullable = false)]
public partial class Labels {

private List<LabelSubset> labelSubsetField;

private string totalResourcesField;

private string totalPagesField;

private string currentPageField;

/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute("LabelSubset", Form = System.Xml.Schema.XmlSchemaForm.Unqualified)]
public List<LabelSubset> LabelSubset {
get {
return this.labelSubsetField;
}
set {
this.labelSubsetField = value;
}
}

/// <remarks/>
[System.Xml.Serialization.XmlAttributeAttribute()]
public string TotalResources {
get {
return this.totalResourcesField;
}
set {
this.totalResourcesField = value;
}
}

/// <remarks/>
[System.Xml.Serialization.XmlAttributeAttribute()]
public string TotalPages {
get {
return this.totalPagesField;
}
set {
this.totalPagesField = value;
}
}

/// <remarks/>
[System.Xml.Serialization.XmlAttributeAttribute()]
public string CurrentPage {
get {
return this.currentPageField;
}
set {
this.currentPageField = value;
}
}
}

/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "2.0.50727.1432")]
[System.SerializableAttribute()]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true)]
public partial class LabelSubset {

private string idField;

private string descriptionField;

private string urlField;

/// <remarks/>
public string Id {
get {
return this.idField;
}
set {
this.idField = value;
}
}

/// <remarks/>
public string Description {
get {
return this.descriptionField;
}
set {
this.descriptionField = value;
}
}

/// <remarks/>
[System.Xml.Serialization.XmlAttributeAttribute()]
public string url {
get {
return this.urlField;
}
set {
this.urlField = value;
}
}
}
}

0 comments on commit cdc26ed

Please sign in to comment.