コード例 #1
0
 public void Reload()
 {
     TimeEntryTypes.Clear();
     LoadData();
     EditTimeEntry.RaiseCanExecuteChanged();
     CreateTimeEntry.RaiseCanExecuteChanged();
 }
コード例 #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
            });
        }
コード例 #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));
     }
 }