Helpline and Infomation Update

main
unknown 6 months ago
parent d478bb57fc
commit f1c836480e
  1. 6
      Justice.csproj
  2. 6
      Justice.csproj.user
  3. 15
      Models/Helpline.cs
  4. 36
      Services/HelplineService.cs
  5. 6
      Views/DashboardPage.xaml
  6. 11
      Views/DashboardPage.xaml.cs
  7. 48
      Views/HelplinePage.xaml
  8. 39
      Views/HelplinePage.xaml.cs
  9. 53
      Views/InformationCenterPage.xaml
  10. 9
      Views/InformationCenterPage.xaml.cs
  11. BIN
      bin/Debug/net9.0-android/Justice.dll
  12. BIN
      bin/Debug/net9.0-android/Justice.pdb
  13. BIN
      bin/Debug/net9.0-android/com.companyname.justice-Signed.apk
  14. BIN
      bin/Debug/net9.0-android/com.companyname.justice-Signed.apk.idsig
  15. BIN
      bin/Debug/net9.0-android/com.companyname.justice.apk
  16. BIN
      bin/Debug/net9.0-ios/iossimulator-x64/Justice.dll
  17. BIN
      bin/Debug/net9.0-ios/iossimulator-x64/Justice.pdb
  18. BIN
      bin/Debug/net9.0-maccatalyst/maccatalyst-x64/Justice.dll
  19. BIN
      bin/Debug/net9.0-maccatalyst/maccatalyst-x64/Justice.pdb
  20. BIN
      bin/Debug/net9.0-windows10.0.19041.0/win10-x64/Justice.dll
  21. BIN
      bin/Debug/net9.0-windows10.0.19041.0/win10-x64/Justice.exe
  22. BIN
      bin/Debug/net9.0-windows10.0.19041.0/win10-x64/Justice.pdb

@ -81,9 +81,15 @@
<MauiXaml Update="Views\EmergencyContactsPage.xaml">
<Generator>MSBuild:Compile</Generator>
</MauiXaml>
<MauiXaml Update="Views\HelplinePage.xaml">
<Generator>MSBuild:Compile</Generator>
</MauiXaml>
<MauiXaml Update="Views\IncidentReportPage.xaml">
<Generator>MSBuild:Compile</Generator>
</MauiXaml>
<MauiXaml Update="Views\InformationCenterPage.xaml">
<Generator>MSBuild:Compile</Generator>
</MauiXaml>
<MauiXaml Update="Views\SosPage.xaml">
<Generator>MSBuild:Compile</Generator>
</MauiXaml>

@ -20,9 +20,15 @@
<MauiXaml Update="Views\EmergencyContactsPage.xaml">
<SubType>Designer</SubType>
</MauiXaml>
<MauiXaml Update="Views\HelplinePage.xaml">
<SubType>Designer</SubType>
</MauiXaml>
<MauiXaml Update="Views\IncidentReportPage.xaml">
<SubType>Designer</SubType>
</MauiXaml>
<MauiXaml Update="Views\InformationCenterPage.xaml">
<SubType>Designer</SubType>
</MauiXaml>
<MauiXaml Update="Views\SosPage.xaml">
<SubType>Designer</SubType>
</MauiXaml>

@ -0,0 +1,15 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Justice.Models
{
public class Helpline
{
public string NumberType { get; set; }
public string AuthorityType { get; set; }
public string Number { get; set; }
}
}

@ -0,0 +1,36 @@
using Justice.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Justice.Services
{
public class HelplineService
{
public static List<Helpline> GetHelplines()
{
return new List<Helpline>
{
new Helpline { NumberType = "General Emergency", AuthorityType = "Police", Number = "100" },
new Helpline { NumberType = "General Emergency", AuthorityType = "Fire Brigade", Number = "101" },
new Helpline { NumberType = "General Emergency", AuthorityType = "Ambulance", Number = "102" },
new Helpline { NumberType = "General Emergency", AuthorityType = "Traffic Control", Number = "103" },
new Helpline { NumberType = "General Emergency", AuthorityType = "Child Missing Emergency", Number = "104" },
new Helpline { NumberType = "Army And Security", AuthorityType = "Comission for Investigation of Abuse of Authority", Number = "107" },
new Helpline { NumberType = "Army And Security", AuthorityType = "Armed Police Force", Number = "1114" },
new Helpline { NumberType = "Army And Security", AuthorityType = "Nepal Army Headquarter", Number = "1113" },
new Helpline { NumberType = "Health and Child", AuthorityType = "Child Rights", Number = "1098" },
new Helpline { NumberType = "Health and Child", AuthorityType = "Health Emergency", Number= "1115" },
new Helpline { NumberType = "Health and Child", AuthorityType = "National Women Commission", Number = "1145" },
new Helpline { NumberType = "Health and Child", AuthorityType = "Human Trafficking Bureau", Number = "1177" },
new Helpline { NumberType = "Public Service", AuthorityType = "Nepal Electricity Authority", Number = "1150" },
new Helpline { NumberType = "Public Service", AuthorityType = "Nepal Red Cross Service", Number = "1130" },
new Helpline { NumberType = "Disaster and Tourism", AuthorityType = "Natural Disaster", Number= "1149" },
new Helpline { NumberType = "Disaster and Tourism", AuthorityType = "Tourist Police", Number = "1144" },
new Helpline { NumberType = "General Inquiries", AuthorityType = "Telephone Enquiry", Number = "197" },
};
}
}
}

@ -65,7 +65,7 @@
<VerticalStackLayout Spacing="10" HorizontalOptions="FillAndExpand" VerticalOptions="Start">
<Label Text="Send SOS Alert" FontSize="17" FontAttributes="Bold" HorizontalOptions="Start"/>
<Label Text="Send SOS Alert" FontSize="12" FontAttributes="Bold" HorizontalOptions="Start" TextColor="Gray"/>
<Button Text="SEND SOS" TextColor="White" FontAttributes="Bold" CornerRadius="5" BackgroundColor="#FFA726" Clicked="OnSOSButtonClicked"/>
<Button Text="SOS" TextColor="White" FontAttributes="Bold" CornerRadius="5" BackgroundColor="#FFA726" Clicked="OnSOSButtonClicked"/>
</VerticalStackLayout>
</Border>
</Grid>
@ -84,7 +84,7 @@
<VerticalStackLayout Spacing="10" HorizontalOptions="FillAndExpand" VerticalOptions="Start">
<Label Text="Incident Report" FontSize="17" FontAttributes="Bold" HorizontalOptions="Start"/>
<Label Text="Add new Report" FontSize="12" FontAttributes="Bold" HorizontalOptions="Start" TextColor="Gray"/>
<Button Text="Add Contact" TextColor="White" FontAttributes="Bold" CornerRadius="5" BackgroundColor="#42A5F5" Clicked="OnIncidentReportClicked"/>
<Button Text="Submit Report" TextColor="White" FontAttributes="Bold" CornerRadius="5" BackgroundColor="#42A5F5" Clicked="OnIncidentReportClicked"/>
</VerticalStackLayout>
</Border>
<Border Grid.Column="1" StrokeThickness="0.05" Stroke="#8BC34A" HeightRequest="160" Padding="15" VerticalOptions="Start" BackgroundColor="#E8F5E9">
@ -118,7 +118,7 @@
<VerticalStackLayout Spacing="10" HorizontalOptions="FillAndExpand" VerticalOptions="Start">
<Label Text="Helpline Numbers" FontSize="17" FontAttributes="Bold" HorizontalOptions="Start"/>
<Label Text="Emergency Helpline for help" FontSize="12" FontAttributes="Bold" HorizontalOptions="Start" TextColor="Gray"/>
<Button Text="Add Contact" TextColor="White" FontAttributes="Bold" CornerRadius="5" BackgroundColor="#42A5F5" Clicked="OnHelpLineNumberClicked" />
<Button Text="HelpLine" TextColor="White" FontAttributes="Bold" CornerRadius="5" BackgroundColor="#42A5F5" Clicked="OnHelpLineNumberClicked" />
</VerticalStackLayout>
</Border>
<Border Grid.Column="1" StrokeThickness="0.05" Stroke="#8BC34A" HeightRequest="160" Padding="15" VerticalOptions="Start" BackgroundColor="#E8F5E9">

@ -12,14 +12,15 @@ public partial class DashboardPage : ContentPage
}
private void OnInformationCenterClicked(object sender, EventArgs e)
{
DisplayAlert("Information button clicked","Information","OK");
}
private async void OnInformationCenterClicked(object sender, EventArgs e)
{
await Navigation.PushAsync(new InformationCenterPage());
}
private void OnHelpLineNumberClicked(object sender, EventArgs e)
{
DisplayAlert("Helpline Clicked button clicked", "HepLine Numbers", "OK");
Navigation.PushAsync(new HelplinePage());
}
private void OnViewReportClicked(object sender, EventArgs e)
{

@ -0,0 +1,48 @@
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="Justice.Views.HelplinePage"
Title="Helpline Numbers">
<StackLayout Padding="20">
<Label Text="Helpline Numbers" FontSize="Large" HorizontalOptions="Center" />
<!-- List of Helplines -->
<ListView x:Name="HelplineListView" HasUnevenRows="True">
<ListView.ItemTemplate>
<DataTemplate>
<ViewCell>
<Grid RowSpacing="5" ColumnSpacing="10">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<!-- Equal width for each column -->
<ColumnDefinition Width="*" />
<ColumnDefinition Width="*" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Label Text="{Binding AuthorityType}"
FontSize="Small"
TextColor="Gray"
Grid.Column="0" />
<Label Text="Number:"
FontSize="Small"
FontAttributes="Bold"
TextColor="Gray"
Grid.Column="1"
HorizontalOptions="End" />
<Label Text="{Binding Number}"
FontSize="Small"
TextColor="Gray"
Grid.Column="2" />
<Button Text="Call"
FontSize="Small"
Clicked="OnCallButtonClicked"
CommandParameter="{Binding Number}"
Grid.Column="3"
HorizontalOptions="End" />
</Grid>
</ViewCell>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
</StackLayout>
</ContentPage>

@ -0,0 +1,39 @@
using Justice.Models;
using Justice.Services;
using Microsoft.Maui.ApplicationModel.Communication;
using System;
using System.Collections.ObjectModel;
namespace Justice.Views
{
public partial class HelplinePage : ContentPage
{
public ObservableCollection<Helpline> Helplines { get; set; }
public HelplinePage()
{
InitializeComponent();
Helplines = new ObservableCollection<Helpline>(HelplineService.GetHelplines());
HelplineListView.ItemsSource = Helplines;
}
private async void OnCallButtonClicked(object sender, EventArgs e)
{
if (sender is Button button && button.CommandParameter is string phoneNumber)
{
bool confirm = await DisplayAlert("Call Helpline", $"Do you want to call {phoneNumber}?", "Yes", "No");
if (confirm)
{
try
{
PhoneDialer.Open(phoneNumber);
}
catch (Exception ex)
{
await DisplayAlert("Error", $"Unable to make the call: {ex.Message}", "OK");
}
}
}
}
}
}

@ -0,0 +1,53 @@
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="Justice.Views.InformationCenterPage"
Title="Information Center">
<ScrollView>
<StackLayout Padding="20" Spacing="15">
<!-- Title -->
<Label Text="Information Center"
FontSize="Large"
HorizontalOptions="Center"
FontAttributes="Bold" />
<!-- Section: How Parents Can Protect Their Children -->
<Label Text="अभिवकहर आफ बचहरई दयवहर र लतबट कसरउन सकछन ?"
FontSize="Medium"
FontAttributes="Bold" />
<Label Text="१. ख सञरलई बढि जह बचहर आफिर र भवनहर गरन सहज महसस गरछन।" FontSize="Small" />
<Label Text="२. विस निण गरन निणय नगर आफ बच सकिय रपम।" FontSize="Small" />
<Label Text="३. बचहरई सह र गलत बन मददत गरन सपषट र सगत सहरट गर।" FontSize="Small" />
<Label Text="४. जि र जवफदिई सढ पन निरनतर अनसन ल गर।" FontSize="Small" />
<Label Text="५. भवनमक रपम उपलबध र सहय, विष गर कठिन समयम।" FontSize="Small" />
<Label Text="६. आफ बच उपलबि र परयसहर मनएर उसक आतमसमन बढउन।" FontSize="Small" />
<Label Text="७. आफ बचई दयवहरकििन रपहर पहिन गरन सिउन र बन पित गर।" FontSize="Small" />
<Label Text="८. आफ बचई लत र पदथ दपयगक खतरहरिित गर।" FontSize="Small" />
<Label Text="९. तनव वयवसपन र सवसथ समन गरयनरहररदरशन गरर सवसथ वयवहरकल बनउन।" FontSize="Small" />
<Label Text="१०. भवनहरयवसपन गरन सवसथ समन गरपहरिस गरन आफ बचई मददत गर।" FontSize="Small" />
<Label Text="११. सकमक परभवहरिित गरन आफ बचिक अनतरकि र मिरतिषण गर।" FontSize="Small" />
<Label Text="१२. सरकिित गरन आफ बच अनलइन र अफलइन गतिििहरिगर गर।" FontSize="Small" />
<Label Text="१३. दयवहर विट मत सरकित र सिर घर ववरण सिजन गर।" FontSize="Small" />
<Label Text="१४. आवशयक परवसिक मददत खर आफ बचनसिक सय आवशयकतहरई च समधन गर।" FontSize="Small" />
<Label Text="१५. सवसथ ब र सनित गतिििहर समश गरिनचरपन गर।" FontSize="Small" />
<Label Text="१६. आफ बचई खलकद व कल जसवसथ शकहरलगन हन पित गर।" FontSize="Small" />
<Label Text="१७. आफ बचिक वि र वयकिगत विसलई समरथन गर।" FontSize="Small" />
<Label Text="१८. भि परियहरफत सहर दबबकरतिध कसर गर भनर आफ बचई सिउन।" FontSize="Small" />
<Label Text="१९. सकमक मयमयत र वयवहर स गरहरग मिरतई बढि।" FontSize="Small" />
<Label Text="२०. दयवहर व लतकरमिक चवनतहर पहिन गर र तवसिक मददत ख।" FontSize="Small" />
<!-- Section: Constitution of Nepal -->
<Label Text="नलकिन"
FontSize="Medium"
FontAttributes="Bold" />
<Label Text="नलकिन, २०७२ ललबि र महिहरिपक अधिरक गरदछ, जसल सबरकरकयवहर र शषणबट सरकिित गरदछ। बलबिहरई नि:शक शि, जिमपण शरमबट सरक र बचबिखन वयवहरकिर भएमिष हरचहक हकदर छ। महिहरई पििक मि समनत र लिक भदभव, शषण र हिट सरकरदन गरिएक छ।
िनलयलई महिहरई सशकत बनउन र उनहर मर र सरकिित गरन सकमक कदम चन आदश दिएक छ।"
FontSize="Small" />
<Label Text="थप रपम, सिनलयवहरकििङ र समधन गरयनर परदन गरदछ, पितहरई नय, रहत र कषतिि पहच सिित गरदछ। घरि ऐन र मनव बचबिखन ऐन जस
वधनहर थप करकरदन गरर यरकहरई सढ बनछन। दयवहर र शषणकितहरई समयम हसतकप र नय सिित गरन परहरहर महि र बलबिरक
ककषहर सहित सहयग परणहरपन गरियक
"
FontSize="Small" />
</StackLayout>
</ScrollView>
</ContentPage>

@ -0,0 +1,9 @@
namespace Justice.Views;
public partial class InformationCenterPage : ContentPage
{
public InformationCenterPage()
{
InitializeComponent();
}
}
Loading…
Cancel
Save