Skip to content
This repository has been archived by the owner on Nov 1, 2024. It is now read-only.

Change to 4D NRIC, add gitignore #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.vs/
2 changes: 2 additions & 0 deletions SL Clearance Management System/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
bin/
obj/
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ public SLDataBaseConnection(string dataBaseLocation = null) {
Environment.Exit(1);
}

_connectionString = $"Provider=\'{OleDbProvider}\';Data Source=\'{DataBaseLocation}\'";
_connectionString = $"Provider=\'{OleDbProvider}\';Data Source=\'{DataBaseLocation}\';";
if(RunConnectionTest())
return;

Expand Down
4 changes: 4 additions & 0 deletions SL Clearance Management System/Model/PersonnelDetails.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@ public string NRIC
RaisePropertyChangedEvent(nameof(NRIC));
}
}
public string NRIC4D
{
get => _nric.Substring(5, 4);
}
public string Rank
{
get => _rank;
Expand Down
3 changes: 2 additions & 1 deletion SL Clearance Management System/Model/VisitorRecord.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ public class VisitorRecord
{
public string NRIC => Visitor?.NRIC ?? "NA";
public string EscortNRIC => Escort?.NRIC ?? "NA";

public string NRIC4D => Visitor?.NRIC4D ?? "NA";
public string EscortNRIC4D => Escort?.NRIC4D ?? "NA";

public PersonnelDetails Visitor { get; set; }
public PersonnelDetails Escort { get; set; }
Expand Down
616 changes: 308 additions & 308 deletions SL Clearance Management System/SL Clearance Management System.csproj

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion SL Clearance Management System/View/AllVisitorHistory.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
<DataGridTextColumn Header="Book In Time" MinWidth="120" MaxWidth="120" Binding="{Binding Path=StartTime, Mode=OneWay, StringFormat=\{0:dd/MM/yy HH:mm:ss\}}"/>
<DataGridTextColumn Header="Book Out Time" MinWidth="120" MaxWidth="120" Binding="{Binding Path=EndTime, Mode=OneWay, StringFormat=\{0:dd/MM/yy HH:mm:ss\}}" SortDirection="Descending"/>
<DataGridTextColumn Header="Pass No." Width="80" CellStyle="{StaticResource SearchableDataGridCell}" Binding="{Binding Path=PersonnelPass, Mode=OneWay}"/>
<DataGridTextColumn Header="Visitor NRIC" Width="100" CellStyle="{StaticResource SearchableDataGridCell}" Binding="{Binding Path=NRIC, Mode=OneWay}"/>
<DataGridTextColumn Header="Visitor NRIC" Width="100" CellStyle="{StaticResource SearchableDataGridCell}" Binding="{Binding Path=NRIC4D, Mode=OneWay}"/>
<DataGridTextColumn Header="Name of Visitor" Width="180" CellStyle="{StaticResource SearchableDataGridCell}" Binding="{Binding Path=Visitor.RankAndName, Mode=OneWay}"/>
<DataGridTextColumn Header="Escort NRIC" Width="100" CellStyle="{StaticResource SearchableDataGridCell}" Binding="{Binding Path=EscortNRIC, Mode=OneWay, FallbackValue='NA'}" />
<DataGridTextColumn Header="Name of Escort" Width="180" CellStyle="{StaticResource SearchableDataGridCell}" Binding="{Binding Path=Escort.RankAndName, Mode=OneWay, FallbackValue='NA'}" />
Expand Down
2 changes: 1 addition & 1 deletion SL Clearance Management System/View/BookInPersonnel.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@
<DataGrid.Columns>
<DataGridTextColumn Header="Visitor NRIC"
Width="90"
Binding="{Binding Path=NRIC, Mode=OneWay}"/>
Binding="{Binding Path=NRIC4D, Mode=OneWay}"/>
<DataGridTextColumn Header="Name of Visitor"
Width="150"
Binding="{Binding Path=Visitor.RankAndName, Mode=OneWay}"/>
Expand Down
4 changes: 2 additions & 2 deletions SL Clearance Management System/View/DashBoard.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,9 @@
LoadingRow="VisitorInCampDataGrid_LoadingRow" SelectionChanged="VisitorInCampDataGrid_SelectionChanged" RowHeight="30">
<DataGrid.Columns>
<DataGridTextColumn Header="Pass No." Width="80" CellStyle="{StaticResource SearchableDataGridCell}" Binding="{Binding Path=PersonnelPass, Mode=OneWay}"/>
<DataGridTextColumn Header="Visitor NRIC" Width="100" CellStyle="{StaticResource SearchableDataGridCell}" Binding="{Binding Path=NRIC, Mode=OneWay}"/>
<DataGridTextColumn Header="Visitor NRIC" Width="100" CellStyle="{StaticResource SearchableDataGridCell}" Binding="{Binding Path=NRIC4D, Mode=OneWay}"/>
<DataGridTextColumn Header="Name of Visitor" Width="180" CellStyle="{StaticResource SearchableDataGridCell}" Binding="{Binding Path=Visitor.RankAndName, Mode=OneWay}"/>
<DataGridTextColumn Header="Escort NRIC" Width="100" CellStyle="{StaticResource SearchableDataGridCell}" Binding="{Binding Path=EscortNRIC, Mode=OneWay, FallbackValue='NA'}" />
<DataGridTextColumn Header="Escort NRIC" Width="100" CellStyle="{StaticResource SearchableDataGridCell}" Binding="{Binding Path=EscortNRIC4D, Mode=OneWay, FallbackValue='NA'}" />
<DataGridTextColumn Header="Name of Escort" Width="180" CellStyle="{StaticResource SearchableDataGridCell}" Binding="{Binding Path=Escort.RankAndName, Mode=OneWay, FallbackValue='NA'}" />
<DataGridTextColumn Header="Visitor Contact No." Width="120" CellStyle="{StaticResource SearchableDataGridCell}" Binding="{Binding Path=Visitor.Contact, Mode=OneWay, FallbackValue='NA'}" />
<DataGridTextColumn Header="Veh. Pass" Width="80" CellStyle="{StaticResource SearchableDataGridCell}" Binding="{Binding Path=VehiclePass, Mode=OneWay}"/>
Expand Down
4 changes: 2 additions & 2 deletions SL Clearance Management System/View/LookUpClearance.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -306,10 +306,10 @@
controls:DataGridTextSearch.SearchValue="{Binding ElementName=SearchTextBox, Path=Text, UpdateSourceTrigger=PropertyChanged}"
LoadingRow="VisitorInCampDataGrid_LoadingRow" SelectionChanged="VisitorInCampDataGrid_SelectionChanged" RowHeight="30">
<DataGrid.Columns>
<DataGridTextColumn Header="Visitor NRIC" Width="100" CellStyle="{StaticResource SearchableDataGridCell}" Binding="{Binding Path=NRIC, Mode=OneWay}"/>
<DataGridTextColumn Header="Visitor NRIC" Width="100" CellStyle="{StaticResource SearchableDataGridCell}" Binding="{Binding Path=NRIC4D, Mode=OneWay}"/>
<DataGridTextColumn Header="Veh. Num" Width="100" CellStyle="{StaticResource SearchableDataGridCell}" Binding="{Binding Path=VehicleNum, Mode=OneWay}"/>
<DataGridTextColumn Header="Name of Visitor" Width="180" CellStyle="{StaticResource SearchableDataGridCell}" Binding="{Binding Path=Visitor.RankAndName, Mode=OneWay}"/>
<DataGridTextColumn Header="Escort NRIC" Width="100" CellStyle="{StaticResource SearchableDataGridCell}" Binding="{Binding Path=EscortNRIC, Mode=OneWay, FallbackValue='NA'}" />
<DataGridTextColumn Header="Escort NRIC" Width="100" CellStyle="{StaticResource SearchableDataGridCell}" Binding="{Binding Path=EscortNRIC4D, Mode=OneWay, FallbackValue='NA'}" />
<DataGridTextColumn Header="Name of Escort" Width="180" CellStyle="{StaticResource SearchableDataGridCell}" Binding="{Binding Path=Escort.RankAndName, Mode=OneWay, FallbackValue='NA'}" />
<DataGridTextColumn Header="Visitor Contact No." Width="120" CellStyle="{StaticResource SearchableDataGridCell}" Binding="{Binding Path=Visitor.Contact, Mode=OneWay, FallbackValue='NA'}" />
</DataGrid.Columns>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@
<TextBlock Grid.Row="6" Grid.Column="0" HorizontalAlignment="Right" VerticalAlignment="Center" FontSize="13" Text="Vehicle:"/>
<TextBlock Grid.Row="7" Grid.Column="0" HorizontalAlignment="Right" VerticalAlignment="Top" Margin="0,3,0,0" FontSize="13" Text="Remarks:"/>

<TextBox x:Name="VisitorNricTextBox" Grid.Row="0" Grid.Column="1" Margin="2" FontSize="12" Foreground="White" Background="Transparent" BorderBrush="Transparent" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" VerticalContentAlignment="Center" Text="{Binding Path=NRIC, FallbackValue='NA'}" IsReadOnly="True" IsTabStop="False">
<TextBox x:Name="VisitorNricTextBox" Grid.Row="0" Grid.Column="1" Margin="2" FontSize="12" Foreground="White" Background="Transparent" BorderBrush="Transparent" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" VerticalContentAlignment="Center" Text="{Binding Path=NRIC4D, FallbackValue='NA', Mode=OneWay}" IsReadOnly="True" IsTabStop="False" TextChanged="VisitorNricTextBox_TextChanged">
<TextBox.Style>
<Style TargetType="{x:Type TextBox}" BasedOn="{StaticResource {x:Type TextBox}}">
<Style.Triggers>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,11 @@ private void LookupButton_Click(object sender, RoutedEventArgs e) {
details.NRIC,
details.RankAndName);
}
}
}

private void VisitorNricTextBox_TextChanged(object sender, System.Windows.Controls.TextChangedEventArgs e)
{

}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
<TextBlock Grid.Row="4" Grid.Column="0" HorizontalAlignment="Right" VerticalAlignment="Top" Margin="0,3,0,0" Text="Vehicle:"/>
<TextBlock Grid.Row="5" Grid.Column="0" HorizontalAlignment="Right" VerticalAlignment="Top" Margin="0,3,0,0" Text="Remarks:"/>

<TextBox Grid.Row="0" Grid.Column="1" FontSize="12" Foreground="White" Background="Transparent" Margin="0.2" BorderBrush="Transparent" IsReadOnly="True" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" VerticalContentAlignment="Top" Text="{Binding NRIC, FallbackValue='NA'}" />
<TextBox Grid.Row="0" Grid.Column="1" FontSize="12" Foreground="White" Background="Transparent" Margin="0.2" BorderBrush="Transparent" IsReadOnly="True" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" VerticalContentAlignment="Top" Text="{Binding NRIC4D, FallbackValue='NA', Mode=OneWay}" />
<TextBox Grid.Row="1" Grid.Column="1" FontSize="12" Foreground="White" Background="Transparent" Margin="0.2" BorderBrush="Transparent" IsReadOnly="True" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" VerticalContentAlignment="Top" Text="{Binding RankAndName, Mode=OneWay, FallbackValue='NA'}" TextWrapping="Wrap" MaxHeight="50"/>
<TextBox Grid.Row="2" Grid.Column="1" FontSize="12" Foreground="White" Background="Transparent" Margin="0.2" BorderBrush="Transparent" IsReadOnly="True" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" VerticalContentAlignment="Top" Text="{Binding UnitOrCompany, FallbackValue='NA'}"/>
<TextBox Grid.Row="3" Grid.Column="1" FontSize="12" Foreground="White" Background="Transparent" Margin="0.2" BorderBrush="Transparent" IsReadOnly="True" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" VerticalContentAlignment="Top" Text="{Binding Contact, FallbackValue='NA'}"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
SelectedItem="{Binding Path=DataContext, ElementName=ThisControl, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" LoadingRow="VisitorInCampDataGrid_LoadingRow"
KeyboardNavigation.TabNavigation="None">
<DataGrid.Columns>
<DataGridTextColumn Header="NRIC" Width="80" CellStyle="{StaticResource SearchableDataGridCell}" Binding="{Binding Path=NRIC, Mode=OneWay}" SortDirection="Ascending"/>
<DataGridTextColumn Header="NRIC" Width="80" CellStyle="{StaticResource SearchableDataGridCell}" Binding="{Binding Path=NRIC4D, Mode=OneWay}" SortDirection="Ascending"/>
<DataGridTextColumn Header="Name of Escort" Width="180" CellStyle="{StaticResource SearchableDataGridCell}" Binding="{Binding Path=RankAndName, Mode=OneWay}"/>
<DataGridTextColumn Header="Contact No." Width="130" CellStyle="{StaticResource SearchableDataGridCell}" Binding="{Binding Path=Contact, Mode=OneWay, FallbackValue='NA'}" />
<DataGridTextColumn Header="Veh. Num" Width="80" CellStyle="{StaticResource SearchableDataGridCell}" Binding="{Binding Path=VehicleNum, Mode=OneWay}"/>
Expand Down
8 changes: 4 additions & 4 deletions SL Clearance Management System/View/VisitorHistoryLookup.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,22 +35,22 @@
</Grid.ColumnDefinitions>

<!-- Search Interface -->
<TextBlock Grid.Row="1" Grid.Column="1" Text="DISPLAYING: " FontSize="15" FontWeight="Bold" VerticalAlignment="Center"/>
<TextBlock Grid.Row="1" Grid.Column="1" Text="DISPLAYING: " FontSize="15" FontWeight="Bold" VerticalAlignment="Bottom" Margin="3,0,4,8"/>
<TextBlock Grid.Row="1" Grid.Column="2" Text="{Binding NameofPersonnel}" FontSize="15" FontWeight="Bold" VerticalAlignment="Center" Foreground="#BDDDF4" HorizontalAlignment="Left" TextWrapping="WrapWithOverflow"/>

<!-- Data Grid -->
<DataGrid Grid.Row="2" Grid.Column="1" Grid.ColumnSpan="2" Grid.RowSpan="4"
x:Name="VisitorRecordsDataGrid" IsReadOnly="True" SelectionUnit="FullRow" AutoGenerateColumns="False" SelectionMode="Single"
LoadingRow="VisitorRecordsDataGrid_LoadingRow"
controls:DataGridTextSearch.SearchValue="{Binding PersonnelNric}"
controls:DataGridTextSearch.SearchValue="{Binding PersonnelNric4D}"
ItemsSource="{Binding ListofVisitorRecords}" SelectedItem="{Binding CurrentSelectedRecord}"
KeyboardNavigation.TabNavigation="None" IsTabStop="False">
<DataGrid.Columns>
<DataGridTextColumn Header="Pass Issued" Width="80" CellStyle="{StaticResource SearchableDataGridCell}" Binding="{Binding Path=PersonnelPass, Mode=OneWay}"/>
<DataGridTextColumn Header="Visitor NRIC" Width="90" CellStyle="{StaticResource SearchableDataGridCell}" Binding="{Binding Path=NRIC, Mode=OneWay}"/>
<DataGridTextColumn Header="Visitor NRIC" Width="90" CellStyle="{StaticResource SearchableDataGridCell}" Binding="{Binding Path=NRIC4D, Mode=OneWay}"/>
<DataGridTextColumn Header="Veh. Pass" Width="80" CellStyle="{StaticResource SearchableDataGridCell}" Binding="{Binding Path=VehiclePass, Mode=OneWay}"/>
<DataGridTextColumn Header="Veh. Num" Width="80" CellStyle="{StaticResource SearchableDataGridCell}" Binding="{Binding Path=VehicleNum, Mode=OneWay, FallbackValue='NA'}" />
<DataGridTextColumn Header="Escort NRIC" Width="90" CellStyle="{StaticResource SearchableDataGridCell}" Binding="{Binding Path=EscortNRIC, Mode=OneWay}"/>
<DataGridTextColumn Header="Escort NRIC" Width="90" CellStyle="{StaticResource SearchableDataGridCell}" Binding="{Binding Path=EscortNRIC4D, Mode=OneWay}"/>
<DataGridTextColumn Header="Locker Tag" Width="80" CellStyle="{StaticResource SearchableDataGridCell}" Binding="{Binding Path=LockerNum, Mode=OneWay}"/>
<DataGridTextColumn Header="Date/Time In" Width="135" CellStyle="{StaticResource SearchableDataGridCell}" Binding="{Binding Path=StartTime, Mode=OneWay, StringFormat=\{0:dd/MM/yy HH:mm:ss\}}" SortDirection="Descending"/>
<DataGridTextColumn Header="Date/Time Out" Width="135" CellStyle="{StaticResource SearchableDataGridCell}" Binding="{Binding Path=EndTime, Mode=OneWay, StringFormat=\{0:dd/MM/yy HH:mm:ss\}}"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@ public string PersonnelNric {
RaisePropertyChangedEvent(nameof(PersonnelNric));
}
}
public string PersonnelNric4D
{
get => _personnelNric?.Substring(5, 4) ?? "NA";
}
public string NameofPersonnel {
get => _nameofPersonnel;
set {
Expand Down Expand Up @@ -69,7 +73,7 @@ public IList<VisitorRecord> ListofVisitorRecords {
}
}

public bool NoRecordsFound => _listofVisitorRecords.Count == 0;
public bool NoRecordsFound => (_listofVisitorRecords?.Count == 0);

public ICommand LookupVisitorCommand {
get => _lookupVisitorCommand;
Expand Down Expand Up @@ -122,7 +126,7 @@ public void LookupVisitorHistory(string visitornric, string rankandFullName) {
return;

PersonnelNric = visitornric;
NameofPersonnel = visitornric + " " + rankandFullName;
NameofPersonnel = visitornric.Substring(5,4) + " " + rankandFullName;
ControlVisibility = Visibility.Visible;
LookupVisitorHistoryhelper(visitornric);
_closeDialogueButton.Focus();
Expand Down