-
Notifications
You must be signed in to change notification settings - Fork 0
/
Form1.cs
executable file
·32 lines (26 loc) · 929 Bytes
/
Form1.cs
1
2
3
4
5
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
using System;
using System.Windows.Forms;
using Xero.Api.Core.Model;
namespace XeroWinForm
{
public partial class XeroWinForm : Form
{
public XeroWinForm()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
/// first create an instance of the Xero API
var api = new Xero.Api.Example.Applications.Private.Core(false);
// create an instance of contact
Contact newContact = new Contact();
newContact.Name = "Metal Fencing"; // company name
newContact.FirstName = "John"; // first name
newContact.LastName = "Smith"; // last name
newContact.EmailAddress = "[email protected]"; // email
// call the API to create the contact
api.Contacts.Create(newContact);
}
}
}