Ejemplo n.º 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.");
         }
     }
 }
Ejemplo n.º 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);
            }
        }