public async Task <IActionResult> Edit(int id, [Bind("Id,CFirstName,CLastName,UserId,CEmail,Topic,Message,ContactDate")] ContactForm contactForm) { if (id != contactForm.Id) { return(NotFound()); } if (ModelState.IsValid) { try { string date = contactForm.ContactDate; _context.Update(contactForm); contactForm.ContactDate = date; _context.Update(contactForm); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!ContactFormExists(contactForm.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(contactForm)); }
public async Task <IActionResult> Edit(int id, [Bind("Id,UserId,StartDate,EndDate,RequestMade,FirstName,LastName,NAUEmail,ProjectName,ProjectObjective,ContactName,ContactID,Funding,SponsorName,SponsorPhone,SponsorEmail,Chemicals,MeetingTimes,GroupMembers,ProjectFile,Status,OwnerID")] Request request) { if (id != request.Id) { return(NotFound()); } if (ModelState.IsValid) { try { //request.OwnerID = request.OwnerID; _context.Update(request); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!RequestExists(request.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(request)); }
public async Task <IActionResult> Edit(int id, [Bind("Id,Name,StartDate,EndDate")] BioRaft bioRaft) { if (id != bioRaft.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(bioRaft); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!BioRaftExists(bioRaft.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(bioRaft)); }
public async Task <IActionResult> Edit(int id, [Bind("Id,Name,CASNum,Manufacturer,HasMSDS,HealthHazard,FlammableHazard,ReactiveHazard,OtherHazard,CurrentQty,Unit,DateReceived,IsCheckedOut,DateCheckedOut,DateReturned,Location,Consumed,HazWaste,Disposed")] Inventory inventory) { if (id != inventory.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(inventory); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!InventoryExists(inventory.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(inventory)); }