Exemple #1
0
        public async Task <IActionResult> Edit(int id, [Bind("ID,EstimatedBid,ActualDesingHours,EstimatedDesingHours,ActualDesingCost,EstimatedDesingCost,Hours,Remaining,ProjectID")] BidStageReport bidStageReport)
        {
            if (id != bidStageReport.ID)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(bidStageReport);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!BidStageReportExists(bidStageReport.ID))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["ProjectID"] = new SelectList(_context.Projects, "ID", "Name", bidStageReport.ProjectID);
            return(View(bidStageReport));
        }
Exemple #2
0
        public async Task <IActionResult> Create([Bind("ID,EstimatedBid,ActualDesingHours,EstimatedDesingHours,ActualDesingCost,EstimatedDesingCost,Hours,Remaining,ProjectID")] BidStageReport bidStageReport)
        {
            if (ModelState.IsValid)
            {
                _context.Add(bidStageReport);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["ProjectID"] = new SelectList(_context.Projects, "ID", "Name", bidStageReport.ProjectID);
            return(View(bidStageReport));
        }