public async Task <IActionResult> PostTbRApprove([FromBody] TbRApprove tbRApprove)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            _context.TbRApprove.Add(tbRApprove);
            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateException)
            {
                if (TbRApproveExists(tbRApprove.YearActive))
                {
                    return(new StatusCodeResult(StatusCodes.Status409Conflict));
                }
                else
                {
                    throw;
                }
            }

            return(CreatedAtAction("GetTbRApprove", new { id = tbRApprove.YearActive }, tbRApprove));
        }
        public async Task <IActionResult> PutTbRApprove([FromRoute] short id, [FromBody] TbRApprove tbRApprove)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

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

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

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

            return(NoContent());
        }