Пример #1
0
        public async Task <IActionResult> Delete(int id)
        {
            var retVal = await _companyRepo.Delete(id);

            _logger.LogInformation($"DELETED {id}");
            return(Ok());
        }
Пример #2
0
        public async Task <IActionResult> DeleteDepartment(int id)
        {
            if (await _departmentRepository.Delete(id))
            {
                return(NoContent());
            }

            return(BadRequest());
        }
        public async Task <IActionResult> DeleteCompany(int id)
        {
            if (await _companyRepository.Delete(id))
            {
                return(NoContent());
            }

            return(BadRequest());
        }
Пример #4
0
        public async Task <IActionResult> DeleteCompany(int id)
        {
            bool retval = await _companyRepository.Delete(id);

            if (retval == false)
            {
                return(StatusCode(StatusCodes.Status400BadRequest));
            }

            return(StatusCode(StatusCodes.Status204NoContent));
        }
Пример #5
0
        public async Task <IActionResult> DeleteDepartment(int id)
        {
            bool retval = await _departmentInterface.Delete(id);

            if (retval == false)
            {
                return(StatusCode(StatusCodes.Status400BadRequest));
            }

            return(StatusCode(StatusCodes.Status204NoContent));
        }
        public async Task <IActionResult> Delete(int id)
        {
            var retVal = await _employeeRepository.Delete(id);

            if (retVal)
            {
                _logger.LogInformation("successful");
                return(StatusCode(StatusCodes.Status200OK, $"Deleted {id}"));
            }
            _logger.LogWarning("Bad Request");
            return(StatusCode(StatusCodes.Status400BadRequest));
        }
Пример #7
0
        public async Task <IActionResult> DeleteEmployee(int id)
        {
            bool retval = await _employeeRepository.Delete(id);

            if (retval == false)
            {
                return(StatusCode(StatusCodes.Status400BadRequest));
            }

            _logger.LogInformation("Employee deleted.");
            return(StatusCode(StatusCodes.Status204NoContent));
        }
        public async Task <IActionResult> DeleteEmployee(int id)
        {
            if (id > 1)
            {
                throw new Helper.RepoException(Helper.RepoResultType.WRONGPARAMETER);
            }

            if (await _employeeRepository.Delete(id))
            {
                return(NoContent());
            }

            return(BadRequest());
        }
Пример #9
0
 public bool Delete(int id)
 {
     return _companyRepository.Delete(id);
 }
 public bool Delete(int id)
 {
     return(_employeeRepository.Delete(id));
 }
 public bool Delete(int id = 0)
 {
     return(_companyRepository.Delete(id));
 }