Example #1
0
        public async Task <IActionResult> PutProjects(int id, Jobs jobs)
        {
            if (id != jobs.Id)
            {
                return(BadRequest());
            }

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

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

            return(NoContent());
        }
Example #2
0
        public async Task <IActionResult> PutTypesOfLeave(int id, TypesOfLeave typesOfLeave)
        {
            if (id != typesOfLeave.Id)
            {
                return(BadRequest());
            }

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

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

            return(NoContent());
        }
        public async Task <IActionResult> PutUserHardware(int id, UserHardware userHardware)
        {
            if (id != userHardware.Id)
            {
                return(BadRequest());
            }

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

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

            return(NoContent());
        }