public async Task <IActionResult> Edit(int id, [Bind("DailyLaborId,Name,OnDate,IsPresent,IsDailyBillable,Amount,ExtraAmount,Remarks")] DailyLabor dailyLabor) { if (id != dailyLabor.DailyLaborId) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(dailyLabor); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!DailyLaborExists(dailyLabor.DailyLaborId)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(dailyLabor)); }
public async Task <IActionResult> Create([Bind("DailyLaborId,Name,OnDate,IsPresent,IsDailyBillable,Amount,ExtraAmount,Remarks")] DailyLabor dailyLabor) { if (ModelState.IsValid) { _context.Add(dailyLabor); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(dailyLabor)); }