Пример #1
0
        public async Task <IActionResult> PutDraftRisk([FromRoute] string id, [FromBody] DraftRisk draftRisk)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            _context.Entry(draftRisk).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!DraftRiskExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(NoContent());
        }
        public async Task <IActionResult> PutTbRControlDetail([FromRoute] short id, [FromBody] TbRControlDetail tbRControlDetail)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (id != tbRControlDetail.YearActive)
            {
                return(BadRequest());
            }

            _context.Entry(tbRControlDetail).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!TbRControlDetailExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(NoContent());
        }
        public async Task <IActionResult> PutTbMOperationalImpact([FromRoute] short id, [FromBody] TbMOperationalImpact tbMOperationalImpact)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }



            _context.Entry(tbMOperationalImpact).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!TbMOperationalImpactExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(NoContent());
        }
        public async Task <IActionResult> PutRiskreport([FromRoute] int id, [FromBody] Riskreport riskreport)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (id != riskreport.YearActive)
            {
                return(BadRequest());
            }

            _context.Entry(riskreport).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!RiskreportExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(NoContent());
        }
        public async Task <IActionResult> PutControlMapping([FromRoute] string id, [FromBody] ControlMapping controlMapping)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (id != controlMapping.Division)
            {
                return(BadRequest());
            }

            _context.Entry(controlMapping).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!ControlMappingExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(NoContent());
        }
        public async Task <IActionResult> PutTbRRiskAssessment([FromRoute] short id, [FromBody] TbRRiskAssessment tbRRiskAssessment)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }


            _context.Entry(tbRRiskAssessment).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                // if (!TbRRiskAssessmentExists(id))
                // {
                //     return NotFound();
                // }
                // else
                // {
                throw;
                // }
            }

            return(NoContent());
        }
        public async Task <IActionResult> PutTbMLibrary([FromRoute] string id, [FromBody] TbMLibrary tbMLibrary)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (id != tbMLibrary.Condition)
            {
                return(BadRequest());
            }

            _context.Entry(tbMLibrary).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!TbMLibraryExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(NoContent());
        }