コード例 #1
0
 private void LoadMenu()
 {
     MenuList.Add(new MenuItem()
     {
         Icon     = "\uf0e4",
         Title    = "Dashboard",
         PageName = MasterModule.GetMasterNavigationPage(PageRoutes.GetKey <DashBoardPage>())
     });
     MenuList.Add(new MenuItem()
     {
         Icon     = "\uf073",
         Title    = "Timesheet",
         PageName = MasterModule.GetMasterNavigationPage(PageRoutes.GetKey <TimesheetPage>())
     });
     MenuList.Add(new MenuItem()
     {
         Icon     = "\uf06e",
         Title    = "Review",
         PageName = MasterModule.GetMasterNavigationPage(PageRoutes.GetKey <ReviewPage>())
     });
     MenuList.Add(new MenuItem()
     {
         Icon     = "\uf085",
         Title    = "Configuration",
         PageName = MasterModule.GetMasterNavigationPage(PageRoutes.GetKey <ConfigurationPage>())
     });
 }
コード例 #2
0
 protected void Close()
 {
     if (IsInternetAndCloseModal())
     {
         NavigateCommand.Execute(MasterModule.GetMasterNavigationPage(PageRoutes.GetKey <DashBoardPage>()));
     }
 }
コード例 #3
0
        protected void OnInfoActivityItem(ActivityDay from)
        {
            var navigationParameters = new NavigationParameters();

            navigationParameters.Add(ActivityDay.Tag, from);
            BaseModule.NavigationService.NavigateAsync(PageRoutes.GetKey <InfoActivityPopUpPage>(), navigationParameters, true, true);
        }
コード例 #4
0
        private async void SignIn()
        {
            try
            {
                IsBusy = true;
                if (Validate())
                {
                    var responseRequest = await BaseModule.AuthenticationService.Login(_email.Value, _password.Value);

                    if (responseRequest.Success)
                    {
                        NavigateCommand.Execute(MasterModule.GetMasterNavigationPage(PageRoutes.GetKey <DashBoardPage>()));
                    }
                    else
                    {
                        IsBusy = false;
                        await BaseModule.DialogService.ShowAlertAsync(responseRequest.Message, "Login error", "Ok");
                    }
                }
            }
            catch (ServiceAuthenticationException)
            {
                await BaseModule.DialogService.ShowAlertAsync("Please, try again", "Login error", "Ok");
            }
            catch (Exception)
            {
                await BaseModule.DialogService.ShowAlertAsync("An error occurred, try again", "Error", "Ok");
            }
            finally
            {
                IsBusy = false;
            }
        }
コード例 #5
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.");
         }
     }
 }
コード例 #6
0
        protected async void ManageImputedDay()
        {
            if (this.IsInternetAndCloseModal())
            {
                try
                {
                    var selectedDateTimesheet = _timesheetModule.TimesheetService.GetTimesheetByDate(_currentTimesheet, Dates.FirstOrDefault());
                    if (selectedDateTimesheet.Day != null)
                    {
                        var navigationParameters = new NavigationParameters();
                        navigationParameters.Add(TimesheetForDay.Tag, selectedDateTimesheet);
                        await BaseModule.NavigationService.NavigateAsync(PageRoutes.GetKey <ManageImputedDayPage>(), navigationParameters);

                        BaseModule.AnalyticsService.TrackEvent("[Activity] :: Info :: Timesheet");
                    }
                    else
                    {
                        throw new ArgumentNullException();
                    }
                } catch (Exception) {
                    BaseModule.DialogService.ShowToast("The all days selected is closed or failed load the month. The month will be load again");
                    ChangeDateCalendar(_currentDayMonthYear);
                }
            }
        }
コード例 #7
0
        protected async void ManageMultipleImputedDay()
        {
            if (this.IsInternetAndCloseModal())
            {
                try
                {
                    var selectedDateTimesheet = _timesheetModule.TimesheetService.GetTimesheetByDates(_currentTimesheet, Dates.ToList());

                    if (selectedDateTimesheet.Days.Any())
                    {
                        var imputed = new Imputed()
                        {
                            CurrentTimesheetMultipleDay = selectedDateTimesheet
                        };

                        var navigationParameters = new NavigationParameters();
                        navigationParameters.Add(Imputed.Tag, imputed);
                        await BaseModule.NavigationService.NavigateAsync(PageRoutes.GetKey <AddActivityPage>(), navigationParameters);

                        BaseModule.AnalyticsService.TrackEvent("[Activity] :: Add :: Multilple :: Timesheet");
                    }
                    else
                    {
                        throw new ArgumentNullException();
                    }
                } catch (Exception)
                {
                    BaseModule.DialogService.ShowToast("The all days selected is closed or failed load the month. The month will be load again");
                    ChangeDateCalendar(_currentDayMonthYear);
                }
            }
        }
コード例 #8
0
        protected async void Next()
        {
            var navigationParameters = new NavigationParameters();

            navigationParameters.Add(Imputed.Tag, Context);
            await BaseModule.NavigationService.NavigateAsync(PageRoutes.GetKey <AddActivityTimeDesviationPage>(), navigationParameters, false, false);
        }
コード例 #9
0
        protected void GoBack()
        {
            var navigationParameters = new NavigationParameters();

            navigationParameters.Add(Imputed.Tag, Context);
            BaseModule.NavigationService.NavigateAsync($"../{PageRoutes.GetKey<AddActivityPage>()}", navigationParameters, false, false);
        }
コード例 #10
0
        protected async void ManageImputedDay()
        {
            var selectedDateTimesheet = _timesheetModule.TimesheetService.GetTimesheetByDate(_currentTimesheet, Dates.FirstOrDefault());
            var navigationParameters  = new NavigationParameters();

            navigationParameters.Add(TimesheetForDay.Tag, selectedDateTimesheet);
            await BaseModule.NavigationService.NavigateAsync(PageRoutes.GetKey <ManageImputedDayPage>(), navigationParameters);
        }
コード例 #11
0
        protected override async void OnInitialized()
        {
            BlobCache.ApplicationName = AppSettings.IdAppCache;

            InitializeComponent();

            await NavigationService.NavigateAsync(PageRoutes.GetKey <SplashPage>());
        }
コード例 #12
0
ファイル: App.xaml.cs プロジェクト: mavazal/AppTokiota
        protected override async void OnInitialized()
        {
            InitializeComponent();

            TaskScheduler.UnobservedTaskException += TaskScheduler_UnobservedTaskException;
            BlobCache.ApplicationName              = AppSettings.IdAppCache;
            await NavigationService.NavigateAsync(PageRoutes.GetKey <SplashPage>());
        }
コード例 #13
0
 protected async void Next()
 {
     if (IsInternetAndCloseModal())
     {
         var navigationParameters = new NavigationParameters();
         navigationParameters.Add(Imputed.Tag, Context);
         await BaseModule.NavigationService.NavigateAsync(PageRoutes.GetKey <AddActivityProjectPage>(), navigationParameters, false, false);
     }
 }
コード例 #14
0
        protected async void OnAddItem()
        {
            var navigationParameters = new NavigationParameters();
            var imputedContext       = new Imputed()
            {
                CurrentTimesheet = _currentTimesheetForDay
            };

            navigationParameters.Add(Imputed.Tag, imputedContext);
            await BaseModule.NavigationService.NavigateAsync(PageRoutes.GetKey <AddActivityPage>(), navigationParameters, false, true);
        }
コード例 #15
0
ファイル: App.xaml.cs プロジェクト: mavazal/AppTokiota
 async void TaskScheduler_OnConnectivityChanged(object sender, Plugin.Connectivity.Abstractions.ConnectivityChangedEventArgs e)
 {
     if (e.IsConnected == true)
     {
         AuthenticationRun(true);
     }
     else
     {
         await NavigationService.NavigateAsync(PageRoutes.GetKey <ConnectionPage>());
     }
 }
コード例 #16
0
        protected override async void OnInitialized()
        {
            try
            {
                InitializeComponent();

                await NavigationService.NavigateAsync(PageRoutes.GetKey <HelloPage>());
            } catch (Exception e)
            {
            }
        }
コード例 #17
0
 private void AuthenticationRun()
 {
     if (AppSettings.AuthenticatedUserResponse != null)
     {
         BaseModule.NavigationService.NavigateAsync(MasterModule.GetMasterNavigationPage(AppSettings.StartupView));
     }
     else
     {
         NavigateCommand.Execute(PageRoutes.GetKey <LoginPage>());
     }
 }
コード例 #18
0
        protected async void OnAddItem()
        {
            var navigationParameters = new NavigationParameters();
            var imputedContext       = new Imputed()
            {
                CurrentTimesheet = _currentTimesheetForDay
            };

            navigationParameters.Add(Imputed.Tag, imputedContext);
            await BaseModule.NavigationService.NavigateAsync(PageRoutes.GetKey <AddActivityPage>(), navigationParameters, false, true);

            BaseModule.AnalyticsService.TrackEvent("[Activity] :: Add :: Single :: ManageImputedDay");
        }
コード例 #19
0
        async Task AuthenticationRun(bool forceRefresh = false)
        {
            try
            {
                var result = await _authenticationService.UserIsAuthenticatedAndValidAsync(forceRefresh);

                if (!result)
                {
                    await NavigationService.NavigateAsync(PageRoutes.GetKey <LoginPage>());
                }
            }
            catch (Exception ex)
            {
                Debug.WriteLine(ex);
            }
        }
コード例 #20
0
 private async void AuthenticationRun()
 {
     if (CrossConnectivity.Current.IsConnected)
     {
         if (await BaseModule.AuthenticationService.UserIsAuthenticatedAndValidAsync())
         {
             NavigateCommand.Execute(MasterModule.GetMasterNavigationPage(PageRoutes.GetKey <DashBoardPage>()));
         }
         else
         {
             NavigateCommand.Execute(PageRoutes.GetKey <LoginPage>());
         }
     }
     else
     {
         NavigateCommand.Execute(PageRoutes.GetKey <ConnectionPage>());
     }
 }
コード例 #21
0
        protected async void ManageMultipleImputedDay()
        {
            var selectedDateTimesheet = _timesheetModule.TimesheetService.GetTimesheetByDates(_currentTimesheet, Dates.ToList());

            if (selectedDateTimesheet.Days.Any())
            {
                var imputed = new Imputed()
                {
                    CurrentTimesheetMultipleDay = selectedDateTimesheet
                };

                var navigationParameters = new NavigationParameters();
                navigationParameters.Add(Imputed.Tag, imputed);
                await BaseModule.NavigationService.NavigateAsync(PageRoutes.GetKey <AddActivityPage>(), navigationParameters);
            }
            else
            {
                BaseModule.DialogService.ShowToast("The all days selected is closed");
            }
        }
コード例 #22
0
        private async void OpenStartUpView()
        {
            try
            {
                var list = new List <string>();
                list.Add(PageRoutes.GetKey <DashBoardPage>());
                list.Add(PageRoutes.GetKey <TimesheetPage>());
                list.Add(PageRoutes.GetKey <ReviewPage>());

                var result = await BaseModule.DialogService.SelectActionAsync("Select the startup view", "Default Startup View", list);

                if (!result.Equals("Cancel"))
                {
                    AppSettings.StartupView = result;
                    StartupViewText         = result;
                }
            }
            catch (Exception ex)
            {
                Crashes.TrackError(ex);
            }
        }
コード例 #23
0
ファイル: App.xaml.cs プロジェクト: mavazal/AppTokiota
        async void AuthenticationRun(bool isConnectivityChange = false)
        {
            try
            {
                var authenticationService = Container.Resolve <IAuthenticationService>();
                var result = await authenticationService.UserIsAuthenticatedAndValidAsync();

                if (!result)
                {
                    await NavigationService.NavigateAsync(PageRoutes.GetKey <LoginPage>());
                }
                else
                {
                    if (authenticationService.IsAuthenticated && isConnectivityChange)
                    {
                        await NavigationService.NavigateAsync(MasterModule.GetMasterNavigationPage(PageRoutes.GetKey <DashBoardPage>()));
                    }
                }
            }
            catch (Exception ex)
            {
            }
        }
コード例 #24
0
        private async void SignOut()
        {
            await BaseModule.AuthenticationService.Logout();

            NavigateCommand.Execute(PageRoutes.GetKey <LoginPage>());
        }
コード例 #25
0
 private void SignIn()
 {
     IsBusy = true;
     Device.BeginInvokeOnMainThread(async() =>
     {
         try
         {
             if (Validate())
             {
                 if (this.IsInternetAndCloseModal())
                 {
                     BaseModule.AnalyticsService.TrackEvent("[Login] :: Start");
                     var responseRequest = await BaseModule.AuthenticationService.Login(_email.Value, _password.Value);
                     IsBusy = false;
                     if (responseRequest.Success)
                     {
                         NavigateCommand.Execute(MasterModule.GetMasterNavigationPage(PageRoutes.GetKey <DashBoardPage>()));
                         BaseModule.AnalyticsService.TrackEvent("[Login] :: End");
                     }
                     else
                     {
                         await BaseModule.DialogService.ShowAlertAsync(responseRequest.Message, "Login error", "Ok");
                     }
                 }
             }
             else
             {
                 IsBusy = false;
             }
         }
         catch (Exception e)
         {
             IsBusy = false;
             BaseModule.DialogErrorCustomService.DialogErrorCommonTryAgain();
             Crashes.TrackError(e);
         }
     });
 }
コード例 #26
0
 protected override async void OnInitialized()
 {
     InitializeComponent();
     await NavigationService.NavigateAsync(PageRoutes.GetKey <LoginPage>());
 }
コード例 #27
0
ファイル: MasterModule.cs プロジェクト: mavazal/AppTokiota
 public static string GetMasterNavigationPage(string page)
 {
     return($"{PageRoutes.GetKey<MasterPage>()}{PageRoutes.GetKey<BaseNavigationPage>()}{page}");
 }