public async Task <IActionResult> PutEmployee(int id, Employee employee) { if (id != employee.EmployeeId) { return(BadRequest()); } _context.Entry(employee).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!EmployeeExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <IActionResult> PutSection(int id, Section section) { if (id != section.SectionId) { return(BadRequest()); } _context.Entry(section).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!SectionExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <IActionResult> PutBusinessDay(int id, BusinessDay businessDay) { if (id != businessDay.BusinessDayId) { return(BadRequest()); } _context.Entry(businessDay).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!BusinessDayExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <IActionResult> PutClassLevel(int id, ClassLevel classLevel) { if (id != classLevel.ClassLevelId) { return(BadRequest()); } _context.Entry(classLevel).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!ClassLevelExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <IActionResult> PutAcademicClass(int id, AcademicClass academicClass) { if (id != academicClass.AcademicClassId) { return(BadRequest()); } _context.Entry(academicClass).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!AcademicClassExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <IActionResult> PutInstituteInfo(int id, InstituteInfo instituteInfo) { if (id != instituteInfo.InstituteInfoId) { return(BadRequest()); } _context.Entry(instituteInfo).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!InstituteInfoExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <IActionResult> PutRoom(int id, Room room) { if (id != room.RoomId) { return(BadRequest()); } _context.Entry(room).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!RoomExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }