private void SaveActivity() { var entry = new RedmineTimeEntry(TimeEntryOrigin.NewInLogger, CreateTimeEntry()); Messenger.Default.Send(new AddNewTimeEntryMessage(entry)); //Mode = TimeEntryDetailsMode.Display; }
private void AddNewEntry(RedmineTimeEntry entry) { var day = Days.FirstOrDefault(d => d.Day.Date == entry?.TimeEntryInfo?.SpentOn?.Date); day?.TimeEntries.Add(entry); RefreshPeriodTotalHours(); _saveEntriesCommand.RaiseCanExecuteChanged(); }
private void RemoveEntry(RedmineTimeEntry entry) { var entryDay = entry?.TimeEntryInfo?.SpentOn; if (entryDay == null) { throw new InvalidOperationException("Invalid Entry to remove"); } var day = Days.SingleOrDefault(d => d.Day.Date == entryDay.Value.Date); if (day == null) { throw new InvalidOperationException("Day of Entry to be removed couldn't be found"); } day.TimeEntries.Remove(entry); }
public async Task <string> CreateTimeEntryAsync(RedmineTimeEntry timeEntry) { if (timeEntry == null) { throw new ArgumentNullException(nameof(timeEntry)); } var projectInternalId = await GetProjectInternalIdAsync(timeEntry.ProjectId); var issueInternalId = await GetIssueInternalIdAsync(timeEntry.IssueId); var internalTimeEntry = new TimeEntry { Project = projectInternalId, Issue = issueInternalId, SpentOn = timeEntry.WorkDate, Hours = Convert.ToDecimal(timeEntry.SpentTime.TotalHours), Comments = timeEntry.Comment }; var createdEntry = await _client.Create(internalTimeEntry); return(createdEntry.Id.ToString()); }
public TimeEntrySelectedMessage(RedmineTimeEntry timeEntry) { TimeEntry = timeEntry; }
public RemoveEntryMessage(RedmineTimeEntry timeEntry) { TimeEntry = timeEntry; }
public AddNewTimeEntryMessage(RedmineTimeEntry entry) { Entry = entry; }