C# Code Examples

This code sample simply gets the company name and displays it in a label. This is a good test to ensure you are successfully connecting to Attendance on Demand web services

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.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Net;
using System.Text;
using System.Windows.Forms;
using TestApp.CC1;

namespace TestApp
{
public partial class Form1 : Form
{
// Create an instance on the IAeXMLBridgeservice
IAeXMLBridgeservice cc1 = new IAeXMLBridgeservice();
// Create a network credential using an AoD Access Account
NetworkCredential aodCred = new NetworkCredential("YourAccessAccountName", "YourAccessAccountPassword", "");

public Form1()
{
InitializeComponent();

cc1.Credentials = aodCred;
cc1.PreAuthenticate = true;
cc1.Url = "https://youruri.attendanceondemand.com:8192/cc1exec.aew/soap/IAeXMLBridge";

lblCompanyName.Text = cc1.getCompanyName();
}
}
}

This code snippet will modify an employee’s first name (a single field value) for the employee whose ID number is ‘A123’

1
2
3
TAeEmployeeBasic emp = cc1.getEmployeeBasicByIDNum("A123");
emp.FirstName = "Mary";
cc1.maintainEmployeeBasic(emp, TAddEmpMode.aemAuto, TBadgeManagement.bmAuto);

This code snippet will populate a listbox with a list of Pay Designations extracted from the system

1
2
ddlPayDesignations.Items.Clear();
ddlPayDesignations.DataSource = cc1.getPayDesignationsSimple();

This code snippet will extract a list of all employees from the system and individually recompute each employee’s previous pay period

1
2
3
4
5
6
TAeEmployeeBasic[] emps = cc1.getEmployeesListBasicFromHyperQuery("All Employees");

foreach (TAeEmployeeBasic e in emps)
{
cc1.recomputeEmployeeByFilekey(e.Filekey, TPayPeriodEnum.ppePrevious);
}

Example Libraries