Beispiel #1
0
 public IActionResult Add(TimeEntryViewModel timeEntryViewModel)
 {
     if (!ModelState.IsValid)
     {
         return(View(timeEntryViewModel));
     }
     else
     {
         //Remove this hard coded employee ID to the employee ID that is logged in
         //Leave this change for later
         timeEntryViewModel.TimeEntry.EmployeeID = 1;
         _timeEntryRepository.AddNewTimeEntry(timeEntryViewModel.TimeEntry);
     }
     PopulateProjectDropDown();
     return(RedirectToAction("List"));
 }