Browse Source

Login error Popup page implemented.

master
Kaustav Chaudhuri 1 year ago
parent
commit
d931b840dc
4 changed files with 44 additions and 6 deletions
  1. +3
    -0
      GMCabsDriverAssistantSolution/GMCabsDriverAssistantSolution.csproj
  2. +6
    -6
      GMCabsDriverAssistantSolution/Views/HomePage.xaml.cs
  3. +18
    -0
      GMCabsDriverAssistantSolution/Views/LoginErrorAlertDialogPage.xaml
  4. +17
    -0
      GMCabsDriverAssistantSolution/Views/LoginErrorAlertDialogPage.xaml.cs

+ 3
- 0
GMCabsDriverAssistantSolution/GMCabsDriverAssistantSolution.csproj View File

@ -146,6 +146,9 @@
<MauiXaml Update="Views\InstallCompletePage.xaml"> <MauiXaml Update="Views\InstallCompletePage.xaml">
<Generator>MSBuild:Compile</Generator> <Generator>MSBuild:Compile</Generator>
</MauiXaml> </MauiXaml>
<MauiXaml Update="Views\LoginErrorAlertDialogPage.xaml">
<Generator>MSBuild:Compile</Generator>
</MauiXaml>
<MauiXaml Update="Views\LoginPage.xaml"> <MauiXaml Update="Views\LoginPage.xaml">
<Generator>MSBuild:Compile</Generator> <Generator>MSBuild:Compile</Generator>
</MauiXaml> </MauiXaml>


+ 6
- 6
GMCabsDriverAssistantSolution/Views/HomePage.xaml.cs View File

@ -163,7 +163,7 @@ public partial class HomePage : ContentPage
var lastLatitude = Convert.ToDouble(Preferences.Get("lastLat", "0")); var lastLatitude = Convert.ToDouble(Preferences.Get("lastLat", "0"));
var lastLongitude = Convert.ToDouble(Preferences.Get("lastLng", "0")); var lastLongitude = Convert.ToDouble(Preferences.Get("lastLng", "0"));
await gmCabsDriverService.LogoutDriverApp(token, lastLatitude, lastLongitude); await gmCabsDriverService.LogoutDriverApp(token, lastLatitude, lastLongitude);
//Navigation.ShowPopup(new LoginErrorAlertDialogPage());
this.ShowPopup(new LoginErrorAlertDialogPage());
} }
} }
@ -197,10 +197,10 @@ public partial class HomePage : ContentPage
if (HasUnreadNotifications && !IsBookingAvailable) if (HasUnreadNotifications && !IsBookingAvailable)
{ {
//open notification page //open notification page
//Device.BeginInvokeOnMainThread(() =>
//{
// Navigation.PushAsync(new NotificationsPage());
//});
Device.BeginInvokeOnMainThread(() =>
{
Navigation.PushAsync(new NotificationsPage());
});
} }
else if (!HasUnreadNotifications && IsBookingAvailable && availableBookingIDs != null && availableBookingIDs.Count == 1) else if (!HasUnreadNotifications && IsBookingAvailable && availableBookingIDs != null && availableBookingIDs.Count == 1)
{ {
@ -223,7 +223,7 @@ public partial class HomePage : ContentPage
Device.BeginInvokeOnMainThread(async () => Device.BeginInvokeOnMainThread(async () =>
{ {
//await Shell.Current.GoToAsync($"{nameof(BookingDetailsPage)}?{nameof(BookingDetailViewModel.BookingJson)}={bookingJson}");
await Shell.Current.GoToAsync($"{nameof(BookingDetailsPage)}?{nameof(BookingDetailViewModel.BookingJson)}={bookingJson}");
}); });
} }
} }


+ 18
- 0
GMCabsDriverAssistantSolution/Views/LoginErrorAlertDialogPage.xaml View File

@ -0,0 +1,18 @@
<?xml version="1.0" encoding="utf-8" ?>
<toolkit:Popup xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="GMCabsDriverAssistantSolution.Views.LoginErrorAlertDialogPage"
xmlns:toolkit="http://schemas.microsoft.com/dotnet/2022/maui/toolkit"
Size="300,300"
Color="Transparent">
<Frame BackgroundColor="White" CornerRadius="10">
<StackLayout Orientation="Vertical">
<StackLayout VerticalOptions="CenterAndExpand">
<Label Text="Cannot work further as the same credential is currently using in a tablet, Press OK to Exit" VerticalTextAlignment="Center" VerticalOptions="CenterAndExpand" HorizontalOptions="CenterAndExpand" FontSize="20"/>
</StackLayout>
<StackLayout VerticalOptions="EndAndExpand" Margin="10,10,0,10">
<Button Text="Ok" Clicked="OkButton_Clicked" TextColor="White" FontSize="20" />
</StackLayout>
</StackLayout>
</Frame>
</toolkit:Popup>

+ 17
- 0
GMCabsDriverAssistantSolution/Views/LoginErrorAlertDialogPage.xaml.cs View File

@ -0,0 +1,17 @@
using CommunityToolkit.Maui.Views;
namespace GMCabsDriverAssistantSolution.Views;
public partial class LoginErrorAlertDialogPage : Popup
{
public LoginErrorAlertDialogPage()
{
InitializeComponent();
}
private async void OkButton_Clicked(object sender, EventArgs e)
{
await Shell.Current.GoToAsync($"//{nameof(LoginPage)}");
//Dismiss(null);
}
}

Loading…
Cancel
Save