public async Task <IActionResult> PutTaiKhoan(string id, TaiKhoan taiKhoan)
        {
            if (id != taiKhoan.Username)
            {
                return(BadRequest());
            }

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

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

            return(NoContent());
        }
Beispiel #2
0
        public async Task <IActionResult> PutHopDong(int id, HopDong hopDong)
        {
            if (id != hopDong.IdhopDong)
            {
                return(BadRequest());
            }

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

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

            return(NoContent());
        }
        public async Task <IActionResult> PutNhanVien(int id, NhanVien nhanVien)
        {
            if (id != nhanVien.IdnhanVien)
            {
                return(BadRequest());
            }

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

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

            return(NoContent());
        }
Beispiel #4
0
        public async Task <IActionResult> PutThuongNgayLe(int id, ThuongNgayLe thuongNgayLe)
        {
            if (id != thuongNgayLe.IdthuongLe)
            {
                return(BadRequest());
            }

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

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

            return(NoContent());
        }
        public async Task <IActionResult> PutTrinhDoDaoTao(int id, TrinhDoDaoTao trinhDoDaoTao)
        {
            if (id != trinhDoDaoTao.IdtrinhDo)
            {
                return(BadRequest());
            }

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

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

            return(NoContent());
        }
        public async Task <IActionResult> PutQuyetDinhBoNhiem(int id, QuyetDinhBoNhiem quyetDinhBoNhiem)
        {
            if (id != quyetDinhBoNhiem.IdquyetDinhBn)
            {
                return(BadRequest());
            }

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

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

            return(NoContent());
        }
        public async Task <IActionResult> PutDanToc(int id, DanToc danToc)
        {
            if (id != danToc.IddanToc)
            {
                return(BadRequest());
            }

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

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

            return(NoContent());
        }
        public async Task <IActionResult> PutChucVu(int id, ChucVu chucVu)
        {
            if (id != chucVu.IdchucVu)
            {
                return(BadRequest());
            }

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

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

            return(NoContent());
        }
        public async Task <IActionResult> PutChamCongTangCa(DateTime id, ChamCongTangCa chamCongTangCa)
        {
            if (id != chamCongTangCa.NgayChamCong)
            {
                return(BadRequest());
            }

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

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

            return(NoContent());
        }