public async Task <IActionResult> Edit(int id, [Bind("ID,JobbookCompanyName,JobbookCompanyDescription,JobbookCompanyWebsite,JobbookCompanyEmail,JobbookCompanyTel")] JobbookCompanyModel jobbookCompanyModel) { if (id != jobbookCompanyModel.ID) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(jobbookCompanyModel); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!JobbookCompanyModelExists(jobbookCompanyModel.ID)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(jobbookCompanyModel)); }
public async Task <IActionResult> Create([Bind("ID,JobbookCompanyName,JobbookCompanyDescription,JobbookCompanyWebsite,JobbookCompanyEmail,JobbookCompanyTel")] JobbookCompanyModel jobbookCompanyModel) { if (ModelState.IsValid) { _context.Add(jobbookCompanyModel); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(jobbookCompanyModel)); }