From 6d1aa948e6cad0a5564b6051da81ac3d0a757132 Mon Sep 17 00:00:00 2001 From: Kaustav Chaudhuri Date: Mon, 8 May 2023 11:20:48 +0530 Subject: [PATCH] Implemented Page rounting on App shell --- GMCabsDriverAssistantSolution/AppShell.xaml | 2 +- .../AppShell.xaml.cs | 44 +++++++++---------- 2 files changed, 23 insertions(+), 23 deletions(-) diff --git a/GMCabsDriverAssistantSolution/AppShell.xaml b/GMCabsDriverAssistantSolution/AppShell.xaml index f8d69c1..12ea0d0 100644 --- a/GMCabsDriverAssistantSolution/AppShell.xaml +++ b/GMCabsDriverAssistantSolution/AppShell.xaml @@ -82,7 +82,7 @@ - + diff --git a/GMCabsDriverAssistantSolution/AppShell.xaml.cs b/GMCabsDriverAssistantSolution/AppShell.xaml.cs index 5dc23c5..944d4f8 100644 --- a/GMCabsDriverAssistantSolution/AppShell.xaml.cs +++ b/GMCabsDriverAssistantSolution/AppShell.xaml.cs @@ -32,28 +32,28 @@ public partial class AppShell : Shell BindingContext = _viewModel = new AppShellViewModel(this); Task.Run(async () => { - //string couponsPermission = await SecureStorageData.GetSecureStorage(SecureStorageData.CanViewCoupons); - //if (string.IsNullOrEmpty(couponsPermission)) { couponsPermission = "false"; } + string couponsPermission = await SecureStorageData.GetSecureStorage(SecureStorageData.CanViewCoupons); + if (string.IsNullOrEmpty(couponsPermission)) { couponsPermission = "false"; } - //string settingsPermission = await SecureStorageData.GetSecureStorage(SecureStorageData.CanViewSettings); - //if (string.IsNullOrEmpty(settingsPermission)) { settingsPermission = "false"; } + string settingsPermission = await SecureStorageData.GetSecureStorage(SecureStorageData.CanViewSettings); + if (string.IsNullOrEmpty(settingsPermission)) { settingsPermission = "false"; } - //string homePermission = await SecureStorageData.GetSecureStorage(SecureStorageData.CanViewHome); - //if (string.IsNullOrEmpty(homePermission)) { homePermission = "true"; } + string homePermission = await SecureStorageData.GetSecureStorage(SecureStorageData.CanViewHome); + if (string.IsNullOrEmpty(homePermission)) { homePermission = "true"; } - //_viewModel.IsVisibleDrivingLicenceScan = Preferences.Get(SecureStorageData.CanUpdateLicence, false); - //_viewModel.IsVisibleVoucherScan = Preferences.Get(SecureStorageData.CanScanVouchers, false); - //_viewModel.IsVisibleRydo = Preferences.Get(SecureStorageData.CanAcceptBookings, false); - //_viewModel.IsVisibleCoupons = Preferences.Get(SecureStorageData.CanViewCoupons, true); - //_viewModel.IsVisibleSettings = Preferences.Get(SecureStorageData.CanViewSettings, true); - //_viewModel.IsCanViewHome = Preferences.Get(SecureStorageData.CanViewHome, false); - //_viewModel.DriverName = Preferences.Get(SecureStorageData.DriverName, ""); - //_viewModel.DriverMobileNumber = Preferences.Get("DriverMobileNumber", ""); + _viewModel.IsVisibleDrivingLicenceScan = Preferences.Get(SecureStorageData.CanUpdateLicence, false); + _viewModel.IsVisibleVoucherScan = Preferences.Get(SecureStorageData.CanScanVouchers, false); + _viewModel.IsVisibleRydo = Preferences.Get(SecureStorageData.CanAcceptBookings, false); + _viewModel.IsVisibleCoupons = Preferences.Get(SecureStorageData.CanViewCoupons, true); + _viewModel.IsVisibleSettings = Preferences.Get(SecureStorageData.CanViewSettings, true); + _viewModel.IsCanViewHome = Preferences.Get(SecureStorageData.CanViewHome, false); + _viewModel.DriverName = Preferences.Get(SecureStorageData.DriverName, ""); + _viewModel.DriverMobileNumber = Preferences.Get("DriverMobileNumber", ""); }); Routing.RegisterRoute(nameof(LoginPage), typeof(LoginPage)); - Routing.RegisterRoute(nameof(NewPage1), typeof(NewPage1)); - //Routing.RegisterRoute(nameof(HomePage), typeof(HomePage)); + //Routing.RegisterRoute(nameof(NewPage1), typeof(NewPage1)); + Routing.RegisterRoute(nameof(HomePage), typeof(HomePage)); Routing.RegisterRoute(nameof(AdminPasswordPage), typeof(AdminPasswordPage)); Routing.RegisterRoute(nameof(TaxiInstallPage), typeof(TaxiInstallPage)); Routing.RegisterRoute(nameof(InstallCompletePage), typeof(InstallCompletePage)); @@ -66,12 +66,12 @@ public partial class AppShell : Shell Routing.RegisterRoute(nameof(ScanDrivingLicencePage), typeof(ScanDrivingLicencePage)); Routing.RegisterRoute(nameof(ScanVoucherPage), typeof(ScanVoucherPage)); Routing.RegisterRoute(nameof(SettingsPage), typeof(SettingsPage)); - //Routing.RegisterRoute(nameof(BookingsPage), typeof(BookingsPage)); - //Routing.RegisterRoute(nameof(BookingDetailsPage), typeof(BookingDetailsPage)); - //Routing.RegisterRoute(nameof(AcceptBookingPage), typeof(AcceptBookingPage)); - //Routing.RegisterRoute(nameof(CancelledBookingPage), typeof(CancelledBookingPage)); + Routing.RegisterRoute(nameof(BookingsPage), typeof(BookingsPage)); + Routing.RegisterRoute(nameof(BookingDetailsPage), typeof(BookingDetailsPage)); + Routing.RegisterRoute(nameof(AcceptBookingPage), typeof(AcceptBookingPage)); + Routing.RegisterRoute(nameof(CancelledBookingPage), typeof(CancelledBookingPage)); Routing.RegisterRoute(nameof(AcceptedFutureBookingsPage), typeof(AcceptedFutureBookingsPage)); - //Routing.RegisterRoute(nameof(AcceptedFutureBookingDetailPage), typeof(AcceptedFutureBookingDetailPage)); + Routing.RegisterRoute(nameof(AcceptedFutureBookingDetailPage), typeof(AcceptedFutureBookingDetailPage)); //Routing.RegisterRoute(nameof(VoucherScanHistory), typeof(VoucherScanHistory)); //Routing.RegisterRoute(nameof(BookingDetailsTabletPage), typeof(BookingDetailsTabletPage)); //Routing.RegisterRoute(nameof(OnTripTabletPage), typeof(OnTripTabletPage)); @@ -178,7 +178,7 @@ public partial class AppShell : Shell } private async void Coupons_Clicked(object sender, EventArgs e) { - //await Current.GoToAsync($"//{nameof(HomePage)}/{nameof(CouponsPage)}"); + await Current.GoToAsync($"//{nameof(HomePage)}/{nameof(CouponsPage)}"); await Current.GoToAsync($"//{nameof(HomePage)}/{nameof(CouponsV2Page)}"); } private async void Rydo_Clicked(object sender, EventArgs e)