public async Task <IActionResult> PutCanBoBenhVien(int id, CanBoBenhVien canBoBenhVien)
        {
            if (id != canBoBenhVien.Id)
            {
                return(BadRequest());
            }

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

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

            return(NoContent());
        }
Exemple #2
0
        public async Task <IActionResult> PutBoPhan(int id, BoPhanViewModel boPhan)
        {
            if (id != boPhan.Id)
            {
                return(BadRequest());
            }

            var boPhanV = Mapper.Map <BoPhanViewModel, BoPhan>(boPhan);

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

            return(NoContent());
        }
Exemple #3
0
        public async Task <IActionResult> PutMauKhaoSat(int id, MauKhaoSat mauKhaoSat)
        {
            if (id != mauKhaoSat.Id)
            {
                return(BadRequest());
            }

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

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

            return(NoContent());
        }
        public async Task <IActionResult> PutChiTietPhieuDanhGia(int id, ChiTietPhieuDanhGia chiTietPhieuDanhGia)
        {
            if (id != chiTietPhieuDanhGia.Id)
            {
                return(BadRequest());
            }

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

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

            return(NoContent());
        }
Exemple #5
0
        public async Task <IActionResult> PutPhieuDanhGia(int id, PhieuDanhGia phieuDanhGia)
        {
            if (id != phieuDanhGia.Id)
            {
                return(BadRequest());
            }
            phieuDanhGia.NgayCapNhat = DateTime.Now;

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

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

            return(NoContent());
        }
Exemple #6
0
 public async Task SaveChange()
 {
     await _dbContext.SaveChangesAsync();
 }