Beispiel #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>())
     });
 }
Beispiel #2
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;
            }
        }
 protected void Close()
 {
     if (IsInternetAndCloseModal())
     {
         NavigateCommand.Execute(MasterModule.GetMasterNavigationPage(PageRoutes.GetKey <DashBoardPage>()));
     }
 }
 private void AuthenticationRun()
 {
     if (AppSettings.AuthenticatedUserResponse != null)
     {
         BaseModule.NavigationService.NavigateAsync(MasterModule.GetMasterNavigationPage(AppSettings.StartupView));
     }
     else
     {
         NavigateCommand.Execute(PageRoutes.GetKey <LoginPage>());
     }
 }
 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>());
     }
 }
 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);
         }
     });
 }
Beispiel #7
0
        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)
            {
            }
        }