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>()) }); }
protected void Close() { if (IsInternetAndCloseModal()) { NavigateCommand.Execute(MasterModule.GetMasterNavigationPage(PageRoutes.GetKey <DashBoardPage>())); } }
protected void OnInfoActivityItem(ActivityDay from) { var navigationParameters = new NavigationParameters(); navigationParameters.Add(ActivityDay.Tag, from); BaseModule.NavigationService.NavigateAsync(PageRoutes.GetKey <InfoActivityPopUpPage>(), navigationParameters, true, true); }
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 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."); } } }
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); } } }
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); } } }
protected async void Next() { var navigationParameters = new NavigationParameters(); navigationParameters.Add(Imputed.Tag, Context); await BaseModule.NavigationService.NavigateAsync(PageRoutes.GetKey <AddActivityTimeDesviationPage>(), navigationParameters, false, false); }
protected void GoBack() { var navigationParameters = new NavigationParameters(); navigationParameters.Add(Imputed.Tag, Context); BaseModule.NavigationService.NavigateAsync($"../{PageRoutes.GetKey<AddActivityPage>()}", navigationParameters, false, false); }
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); }
protected override async void OnInitialized() { BlobCache.ApplicationName = AppSettings.IdAppCache; InitializeComponent(); await NavigationService.NavigateAsync(PageRoutes.GetKey <SplashPage>()); }
protected override async void OnInitialized() { InitializeComponent(); TaskScheduler.UnobservedTaskException += TaskScheduler_UnobservedTaskException; BlobCache.ApplicationName = AppSettings.IdAppCache; await NavigationService.NavigateAsync(PageRoutes.GetKey <SplashPage>()); }
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); } }
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); }
async void TaskScheduler_OnConnectivityChanged(object sender, Plugin.Connectivity.Abstractions.ConnectivityChangedEventArgs e) { if (e.IsConnected == true) { AuthenticationRun(true); } else { await NavigationService.NavigateAsync(PageRoutes.GetKey <ConnectionPage>()); } }
protected override async void OnInitialized() { try { InitializeComponent(); await NavigationService.NavigateAsync(PageRoutes.GetKey <HelloPage>()); } catch (Exception e) { } }
private void AuthenticationRun() { if (AppSettings.AuthenticatedUserResponse != null) { BaseModule.NavigationService.NavigateAsync(MasterModule.GetMasterNavigationPage(AppSettings.StartupView)); } else { NavigateCommand.Execute(PageRoutes.GetKey <LoginPage>()); } }
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"); }
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); } }
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>()); } }
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"); } }
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); } }
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) { } }
private async void SignOut() { await BaseModule.AuthenticationService.Logout(); NavigateCommand.Execute(PageRoutes.GetKey <LoginPage>()); }
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); } }); }
protected override async void OnInitialized() { InitializeComponent(); await NavigationService.NavigateAsync(PageRoutes.GetKey <LoginPage>()); }
public static string GetMasterNavigationPage(string page) { return($"{PageRoutes.GetKey<MasterPage>()}{PageRoutes.GetKey<BaseNavigationPage>()}{page}"); }