コード例 #1
0
        public async Task <IActionResult> EditCompany(string id, EditOrgStructureGenericDto companyDto)
        {
            if (id != companyDto.Id)
            {
                return(BadRequest());
            }

            try
            {
                var company = new Company()
                {
                    Id   = companyDto.Id,
                    Name = companyDto.Name
                };

                await _orgStructureService.EditCompanyAsync(company);
            }
            catch (Exception ex)
            {
                _logger.LogError(ex.Message);
                return(StatusCode(500, new { error = ex.Message }));
            }

            return(NoContent());
        }
コード例 #2
0
        public async Task <IActionResult> EditPosition(string id, EditOrgStructureGenericDto positionDto)
        {
            if (id != positionDto.Id)
            {
                return(BadRequest());
            }

            try
            {
                var position = new Position()
                {
                    Id   = positionDto.Id,
                    Name = positionDto.Name
                };

                await _orgStructureService.EditPositionAsync(position);
            }
            catch (Exception ex)
            {
                _logger.LogError(ex.Message);
                return(StatusCode(500, new { error = ex.Message }));
            }

            return(NoContent());
        }