public async Task <IActionResult> Edit(int id, [Bind("ID,EstBid,ActlHours,EstHours,ActlCosts,EstCost,HoursRemaining,CostsRemaining,ProjectID")] BidReport bidReport) { if (id != bidReport.ID) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(bidReport); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!BidReportExists(bidReport.ID)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["ProjectID"] = new SelectList(_context.Projects, "ID", "Desc", bidReport.ProjectID); return(View(bidReport)); }
public async Task <IActionResult> Create([Bind("ID,EstBid,ActlHours,EstHours,ActlCosts,EstCost,HoursRemaining,CostsRemaining,ProjectID")] BidReport bidReport) { if (ModelState.IsValid) { _context.Add(bidReport); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["ProjectID"] = new SelectList(_context.Projects, "ID", "Desc", bidReport.ProjectID); return(View(bidReport)); }