private async static Task DisplayTabluarData(int employeeId, BambooHrTableType tableType) { var bambooHrClient = new BambooHrClient(); var data = await bambooHrClient.GetTabularData(employeeId.ToString(), tableType); foreach (var row in data) { foreach (var key in row.Keys) { Console.WriteLine(row[key]); } } }
private static void DisplayEmployeePhotoUrl(string workEmail) { var bambooHrClient = new BambooHrClient(); var photoUrl = bambooHrClient.GetEmployeePhotoUrl(workEmail); Console.WriteLine($"The photo URL for {workEmail} is '{photoUrl}'."); }
private async static Task <bool> UpdateEmployee(BambooHrEmployee bambooHrEmployee) { var bambooHrClient = new BambooHrClient(); await bambooHrClient.UpdateEmployee(bambooHrEmployee); Console.WriteLine($"Updated employee with ID {bambooHrEmployee.Id}"); return(true); }
private async static Task <BambooHrEmployee> GetEmployee(int employeeId) { var bambooHrClient = new BambooHrClient(); var employee = await bambooHrClient.GetEmployee(employeeId); Console.WriteLine($"Got employee with ID {employee.Id}"); return(employee); }
private async static Task DownloadEmployeePhoto(int employeeId) { var bambooHrClient = new BambooHrClient(); var fileData = await bambooHrClient.GetEmployeePhoto(employeeId); File.WriteAllBytes(@"C:\test.jpeg", fileData); Console.WriteLine("Photo downloaded."); }
private async static Task UploadloadEmployeePhoto(int employeeId) { var bambooHrClient = new BambooHrClient(); var binaryData = File.ReadAllBytes(@"C:\test.jpeg"); var fileData = await bambooHrClient.UploadEmployeePhoto(employeeId, binaryData, "test.jpeg"); Console.WriteLine("Photo uploaded."); }
private async static Task DisplayWhosOut() { var bambooHrClient = new BambooHrClient(); var whosOut = await bambooHrClient.GetWhosOut(); foreach (var whosOutInfo in whosOut) { Console.WriteLine(whosOutInfo.PropsToString()); } }
private async static Task DisplayFields() { var bambooHrClient = new BambooHrClient(); var fields = await bambooHrClient.GetFields(); foreach (var field in fields) { Console.WriteLine(field.PropsToString()); } }
private async static Task DisplayAssignedTimeOffPolicies(int employeeId) { var bambooHrClient = new BambooHrClient(); var timeOffPolicies = await bambooHrClient.GetAssignedTimeOffPolicies(employeeId); foreach (var timeOffPolicy in timeOffPolicies) { Console.WriteLine(timeOffPolicy.PropsToString()); } }
public async static Task DisplayTimeOffPolicies() { var bambooHrClient = new BambooHrClient(); var timeOffPolicies = await bambooHrClient.GetTimeOffPolicies(); foreach (var timeOffPolicy in timeOffPolicies) { Console.WriteLine(timeOffPolicy.PropsToString()); } }
public async static Task DisplayUsers() { var bambooHrClient = new BambooHrClient(); var users = await bambooHrClient.GetUsers(); foreach (var user in users) { Console.WriteLine(user.PropsToString()); } }
public async static Task DisplayLastChangedInfo() { var bambooHrClient = new BambooHrClient(); var users = await bambooHrClient.GetLastChangedInfo(DateTime.Now.AddDays(-7)); foreach (var user in users) { Console.WriteLine(user.PropsToString()); } }
public async static void ListHolidays() { var bambooHrClient = new BambooHrClient(); var holidays = await bambooHrClient.GetHolidays(DateTime.Now, DateTime.Now.AddYears(1)); foreach (var holiday in holidays) { Console.WriteLine("{0} {1} {2}", holiday.Id, holiday.Start.ToString(Constants.BambooHrDateFormat), holiday.Name); } }
private async static Task DisplayFutureTimeOffBalanceEstimates(int employeeId) { var bambooHrClient = new BambooHrClient(); var estimates = await bambooHrClient.GetFutureTimeOffBalanceEstimates(employeeId); foreach (var estimate in estimates) { Console.WriteLine(estimate.PropsToString()); } }
private async static Task DisplayTabluarData(int employeeId, BambooHrTableType tableType) { var bambooHrClient = new BambooHrClient(); var data = await bambooHrClient.GetTabularData(employeeId.ToString(), tableType); foreach (var row in data) { foreach (var key in row.Keys) { Console.WriteLine(row[key]); } } }
private async static Task AddOrUpdateListValues(int listId) { var values = new List <BambooHrListFieldOption> { new BambooHrListFieldOption { Value = "New Option" } }; var bambooHrClient = new BambooHrClient(); var results = await bambooHrClient.AddOrUpdateListValues(listId, values); Console.WriteLine("List values added/updated"); }
private async static void DisplayEmployeeInfos() { var bambooHrClient = new BambooHrClient(); var employees = await bambooHrClient.GetEmployees(); foreach (var employee in employees) { Console.WriteLine(employee.LastFirst); } // Display the details of the last employee in the list to compare to the regular GetEmployee call Console.WriteLine(); Console.WriteLine(employees.Last().PropsToString()); }
private async static void AddEmployee(string firstName, string lastName, string workEmail) { var bambooHrClient = new BambooHrClient(); var bambooHrEmployee = new BambooHrEmployee { FirstName = firstName, LastName = lastName, WorkEmail = workEmail }; var url = await bambooHrClient.AddEmployee(bambooHrEmployee); Console.WriteLine($"Employee created at {url}"); Console.WriteLine(bambooHrEmployee.PropsToString()); }
private async static Task DisplayTabularFields() { var bambooHrClient = new BambooHrClient(); var tables = await bambooHrClient.GetTabularFields(); foreach (var table in tables) { Console.WriteLine(); Console.WriteLine(table.Alias); foreach (var field in table.Fields) { Console.WriteLine(field.PropsToString()); } } }
private async static Task DisplayListFieldDetails() { var bambooHrClient = new BambooHrClient(); var fields = await bambooHrClient.GetListFieldDetails(); foreach (var field in fields) { Console.WriteLine(); Console.WriteLine(field.PropsToString()); foreach (var option in field.Options) { Console.WriteLine(option.PropsToString()); } } }
public async static Task DisplayTimeOffTypesByPermissions() { var bambooHrClient = new BambooHrClient(); var timeOffInfo = await bambooHrClient.GetTimeOffTypes("request"); Console.WriteLine("Time Off Types:"); foreach (var timeOffType in timeOffInfo.TimeOffTypes) { Console.WriteLine(timeOffType.PropsToString()); } Console.WriteLine("Default Hours:"); foreach (var defaultHour in timeOffInfo.DefaultHours) { Console.WriteLine(defaultHour.PropsToString()); } }
public async static Task <int> CreateTimeOffRequest() { var userId = 5; var reason = "vacation"; var startDate = DateTime.Now; var endDate = DateTime.Now.AddDays(1); var timeOffTypeId = GetTimeOffTypeId(reason); var bambooHrClient = new BambooHrClient(); var employee = bambooHrClient.GetEmployee(userId); var result = await bambooHrClient.CreateTimeOffRequest(employee.Id, timeOffTypeId, startDate, endDate); Console.WriteLine($"Result: {result}"); return(result); }
private async static Task DisplayFutureTimeOffBalanceEstimates(int employeeId) { var bambooHrClient = new BambooHrClient(); var estimates = await bambooHrClient.GetFutureTimeOffBalanceEstimates(employeeId); foreach (var estimate in estimates) { Console.WriteLine(estimate.PropsToString()); } }
private async static Task DownloadEmployeePhoto(int employeeId) { var bambooHrClient = new BambooHrClient(); var fileData = await bambooHrClient.GetEmployeePhoto(employeeId); File.WriteAllBytes(@"C:\test.jpeg", fileData); Console.WriteLine("Photo downloaded."); }
private async static Task DisplayWhosOut() { var bambooHrClient = new BambooHrClient(); var whosOut = await bambooHrClient.GetWhosOut(); foreach (var whosOutInfo in whosOut) { Console.WriteLine(whosOutInfo.PropsToString()); } }
private async static Task UploadloadEmployeePhoto(int employeeId) { var bambooHrClient = new BambooHrClient(); var binaryData = File.ReadAllBytes(@"C:\test.jpeg"); var fileData = await bambooHrClient.UploadEmployeePhoto(employeeId, binaryData, "test.jpeg"); Console.WriteLine("Photo uploaded."); }
private static void DisplayEmployeePhotoUrl(string workEmail) { var bambooHrClient = new BambooHrClient(); var photoUrl = bambooHrClient.GetEmployeePhotoUrl(workEmail); Console.WriteLine($"The photo URL for {workEmail} is '{photoUrl}'."); }
private async static Task<BambooHrEmployee> GetEmployee(int employeeId) { var bambooHrClient = new BambooHrClient(); var employee = await bambooHrClient.GetEmployee(employeeId); Console.WriteLine($"Got employee with ID {employee.Id}"); return employee; }
public async static Task<int> CreateTimeOffRequest() { var userId = 5; var reason = "vacation"; var startDate = DateTime.Now; var endDate = DateTime.Now.AddDays(1); var timeOffTypeId = GetTimeOffTypeId(reason); var bambooHrClient = new BambooHrClient(); var employee = bambooHrClient.GetEmployee(userId); var result = await bambooHrClient.CreateTimeOffRequest(employee.Id, timeOffTypeId, startDate, endDate); Console.WriteLine($"Result: {result}"); return result; }
private async static Task AddOrUpdateListValues(int listId) { var values = new List<BambooHrListFieldOption> { new BambooHrListFieldOption { Value="New Option" } }; var bambooHrClient = new BambooHrClient(); var results = await bambooHrClient.AddOrUpdateListValues(listId, values); Console.WriteLine("List values added/updated"); }
private async static Task DisplayListFieldDetails() { var bambooHrClient = new BambooHrClient(); var fields = await bambooHrClient.GetListFieldDetails(); foreach (var field in fields) { Console.WriteLine(); Console.WriteLine(field.PropsToString()); foreach (var option in field.Options) { Console.WriteLine(option.PropsToString()); } } }
public async static Task DisplayTimeOffPolicies() { var bambooHrClient = new BambooHrClient(); var timeOffPolicies = await bambooHrClient.GetTimeOffPolicies(); foreach (var timeOffPolicy in timeOffPolicies) { Console.WriteLine(timeOffPolicy.PropsToString()); } }
public async static Task DisplayTimeOffTypesByPermissions() { var bambooHrClient = new BambooHrClient(); var timeOffInfo = await bambooHrClient.GetTimeOffTypes("request"); Console.WriteLine("Time Off Types:"); foreach (var timeOffType in timeOffInfo.TimeOffTypes) { Console.WriteLine(timeOffType.PropsToString()); } Console.WriteLine("Default Hours:"); foreach (var defaultHour in timeOffInfo.DefaultHours) { Console.WriteLine(defaultHour.PropsToString()); } }
public async static Task DisplayUsers() { var bambooHrClient = new BambooHrClient(); var users = await bambooHrClient.GetUsers(); foreach (var user in users) { Console.WriteLine(user.PropsToString()); } }
public async static Task DisplayLastChangedInfo() { var bambooHrClient = new BambooHrClient(); var users = await bambooHrClient.GetLastChangedInfo(DateTime.Now.AddDays(-7)); foreach (var user in users) { Console.WriteLine(user.PropsToString()); } }
public async static void ListHolidays() { var bambooHrClient = new BambooHrClient(); var holidays = await bambooHrClient.GetHolidays(DateTime.Now, DateTime.Now.AddYears(1)); foreach (var holiday in holidays) { Console.WriteLine("{0} {1} {2}", holiday.Id, holiday.Start.ToString(Constants.BambooHrDateFormat), holiday.Name); } }
private async static Task DisplayAssignedTimeOffPolicies(int employeeId) { var bambooHrClient = new BambooHrClient(); var timeOffPolicies = await bambooHrClient.GetAssignedTimeOffPolicies(employeeId); foreach (var timeOffPolicy in timeOffPolicies) { Console.WriteLine(timeOffPolicy.PropsToString()); } }
private async static Task DisplayTabularFields() { var bambooHrClient = new BambooHrClient(); var tables = await bambooHrClient.GetTabularFields(); foreach (var table in tables) { Console.WriteLine(); Console.WriteLine(table.Alias); foreach (var field in table.Fields) { Console.WriteLine(field.PropsToString()); } } }
private async static Task<bool> UpdateEmployee(BambooHrEmployee bambooHrEmployee) { var bambooHrClient = new BambooHrClient(); await bambooHrClient.UpdateEmployee(bambooHrEmployee); Console.WriteLine($"Updated employee with ID {bambooHrEmployee.Id}"); return true; }
private async static Task DisplayFields() { var bambooHrClient = new BambooHrClient(); var fields = await bambooHrClient.GetFields(); foreach (var field in fields) { Console.WriteLine(field.PropsToString()); } }
private async static void DisplayEmployeeInfos() { var bambooHrClient = new BambooHrClient(); var employees = await bambooHrClient.GetEmployees(); foreach (var employee in employees) { Console.WriteLine(employee.LastFirst); } // Display the details of the last employee in the list to compare to the regular GetEmployee call Console.WriteLine(); Console.WriteLine(employees.Last().PropsToString()); }
private async static void AddEmployee(string firstName, string lastName, string workEmail) { var bambooHrClient = new BambooHrClient(); var bambooHrEmployee = new BambooHrEmployee { FirstName = firstName, LastName = lastName, WorkEmail = workEmail }; var url = await bambooHrClient.AddEmployee(bambooHrEmployee); Console.WriteLine($"Employee created at {url}"); Console.WriteLine(bambooHrEmployee.PropsToString()); }