Skip to content

Commit 1170a0a

Browse files
authored
Merge pull request #57 from FourFront-Senior-Design/development
Development
2 parents 18c997c + a962a5d commit 1170a0a

File tree

20 files changed

+594
-324
lines changed

20 files changed

+594
-324
lines changed

DataEntryForm/DataEntryForm.csproj

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -293,5 +293,8 @@
293293
<ItemGroup>
294294
<Resource Include="FormIcon.ico" />
295295
</ItemGroup>
296+
<ItemGroup>
297+
<Resource Include="Emblems\emb-empty.png" />
298+
</ItemGroup>
296299
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
297300
</Project>

DataEntryForm/MainWindow.xaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
44
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
55
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
6-
mc:Ignorable="d" Icon="FormIcon.ico"
7-
Title="Data Entry Form (Version 1.4)" Height="450" Width="800" Background="#FFE4E4E4">
6+
mc:Ignorable="d" Icon="FormIcon.ico" Title="{Binding Title}"
7+
Height="450" Width="800" Background="#FFE4E4E4">
88
<Grid>
99
<Grid.RowDefinitions>
1010
<RowDefinition Height="0.2*"/>
@@ -75,7 +75,7 @@
7575
FontSize="18"
7676
Margin="10"
7777
Click="ReviewClick"
78-
IsEnabled="{Binding EnableExtract}" />
78+
IsEnabled="{Binding ReviewButtonEnabled}" />
7979

8080
<Button
8181
Content="Exit"

DataEntryForm/MainWindow.xaml.cs

Lines changed: 11 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -22,54 +22,37 @@ public MainWindow(IMainWindowVM viewModel)
2222

2323
public void ResetMainWindow()
2424
{
25-
_viewModel.EnableExtract = false;
26-
_viewModel.Message = "";
27-
_viewModel.FileLocation = Properties.Settings.Default.databaseFilePath;
25+
_viewModel.ResetWindow();
26+
_viewModel.SetFilePath(Properties.Settings.Default.databaseFilePath);
27+
2828
sectionPath.Focus();
2929
sectionPath.Select(_viewModel.FileLocation.Length, 0);
30+
3031
Trace.WriteLine(_viewModel.FileLocation);
31-
Trace.WriteLine(_viewModel.FileLocation.Length);
3232
}
3333

3434
private void BrowseClick(object sender, RoutedEventArgs e)
35-
{
36-
_viewModel.Message = "";
35+
{
3736
var dialog = new System.Windows.Forms.FolderBrowserDialog();
3837
dialog.ShowDialog();
39-
4038
string selectedPath = dialog.SelectedPath;
41-
if(selectedPath != string.Empty)
42-
{
43-
_viewModel.FileLocation = selectedPath;
44-
}
39+
40+
_viewModel.SetFilePath(selectedPath);
41+
4542
sectionPath.Focus();
4643
sectionPath.Select(_viewModel.FileLocation.Length, 0);
47-
Trace.WriteLine(sectionPath.CaretIndex);
4844
}
4945

5046
private void LoadDataClick(object sender, RoutedEventArgs e)
5147
{
52-
Trace.WriteLine("Printing...");
5348
Trace.WriteLine(_viewModel.FileLocation);
5449

55-
int countData = _viewModel.LoadData();
56-
57-
if(countData == -1)
58-
{
59-
_viewModel.Message = "Invalid Path. Try Again.";
60-
}
61-
else if (countData == 0)
62-
{
63-
_viewModel.Message = "No database found. Try Again.";
64-
}
65-
else
50+
if (_viewModel.LoadData())
6651
{
6752
Properties.Settings.Default.databaseFilePath = _viewModel.FileLocation;
6853
Properties.Settings.Default.Save();
69-
_viewModel.Message = "Successfully uploaded " + countData.ToString() +
70-
" records from the Database";
71-
_viewModel.EnableExtract = true;
7254
}
55+
7356
sectionPath.Focus();
7457
sectionPath.Select(_viewModel.FileLocation.Length, 0);
7558
}
@@ -81,8 +64,7 @@ private void ReviewClick(object sender, RoutedEventArgs e)
8164

8265
private void OnTextChanged(object sender, RoutedEventArgs e)
8366
{
84-
_viewModel.EnableExtract = false;
85-
_viewModel.Message = "";
67+
_viewModel.ResetWindow();
8668
}
8769

8870
private void ExitClick(object sender, RoutedEventArgs e)

DataEntryForm/Properties/AssemblyInfo.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,5 +51,5 @@
5151
// You can specify all the values or you can default the Build and Revision Numbers
5252
// by using the '*' as shown below:
5353
// [assembly: AssemblyVersion("1.0.*")]
54-
[assembly: AssemblyVersion("1.4.0.0")]
55-
[assembly: AssemblyFileVersion("1.4.0.0")]
54+
[assembly: AssemblyVersion("1.5.0.0")]
55+
[assembly: AssemblyFileVersion("1.5.0.0")]

DataEntryForm/ReviewWindow.xaml

Lines changed: 120 additions & 39 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)