Exemplo n.º 1
0
        private async Task stopTimeEntry()
        {
            isStopButtonEnabled = false;
            StopTimeEntryCommand.RaiseCanExecuteChanged();

            await dataSource.TimeEntries.Stop(timeService.CurrentDateTime)
            .Do(_ => dataSource.SyncManager.PushSync());

            CurrentTimeEntryElapsedTime = TimeSpan.Zero;
        }
Exemplo n.º 2
0
        private async Task stopTimeEntry()
        {
            OnboardingStorage.StopButtonWasTapped();

            isStopButtonEnabled = false;
            StopTimeEntryCommand.RaiseCanExecuteChanged();

            await dataSource.TimeEntries.Stop(timeService.CurrentDateTime)
            .Do(dataSource.SyncManager.InitiatePushSync);

            CurrentTimeEntryElapsedTime = TimeSpan.Zero;
        }
Exemplo n.º 3
0
        private async Task stopTimeEntry()
        {
            OnboardingStorage.StopButtonWasTapped();

            isStopButtonEnabled = false;
            StopTimeEntryCommand.RaiseCanExecuteChanged();

            await interactorFactory
            .StopTimeEntry(timeService.CurrentDateTime)
            .Execute()
            .Do(_ => intentDonationService.DonateStopCurrentTimeEntry())
            .Do(dataSource.SyncManager.InitiatePushSync);

            CurrentTimeEntryElapsedTime = TimeSpan.Zero;
        }
Exemplo n.º 4
0
        private void setRunningEntry(IDatabaseTimeEntry timeEntry)
        {
            CurrentTimeEntryId          = timeEntry?.Id;
            currentTimeEntryStart       = timeEntry?.Start;
            CurrentTimeEntryDescription = timeEntry?.Description ?? "";

            CurrentTimeEntryTask         = timeEntry?.Task?.Name ?? "";
            CurrentTimeEntryProject      = timeEntry?.Project?.Name ?? "";
            CurrentTimeEntryProjectColor = timeEntry?.Project?.Color ?? "";
            CurrentTimeEntryClient       = timeEntry?.Project?.Client?.Name ?? "";

            ChangePresentation(new CardVisibilityHint(CurrentTimeEntryId != null));

            isStopButtonEnabled = timeEntry != null;

            StopTimeEntryCommand.RaiseCanExecuteChanged();
            StartTimeEntryCommand.RaiseCanExecuteChanged();
            EditTimeEntryCommand.RaiseCanExecuteChanged();
        }
Exemplo n.º 5
0
        private void setRunningEntry(IThreadSafeTimeEntry timeEntry)
        {
            CurrentTimeEntryId          = timeEntry?.Id;
            currentTimeEntryStart       = timeEntry?.Start;
            CurrentTimeEntryDescription = timeEntry?.Description ?? "";
            CurrentTimeEntryElapsedTime = timeService.CurrentDateTime - currentTimeEntryStart ?? TimeSpan.Zero;

            CurrentTimeEntryTask         = timeEntry?.Task?.Name ?? "";
            CurrentTimeEntryProject      = timeEntry?.Project?.DisplayName() ?? "";
            CurrentTimeEntryProjectColor = timeEntry?.Project?.DisplayColor() ?? "";
            CurrentTimeEntryClient       = timeEntry?.Project?.Client?.Name ?? "";

            isStopButtonEnabled = timeEntry != null;

            StopTimeEntryCommand.RaiseCanExecuteChanged();
            StartTimeEntryCommand.RaiseCanExecuteChanged();
            EditTimeEntryCommand.RaiseCanExecuteChanged();

            RaisePropertyChanged(nameof(IsTimeEntryRunning));
        }