Esempio n. 1
0
        public async Task <IActionResult> CreateTeamSalary(TeamSalaryCreationDto teamSalaryDto)
        {
            var teamSalaryToCreate = new TeamSalary
            {
                AvailableSalary = teamSalaryDto.AvailableSalary,
                UserId          = teamSalaryDto.UserId
            };


            var createdSalary = await _repo.CreateTeamSalary(teamSalaryToCreate);

            return(StatusCode(201));
        }
Esempio n. 2
0
        public async Task <IActionResult> UpdateTeamSalary(TeamSalaryCreationDto teamSalaryDto)
        {
            var salaryToUpdate = new TeamSalary
            {
                Id = teamSalaryDto.Id,
                AvailableSalary = teamSalaryDto.AvailableSalary,
                UserId          = teamSalaryDto.UserId
            };


            var updateSalary = await _repo.UpdateTeamSalary(salaryToUpdate);

            return(StatusCode(201));
        }
Esempio n. 3
0
 public async Task <bool> UpdateTeamSalary(TeamSalary teamSalary)
 {
     _content.TeamSalary.Update(teamSalary);
     return(await _content.SaveChangesAsync() > 0);
 }
Esempio n. 4
0
        public async Task <bool> CreateTeamSalary(TeamSalary teamSalary)
        {
            await _content.TeamSalary.AddAsync(teamSalary);

            return(await _content.SaveChangesAsync() > 0);
        }