public async Task <IActionResult> Edit(int id, [Bind("ID,Submitter,SubmissionDate,ProjectID")] ProductionWorkReport productionWorkReport) { if (id != productionWorkReport.ID) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(productionWorkReport); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!ProductionWorkReportExists(productionWorkReport.ID)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["ProjectID"] = new SelectList(_context.Projects, "ID", "Desc", productionWorkReport.ProjectID); return(View(productionWorkReport)); }
public async Task <IActionResult> Create([Bind("ID,Submitter,SubmissionDate")] ProductionWorkReport productionWorkReport) { if (ModelState.IsValid) { _context.Add(productionWorkReport); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(productionWorkReport)); }
public async Task <IActionResult> Create([Bind("ID,Submitter,SubmissionDate,ProjectID")] ProductionWorkReport productionWorkReport) { if (ModelState.IsValid) { _context.Add(productionWorkReport); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["ProjectID"] = new SelectList(_context.Projects, "ID", "Desc", productionWorkReport.ProjectID); return(View(productionWorkReport)); }