public void Reload()
 {
     TimeEntryTypes.Clear();
     LoadData();
     EditTimeEntry.RaiseCanExecuteChanged();
     CreateTimeEntry.RaiseCanExecuteChanged();
 }
Exemple #2
0
        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
            });
        }
Exemple #3
0
 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));
     }
 }