public async Task <IActionResult> Edit(int id, [Bind("id,AgentName,email,phone,bid,comments")] BidII bidII) { if (id != bidII.id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(bidII); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!BidIIExists(bidII.id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(bidII)); }
// GET: BidIIS/Create public IActionResult Create() //Generates empty table for user to fill out. { BidII NewBid = new BidII() { AgentName = _context.AgentLoggedIn.LastOrDefault().LoggedInName, email = _context.AgentLoggedIn.LastOrDefault().LoggedInEmail, phone = (int)_context.AgentLoggedIn.LastOrDefault().LoggedInPhone }; return(View(NewBid)); }
public async Task <IActionResult> Create([Bind("id,AgentName,email,phone,bid,comments")] BidII bidII) //ADDS data from from to table. { if (ModelState.IsValid) { _context.Add(bidII); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } //return View(bidII); return(RedirectToAction("ThankYou", "BidIIS")); }