public void Reload() { TimeEntryTypes.Clear(); LoadData(); EditTimeEntry.RaiseCanExecuteChanged(); CreateTimeEntry.RaiseCanExecuteChanged(); }
public async Task <CreateTimeEntryResponse> CreateTimeSheetEntry(CreateTimeEntry input) { var timeSheetEntry = Repository.Create(input.UserId, input.EntryDate); timeSheetEntry.Initialize(input.ProjectId, input.ProjectName, input.Hours); await UnitOfWork.Commit(); return(new CreateTimeEntryResponse { TimeEntryId = timeSheetEntry.Id }); }
public async Task <IHttpActionResult> CreateTimeSheetEntry([FromBody] CreateTimeEntry input) { try { return(Ok(await CommandService.CreateTimeSheetEntry(input))); } catch (Exception ex) { // To do -Logging // Can be fine tuned to throw a general exception instead of sending the server exception return(InternalServerError(ex)); } }