public async Task <IActionResult> Edit(int id, [Bind("CostId,DailyRate,HourlyRate,MonthlyIncome,MonthlyRate,PercentSalaryHike,StandardHours")] CompanyCost companyCost) { if (id != companyCost.CostId) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(companyCost); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!CompanyCostExists(companyCost.CostId)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(companyCost)); }
public async Task <IActionResult> Create([Bind("CostId,DailyRate,HourlyRate,MonthlyIncome,MonthlyRate,PercentSalaryHike,StandardHours")] CompanyCost companyCost) { if (ModelState.IsValid) { _context.Add(companyCost); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(companyCost)); }