public async Task <IActionResult> Edit(int id, [Bind("Id,business_Name,business_Number,location,industry,date_Issued,issued_To,notice_Type,topic,pdf_URL")] WSNotice wSNotice) { if (id != wSNotice.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(wSNotice); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!WSNoticeExists(wSNotice.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(wSNotice)); }
public async Task <IActionResult> Create([Bind("Id,business_Name,business_Number,location,industry,date_Issued,issued_To,notice_Type,topic,pdf_URL")] WSNotice wSNotice) { if (ModelState.IsValid) { _context.Add(wSNotice); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(wSNotice)); }