Esempio n. 1
0
        public async Task <int> AddPersonnelEntry(PersonnelEntry personnelEntry)
        {
            using var _ = _connectionManager.GetConnection(transactionRequired: true);

            return(await _.Connection.QuerySingleAsync <int>(
                       "INSERT INTO Personnel VALUES (NULL, @FirstName, @LastName, @DateOfBirth, @EmploymentDate); SELECT last_insert_rowid();", personnelEntry, _.Transaction));
        }
Esempio n. 2
0
        public async Task UpdatePersonnelEntry(PersonnelEntry personnelEntry)
        {
            using var _ = _connectionManager.GetConnection(transactionRequired: true);

            await _.Connection.ExecuteAsync("UPDATE Personnel SET FirstName = @FirstName, LastName = @LastName, DateOfBirth = @DateOfBirth, EmploymentDate = @EmploymentDate WHERE PersonnelId = @PersonnelId;", personnelEntry, _.Transaction);
        }
 public Task UpdatePersonnelEntry(PersonnelEntry updateEntry)
 {
     return(_personnelRepository.UpdatePersonnelEntry(updateEntry));
 }
 public Task <int> AddPersonnelEntry(PersonnelEntry personnelEntry)
 {
     return(_personnelRepository.AddPersonnelEntry(personnelEntry));
 }