Esempio n. 1
0
        public async Task <IActionResult> PutUser(Guid id, User user)
        {
            if (id != user.Id)
            {
                return(BadRequest());
            }

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

            ChangeLog.AddUpdatedLog(_context, "Users", user);

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

            return(NoContent());
        }
Esempio n. 2
0
        public async Task <IActionResult> PutTableConsecutive(Guid id, TableConsecutive tableConsecutive)
        {
            if (id != tableConsecutive.Id)
            {
                return(BadRequest());
            }

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

            ChangeLog.AddUpdatedLog(_context, "TableConsecutives", tableConsecutive);

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

            return(NoContent());
        }
Esempio n. 3
0
        public async Task <IActionResult> PutProductMovie(string id, ProductMovie productMovie)
        {
            if (id != productMovie.Code)
            {
                return(BadRequest());
            }

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

            ChangeLog.AddUpdatedLog(_context, "Movies", productMovie);

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

            return(NoContent());
        }
Esempio n. 4
0
        public async Task <IActionResult> PutProductBookSubject(Guid id, ProductBookSubject productBookSubject)
        {
            if (id != productBookSubject.Id)
            {
                return(BadRequest());
            }

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

            ChangeLog.AddUpdatedLog(_context, "BookSubjects", productBookSubject);

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

            return(NoContent());
        }
Esempio n. 5
0
        public async Task <IActionResult> PutSystemConfiguration(Guid id, SystemConfiguration systemConfiguration)
        {
            if (id != systemConfiguration.Id)
            {
                return(BadRequest());
            }

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

            ChangeLog.AddUpdatedLog(_context, "SystemConfigurations", systemConfiguration);

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

            return(NoContent());
        }