Exemple #1
0
        private User CreateBasicUser(Employee employee)
        {
            var maxValue = employee.TerminationDate ?? System.TimeZoneInfo.ConvertTimeToUtc(DateTime.MaxValue);
            var minValue = DateTime.MinValue;
            var password = employee.Password;

            return(User.CreateBasicUser(null, employee.Username, employee.FirstName, employee.LastName, password, null,
                                        null, null, minValue, maxValue, null, null,
                                        null, null));
        }
Exemple #2
0
        public async Task UpdateEmployee(Employee employee)
        {
            var user = CreateBasicUser(employee);

#if !DEBUG
            await _api.CallAsync <Id>("Update", typeof(User), new { entity = user });
#else
            Thread.Sleep(300);
            await Task.CompletedTask;
#endif
        }
Exemple #3
0
 public async Task DeleteEmployee(Employee employee)
 {
     await UpdateEmployee(employee); //Cannot delete in Geotab: only deactivate
 }