コード例 #1
0
 protected async void ManageImputedDay(ReviewTimeLine from)
 {
     if (this.IsInternetAndCloseModal())
     {
         try
         {
             var selectedDateTimesheet = TimeLineList.FirstOrDefault(x => x.Day == from.Day);
             if (selectedDateTimesheet.Day != null)
             {
                 var navigationParameters = new NavigationParameters();
                 var timesheetForDay      = new TimesheetForDay()
                 {
                     Day        = selectedDateTimesheet.Day,
                     Activities = selectedDateTimesheet.Activities,
                     Projects   = _currentReview?.Projects?.Values?.ToList()
                 };
                 navigationParameters.Add(TimesheetForDay.Tag, timesheetForDay);
                 navigationParameters.Add("IsVisibleButtonAdd", false);
                 await BaseModule.NavigationService.NavigateAsync(PageRoutes.GetKey <ManageImputedDayPage>(), navigationParameters);
             }
             else
             {
                 throw new ArgumentNullException();
             }
         }
         catch (Exception)
         {
             BaseModule.DialogService.ShowToast("Fail load Detail. Try Again.");
         }
     }
 }
コード例 #2
0
        protected async void LoadDataReviewByDate()
        {
            try
            {
                IsBusy = true;
                if (this.IsInternetAndCloseModal())
                {
                    _currentReview = await _reviewModule.ReviewService.GetReview(MyItemYearPicker.Value, MyItemMonthPicker.Value);

                    BtnSendReviewIsVisible = !(_currentReview.IsValidated || _currentReview.IsClosed);
                    ImputedTotal           = _currentReview.Activities.Sum(x => x.Value.Imputed);
                    DeviationTotal         = _currentReview.Activities.Sum(x => x.Value.Deviation);

                    TimeLineList = await _reviewModule.TimeLineService.GetListTimesheetForDay(_currentReview);

                    var listTemp = new ObservableCollection <ReviewTimeLine>();
                    TimeLineList.ForEach(x => listTemp.Add(ReviewTimeLine.Map(x)));
                    listTemp.Last().IsLast = true;
                    LstReview = listTemp;

                    IsBusy = false;
                }
            }
            catch (Exception ex)
            {
                IsBusy = false;
                BaseModule.DialogErrorCustomService.DialogErrorCommonTryAgain();
                Crashes.TrackError(ex);
            }
        }
コード例 #3
0
        public void StartStream(object paramter = null)
        {
            if (TwitterToken.IsAvailableToken())
            {
                stream = new TwitterUserStream();

                stream.StartStreaming(App.Usertoken, (status) =>
                                      App.Current.Dispatcher.Invoke(() => TimeLineList.Insert(0, status)));
                new WpfMessageBox("Streaming を開始しました", System.Windows.MessageBoxButton.OK).ShowDialog();
            }
            else
            {
                TwitterToken.GetToken();
            }
        }