public async Task <IActionResult> PutBookList(int id, BookList bookList) { if (id != bookList.Id) { return(BadRequest()); } _context.Entry(bookList).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!BookListExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <IActionResult> Create([Bind("firstName,middleName,lastName,birthDate,hireDate,department,jobTitle,salary,salaryType,ID,availableHours")] employeeModel employeeModel) { if (ModelState.IsValid) { _context.Add(employeeModel); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(employeeModel)); }
public async Task <IActionResult> Create([Bind("empid,name,city")] emp emp) { if (ModelState.IsValid) { _context.Add(emp); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(emp)); }
public async Task <IActionResult> AddOrEdit([Bind("EmployeeId,FullName,EMPCode,Position,OfficeLocation")] Employee employee) { if (ModelState.IsValid) { _context.Add(employee); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(employee)); }