diff --git a/Lab/Exercise3/01-Start/ContosoExpenses/ContosoExpenses/ExpenseDetail.xaml b/Lab/Exercise3/01-Start/ContosoExpenses/ContosoExpenses/ExpenseDetail.xaml
index 4fb7a79..6b4efd6 100644
--- a/Lab/Exercise3/01-Start/ContosoExpenses/ContosoExpenses/ExpenseDetail.xaml
+++ b/Lab/Exercise3/01-Start/ContosoExpenses/ContosoExpenses/ExpenseDetail.xaml
@@ -40,7 +40,7 @@
-
+
@@ -67,11 +67,11 @@
-
+
-
+
-
+
diff --git a/Lab/Exercise3/02-End/ContosoExpenses/ContosoExpenses.Package/ContosoExpenses.Package.wapproj b/Lab/Exercise3/02-End/ContosoExpenses/ContosoExpenses.Package/ContosoExpenses.Package.wapproj
index cbfe31c..6b5199b 100644
--- a/Lab/Exercise3/02-End/ContosoExpenses/ContosoExpenses.Package/ContosoExpenses.Package.wapproj
+++ b/Lab/Exercise3/02-End/ContosoExpenses/ContosoExpenses.Package/ContosoExpenses.Package.wapproj
@@ -34,21 +34,20 @@
- f0388f05-addf-498a-b87f-62c88aa49022
+ 2d8fd114-a304-45b1-bca2-16949103603e
10.0.17763.0
10.0.17763.0
en-US
ContosoExpenses.Package_TemporaryKey.pfx
- 840FBCC4422ED8EF0A173F9309A29C681DF0B5EA
..\ContosoExpenses\ContosoExpenses.csproj
Designer
+
-
diff --git a/Lab/Exercise3/02-End/ContosoExpenses/ContosoExpenses.Package/Package.appxmanifest b/Lab/Exercise3/02-End/ContosoExpenses/ContosoExpenses.Package/Package.appxmanifest
index a01cf89..aba7ddc 100644
--- a/Lab/Exercise3/02-End/ContosoExpenses/ContosoExpenses.Package/Package.appxmanifest
+++ b/Lab/Exercise3/02-End/ContosoExpenses/ContosoExpenses.Package/Package.appxmanifest
@@ -1,28 +1,49 @@
-
-
+
+
+
+
+
- Contoso Expenses
- Windows AppConsult
+ ContosoExpenses.Package
+ mpagani
Images\StoreLogo.png
+
+
-
+
+
-
-
-
-
+
+
+
+
-
\ No newline at end of file
+
diff --git a/Lab/Exercise3/02-End/ContosoExpenses/ContosoExpenses.sln b/Lab/Exercise3/02-End/ContosoExpenses/ContosoExpenses.sln
index 600e200..2e4933f 100644
--- a/Lab/Exercise3/02-End/ContosoExpenses/ContosoExpenses.sln
+++ b/Lab/Exercise3/02-End/ContosoExpenses/ContosoExpenses.sln
@@ -5,7 +5,7 @@ VisualStudioVersion = 16.0.28407.52
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ContosoExpenses", "ContosoExpenses\ContosoExpenses.csproj", "{A3E7CBAC-2DFE-463B-B7F9-0B6477EA7A37}"
EndProject
-Project("{C7167F0D-BC9F-4E6E-AFE1-012C56B48DB5}") = "ContosoExpenses.Package", "ContosoExpenses.Package\ContosoExpenses.Package.wapproj", "{F0388F05-ADDF-498A-B87F-62C88AA49022}"
+Project("{C7167F0D-BC9F-4E6E-AFE1-012C56B48DB5}") = "ContosoExpenses.Package", "ContosoExpenses.Package\ContosoExpenses.Package.wapproj", "{2D8FD114-A304-45B1-BCA2-16949103603E}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@@ -29,24 +29,24 @@ Global
{A3E7CBAC-2DFE-463B-B7F9-0B6477EA7A37}.Release|x64.Build.0 = Release|Any CPU
{A3E7CBAC-2DFE-463B-B7F9-0B6477EA7A37}.Release|x86.ActiveCfg = Release|Any CPU
{A3E7CBAC-2DFE-463B-B7F9-0B6477EA7A37}.Release|x86.Build.0 = Release|Any CPU
- {F0388F05-ADDF-498A-B87F-62C88AA49022}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {F0388F05-ADDF-498A-B87F-62C88AA49022}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {F0388F05-ADDF-498A-B87F-62C88AA49022}.Debug|Any CPU.Deploy.0 = Debug|Any CPU
- {F0388F05-ADDF-498A-B87F-62C88AA49022}.Debug|x64.ActiveCfg = Debug|x64
- {F0388F05-ADDF-498A-B87F-62C88AA49022}.Debug|x64.Build.0 = Debug|x64
- {F0388F05-ADDF-498A-B87F-62C88AA49022}.Debug|x64.Deploy.0 = Debug|x64
- {F0388F05-ADDF-498A-B87F-62C88AA49022}.Debug|x86.ActiveCfg = Debug|x86
- {F0388F05-ADDF-498A-B87F-62C88AA49022}.Debug|x86.Build.0 = Debug|x86
- {F0388F05-ADDF-498A-B87F-62C88AA49022}.Debug|x86.Deploy.0 = Debug|x86
- {F0388F05-ADDF-498A-B87F-62C88AA49022}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {F0388F05-ADDF-498A-B87F-62C88AA49022}.Release|Any CPU.Build.0 = Release|Any CPU
- {F0388F05-ADDF-498A-B87F-62C88AA49022}.Release|Any CPU.Deploy.0 = Release|Any CPU
- {F0388F05-ADDF-498A-B87F-62C88AA49022}.Release|x64.ActiveCfg = Release|x64
- {F0388F05-ADDF-498A-B87F-62C88AA49022}.Release|x64.Build.0 = Release|x64
- {F0388F05-ADDF-498A-B87F-62C88AA49022}.Release|x64.Deploy.0 = Release|x64
- {F0388F05-ADDF-498A-B87F-62C88AA49022}.Release|x86.ActiveCfg = Release|x86
- {F0388F05-ADDF-498A-B87F-62C88AA49022}.Release|x86.Build.0 = Release|x86
- {F0388F05-ADDF-498A-B87F-62C88AA49022}.Release|x86.Deploy.0 = Release|x86
+ {2D8FD114-A304-45B1-BCA2-16949103603E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {2D8FD114-A304-45B1-BCA2-16949103603E}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {2D8FD114-A304-45B1-BCA2-16949103603E}.Debug|Any CPU.Deploy.0 = Debug|Any CPU
+ {2D8FD114-A304-45B1-BCA2-16949103603E}.Debug|x64.ActiveCfg = Debug|x64
+ {2D8FD114-A304-45B1-BCA2-16949103603E}.Debug|x64.Build.0 = Debug|x64
+ {2D8FD114-A304-45B1-BCA2-16949103603E}.Debug|x64.Deploy.0 = Debug|x64
+ {2D8FD114-A304-45B1-BCA2-16949103603E}.Debug|x86.ActiveCfg = Debug|x86
+ {2D8FD114-A304-45B1-BCA2-16949103603E}.Debug|x86.Build.0 = Debug|x86
+ {2D8FD114-A304-45B1-BCA2-16949103603E}.Debug|x86.Deploy.0 = Debug|x86
+ {2D8FD114-A304-45B1-BCA2-16949103603E}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {2D8FD114-A304-45B1-BCA2-16949103603E}.Release|Any CPU.Build.0 = Release|Any CPU
+ {2D8FD114-A304-45B1-BCA2-16949103603E}.Release|Any CPU.Deploy.0 = Release|Any CPU
+ {2D8FD114-A304-45B1-BCA2-16949103603E}.Release|x64.ActiveCfg = Release|x64
+ {2D8FD114-A304-45B1-BCA2-16949103603E}.Release|x64.Build.0 = Release|x64
+ {2D8FD114-A304-45B1-BCA2-16949103603E}.Release|x64.Deploy.0 = Release|x64
+ {2D8FD114-A304-45B1-BCA2-16949103603E}.Release|x86.ActiveCfg = Release|x86
+ {2D8FD114-A304-45B1-BCA2-16949103603E}.Release|x86.Build.0 = Release|x86
+ {2D8FD114-A304-45B1-BCA2-16949103603E}.Release|x86.Deploy.0 = Release|x86
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
diff --git a/Lab/Exercise3/02-End/ContosoExpenses/ContosoExpenses/AboutView.xaml b/Lab/Exercise3/02-End/ContosoExpenses/ContosoExpenses/AboutView.xaml
index 01a72f4..438749e 100644
--- a/Lab/Exercise3/02-End/ContosoExpenses/ContosoExpenses/AboutView.xaml
+++ b/Lab/Exercise3/02-End/ContosoExpenses/ContosoExpenses/AboutView.xaml
@@ -18,7 +18,6 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
- xmlns:toolkit="clr-namespace:Microsoft.Toolkit.Wpf.UI.Controls;assembly=Microsoft.Toolkit.Wpf.UI.Controls.WebView"
mc:Ignorable="d" MinHeight="500" MinWidth="700" Height="500" Width="700">
@@ -27,7 +26,10 @@
- About Contoso:
-
+
+ Contoso Expenses is a 'modern application of yesterday tomorrow' from Contoso Corp.
+
+
diff --git a/Lab/Exercise3/02-End/ContosoExpenses/ContosoExpenses/AboutView.xaml.cs b/Lab/Exercise3/02-End/ContosoExpenses/ContosoExpenses/AboutView.xaml.cs
index 8502e06..7b508bc 100644
--- a/Lab/Exercise3/02-End/ContosoExpenses/ContosoExpenses/AboutView.xaml.cs
+++ b/Lab/Exercise3/02-End/ContosoExpenses/ContosoExpenses/AboutView.xaml.cs
@@ -12,7 +12,6 @@
// ******************************************************************
-using Microsoft.Toolkit.Wpf.UI.Controls;
using System.Linq;
using System.Linq.Expressions;
@@ -23,18 +22,6 @@ namespace ContosoExpenses
public AboutView()
{
InitializeComponent();
- Loaded += AboutView_Loaded;
- }
-
- private void AboutView_Loaded(object sender, System.Windows.RoutedEventArgs e)
- {
- // Workaround for scaling issue
- var webView = LayoutRoot.Children.OfType().FirstOrDefault();
-
- if(webView != null)
- {
- webView.NavigationCompleted += (s,a) => { webView.Height = this.Height; webView.Width = this.Width; };
- }
}
}
}
diff --git a/Lab/Exercise5/02-End/ContosoExpenses/ContosoExpenses/AddNewExpense.xaml b/Lab/Exercise3/02-End/ContosoExpenses/ContosoExpenses/AddNewExpense.xaml
similarity index 91%
rename from Lab/Exercise5/02-End/ContosoExpenses/ContosoExpenses/AddNewExpense.xaml
rename to Lab/Exercise3/02-End/ContosoExpenses/ContosoExpenses/AddNewExpense.xaml
index 2a3c6fe..66a33e8 100644
--- a/Lab/Exercise5/02-End/ContosoExpenses/ContosoExpenses/AddNewExpense.xaml
+++ b/Lab/Exercise3/02-End/ContosoExpenses/ContosoExpenses/AddNewExpense.xaml
@@ -59,10 +59,11 @@
-
-
-
+
+
+
diff --git a/Lab/Exercise5/02-End/ContosoExpenses/ContosoExpenses/AddNewExpense.xaml.cs b/Lab/Exercise3/02-End/ContosoExpenses/ContosoExpenses/AddNewExpense.xaml.cs
similarity index 69%
rename from Lab/Exercise5/02-End/ContosoExpenses/ContosoExpenses/AddNewExpense.xaml.cs
rename to Lab/Exercise3/02-End/ContosoExpenses/ContosoExpenses/AddNewExpense.xaml.cs
index 380ce35..67e7057 100644
--- a/Lab/Exercise5/02-End/ContosoExpenses/ContosoExpenses/AddNewExpense.xaml.cs
+++ b/Lab/Exercise3/02-End/ContosoExpenses/ContosoExpenses/AddNewExpense.xaml.cs
@@ -29,6 +29,8 @@ namespace ContosoExpenses
{
public int EmployeeId { get; set; }
+ private DateTime SelectedDate;
+
public AddNewExpense()
{
InitializeComponent();
@@ -45,7 +47,7 @@ namespace ContosoExpenses
Cost = Convert.ToDouble(txtAmount.Text),
Description = txtDescription.Text,
Type = txtType.Text,
- Date = CalendarUwp.SelectedDates.FirstOrDefault().DateTime,
+ Date = SelectedDate,
EmployeeId = EmployeeId
};
@@ -59,14 +61,32 @@ namespace ContosoExpenses
}
}
+ private void CalendarUwp_ChildChanged(object sender, EventArgs e)
+ {
+ WindowsXamlHost windowsXamlHost = (WindowsXamlHost)sender;
+
+ Windows.UI.Xaml.Controls.CalendarView calendarView =
+ (Windows.UI.Xaml.Controls.CalendarView)windowsXamlHost.Child;
+
+ if (calendarView != null)
+ {
+ calendarView.SelectedDatesChanged += (obj, args) =>
+ {
+ if (calendarView.SelectedDates.Count > 0)
+ {
+ SelectedDate = calendarView.SelectedDates.FirstOrDefault().DateTime;
+ txtDate.Text = SelectedDate.ToShortDateString();
+ }
+ };
+
+ calendarView.MinDate = DateTimeOffset.Now.AddYears(-1);
+ calendarView.MaxDate = DateTimeOffset.Now;
+ }
+ }
+
private void Window_Closed(object sender, EventArgs e)
{
CalendarUwp.Dispose();
}
-
- private void CalendarUwp_SelectedDatesChanged(object sender, SelectedDatesChangedEventArgs e)
- {
- txtDate.Text = e.SelectedDates.FirstOrDefault().DateTime.ToShortDateString();
- }
}
}
diff --git a/Lab/Exercise3/02-End/ContosoExpenses/ContosoExpenses/App.xaml b/Lab/Exercise3/02-End/ContosoExpenses/ContosoExpenses/App.xaml
index e87dee4..4bdb029 100644
--- a/Lab/Exercise3/02-End/ContosoExpenses/ContosoExpenses/App.xaml
+++ b/Lab/Exercise3/02-End/ContosoExpenses/ContosoExpenses/App.xaml
@@ -1,9 +1,55 @@
-
+
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Lab/Exercise3/02-End/ContosoExpenses/ContosoExpenses/ContosoExpenses.csproj b/Lab/Exercise3/02-End/ContosoExpenses/ContosoExpenses/ContosoExpenses.csproj
index d4cb9f9..aefd115 100644
--- a/Lab/Exercise3/02-End/ContosoExpenses/ContosoExpenses/ContosoExpenses.csproj
+++ b/Lab/Exercise3/02-End/ContosoExpenses/ContosoExpenses/ContosoExpenses.csproj
@@ -37,7 +37,7 @@
4
- contoso.ico
+ Images\contoso.ico
@@ -49,9 +49,6 @@
..\packages\Microsoft.Toolkit.Wpf.UI.Controls.5.0.1\lib\net462\Microsoft.Toolkit.Wpf.UI.Controls.dll
-
- ..\packages\Microsoft.Toolkit.Wpf.UI.Controls.WebView.5.0.1\lib\net462\Microsoft.Toolkit.Wpf.UI.Controls.WebView.dll
-
..\packages\Microsoft.Toolkit.Wpf.UI.XamlHost.5.0.1\lib\net462\Microsoft.Toolkit.Wpf.UI.XamlHost.dll
@@ -62,7 +59,7 @@
False
- C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETCore\v4.5\System.Runtime.WindowsRuntime.dll
+ C:\Windows\Microsoft.NET\Framework\v4.0.30319\System.Runtime.WindowsRuntime.dll
@@ -87,6 +84,9 @@
MSBuild:Compile
Designer
+
+ AddNewExpense.xaml
+
ExpensesList.xaml
@@ -95,6 +95,10 @@
MSBuild:Compile
Designer
+
+ Designer
+ MSBuild:Compile
+
Designer
MSBuild:Compile
@@ -152,7 +156,21 @@
-
+
+
+
+
+ PreserveNewest
+
+
+ PreserveNewest
+
+
+ PreserveNewest
+
+
+ PreserveNewest
+
\ No newline at end of file
diff --git a/Lab/Exercise3/02-End/ContosoExpenses/ContosoExpenses/ExpenseDetail.xaml b/Lab/Exercise3/02-End/ContosoExpenses/ContosoExpenses/ExpenseDetail.xaml
index 99807a9..6b4efd6 100644
--- a/Lab/Exercise3/02-End/ContosoExpenses/ContosoExpenses/ExpenseDetail.xaml
+++ b/Lab/Exercise3/02-End/ContosoExpenses/ContosoExpenses/ExpenseDetail.xaml
@@ -1,54 +1,146 @@
-
+
-
+ Title="Expense Detail" Height="500" Width="800"
+ Background="{StaticResource HorizontalBackground}">
-
-
-
-
-
-
-
-
-
-
+
+
+
+
-
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
+
-
-
-
-
+
+
+
+
-
-
-
-
+
+
+
+
-
-
-
-
+
+
+
+
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
diff --git a/Lab/Exercise3/02-End/ContosoExpenses/ContosoExpenses/ExpenseDetail.xaml.cs b/Lab/Exercise3/02-End/ContosoExpenses/ContosoExpenses/ExpenseDetail.xaml.cs
index 0b6e06a..4275799 100644
--- a/Lab/Exercise3/02-End/ContosoExpenses/ContosoExpenses/ExpenseDetail.xaml.cs
+++ b/Lab/Exercise3/02-End/ContosoExpenses/ContosoExpenses/ExpenseDetail.xaml.cs
@@ -1,4 +1,18 @@
-using System;
+// ******************************************************************
+
+// Copyright (c) Microsoft. All rights reserved.
+// This code is licensed under the MIT License (MIT).
+// THE CODE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH
+// THE CODE OR THE USE OR OTHER DEALINGS IN THE CODE.
+
+// ******************************************************************
+
+using System;
using System.Linq;
using System.Windows;
using ContosoExpenses.Models;
@@ -17,8 +31,9 @@ namespace ContosoExpenses
public ExpenseDetail()
{
InitializeComponent();
+ Signature.InkPresenter.InputDeviceTypes = CoreInputDeviceTypes.Mouse | CoreInputDeviceTypes.Pen;
+
MapService.ServiceToken = "IFFAI5SFOtHV9VBKF8Ea~3FS1XamCV2NM0IqlfoQo6A~AguqcUboJvnqWU1H9E-6MVThouJoCrM4wpv_1R_KX_oQLV_e59vyoK42470JvLsU";
- SignatureCanvas.InkPresenter.InputDeviceTypes = CoreInputDeviceTypes.Mouse | CoreInputDeviceTypes.Pen;
}
private async void Window_Loaded(object sender, RoutedEventArgs e)
@@ -27,24 +42,20 @@ namespace ContosoExpenses
txtDescription.Text = SelectedExpense.Description;
txtLocation.Text = SelectedExpense.Address;
txtAmount.Text = SelectedExpense.Cost.ToString();
-
- BasicGeoposition queryHint = new BasicGeoposition();
- queryHint.Latitude = 47.643;
- queryHint.Longitude = -122.131;
- Geopoint hintPoint = new Geopoint(queryHint);
+ Chart.Height = (SelectedExpense.Cost * 400) / 1000;
var result = await MapLocationFinder.FindLocationsAsync(SelectedExpense.Address, null);
var location = result.Locations.FirstOrDefault();
if (location != null)
{
- await UserLocation.TrySetViewAsync(location.Point, 13);
+ await ExpenseMap.TrySetViewAsync(location.Point, 13);
}
}
- private void Window_Closing(object sender, System.ComponentModel.CancelEventArgs e)
+ private void Window_Closed(object sender, EventArgs e)
{
- UserLocation.Dispose();
- SignatureCanvas.Dispose();
+ Signature.Dispose();
+ ExpenseMap.Dispose();
}
}
}
diff --git a/Lab/Exercise3/02-End/ContosoExpenses/ContosoExpenses/ExpensesList.xaml b/Lab/Exercise3/02-End/ContosoExpenses/ContosoExpenses/ExpensesList.xaml
index 7a15781..400d21e 100644
--- a/Lab/Exercise3/02-End/ContosoExpenses/ContosoExpenses/ExpensesList.xaml
+++ b/Lab/Exercise3/02-End/ContosoExpenses/ContosoExpenses/ExpensesList.xaml
@@ -1,4 +1,19 @@
-
+
-
-
+ Activated="Window_Activated"
+ Title="Expenses List" Height="450" Width="800"
+ Background="{StaticResource ExpensesListBackground}">
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
+
+
+
+
+
+
+
+
diff --git a/Lab/Exercise3/02-End/ContosoExpenses/ContosoExpenses/ExpensesList.xaml.cs b/Lab/Exercise3/02-End/ContosoExpenses/ContosoExpenses/ExpensesList.xaml.cs
index 158fdd4..8e58c9c 100644
--- a/Lab/Exercise3/02-End/ContosoExpenses/ContosoExpenses/ExpensesList.xaml.cs
+++ b/Lab/Exercise3/02-End/ContosoExpenses/ContosoExpenses/ExpensesList.xaml.cs
@@ -1,4 +1,18 @@
-using System;
+// ******************************************************************
+
+// Copyright (c) Microsoft. All rights reserved.
+// This code is licensed under the MIT License (MIT).
+// THE CODE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH
+// THE CODE OR THE USE OR OTHER DEALINGS IN THE CODE.
+
+// ******************************************************************
+
+using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
@@ -32,17 +46,44 @@ namespace ContosoExpenses
private void OnSelectedExpense(object sender, SelectionChangedEventArgs e)
{
- var expense = e.AddedItems[0] as Expense;
- ExpenseDetail detail = new ExpenseDetail();
- detail.SelectedExpense = expense;
- detail.ShowDialog();
+ if (e.AddedItems.Count > 0)
+ {
+ var expense = e.AddedItems[0] as Expense;
+ if (expense != null && expense.ExpenseId != 0)
+ {
+ ExpenseDetail detail = new ExpenseDetail();
+ detail.SelectedExpense = expense;
+ detail.ShowDialog();
+ }
+ }
}
private void Window_Loaded(object sender, RoutedEventArgs e)
{
DatabaseService databaseService = new DatabaseService();
selectedEmployee = databaseService.GetEmployee(EmployeeId);
+
+ txtEmployeeId.Text = selectedEmployee.EmployeeId.ToString();
+ txtFullName.Text = $"{selectedEmployee.FirstName} {selectedEmployee.LastName}";
+ txtEmail.Text = selectedEmployee.Email;
+ }
+
+ private void OnAddNewExpense(object sender, RoutedEventArgs e)
+ {
+ AddNewExpense newExpense = new AddNewExpense();
+ newExpense.EmployeeId = EmployeeId;
+ newExpense.ShowDialog();
+ }
+
+ public void LoadData()
+ {
+ DatabaseService databaseService = new DatabaseService();
ExpensesGrid.ItemsSource = databaseService.GetExpenses(EmployeeId);
}
+
+ private void Window_Activated(object sender, EventArgs e)
+ {
+ LoadData();
+ }
}
}
diff --git a/Lab/Exercise4/01-Start/ContosoExpenses/ContosoExpenses/Images/AddNewExpense.png b/Lab/Exercise3/02-End/ContosoExpenses/ContosoExpenses/Images/AddNewExpense.png
similarity index 100%
rename from Lab/Exercise4/01-Start/ContosoExpenses/ContosoExpenses/Images/AddNewExpense.png
rename to Lab/Exercise3/02-End/ContosoExpenses/ContosoExpenses/Images/AddNewExpense.png
diff --git a/Lab/Exercise4/01-Start/ContosoExpenses/ContosoExpenses/Images/ExpensesBackground.jpg b/Lab/Exercise3/02-End/ContosoExpenses/ContosoExpenses/Images/ExpensesBackground.jpg
similarity index 100%
rename from Lab/Exercise4/01-Start/ContosoExpenses/ContosoExpenses/Images/ExpensesBackground.jpg
rename to Lab/Exercise3/02-End/ContosoExpenses/ContosoExpenses/Images/ExpensesBackground.jpg
diff --git a/Lab/Exercise4/01-Start/ContosoExpenses/ContosoExpenses/Images/ExpensesListBackground.png b/Lab/Exercise3/02-End/ContosoExpenses/ContosoExpenses/Images/ExpensesListBackground.png
similarity index 100%
rename from Lab/Exercise4/01-Start/ContosoExpenses/ContosoExpenses/Images/ExpensesListBackground.png
rename to Lab/Exercise3/02-End/ContosoExpenses/ContosoExpenses/Images/ExpensesListBackground.png
diff --git a/Lab/Exercise4/01-Start/ContosoExpenses/ContosoExpenses/Images/HorizontalBackground.png b/Lab/Exercise3/02-End/ContosoExpenses/ContosoExpenses/Images/HorizontalBackground.png
similarity index 100%
rename from Lab/Exercise4/01-Start/ContosoExpenses/ContosoExpenses/Images/HorizontalBackground.png
rename to Lab/Exercise3/02-End/ContosoExpenses/ContosoExpenses/Images/HorizontalBackground.png
diff --git a/Lab/Exercise3/02-End/ContosoExpenses/ContosoExpenses/contoso.ico b/Lab/Exercise3/02-End/ContosoExpenses/ContosoExpenses/Images/contoso.ico
similarity index 100%
rename from Lab/Exercise3/02-End/ContosoExpenses/ContosoExpenses/contoso.ico
rename to Lab/Exercise3/02-End/ContosoExpenses/ContosoExpenses/Images/contoso.ico
diff --git a/Lab/Exercise3/02-End/ContosoExpenses/ContosoExpenses/MainWindow.xaml b/Lab/Exercise3/02-End/ContosoExpenses/ContosoExpenses/MainWindow.xaml
index 90830d9..8f3bbe5 100644
--- a/Lab/Exercise3/02-End/ContosoExpenses/ContosoExpenses/MainWindow.xaml
+++ b/Lab/Exercise3/02-End/ContosoExpenses/ContosoExpenses/MainWindow.xaml
@@ -1,31 +1,62 @@
-
+
-
-
+ Title="Contoso Expenses" Height="450" Width="800"
+ Background="{StaticResource MainBackground}">
+
+
+
+
-
-
+
-
+
-
-
-
-
+
+
+
+
+
+
+
diff --git a/Lab/Exercise3/02-End/ContosoExpenses/ContosoExpenses/MainWindow.xaml.cs b/Lab/Exercise3/02-End/ContosoExpenses/ContosoExpenses/MainWindow.xaml.cs
index 34fa013..18b62ca 100644
--- a/Lab/Exercise3/02-End/ContosoExpenses/ContosoExpenses/MainWindow.xaml.cs
+++ b/Lab/Exercise3/02-End/ContosoExpenses/ContosoExpenses/MainWindow.xaml.cs
@@ -1,4 +1,18 @@
-using System.Collections.Generic;
+// ******************************************************************
+
+// Copyright (c) Microsoft. All rights reserved.
+// This code is licensed under the MIT License (MIT).
+// THE CODE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH
+// THE CODE OR THE USE OR OTHER DEALINGS IN THE CODE.
+
+// ******************************************************************
+
+using System.Collections.Generic;
using System.Windows;
using System.Windows.Controls;
using ContosoExpenses.Models;
@@ -32,10 +46,16 @@ namespace ContosoExpenses
private void OnSelectedEmployee(object sender, SelectionChangedEventArgs e)
{
- var employee = e.AddedItems[0] as Employee;
- ExpensesList detail = new ExpensesList();
- detail.EmployeeId = employee.EmployeeId;
- detail.Show();
+ if (e.AddedItems.Count > 0)
+ {
+ var employee = e.AddedItems[0] as Employee;
+ if (employee != null && employee.EmployeeId != 0)
+ {
+ ExpensesList detail = new ExpensesList();
+ detail.EmployeeId = employee.EmployeeId;
+ detail.Show();
+ }
+ }
}
private void OnOpenAbout(object sender, RoutedEventArgs e)
diff --git a/Lab/Exercise3/02-End/ContosoExpenses/ContosoExpenses/Models/Expense.cs b/Lab/Exercise3/02-End/ContosoExpenses/ContosoExpenses/Models/Expense.cs
index 4b1192d..791cfbd 100644
--- a/Lab/Exercise3/02-End/ContosoExpenses/ContosoExpenses/Models/Expense.cs
+++ b/Lab/Exercise3/02-End/ContosoExpenses/ContosoExpenses/Models/Expense.cs
@@ -1,4 +1,6 @@
-namespace ContosoExpenses.Models
+using System;
+
+namespace ContosoExpenses.Models
{
public class Expense
{
@@ -8,6 +10,7 @@
public double Cost { get; set; }
public string Address { get; set; }
public string City { get; set; }
+ public DateTime Date { get; set; }
public int EmployeeId { get; set; }
}
}
diff --git a/Lab/Exercise3/02-End/ContosoExpenses/ContosoExpenses/Properties/AssemblyInfo.cs b/Lab/Exercise3/02-End/ContosoExpenses/ContosoExpenses/Properties/AssemblyInfo.cs
index 5ea58b0..a68a32b 100644
--- a/Lab/Exercise3/02-End/ContosoExpenses/ContosoExpenses/Properties/AssemblyInfo.cs
+++ b/Lab/Exercise3/02-End/ContosoExpenses/ContosoExpenses/Properties/AssemblyInfo.cs
@@ -12,7 +12,7 @@ using System.Windows;
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("XamlIslandDemo")]
-[assembly: AssemblyCopyright("Copyright © 2018")]
+[assembly: AssemblyCopyright("Copyright © 2019")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
diff --git a/Lab/Exercise3/02-End/ContosoExpenses/ContosoExpenses/Services/DatabaseService.cs b/Lab/Exercise3/02-End/ContosoExpenses/ContosoExpenses/Services/DatabaseService.cs
index 1a7e775..764603b 100644
--- a/Lab/Exercise3/02-End/ContosoExpenses/ContosoExpenses/Services/DatabaseService.cs
+++ b/Lab/Exercise3/02-End/ContosoExpenses/ContosoExpenses/Services/DatabaseService.cs
@@ -43,6 +43,15 @@ namespace ContosoExpenses.Services
}
}
+ public void SaveExpense(Expense expense)
+ {
+ using (var connection = new LiteDatabase(filePath))
+ {
+ var expenses = connection.GetCollection();
+ expenses.Insert(expense);
+ }
+ }
+
public void InitializeDatabase()
{
if (!File.Exists(filePath))
@@ -88,6 +97,7 @@ namespace ContosoExpenses.Services
.RuleFor(x => x.Cost, (f, u) => (double)f.Finance.Amount())
.RuleFor(x => x.Address, (f, u) => f.Address.FullAddress())
.RuleFor(x => x.City, (f, u) => f.Address.City())
+ .RuleFor(x => x.Date, (f, u) => f.Date.Past())
.Generate();
expense.EmployeeId = employeeId;
diff --git a/Lab/Exercise3/02-End/ContosoExpenses/ContosoExpenses/packages.config b/Lab/Exercise3/02-End/ContosoExpenses/ContosoExpenses/packages.config
index 6c508dd..e45ff71 100644
--- a/Lab/Exercise3/02-End/ContosoExpenses/ContosoExpenses/packages.config
+++ b/Lab/Exercise3/02-End/ContosoExpenses/ContosoExpenses/packages.config
@@ -3,6 +3,5 @@
-
\ No newline at end of file
diff --git a/Lab/Exercise4/01-Start/ContosoExpenses/ContosoExpenses.Package/ContosoExpenses.Package.wapproj b/Lab/Exercise4/01-Start/ContosoExpenses/ContosoExpenses.Package/ContosoExpenses.Package.wapproj
deleted file mode 100644
index 6b5199b..0000000
--- a/Lab/Exercise4/01-Start/ContosoExpenses/ContosoExpenses.Package/ContosoExpenses.Package.wapproj
+++ /dev/null
@@ -1,62 +0,0 @@
-
-
-
- 15.0
-
-
-
- Debug
- x86
-
-
- Release
- x86
-
-
- Debug
- x64
-
-
- Release
- x64
-
-
- Debug
- AnyCPU
-
-
- Release
- AnyCPU
-
-
-
- $(MSBuildExtensionsPath)\Microsoft\DesktopBridge\
-
-
-
- 2d8fd114-a304-45b1-bca2-16949103603e
- 10.0.17763.0
- 10.0.17763.0
- en-US
- ContosoExpenses.Package_TemporaryKey.pfx
- ..\ContosoExpenses\ContosoExpenses.csproj
-
-
-
- Designer
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/Lab/Exercise4/01-Start/ContosoExpenses/ContosoExpenses.Package/Images/LockScreenLogo.scale-200.png b/Lab/Exercise4/01-Start/ContosoExpenses/ContosoExpenses.Package/Images/LockScreenLogo.scale-200.png
deleted file mode 100644
index 735f57a..0000000
Binary files a/Lab/Exercise4/01-Start/ContosoExpenses/ContosoExpenses.Package/Images/LockScreenLogo.scale-200.png and /dev/null differ
diff --git a/Lab/Exercise4/01-Start/ContosoExpenses/ContosoExpenses.Package/Images/Square150x150Logo.scale-200.png b/Lab/Exercise4/01-Start/ContosoExpenses/ContosoExpenses.Package/Images/Square150x150Logo.scale-200.png
deleted file mode 100644
index af49fec..0000000
Binary files a/Lab/Exercise4/01-Start/ContosoExpenses/ContosoExpenses.Package/Images/Square150x150Logo.scale-200.png and /dev/null differ
diff --git a/Lab/Exercise4/01-Start/ContosoExpenses/ContosoExpenses.Package/Images/Square44x44Logo.scale-200.png b/Lab/Exercise4/01-Start/ContosoExpenses/ContosoExpenses.Package/Images/Square44x44Logo.scale-200.png
deleted file mode 100644
index ce342a2..0000000
Binary files a/Lab/Exercise4/01-Start/ContosoExpenses/ContosoExpenses.Package/Images/Square44x44Logo.scale-200.png and /dev/null differ
diff --git a/Lab/Exercise4/01-Start/ContosoExpenses/ContosoExpenses.Package/Images/Square44x44Logo.targetsize-24_altform-unplated.png b/Lab/Exercise4/01-Start/ContosoExpenses/ContosoExpenses.Package/Images/Square44x44Logo.targetsize-24_altform-unplated.png
deleted file mode 100644
index f6c02ce..0000000
Binary files a/Lab/Exercise4/01-Start/ContosoExpenses/ContosoExpenses.Package/Images/Square44x44Logo.targetsize-24_altform-unplated.png and /dev/null differ
diff --git a/Lab/Exercise4/01-Start/ContosoExpenses/ContosoExpenses.Package/Images/StoreLogo.png b/Lab/Exercise4/01-Start/ContosoExpenses/ContosoExpenses.Package/Images/StoreLogo.png
deleted file mode 100644
index 7385b56..0000000
Binary files a/Lab/Exercise4/01-Start/ContosoExpenses/ContosoExpenses.Package/Images/StoreLogo.png and /dev/null differ
diff --git a/Lab/Exercise4/01-Start/ContosoExpenses/ContosoExpenses.Package/Images/Wide310x150Logo.scale-200.png b/Lab/Exercise4/01-Start/ContosoExpenses/ContosoExpenses.Package/Images/Wide310x150Logo.scale-200.png
deleted file mode 100644
index 288995b..0000000
Binary files a/Lab/Exercise4/01-Start/ContosoExpenses/ContosoExpenses.Package/Images/Wide310x150Logo.scale-200.png and /dev/null differ
diff --git a/Lab/Exercise4/01-Start/ContosoExpenses/ContosoExpenses.Package/Package.appxmanifest b/Lab/Exercise4/01-Start/ContosoExpenses/ContosoExpenses.Package/Package.appxmanifest
deleted file mode 100644
index aba7ddc..0000000
--- a/Lab/Exercise4/01-Start/ContosoExpenses/ContosoExpenses.Package/Package.appxmanifest
+++ /dev/null
@@ -1,49 +0,0 @@
-
-
-
-
-
-
-
- ContosoExpenses.Package
- mpagani
- Images\StoreLogo.png
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/Lab/Exercise4/01-Start/ContosoExpenses/ContosoExpenses.sln b/Lab/Exercise4/01-Start/ContosoExpenses/ContosoExpenses.sln
deleted file mode 100644
index 2e4933f..0000000
--- a/Lab/Exercise4/01-Start/ContosoExpenses/ContosoExpenses.sln
+++ /dev/null
@@ -1,57 +0,0 @@
-
-Microsoft Visual Studio Solution File, Format Version 12.00
-# Visual Studio Version 16
-VisualStudioVersion = 16.0.28407.52
-MinimumVisualStudioVersion = 10.0.40219.1
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ContosoExpenses", "ContosoExpenses\ContosoExpenses.csproj", "{A3E7CBAC-2DFE-463B-B7F9-0B6477EA7A37}"
-EndProject
-Project("{C7167F0D-BC9F-4E6E-AFE1-012C56B48DB5}") = "ContosoExpenses.Package", "ContosoExpenses.Package\ContosoExpenses.Package.wapproj", "{2D8FD114-A304-45B1-BCA2-16949103603E}"
-EndProject
-Global
- GlobalSection(SolutionConfigurationPlatforms) = preSolution
- Debug|Any CPU = Debug|Any CPU
- Debug|x64 = Debug|x64
- Debug|x86 = Debug|x86
- Release|Any CPU = Release|Any CPU
- Release|x64 = Release|x64
- Release|x86 = Release|x86
- EndGlobalSection
- GlobalSection(ProjectConfigurationPlatforms) = postSolution
- {A3E7CBAC-2DFE-463B-B7F9-0B6477EA7A37}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {A3E7CBAC-2DFE-463B-B7F9-0B6477EA7A37}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {A3E7CBAC-2DFE-463B-B7F9-0B6477EA7A37}.Debug|x64.ActiveCfg = Debug|Any CPU
- {A3E7CBAC-2DFE-463B-B7F9-0B6477EA7A37}.Debug|x64.Build.0 = Debug|Any CPU
- {A3E7CBAC-2DFE-463B-B7F9-0B6477EA7A37}.Debug|x86.ActiveCfg = Debug|Any CPU
- {A3E7CBAC-2DFE-463B-B7F9-0B6477EA7A37}.Debug|x86.Build.0 = Debug|Any CPU
- {A3E7CBAC-2DFE-463B-B7F9-0B6477EA7A37}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {A3E7CBAC-2DFE-463B-B7F9-0B6477EA7A37}.Release|Any CPU.Build.0 = Release|Any CPU
- {A3E7CBAC-2DFE-463B-B7F9-0B6477EA7A37}.Release|x64.ActiveCfg = Release|Any CPU
- {A3E7CBAC-2DFE-463B-B7F9-0B6477EA7A37}.Release|x64.Build.0 = Release|Any CPU
- {A3E7CBAC-2DFE-463B-B7F9-0B6477EA7A37}.Release|x86.ActiveCfg = Release|Any CPU
- {A3E7CBAC-2DFE-463B-B7F9-0B6477EA7A37}.Release|x86.Build.0 = Release|Any CPU
- {2D8FD114-A304-45B1-BCA2-16949103603E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {2D8FD114-A304-45B1-BCA2-16949103603E}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {2D8FD114-A304-45B1-BCA2-16949103603E}.Debug|Any CPU.Deploy.0 = Debug|Any CPU
- {2D8FD114-A304-45B1-BCA2-16949103603E}.Debug|x64.ActiveCfg = Debug|x64
- {2D8FD114-A304-45B1-BCA2-16949103603E}.Debug|x64.Build.0 = Debug|x64
- {2D8FD114-A304-45B1-BCA2-16949103603E}.Debug|x64.Deploy.0 = Debug|x64
- {2D8FD114-A304-45B1-BCA2-16949103603E}.Debug|x86.ActiveCfg = Debug|x86
- {2D8FD114-A304-45B1-BCA2-16949103603E}.Debug|x86.Build.0 = Debug|x86
- {2D8FD114-A304-45B1-BCA2-16949103603E}.Debug|x86.Deploy.0 = Debug|x86
- {2D8FD114-A304-45B1-BCA2-16949103603E}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {2D8FD114-A304-45B1-BCA2-16949103603E}.Release|Any CPU.Build.0 = Release|Any CPU
- {2D8FD114-A304-45B1-BCA2-16949103603E}.Release|Any CPU.Deploy.0 = Release|Any CPU
- {2D8FD114-A304-45B1-BCA2-16949103603E}.Release|x64.ActiveCfg = Release|x64
- {2D8FD114-A304-45B1-BCA2-16949103603E}.Release|x64.Build.0 = Release|x64
- {2D8FD114-A304-45B1-BCA2-16949103603E}.Release|x64.Deploy.0 = Release|x64
- {2D8FD114-A304-45B1-BCA2-16949103603E}.Release|x86.ActiveCfg = Release|x86
- {2D8FD114-A304-45B1-BCA2-16949103603E}.Release|x86.Build.0 = Release|x86
- {2D8FD114-A304-45B1-BCA2-16949103603E}.Release|x86.Deploy.0 = Release|x86
- EndGlobalSection
- GlobalSection(SolutionProperties) = preSolution
- HideSolutionNode = FALSE
- EndGlobalSection
- GlobalSection(ExtensibilityGlobals) = postSolution
- SolutionGuid = {3BADFBD9-C57F-40A7-B058-D6B067196030}
- EndGlobalSection
-EndGlobal
diff --git a/Lab/Exercise4/01-Start/ContosoExpenses/ContosoExpenses/AboutView.xaml b/Lab/Exercise4/01-Start/ContosoExpenses/ContosoExpenses/AboutView.xaml
deleted file mode 100644
index 438749e..0000000
--- a/Lab/Exercise4/01-Start/ContosoExpenses/ContosoExpenses/AboutView.xaml
+++ /dev/null
@@ -1,35 +0,0 @@
-
-
-
-
-
-
-
-
-
-
- Contoso Expenses is a 'modern application of yesterday tomorrow' from Contoso Corp.
-
-
-
-
diff --git a/Lab/Exercise4/01-Start/ContosoExpenses/ContosoExpenses/AboutView.xaml.cs b/Lab/Exercise4/01-Start/ContosoExpenses/ContosoExpenses/AboutView.xaml.cs
deleted file mode 100644
index 7b508bc..0000000
--- a/Lab/Exercise4/01-Start/ContosoExpenses/ContosoExpenses/AboutView.xaml.cs
+++ /dev/null
@@ -1,27 +0,0 @@
-// ******************************************************************
-
-// Copyright (c) Microsoft. All rights reserved.
-// This code is licensed under the MIT License (MIT).
-// THE CODE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
-// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
-// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
-// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH
-// THE CODE OR THE USE OR OTHER DEALINGS IN THE CODE.
-
-// ******************************************************************
-
-using System.Linq;
-using System.Linq.Expressions;
-
-namespace ContosoExpenses
-{
- public partial class AboutView
- {
- public AboutView()
- {
- InitializeComponent();
- }
- }
-}
diff --git a/Lab/Exercise4/01-Start/ContosoExpenses/ContosoExpenses/AddNewExpense.xaml b/Lab/Exercise4/01-Start/ContosoExpenses/ContosoExpenses/AddNewExpense.xaml
deleted file mode 100644
index c8b7584..0000000
--- a/Lab/Exercise4/01-Start/ContosoExpenses/ContosoExpenses/AddNewExpense.xaml
+++ /dev/null
@@ -1,64 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/Lab/Exercise4/01-Start/ContosoExpenses/ContosoExpenses/AddNewExpense.xaml.cs b/Lab/Exercise4/01-Start/ContosoExpenses/ContosoExpenses/AddNewExpense.xaml.cs
deleted file mode 100644
index 964a736..0000000
--- a/Lab/Exercise4/01-Start/ContosoExpenses/ContosoExpenses/AddNewExpense.xaml.cs
+++ /dev/null
@@ -1,59 +0,0 @@
-// ******************************************************************
-
-// Copyright (c) Microsoft. All rights reserved.
-// This code is licensed under the MIT License (MIT).
-// THE CODE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
-// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
-// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
-// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH
-// THE CODE OR THE USE OR OTHER DEALINGS IN THE CODE.
-
-// ******************************************************************
-
-using ContosoExpenses.Models;
-using ContosoExpenses.Services;
-using System;
-using System.Windows;
-
-namespace ContosoExpenses
-{
- ///
- /// Interaction logic for AddNewExpense.xaml
- ///
- public partial class AddNewExpense : Window
- {
- public int EmployeeId { get; set; }
-
- public AddNewExpense()
- {
- InitializeComponent();
- }
-
- private void OnSaveExpense(object sender, RoutedEventArgs e)
- {
- try
- {
- Expense expense = new Expense
- {
- Address = txtAmount.Text,
- City = txtCity.Text,
- Cost = Convert.ToDouble(txtAmount.Text),
- Description = txtDescription.Text,
- Type = txtType.Text,
- Date = txtDate.SelectedDate.GetValueOrDefault(),
- EmployeeId = EmployeeId
- };
-
- DatabaseService service = new DatabaseService();
- service.SaveExpense(expense);
- this.Close();
- }
- catch (Exception exc)
- {
- MessageBox.Show("Validation error. Please check your data.", "Error", MessageBoxButton.OK, MessageBoxImage.Error);
- }
- }
- }
-}
diff --git a/Lab/Exercise4/01-Start/ContosoExpenses/ContosoExpenses/App.config b/Lab/Exercise4/01-Start/ContosoExpenses/ContosoExpenses/App.config
deleted file mode 100644
index 56efbc7..0000000
--- a/Lab/Exercise4/01-Start/ContosoExpenses/ContosoExpenses/App.config
+++ /dev/null
@@ -1,6 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/Lab/Exercise4/01-Start/ContosoExpenses/ContosoExpenses/App.xaml b/Lab/Exercise4/01-Start/ContosoExpenses/ContosoExpenses/App.xaml
deleted file mode 100644
index 4bdb029..0000000
--- a/Lab/Exercise4/01-Start/ContosoExpenses/ContosoExpenses/App.xaml
+++ /dev/null
@@ -1,55 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/Lab/Exercise4/01-Start/ContosoExpenses/ContosoExpenses/App.xaml.cs b/Lab/Exercise4/01-Start/ContosoExpenses/ContosoExpenses/App.xaml.cs
deleted file mode 100644
index 975a1cc..0000000
--- a/Lab/Exercise4/01-Start/ContosoExpenses/ContosoExpenses/App.xaml.cs
+++ /dev/null
@@ -1,17 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Configuration;
-using System.Data;
-using System.Linq;
-using System.Threading.Tasks;
-using System.Windows;
-
-namespace ContosoExpenses
-{
- ///
- /// Interaction logic for App.xaml
- ///
- public partial class App : Application
- {
- }
-}
diff --git a/Lab/Exercise4/01-Start/ContosoExpenses/ContosoExpenses/ContosoExpenses.csproj b/Lab/Exercise4/01-Start/ContosoExpenses/ContosoExpenses/ContosoExpenses.csproj
deleted file mode 100644
index aefd115..0000000
--- a/Lab/Exercise4/01-Start/ContosoExpenses/ContosoExpenses/ContosoExpenses.csproj
+++ /dev/null
@@ -1,176 +0,0 @@
-
-
-
-
- Debug
- AnyCPU
- {A3E7CBAC-2DFE-463B-B7F9-0B6477EA7A37}
- WinExe
- ContosoExpenses
- ContosoExpenses
- v4.7.2
- 512
- {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}
- 4
- true
- true
-
-
-
-
- AnyCPU
- true
- full
- false
- bin\Debug\
- DEBUG;TRACE
- prompt
- 4
-
-
- AnyCPU
- pdbonly
- true
- bin\Release\
- TRACE
- prompt
- 4
-
-
- Images\contoso.ico
-
-
-
- ..\packages\Bogus.25.0.3\lib\net40\Bogus.dll
-
-
- ..\packages\LiteDB.4.1.4\lib\net40\LiteDB.dll
-
-
- ..\packages\Microsoft.Toolkit.Wpf.UI.Controls.5.0.1\lib\net462\Microsoft.Toolkit.Wpf.UI.Controls.dll
-
-
- ..\packages\Microsoft.Toolkit.Wpf.UI.XamlHost.5.0.1\lib\net462\Microsoft.Toolkit.Wpf.UI.XamlHost.dll
-
-
-
-
-
-
-
- False
- C:\Windows\Microsoft.NET\Framework\v4.0.30319\System.Runtime.WindowsRuntime.dll
-
-
-
-
-
-
-
-
-
- 4.0
-
-
- C:\Program Files (x86)\Windows Kits\10\UnionMetadata\10.0.17763.0\Windows.winmd
- False
-
-
-
-
-
-
-
- MSBuild:Compile
- Designer
-
-
- AddNewExpense.xaml
-
-
- ExpensesList.xaml
-
-
-
- MSBuild:Compile
- Designer
-
-
- Designer
- MSBuild:Compile
-
-
- Designer
- MSBuild:Compile
-
-
- Designer
- MSBuild:Compile
-
-
- MSBuild:Compile
- Designer
-
-
- AboutView.xaml
-
-
- App.xaml
- Code
-
-
- ExpenseDetail.xaml
-
-
- MainWindow.xaml
- Code
-
-
-
-
-
-
- Code
-
-
- True
- True
- Resources.resx
-
-
- True
- Settings.settings
- True
-
-
- ResXFileCodeGenerator
- Resources.Designer.cs
-
-
-
- SettingsSingleFileGenerator
- Settings.Designer.cs
-
-
-
-
-
-
-
-
-
-
- PreserveNewest
-
-
- PreserveNewest
-
-
- PreserveNewest
-
-
- PreserveNewest
-
-
-
-
\ No newline at end of file
diff --git a/Lab/Exercise4/01-Start/ContosoExpenses/ContosoExpenses/ExpenseDetail.xaml b/Lab/Exercise4/01-Start/ContosoExpenses/ContosoExpenses/ExpenseDetail.xaml
deleted file mode 100644
index 6b4efd6..0000000
--- a/Lab/Exercise4/01-Start/ContosoExpenses/ContosoExpenses/ExpenseDetail.xaml
+++ /dev/null
@@ -1,146 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/Lab/Exercise4/01-Start/ContosoExpenses/ContosoExpenses/ExpenseDetail.xaml.cs b/Lab/Exercise4/01-Start/ContosoExpenses/ContosoExpenses/ExpenseDetail.xaml.cs
deleted file mode 100644
index 4275799..0000000
--- a/Lab/Exercise4/01-Start/ContosoExpenses/ContosoExpenses/ExpenseDetail.xaml.cs
+++ /dev/null
@@ -1,61 +0,0 @@
-// ******************************************************************
-
-// Copyright (c) Microsoft. All rights reserved.
-// This code is licensed under the MIT License (MIT).
-// THE CODE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
-// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
-// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
-// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH
-// THE CODE OR THE USE OR OTHER DEALINGS IN THE CODE.
-
-// ******************************************************************
-
-using System;
-using System.Linq;
-using System.Windows;
-using ContosoExpenses.Models;
-using Microsoft.Toolkit.Win32.UI.Controls.Interop.WinRT;
-using Windows.Services.Maps;
-
-namespace ContosoExpenses
-{
- ///
- /// Interaction logic for ExpenseDetail.xaml
- ///
- public partial class ExpenseDetail : Window
- {
- public Expense SelectedExpense { get; set; }
-
- public ExpenseDetail()
- {
- InitializeComponent();
- Signature.InkPresenter.InputDeviceTypes = CoreInputDeviceTypes.Mouse | CoreInputDeviceTypes.Pen;
-
- MapService.ServiceToken = "IFFAI5SFOtHV9VBKF8Ea~3FS1XamCV2NM0IqlfoQo6A~AguqcUboJvnqWU1H9E-6MVThouJoCrM4wpv_1R_KX_oQLV_e59vyoK42470JvLsU";
- }
-
- private async void Window_Loaded(object sender, RoutedEventArgs e)
- {
- txtType.Text = SelectedExpense.Type;
- txtDescription.Text = SelectedExpense.Description;
- txtLocation.Text = SelectedExpense.Address;
- txtAmount.Text = SelectedExpense.Cost.ToString();
- Chart.Height = (SelectedExpense.Cost * 400) / 1000;
-
- var result = await MapLocationFinder.FindLocationsAsync(SelectedExpense.Address, null);
- var location = result.Locations.FirstOrDefault();
- if (location != null)
- {
- await ExpenseMap.TrySetViewAsync(location.Point, 13);
- }
- }
-
- private void Window_Closed(object sender, EventArgs e)
- {
- Signature.Dispose();
- ExpenseMap.Dispose();
- }
- }
-}
diff --git a/Lab/Exercise4/01-Start/ContosoExpenses/ContosoExpenses/ExpensesList.xaml b/Lab/Exercise4/01-Start/ContosoExpenses/ContosoExpenses/ExpensesList.xaml
deleted file mode 100644
index 400d21e..0000000
--- a/Lab/Exercise4/01-Start/ContosoExpenses/ContosoExpenses/ExpensesList.xaml
+++ /dev/null
@@ -1,80 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/Lab/Exercise4/01-Start/ContosoExpenses/ContosoExpenses/ExpensesList.xaml.cs b/Lab/Exercise4/01-Start/ContosoExpenses/ContosoExpenses/ExpensesList.xaml.cs
deleted file mode 100644
index 8e58c9c..0000000
--- a/Lab/Exercise4/01-Start/ContosoExpenses/ContosoExpenses/ExpensesList.xaml.cs
+++ /dev/null
@@ -1,89 +0,0 @@
-// ******************************************************************
-
-// Copyright (c) Microsoft. All rights reserved.
-// This code is licensed under the MIT License (MIT).
-// THE CODE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
-// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
-// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
-// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH
-// THE CODE OR THE USE OR OTHER DEALINGS IN THE CODE.
-
-// ******************************************************************
-
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-using System.Windows;
-using System.Windows.Controls;
-using System.Windows.Data;
-using System.Windows.Documents;
-using System.Windows.Input;
-using System.Windows.Media;
-using System.Windows.Media.Imaging;
-using System.Windows.Shapes;
-using ContosoExpenses.Models;
-using ContosoExpenses.Services;
-
-namespace ContosoExpenses
-{
- ///
- /// Interaction logic for ExpensesList.xaml
- ///
- public partial class ExpensesList : Window
- {
- public int EmployeeId { get; set; }
-
- private Employee selectedEmployee;
-
- public ExpensesList()
- {
- InitializeComponent();
- }
-
- private void OnSelectedExpense(object sender, SelectionChangedEventArgs e)
- {
- if (e.AddedItems.Count > 0)
- {
- var expense = e.AddedItems[0] as Expense;
- if (expense != null && expense.ExpenseId != 0)
- {
- ExpenseDetail detail = new ExpenseDetail();
- detail.SelectedExpense = expense;
- detail.ShowDialog();
- }
- }
- }
-
- private void Window_Loaded(object sender, RoutedEventArgs e)
- {
- DatabaseService databaseService = new DatabaseService();
- selectedEmployee = databaseService.GetEmployee(EmployeeId);
-
- txtEmployeeId.Text = selectedEmployee.EmployeeId.ToString();
- txtFullName.Text = $"{selectedEmployee.FirstName} {selectedEmployee.LastName}";
- txtEmail.Text = selectedEmployee.Email;
- }
-
- private void OnAddNewExpense(object sender, RoutedEventArgs e)
- {
- AddNewExpense newExpense = new AddNewExpense();
- newExpense.EmployeeId = EmployeeId;
- newExpense.ShowDialog();
- }
-
- public void LoadData()
- {
- DatabaseService databaseService = new DatabaseService();
- ExpensesGrid.ItemsSource = databaseService.GetExpenses(EmployeeId);
- }
-
- private void Window_Activated(object sender, EventArgs e)
- {
- LoadData();
- }
- }
-}
diff --git a/Lab/Exercise4/01-Start/ContosoExpenses/ContosoExpenses/Images/contoso.ico b/Lab/Exercise4/01-Start/ContosoExpenses/ContosoExpenses/Images/contoso.ico
deleted file mode 100644
index 7a6845c..0000000
Binary files a/Lab/Exercise4/01-Start/ContosoExpenses/ContosoExpenses/Images/contoso.ico and /dev/null differ
diff --git a/Lab/Exercise4/01-Start/ContosoExpenses/ContosoExpenses/MainWindow.xaml b/Lab/Exercise4/01-Start/ContosoExpenses/ContosoExpenses/MainWindow.xaml
deleted file mode 100644
index fd640cc..0000000
--- a/Lab/Exercise4/01-Start/ContosoExpenses/ContosoExpenses/MainWindow.xaml
+++ /dev/null
@@ -1,57 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/Lab/Exercise4/01-Start/ContosoExpenses/ContosoExpenses/MainWindow.xaml.cs b/Lab/Exercise4/01-Start/ContosoExpenses/ContosoExpenses/MainWindow.xaml.cs
deleted file mode 100644
index 18b62ca..0000000
--- a/Lab/Exercise4/01-Start/ContosoExpenses/ContosoExpenses/MainWindow.xaml.cs
+++ /dev/null
@@ -1,67 +0,0 @@
-// ******************************************************************
-
-// Copyright (c) Microsoft. All rights reserved.
-// This code is licensed under the MIT License (MIT).
-// THE CODE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
-// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
-// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
-// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH
-// THE CODE OR THE USE OR OTHER DEALINGS IN THE CODE.
-
-// ******************************************************************
-
-using System.Collections.Generic;
-using System.Windows;
-using System.Windows.Controls;
-using ContosoExpenses.Models;
-using ContosoExpenses.Services;
-
-namespace ContosoExpenses
-{
- ///
- /// Interaction logic for MainWindow.xaml
- ///
- public partial class MainWindow : Window
- {
- public MainWindow()
- {
- InitializeComponent();
- }
-
- private void Window_Loaded(object sender, RoutedEventArgs e)
- {
- LoadData();
- }
-
- private void LoadData()
- {
- List customers = new List();
- DatabaseService db = new DatabaseService();
- db.InitializeDatabase();
-
- CustomersGrid.ItemsSource = db.GetEmployees();
- }
-
- private void OnSelectedEmployee(object sender, SelectionChangedEventArgs e)
- {
- if (e.AddedItems.Count > 0)
- {
- var employee = e.AddedItems[0] as Employee;
- if (employee != null && employee.EmployeeId != 0)
- {
- ExpensesList detail = new ExpensesList();
- detail.EmployeeId = employee.EmployeeId;
- detail.Show();
- }
- }
- }
-
- private void OnOpenAbout(object sender, RoutedEventArgs e)
- {
- AboutView about = new AboutView();
- about.ShowDialog();
- }
- }
-}
diff --git a/Lab/Exercise4/01-Start/ContosoExpenses/ContosoExpenses/Models/Employee.cs b/Lab/Exercise4/01-Start/ContosoExpenses/ContosoExpenses/Models/Employee.cs
deleted file mode 100644
index 6617470..0000000
--- a/Lab/Exercise4/01-Start/ContosoExpenses/ContosoExpenses/Models/Employee.cs
+++ /dev/null
@@ -1,11 +0,0 @@
-
-namespace ContosoExpenses.Models
-{
- public class Employee
- {
- public int EmployeeId { get; set; }
- public string FirstName { get; set; }
- public string LastName { get; set; }
- public string Email { get; set; }
- }
-}
diff --git a/Lab/Exercise4/01-Start/ContosoExpenses/ContosoExpenses/Models/Expense.cs b/Lab/Exercise4/01-Start/ContosoExpenses/ContosoExpenses/Models/Expense.cs
deleted file mode 100644
index 791cfbd..0000000
--- a/Lab/Exercise4/01-Start/ContosoExpenses/ContosoExpenses/Models/Expense.cs
+++ /dev/null
@@ -1,16 +0,0 @@
-using System;
-
-namespace ContosoExpenses.Models
-{
- public class Expense
- {
- public int ExpenseId { get; set; }
- public string Type { get; set; }
- public string Description { get; set; }
- public double Cost { get; set; }
- public string Address { get; set; }
- public string City { get; set; }
- public DateTime Date { get; set; }
- public int EmployeeId { get; set; }
- }
-}
diff --git a/Lab/Exercise4/01-Start/ContosoExpenses/ContosoExpenses/Properties/AssemblyInfo.cs b/Lab/Exercise4/01-Start/ContosoExpenses/ContosoExpenses/Properties/AssemblyInfo.cs
deleted file mode 100644
index a68a32b..0000000
--- a/Lab/Exercise4/01-Start/ContosoExpenses/ContosoExpenses/Properties/AssemblyInfo.cs
+++ /dev/null
@@ -1,55 +0,0 @@
-using System.Reflection;
-using System.Resources;
-using System.Runtime.CompilerServices;
-using System.Runtime.InteropServices;
-using System.Windows;
-
-// General Information about an assembly is controlled through the following
-// set of attributes. Change these attribute values to modify the information
-// associated with an assembly.
-[assembly: AssemblyTitle("XamlIslandDemo")]
-[assembly: AssemblyDescription("")]
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("")]
-[assembly: AssemblyProduct("XamlIslandDemo")]
-[assembly: AssemblyCopyright("Copyright © 2019")]
-[assembly: AssemblyTrademark("")]
-[assembly: AssemblyCulture("")]
-
-// Setting ComVisible to false makes the types in this assembly not visible
-// to COM components. If you need to access a type in this assembly from
-// COM, set the ComVisible attribute to true on that type.
-[assembly: ComVisible(false)]
-
-//In order to begin building localizable applications, set
-//CultureYouAreCodingWith in your .csproj file
-//inside a . For example, if you are using US english
-//in your source files, set the to en-US. Then uncomment
-//the NeutralResourceLanguage attribute below. Update the "en-US" in
-//the line below to match the UICulture setting in the project file.
-
-//[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)]
-
-
-[assembly: ThemeInfo(
- ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
- //(used if a resource is not found in the page,
- // or application resource dictionaries)
- ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
- //(used if a resource is not found in the page,
- // app, or any theme specific resource dictionaries)
-)]
-
-
-// Version information for an assembly consists of the following four values:
-//
-// Major Version
-// Minor Version
-// Build Number
-// Revision
-//
-// You can specify all the values or you can default the Build and Revision Numbers
-// by using the '*' as shown below:
-// [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("1.0.0.0")]
-[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/Lab/Exercise4/01-Start/ContosoExpenses/ContosoExpenses/Properties/Resources.Designer.cs b/Lab/Exercise4/01-Start/ContosoExpenses/ContosoExpenses/Properties/Resources.Designer.cs
deleted file mode 100644
index 5fbb5f9..0000000
--- a/Lab/Exercise4/01-Start/ContosoExpenses/ContosoExpenses/Properties/Resources.Designer.cs
+++ /dev/null
@@ -1,63 +0,0 @@
-//------------------------------------------------------------------------------
-//
-// This code was generated by a tool.
-// Runtime Version:4.0.30319.42000
-//
-// Changes to this file may cause incorrect behavior and will be lost if
-// the code is regenerated.
-//
-//------------------------------------------------------------------------------
-
-namespace ContosoExpenses.Properties {
- using System;
-
-
- ///
- /// A strongly-typed resource class, for looking up localized strings, etc.
- ///
- // This class was auto-generated by the StronglyTypedResourceBuilder
- // class via a tool like ResGen or Visual Studio.
- // To add or remove a member, edit your .ResX file then rerun ResGen
- // with the /str option, or rebuild your VS project.
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")]
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
- internal class Resources {
-
- private static global::System.Resources.ResourceManager resourceMan;
-
- private static global::System.Globalization.CultureInfo resourceCulture;
-
- [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
- internal Resources() {
- }
-
- ///
- /// Returns the cached ResourceManager instance used by this class.
- ///
- [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
- internal static global::System.Resources.ResourceManager ResourceManager {
- get {
- if (object.ReferenceEquals(resourceMan, null)) {
- global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("ContosoExpenses.Properties.Resources", typeof(Resources).Assembly);
- resourceMan = temp;
- }
- return resourceMan;
- }
- }
-
- ///
- /// Overrides the current thread's CurrentUICulture property for all
- /// resource lookups using this strongly typed resource class.
- ///
- [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
- internal static global::System.Globalization.CultureInfo Culture {
- get {
- return resourceCulture;
- }
- set {
- resourceCulture = value;
- }
- }
- }
-}
diff --git a/Lab/Exercise4/01-Start/ContosoExpenses/ContosoExpenses/Properties/Resources.resx b/Lab/Exercise4/01-Start/ContosoExpenses/ContosoExpenses/Properties/Resources.resx
deleted file mode 100644
index af7dbeb..0000000
--- a/Lab/Exercise4/01-Start/ContosoExpenses/ContosoExpenses/Properties/Resources.resx
+++ /dev/null
@@ -1,117 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- text/microsoft-resx
-
-
- 2.0
-
-
- System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
-
- System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
-
\ No newline at end of file
diff --git a/Lab/Exercise4/01-Start/ContosoExpenses/ContosoExpenses/Properties/Settings.Designer.cs b/Lab/Exercise4/01-Start/ContosoExpenses/ContosoExpenses/Properties/Settings.Designer.cs
deleted file mode 100644
index 8b6c6e7..0000000
--- a/Lab/Exercise4/01-Start/ContosoExpenses/ContosoExpenses/Properties/Settings.Designer.cs
+++ /dev/null
@@ -1,26 +0,0 @@
-//------------------------------------------------------------------------------
-//
-// This code was generated by a tool.
-// Runtime Version:4.0.30319.42000
-//
-// Changes to this file may cause incorrect behavior and will be lost if
-// the code is regenerated.
-//
-//------------------------------------------------------------------------------
-
-namespace ContosoExpenses.Properties {
-
-
- [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.0.0.0")]
- internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
-
- private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
-
- public static Settings Default {
- get {
- return defaultInstance;
- }
- }
- }
-}
diff --git a/Lab/Exercise4/01-Start/ContosoExpenses/ContosoExpenses/Properties/Settings.settings b/Lab/Exercise4/01-Start/ContosoExpenses/ContosoExpenses/Properties/Settings.settings
deleted file mode 100644
index 033d7a5..0000000
--- a/Lab/Exercise4/01-Start/ContosoExpenses/ContosoExpenses/Properties/Settings.settings
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/Lab/Exercise4/01-Start/ContosoExpenses/ContosoExpenses/Services/DatabaseService.cs b/Lab/Exercise4/01-Start/ContosoExpenses/ContosoExpenses/Services/DatabaseService.cs
deleted file mode 100644
index 764603b..0000000
--- a/Lab/Exercise4/01-Start/ContosoExpenses/ContosoExpenses/Services/DatabaseService.cs
+++ /dev/null
@@ -1,112 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.IO;
-using System.Linq;
-using Bogus;
-using LiteDB;
-using ContosoExpenses.Models;
-
-namespace ContosoExpenses.Services
-{
- public class DatabaseService
- {
- readonly int numberOfEmployees = 10;
- readonly int numberOfExpenses = 5;
-
- string filePath = $"{Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData)}\\ExpenseIt\\data.db";
- string directoryPath = $"{Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData)}\\ExpenseIt\\";
-
- public Employee GetEmployee(int employeeId)
- {
- using (var connection = new LiteDatabase(filePath))
- {
- var employees = connection.GetCollection();
- return employees.FindById(employeeId);
- }
- }
-
- public List GetEmployees()
- {
- using (var connection = new LiteDatabase(filePath))
- {
- var employees = connection.GetCollection();
- return employees.FindAll().ToList();
- }
- }
-
- public List GetExpenses(int employeedId)
- {
- using (var connection = new LiteDatabase(filePath))
- {
- var expenses = connection.GetCollection();
- return expenses.Find(x => x.EmployeeId == employeedId).ToList();
- }
- }
-
- public void SaveExpense(Expense expense)
- {
- using (var connection = new LiteDatabase(filePath))
- {
- var expenses = connection.GetCollection();
- expenses.Insert(expense);
- }
- }
-
- public void InitializeDatabase()
- {
- if (!File.Exists(filePath))
- {
- Directory.CreateDirectory(directoryPath);
- }
-
- using (var connection = new LiteDatabase(filePath))
- {
- var employees = connection.GetCollection();
- var expenses = connection.GetCollection();
-
- int result = employees.Count();
- if (result == 0)
- {
- GenerateFakeData(numberOfEmployees, numberOfExpenses);
- }
- }
- }
-
- private void GenerateFakeData(int numberOfEmployees, int numberOfExpenses)
- {
- using (var connection = new LiteDatabase(filePath))
- {
- var employees = connection.GetCollection();
- var expenses = connection.GetCollection();
-
- for (int cont = 0; cont < numberOfEmployees; cont++)
- {
- var employee = new Faker()
- .RuleFor(x => x.FirstName, (f, u) => f.Name.FirstName())
- .RuleFor(x => x.LastName, (f, u) => f.Name.LastName())
- .RuleFor(x => x.Email, (f, u) => f.Internet.Email(u.FirstName, u.LastName, "contoso.com"))
- .Generate();
-
- int employeeId = employees.Insert(employee).AsInt32;
-
- for (int contExpenses = 0; contExpenses < numberOfExpenses; contExpenses++)
- {
- var expense = new Faker()
- .RuleFor(x => x.Description, (f, u) => f.Commerce.ProductName())
- .RuleFor(x => x.Type, (f, u) => f.Finance.TransactionType())
- .RuleFor(x => x.Cost, (f, u) => (double)f.Finance.Amount())
- .RuleFor(x => x.Address, (f, u) => f.Address.FullAddress())
- .RuleFor(x => x.City, (f, u) => f.Address.City())
- .RuleFor(x => x.Date, (f, u) => f.Date.Past())
- .Generate();
-
- expense.EmployeeId = employeeId;
-
- expenses.Insert(expense);
- }
- }
- }
-
- }
- }
-}
diff --git a/Lab/Exercise4/01-Start/ContosoExpenses/ContosoExpenses/packages.config b/Lab/Exercise4/01-Start/ContosoExpenses/ContosoExpenses/packages.config
deleted file mode 100644
index e45ff71..0000000
--- a/Lab/Exercise4/01-Start/ContosoExpenses/ContosoExpenses/packages.config
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/Lab/Exercise4/02-End/ContosoExpenses/ContosoExpenses/AddNewExpense.xaml b/Lab/Exercise4/02-End/ContosoExpenses/ContosoExpenses/AddNewExpense.xaml
index 66a33e8..2a3c6fe 100644
--- a/Lab/Exercise4/02-End/ContosoExpenses/ContosoExpenses/AddNewExpense.xaml
+++ b/Lab/Exercise4/02-End/ContosoExpenses/ContosoExpenses/AddNewExpense.xaml
@@ -59,11 +59,10 @@
-
+
+
+
-
-
diff --git a/Lab/Exercise4/02-End/ContosoExpenses/ContosoExpenses/AddNewExpense.xaml.cs b/Lab/Exercise4/02-End/ContosoExpenses/ContosoExpenses/AddNewExpense.xaml.cs
index 67e7057..380ce35 100644
--- a/Lab/Exercise4/02-End/ContosoExpenses/ContosoExpenses/AddNewExpense.xaml.cs
+++ b/Lab/Exercise4/02-End/ContosoExpenses/ContosoExpenses/AddNewExpense.xaml.cs
@@ -29,8 +29,6 @@ namespace ContosoExpenses
{
public int EmployeeId { get; set; }
- private DateTime SelectedDate;
-
public AddNewExpense()
{
InitializeComponent();
@@ -47,7 +45,7 @@ namespace ContosoExpenses
Cost = Convert.ToDouble(txtAmount.Text),
Description = txtDescription.Text,
Type = txtType.Text,
- Date = SelectedDate,
+ Date = CalendarUwp.SelectedDates.FirstOrDefault().DateTime,
EmployeeId = EmployeeId
};
@@ -61,32 +59,14 @@ namespace ContosoExpenses
}
}
- private void CalendarUwp_ChildChanged(object sender, EventArgs e)
- {
- WindowsXamlHost windowsXamlHost = (WindowsXamlHost)sender;
-
- Windows.UI.Xaml.Controls.CalendarView calendarView =
- (Windows.UI.Xaml.Controls.CalendarView)windowsXamlHost.Child;
-
- if (calendarView != null)
- {
- calendarView.SelectedDatesChanged += (obj, args) =>
- {
- if (calendarView.SelectedDates.Count > 0)
- {
- SelectedDate = calendarView.SelectedDates.FirstOrDefault().DateTime;
- txtDate.Text = SelectedDate.ToShortDateString();
- }
- };
-
- calendarView.MinDate = DateTimeOffset.Now.AddYears(-1);
- calendarView.MaxDate = DateTimeOffset.Now;
- }
- }
-
private void Window_Closed(object sender, EventArgs e)
{
CalendarUwp.Dispose();
}
+
+ private void CalendarUwp_SelectedDatesChanged(object sender, SelectedDatesChangedEventArgs e)
+ {
+ txtDate.Text = e.SelectedDates.FirstOrDefault().DateTime.ToShortDateString();
+ }
}
}
diff --git a/Lab/Exercise5/02-End/ContosoExpenses/ContosoExpenses/CalendarViewWrapper.cs b/Lab/Exercise4/02-End/ContosoExpenses/ContosoExpenses/CalendarViewWrapper.cs
similarity index 100%
rename from Lab/Exercise5/02-End/ContosoExpenses/ContosoExpenses/CalendarViewWrapper.cs
rename to Lab/Exercise4/02-End/ContosoExpenses/ContosoExpenses/CalendarViewWrapper.cs
diff --git a/Lab/Exercise4/02-End/ContosoExpenses/ContosoExpenses/ContosoExpenses.csproj b/Lab/Exercise4/02-End/ContosoExpenses/ContosoExpenses/ContosoExpenses.csproj
index aefd115..4ea7235 100644
--- a/Lab/Exercise4/02-End/ContosoExpenses/ContosoExpenses/ContosoExpenses.csproj
+++ b/Lab/Exercise4/02-End/ContosoExpenses/ContosoExpenses/ContosoExpenses.csproj
@@ -87,9 +87,11 @@
AddNewExpense.xaml
+
ExpensesList.xaml
+
MSBuild:Compile
diff --git a/Lab/Exercise5/02-End/ContosoExpenses/ContosoExpenses/SelectedDatesChangedEventArgs.cs b/Lab/Exercise4/02-End/ContosoExpenses/ContosoExpenses/SelectedDatesChangedEventArgs.cs
similarity index 100%
rename from Lab/Exercise5/02-End/ContosoExpenses/ContosoExpenses/SelectedDatesChangedEventArgs.cs
rename to Lab/Exercise4/02-End/ContosoExpenses/ContosoExpenses/SelectedDatesChangedEventArgs.cs
diff --git a/Lab/Exercise5/02-End/ContosoExpenses/ContosoExpenses.Package/ContosoExpenses.Package.wapproj b/Lab/Exercise5/02-End/ContosoExpenses/ContosoExpenses.Package/ContosoExpenses.Package.wapproj
deleted file mode 100644
index 6b5199b..0000000
--- a/Lab/Exercise5/02-End/ContosoExpenses/ContosoExpenses.Package/ContosoExpenses.Package.wapproj
+++ /dev/null
@@ -1,62 +0,0 @@
-
-
-
- 15.0
-
-
-
- Debug
- x86
-
-
- Release
- x86
-
-
- Debug
- x64
-
-
- Release
- x64
-
-
- Debug
- AnyCPU
-
-
- Release
- AnyCPU
-
-
-
- $(MSBuildExtensionsPath)\Microsoft\DesktopBridge\
-
-
-
- 2d8fd114-a304-45b1-bca2-16949103603e
- 10.0.17763.0
- 10.0.17763.0
- en-US
- ContosoExpenses.Package_TemporaryKey.pfx
- ..\ContosoExpenses\ContosoExpenses.csproj
-
-
-
- Designer
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/Lab/Exercise5/02-End/ContosoExpenses/ContosoExpenses.Package/Images/LockScreenLogo.scale-200.png b/Lab/Exercise5/02-End/ContosoExpenses/ContosoExpenses.Package/Images/LockScreenLogo.scale-200.png
deleted file mode 100644
index 735f57a..0000000
Binary files a/Lab/Exercise5/02-End/ContosoExpenses/ContosoExpenses.Package/Images/LockScreenLogo.scale-200.png and /dev/null differ
diff --git a/Lab/Exercise5/02-End/ContosoExpenses/ContosoExpenses.Package/Images/Square150x150Logo.scale-200.png b/Lab/Exercise5/02-End/ContosoExpenses/ContosoExpenses.Package/Images/Square150x150Logo.scale-200.png
deleted file mode 100644
index af49fec..0000000
Binary files a/Lab/Exercise5/02-End/ContosoExpenses/ContosoExpenses.Package/Images/Square150x150Logo.scale-200.png and /dev/null differ
diff --git a/Lab/Exercise5/02-End/ContosoExpenses/ContosoExpenses.Package/Images/Square44x44Logo.scale-200.png b/Lab/Exercise5/02-End/ContosoExpenses/ContosoExpenses.Package/Images/Square44x44Logo.scale-200.png
deleted file mode 100644
index ce342a2..0000000
Binary files a/Lab/Exercise5/02-End/ContosoExpenses/ContosoExpenses.Package/Images/Square44x44Logo.scale-200.png and /dev/null differ
diff --git a/Lab/Exercise5/02-End/ContosoExpenses/ContosoExpenses.Package/Images/Square44x44Logo.targetsize-24_altform-unplated.png b/Lab/Exercise5/02-End/ContosoExpenses/ContosoExpenses.Package/Images/Square44x44Logo.targetsize-24_altform-unplated.png
deleted file mode 100644
index f6c02ce..0000000
Binary files a/Lab/Exercise5/02-End/ContosoExpenses/ContosoExpenses.Package/Images/Square44x44Logo.targetsize-24_altform-unplated.png and /dev/null differ
diff --git a/Lab/Exercise5/02-End/ContosoExpenses/ContosoExpenses.Package/Images/StoreLogo.png b/Lab/Exercise5/02-End/ContosoExpenses/ContosoExpenses.Package/Images/StoreLogo.png
deleted file mode 100644
index 7385b56..0000000
Binary files a/Lab/Exercise5/02-End/ContosoExpenses/ContosoExpenses.Package/Images/StoreLogo.png and /dev/null differ
diff --git a/Lab/Exercise5/02-End/ContosoExpenses/ContosoExpenses.Package/Images/Wide310x150Logo.scale-200.png b/Lab/Exercise5/02-End/ContosoExpenses/ContosoExpenses.Package/Images/Wide310x150Logo.scale-200.png
deleted file mode 100644
index 288995b..0000000
Binary files a/Lab/Exercise5/02-End/ContosoExpenses/ContosoExpenses.Package/Images/Wide310x150Logo.scale-200.png and /dev/null differ
diff --git a/Lab/Exercise5/02-End/ContosoExpenses/ContosoExpenses.Package/Package.appxmanifest b/Lab/Exercise5/02-End/ContosoExpenses/ContosoExpenses.Package/Package.appxmanifest
deleted file mode 100644
index aba7ddc..0000000
--- a/Lab/Exercise5/02-End/ContosoExpenses/ContosoExpenses.Package/Package.appxmanifest
+++ /dev/null
@@ -1,49 +0,0 @@
-
-
-
-
-
-
-
- ContosoExpenses.Package
- mpagani
- Images\StoreLogo.png
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/Lab/Exercise5/02-End/ContosoExpenses/ContosoExpenses.sln b/Lab/Exercise5/02-End/ContosoExpenses/ContosoExpenses.sln
deleted file mode 100644
index 2e4933f..0000000
--- a/Lab/Exercise5/02-End/ContosoExpenses/ContosoExpenses.sln
+++ /dev/null
@@ -1,57 +0,0 @@
-
-Microsoft Visual Studio Solution File, Format Version 12.00
-# Visual Studio Version 16
-VisualStudioVersion = 16.0.28407.52
-MinimumVisualStudioVersion = 10.0.40219.1
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ContosoExpenses", "ContosoExpenses\ContosoExpenses.csproj", "{A3E7CBAC-2DFE-463B-B7F9-0B6477EA7A37}"
-EndProject
-Project("{C7167F0D-BC9F-4E6E-AFE1-012C56B48DB5}") = "ContosoExpenses.Package", "ContosoExpenses.Package\ContosoExpenses.Package.wapproj", "{2D8FD114-A304-45B1-BCA2-16949103603E}"
-EndProject
-Global
- GlobalSection(SolutionConfigurationPlatforms) = preSolution
- Debug|Any CPU = Debug|Any CPU
- Debug|x64 = Debug|x64
- Debug|x86 = Debug|x86
- Release|Any CPU = Release|Any CPU
- Release|x64 = Release|x64
- Release|x86 = Release|x86
- EndGlobalSection
- GlobalSection(ProjectConfigurationPlatforms) = postSolution
- {A3E7CBAC-2DFE-463B-B7F9-0B6477EA7A37}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {A3E7CBAC-2DFE-463B-B7F9-0B6477EA7A37}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {A3E7CBAC-2DFE-463B-B7F9-0B6477EA7A37}.Debug|x64.ActiveCfg = Debug|Any CPU
- {A3E7CBAC-2DFE-463B-B7F9-0B6477EA7A37}.Debug|x64.Build.0 = Debug|Any CPU
- {A3E7CBAC-2DFE-463B-B7F9-0B6477EA7A37}.Debug|x86.ActiveCfg = Debug|Any CPU
- {A3E7CBAC-2DFE-463B-B7F9-0B6477EA7A37}.Debug|x86.Build.0 = Debug|Any CPU
- {A3E7CBAC-2DFE-463B-B7F9-0B6477EA7A37}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {A3E7CBAC-2DFE-463B-B7F9-0B6477EA7A37}.Release|Any CPU.Build.0 = Release|Any CPU
- {A3E7CBAC-2DFE-463B-B7F9-0B6477EA7A37}.Release|x64.ActiveCfg = Release|Any CPU
- {A3E7CBAC-2DFE-463B-B7F9-0B6477EA7A37}.Release|x64.Build.0 = Release|Any CPU
- {A3E7CBAC-2DFE-463B-B7F9-0B6477EA7A37}.Release|x86.ActiveCfg = Release|Any CPU
- {A3E7CBAC-2DFE-463B-B7F9-0B6477EA7A37}.Release|x86.Build.0 = Release|Any CPU
- {2D8FD114-A304-45B1-BCA2-16949103603E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {2D8FD114-A304-45B1-BCA2-16949103603E}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {2D8FD114-A304-45B1-BCA2-16949103603E}.Debug|Any CPU.Deploy.0 = Debug|Any CPU
- {2D8FD114-A304-45B1-BCA2-16949103603E}.Debug|x64.ActiveCfg = Debug|x64
- {2D8FD114-A304-45B1-BCA2-16949103603E}.Debug|x64.Build.0 = Debug|x64
- {2D8FD114-A304-45B1-BCA2-16949103603E}.Debug|x64.Deploy.0 = Debug|x64
- {2D8FD114-A304-45B1-BCA2-16949103603E}.Debug|x86.ActiveCfg = Debug|x86
- {2D8FD114-A304-45B1-BCA2-16949103603E}.Debug|x86.Build.0 = Debug|x86
- {2D8FD114-A304-45B1-BCA2-16949103603E}.Debug|x86.Deploy.0 = Debug|x86
- {2D8FD114-A304-45B1-BCA2-16949103603E}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {2D8FD114-A304-45B1-BCA2-16949103603E}.Release|Any CPU.Build.0 = Release|Any CPU
- {2D8FD114-A304-45B1-BCA2-16949103603E}.Release|Any CPU.Deploy.0 = Release|Any CPU
- {2D8FD114-A304-45B1-BCA2-16949103603E}.Release|x64.ActiveCfg = Release|x64
- {2D8FD114-A304-45B1-BCA2-16949103603E}.Release|x64.Build.0 = Release|x64
- {2D8FD114-A304-45B1-BCA2-16949103603E}.Release|x64.Deploy.0 = Release|x64
- {2D8FD114-A304-45B1-BCA2-16949103603E}.Release|x86.ActiveCfg = Release|x86
- {2D8FD114-A304-45B1-BCA2-16949103603E}.Release|x86.Build.0 = Release|x86
- {2D8FD114-A304-45B1-BCA2-16949103603E}.Release|x86.Deploy.0 = Release|x86
- EndGlobalSection
- GlobalSection(SolutionProperties) = preSolution
- HideSolutionNode = FALSE
- EndGlobalSection
- GlobalSection(ExtensibilityGlobals) = postSolution
- SolutionGuid = {3BADFBD9-C57F-40A7-B058-D6B067196030}
- EndGlobalSection
-EndGlobal
diff --git a/Lab/Exercise5/02-End/ContosoExpenses/ContosoExpenses/AboutView.xaml b/Lab/Exercise5/02-End/ContosoExpenses/ContosoExpenses/AboutView.xaml
deleted file mode 100644
index 438749e..0000000
--- a/Lab/Exercise5/02-End/ContosoExpenses/ContosoExpenses/AboutView.xaml
+++ /dev/null
@@ -1,35 +0,0 @@
-
-
-
-
-
-
-
-
-
-
- Contoso Expenses is a 'modern application of yesterday tomorrow' from Contoso Corp.
-
-
-
-
diff --git a/Lab/Exercise5/02-End/ContosoExpenses/ContosoExpenses/AboutView.xaml.cs b/Lab/Exercise5/02-End/ContosoExpenses/ContosoExpenses/AboutView.xaml.cs
deleted file mode 100644
index 7b508bc..0000000
--- a/Lab/Exercise5/02-End/ContosoExpenses/ContosoExpenses/AboutView.xaml.cs
+++ /dev/null
@@ -1,27 +0,0 @@
-// ******************************************************************
-
-// Copyright (c) Microsoft. All rights reserved.
-// This code is licensed under the MIT License (MIT).
-// THE CODE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
-// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
-// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
-// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH
-// THE CODE OR THE USE OR OTHER DEALINGS IN THE CODE.
-
-// ******************************************************************
-
-using System.Linq;
-using System.Linq.Expressions;
-
-namespace ContosoExpenses
-{
- public partial class AboutView
- {
- public AboutView()
- {
- InitializeComponent();
- }
- }
-}
diff --git a/Lab/Exercise5/02-End/ContosoExpenses/ContosoExpenses/App.config b/Lab/Exercise5/02-End/ContosoExpenses/ContosoExpenses/App.config
deleted file mode 100644
index 56efbc7..0000000
--- a/Lab/Exercise5/02-End/ContosoExpenses/ContosoExpenses/App.config
+++ /dev/null
@@ -1,6 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/Lab/Exercise5/02-End/ContosoExpenses/ContosoExpenses/App.xaml b/Lab/Exercise5/02-End/ContosoExpenses/ContosoExpenses/App.xaml
deleted file mode 100644
index 4bdb029..0000000
--- a/Lab/Exercise5/02-End/ContosoExpenses/ContosoExpenses/App.xaml
+++ /dev/null
@@ -1,55 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/Lab/Exercise5/02-End/ContosoExpenses/ContosoExpenses/App.xaml.cs b/Lab/Exercise5/02-End/ContosoExpenses/ContosoExpenses/App.xaml.cs
deleted file mode 100644
index 975a1cc..0000000
--- a/Lab/Exercise5/02-End/ContosoExpenses/ContosoExpenses/App.xaml.cs
+++ /dev/null
@@ -1,17 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Configuration;
-using System.Data;
-using System.Linq;
-using System.Threading.Tasks;
-using System.Windows;
-
-namespace ContosoExpenses
-{
- ///
- /// Interaction logic for App.xaml
- ///
- public partial class App : Application
- {
- }
-}
diff --git a/Lab/Exercise5/02-End/ContosoExpenses/ContosoExpenses/ContosoExpenses.csproj b/Lab/Exercise5/02-End/ContosoExpenses/ContosoExpenses/ContosoExpenses.csproj
deleted file mode 100644
index 4ea7235..0000000
--- a/Lab/Exercise5/02-End/ContosoExpenses/ContosoExpenses/ContosoExpenses.csproj
+++ /dev/null
@@ -1,178 +0,0 @@
-
-
-
-
- Debug
- AnyCPU
- {A3E7CBAC-2DFE-463B-B7F9-0B6477EA7A37}
- WinExe
- ContosoExpenses
- ContosoExpenses
- v4.7.2
- 512
- {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}
- 4
- true
- true
-
-
-
-
- AnyCPU
- true
- full
- false
- bin\Debug\
- DEBUG;TRACE
- prompt
- 4
-
-
- AnyCPU
- pdbonly
- true
- bin\Release\
- TRACE
- prompt
- 4
-
-
- Images\contoso.ico
-
-
-
- ..\packages\Bogus.25.0.3\lib\net40\Bogus.dll
-
-
- ..\packages\LiteDB.4.1.4\lib\net40\LiteDB.dll
-
-
- ..\packages\Microsoft.Toolkit.Wpf.UI.Controls.5.0.1\lib\net462\Microsoft.Toolkit.Wpf.UI.Controls.dll
-
-
- ..\packages\Microsoft.Toolkit.Wpf.UI.XamlHost.5.0.1\lib\net462\Microsoft.Toolkit.Wpf.UI.XamlHost.dll
-
-
-
-
-
-
-
- False
- C:\Windows\Microsoft.NET\Framework\v4.0.30319\System.Runtime.WindowsRuntime.dll
-
-
-
-
-
-
-
-
-
- 4.0
-
-
- C:\Program Files (x86)\Windows Kits\10\UnionMetadata\10.0.17763.0\Windows.winmd
- False
-
-
-
-
-
-
-
- MSBuild:Compile
- Designer
-
-
- AddNewExpense.xaml
-
-
-
- ExpensesList.xaml
-
-
-
-
- MSBuild:Compile
- Designer
-
-
- Designer
- MSBuild:Compile
-
-
- Designer
- MSBuild:Compile
-
-
- Designer
- MSBuild:Compile
-
-
- MSBuild:Compile
- Designer
-
-
- AboutView.xaml
-
-
- App.xaml
- Code
-
-
- ExpenseDetail.xaml
-
-
- MainWindow.xaml
- Code
-
-
-
-
-
-
- Code
-
-
- True
- True
- Resources.resx
-
-
- True
- Settings.settings
- True
-
-
- ResXFileCodeGenerator
- Resources.Designer.cs
-
-
-
- SettingsSingleFileGenerator
- Settings.Designer.cs
-
-
-
-
-
-
-
-
-
-
- PreserveNewest
-
-
- PreserveNewest
-
-
- PreserveNewest
-
-
- PreserveNewest
-
-
-
-
\ No newline at end of file
diff --git a/Lab/Exercise5/02-End/ContosoExpenses/ContosoExpenses/ExpenseDetail.xaml b/Lab/Exercise5/02-End/ContosoExpenses/ContosoExpenses/ExpenseDetail.xaml
deleted file mode 100644
index 6b4efd6..0000000
--- a/Lab/Exercise5/02-End/ContosoExpenses/ContosoExpenses/ExpenseDetail.xaml
+++ /dev/null
@@ -1,146 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/Lab/Exercise5/02-End/ContosoExpenses/ContosoExpenses/ExpenseDetail.xaml.cs b/Lab/Exercise5/02-End/ContosoExpenses/ContosoExpenses/ExpenseDetail.xaml.cs
deleted file mode 100644
index 4275799..0000000
--- a/Lab/Exercise5/02-End/ContosoExpenses/ContosoExpenses/ExpenseDetail.xaml.cs
+++ /dev/null
@@ -1,61 +0,0 @@
-// ******************************************************************
-
-// Copyright (c) Microsoft. All rights reserved.
-// This code is licensed under the MIT License (MIT).
-// THE CODE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
-// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
-// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
-// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH
-// THE CODE OR THE USE OR OTHER DEALINGS IN THE CODE.
-
-// ******************************************************************
-
-using System;
-using System.Linq;
-using System.Windows;
-using ContosoExpenses.Models;
-using Microsoft.Toolkit.Win32.UI.Controls.Interop.WinRT;
-using Windows.Services.Maps;
-
-namespace ContosoExpenses
-{
- ///
- /// Interaction logic for ExpenseDetail.xaml
- ///
- public partial class ExpenseDetail : Window
- {
- public Expense SelectedExpense { get; set; }
-
- public ExpenseDetail()
- {
- InitializeComponent();
- Signature.InkPresenter.InputDeviceTypes = CoreInputDeviceTypes.Mouse | CoreInputDeviceTypes.Pen;
-
- MapService.ServiceToken = "IFFAI5SFOtHV9VBKF8Ea~3FS1XamCV2NM0IqlfoQo6A~AguqcUboJvnqWU1H9E-6MVThouJoCrM4wpv_1R_KX_oQLV_e59vyoK42470JvLsU";
- }
-
- private async void Window_Loaded(object sender, RoutedEventArgs e)
- {
- txtType.Text = SelectedExpense.Type;
- txtDescription.Text = SelectedExpense.Description;
- txtLocation.Text = SelectedExpense.Address;
- txtAmount.Text = SelectedExpense.Cost.ToString();
- Chart.Height = (SelectedExpense.Cost * 400) / 1000;
-
- var result = await MapLocationFinder.FindLocationsAsync(SelectedExpense.Address, null);
- var location = result.Locations.FirstOrDefault();
- if (location != null)
- {
- await ExpenseMap.TrySetViewAsync(location.Point, 13);
- }
- }
-
- private void Window_Closed(object sender, EventArgs e)
- {
- Signature.Dispose();
- ExpenseMap.Dispose();
- }
- }
-}
diff --git a/Lab/Exercise5/02-End/ContosoExpenses/ContosoExpenses/ExpensesList.xaml b/Lab/Exercise5/02-End/ContosoExpenses/ContosoExpenses/ExpensesList.xaml
deleted file mode 100644
index 400d21e..0000000
--- a/Lab/Exercise5/02-End/ContosoExpenses/ContosoExpenses/ExpensesList.xaml
+++ /dev/null
@@ -1,80 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/Lab/Exercise5/02-End/ContosoExpenses/ContosoExpenses/ExpensesList.xaml.cs b/Lab/Exercise5/02-End/ContosoExpenses/ContosoExpenses/ExpensesList.xaml.cs
deleted file mode 100644
index 8e58c9c..0000000
--- a/Lab/Exercise5/02-End/ContosoExpenses/ContosoExpenses/ExpensesList.xaml.cs
+++ /dev/null
@@ -1,89 +0,0 @@
-// ******************************************************************
-
-// Copyright (c) Microsoft. All rights reserved.
-// This code is licensed under the MIT License (MIT).
-// THE CODE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
-// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
-// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
-// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH
-// THE CODE OR THE USE OR OTHER DEALINGS IN THE CODE.
-
-// ******************************************************************
-
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-using System.Windows;
-using System.Windows.Controls;
-using System.Windows.Data;
-using System.Windows.Documents;
-using System.Windows.Input;
-using System.Windows.Media;
-using System.Windows.Media.Imaging;
-using System.Windows.Shapes;
-using ContosoExpenses.Models;
-using ContosoExpenses.Services;
-
-namespace ContosoExpenses
-{
- ///
- /// Interaction logic for ExpensesList.xaml
- ///
- public partial class ExpensesList : Window
- {
- public int EmployeeId { get; set; }
-
- private Employee selectedEmployee;
-
- public ExpensesList()
- {
- InitializeComponent();
- }
-
- private void OnSelectedExpense(object sender, SelectionChangedEventArgs e)
- {
- if (e.AddedItems.Count > 0)
- {
- var expense = e.AddedItems[0] as Expense;
- if (expense != null && expense.ExpenseId != 0)
- {
- ExpenseDetail detail = new ExpenseDetail();
- detail.SelectedExpense = expense;
- detail.ShowDialog();
- }
- }
- }
-
- private void Window_Loaded(object sender, RoutedEventArgs e)
- {
- DatabaseService databaseService = new DatabaseService();
- selectedEmployee = databaseService.GetEmployee(EmployeeId);
-
- txtEmployeeId.Text = selectedEmployee.EmployeeId.ToString();
- txtFullName.Text = $"{selectedEmployee.FirstName} {selectedEmployee.LastName}";
- txtEmail.Text = selectedEmployee.Email;
- }
-
- private void OnAddNewExpense(object sender, RoutedEventArgs e)
- {
- AddNewExpense newExpense = new AddNewExpense();
- newExpense.EmployeeId = EmployeeId;
- newExpense.ShowDialog();
- }
-
- public void LoadData()
- {
- DatabaseService databaseService = new DatabaseService();
- ExpensesGrid.ItemsSource = databaseService.GetExpenses(EmployeeId);
- }
-
- private void Window_Activated(object sender, EventArgs e)
- {
- LoadData();
- }
- }
-}
diff --git a/Lab/Exercise5/02-End/ContosoExpenses/ContosoExpenses/Images/AddNewExpense.png b/Lab/Exercise5/02-End/ContosoExpenses/ContosoExpenses/Images/AddNewExpense.png
deleted file mode 100644
index 63410a5..0000000
Binary files a/Lab/Exercise5/02-End/ContosoExpenses/ContosoExpenses/Images/AddNewExpense.png and /dev/null differ
diff --git a/Lab/Exercise5/02-End/ContosoExpenses/ContosoExpenses/Images/ExpensesBackground.jpg b/Lab/Exercise5/02-End/ContosoExpenses/ContosoExpenses/Images/ExpensesBackground.jpg
deleted file mode 100644
index bb86330..0000000
Binary files a/Lab/Exercise5/02-End/ContosoExpenses/ContosoExpenses/Images/ExpensesBackground.jpg and /dev/null differ
diff --git a/Lab/Exercise5/02-End/ContosoExpenses/ContosoExpenses/Images/ExpensesListBackground.png b/Lab/Exercise5/02-End/ContosoExpenses/ContosoExpenses/Images/ExpensesListBackground.png
deleted file mode 100644
index b4dc0c3..0000000
Binary files a/Lab/Exercise5/02-End/ContosoExpenses/ContosoExpenses/Images/ExpensesListBackground.png and /dev/null differ
diff --git a/Lab/Exercise5/02-End/ContosoExpenses/ContosoExpenses/Images/HorizontalBackground.png b/Lab/Exercise5/02-End/ContosoExpenses/ContosoExpenses/Images/HorizontalBackground.png
deleted file mode 100644
index 6644ab1..0000000
Binary files a/Lab/Exercise5/02-End/ContosoExpenses/ContosoExpenses/Images/HorizontalBackground.png and /dev/null differ
diff --git a/Lab/Exercise5/02-End/ContosoExpenses/ContosoExpenses/Images/contoso.ico b/Lab/Exercise5/02-End/ContosoExpenses/ContosoExpenses/Images/contoso.ico
deleted file mode 100644
index 7a6845c..0000000
Binary files a/Lab/Exercise5/02-End/ContosoExpenses/ContosoExpenses/Images/contoso.ico and /dev/null differ
diff --git a/Lab/Exercise5/02-End/ContosoExpenses/ContosoExpenses/MainWindow.xaml b/Lab/Exercise5/02-End/ContosoExpenses/ContosoExpenses/MainWindow.xaml
deleted file mode 100644
index 8f3bbe5..0000000
--- a/Lab/Exercise5/02-End/ContosoExpenses/ContosoExpenses/MainWindow.xaml
+++ /dev/null
@@ -1,62 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/Lab/Exercise5/02-End/ContosoExpenses/ContosoExpenses/MainWindow.xaml.cs b/Lab/Exercise5/02-End/ContosoExpenses/ContosoExpenses/MainWindow.xaml.cs
deleted file mode 100644
index 18b62ca..0000000
--- a/Lab/Exercise5/02-End/ContosoExpenses/ContosoExpenses/MainWindow.xaml.cs
+++ /dev/null
@@ -1,67 +0,0 @@
-// ******************************************************************
-
-// Copyright (c) Microsoft. All rights reserved.
-// This code is licensed under the MIT License (MIT).
-// THE CODE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
-// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
-// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
-// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH
-// THE CODE OR THE USE OR OTHER DEALINGS IN THE CODE.
-
-// ******************************************************************
-
-using System.Collections.Generic;
-using System.Windows;
-using System.Windows.Controls;
-using ContosoExpenses.Models;
-using ContosoExpenses.Services;
-
-namespace ContosoExpenses
-{
- ///
- /// Interaction logic for MainWindow.xaml
- ///
- public partial class MainWindow : Window
- {
- public MainWindow()
- {
- InitializeComponent();
- }
-
- private void Window_Loaded(object sender, RoutedEventArgs e)
- {
- LoadData();
- }
-
- private void LoadData()
- {
- List customers = new List();
- DatabaseService db = new DatabaseService();
- db.InitializeDatabase();
-
- CustomersGrid.ItemsSource = db.GetEmployees();
- }
-
- private void OnSelectedEmployee(object sender, SelectionChangedEventArgs e)
- {
- if (e.AddedItems.Count > 0)
- {
- var employee = e.AddedItems[0] as Employee;
- if (employee != null && employee.EmployeeId != 0)
- {
- ExpensesList detail = new ExpensesList();
- detail.EmployeeId = employee.EmployeeId;
- detail.Show();
- }
- }
- }
-
- private void OnOpenAbout(object sender, RoutedEventArgs e)
- {
- AboutView about = new AboutView();
- about.ShowDialog();
- }
- }
-}
diff --git a/Lab/Exercise5/02-End/ContosoExpenses/ContosoExpenses/Models/Employee.cs b/Lab/Exercise5/02-End/ContosoExpenses/ContosoExpenses/Models/Employee.cs
deleted file mode 100644
index 6617470..0000000
--- a/Lab/Exercise5/02-End/ContosoExpenses/ContosoExpenses/Models/Employee.cs
+++ /dev/null
@@ -1,11 +0,0 @@
-
-namespace ContosoExpenses.Models
-{
- public class Employee
- {
- public int EmployeeId { get; set; }
- public string FirstName { get; set; }
- public string LastName { get; set; }
- public string Email { get; set; }
- }
-}
diff --git a/Lab/Exercise5/02-End/ContosoExpenses/ContosoExpenses/Models/Expense.cs b/Lab/Exercise5/02-End/ContosoExpenses/ContosoExpenses/Models/Expense.cs
deleted file mode 100644
index 791cfbd..0000000
--- a/Lab/Exercise5/02-End/ContosoExpenses/ContosoExpenses/Models/Expense.cs
+++ /dev/null
@@ -1,16 +0,0 @@
-using System;
-
-namespace ContosoExpenses.Models
-{
- public class Expense
- {
- public int ExpenseId { get; set; }
- public string Type { get; set; }
- public string Description { get; set; }
- public double Cost { get; set; }
- public string Address { get; set; }
- public string City { get; set; }
- public DateTime Date { get; set; }
- public int EmployeeId { get; set; }
- }
-}
diff --git a/Lab/Exercise5/02-End/ContosoExpenses/ContosoExpenses/Properties/AssemblyInfo.cs b/Lab/Exercise5/02-End/ContosoExpenses/ContosoExpenses/Properties/AssemblyInfo.cs
deleted file mode 100644
index a68a32b..0000000
--- a/Lab/Exercise5/02-End/ContosoExpenses/ContosoExpenses/Properties/AssemblyInfo.cs
+++ /dev/null
@@ -1,55 +0,0 @@
-using System.Reflection;
-using System.Resources;
-using System.Runtime.CompilerServices;
-using System.Runtime.InteropServices;
-using System.Windows;
-
-// General Information about an assembly is controlled through the following
-// set of attributes. Change these attribute values to modify the information
-// associated with an assembly.
-[assembly: AssemblyTitle("XamlIslandDemo")]
-[assembly: AssemblyDescription("")]
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("")]
-[assembly: AssemblyProduct("XamlIslandDemo")]
-[assembly: AssemblyCopyright("Copyright © 2019")]
-[assembly: AssemblyTrademark("")]
-[assembly: AssemblyCulture("")]
-
-// Setting ComVisible to false makes the types in this assembly not visible
-// to COM components. If you need to access a type in this assembly from
-// COM, set the ComVisible attribute to true on that type.
-[assembly: ComVisible(false)]
-
-//In order to begin building localizable applications, set
-//CultureYouAreCodingWith in your .csproj file
-//inside a . For example, if you are using US english
-//in your source files, set the to en-US. Then uncomment
-//the NeutralResourceLanguage attribute below. Update the "en-US" in
-//the line below to match the UICulture setting in the project file.
-
-//[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)]
-
-
-[assembly: ThemeInfo(
- ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
- //(used if a resource is not found in the page,
- // or application resource dictionaries)
- ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
- //(used if a resource is not found in the page,
- // app, or any theme specific resource dictionaries)
-)]
-
-
-// Version information for an assembly consists of the following four values:
-//
-// Major Version
-// Minor Version
-// Build Number
-// Revision
-//
-// You can specify all the values or you can default the Build and Revision Numbers
-// by using the '*' as shown below:
-// [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("1.0.0.0")]
-[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/Lab/Exercise5/02-End/ContosoExpenses/ContosoExpenses/Properties/Resources.Designer.cs b/Lab/Exercise5/02-End/ContosoExpenses/ContosoExpenses/Properties/Resources.Designer.cs
deleted file mode 100644
index 5fbb5f9..0000000
--- a/Lab/Exercise5/02-End/ContosoExpenses/ContosoExpenses/Properties/Resources.Designer.cs
+++ /dev/null
@@ -1,63 +0,0 @@
-//------------------------------------------------------------------------------
-//
-// This code was generated by a tool.
-// Runtime Version:4.0.30319.42000
-//
-// Changes to this file may cause incorrect behavior and will be lost if
-// the code is regenerated.
-//
-//------------------------------------------------------------------------------
-
-namespace ContosoExpenses.Properties {
- using System;
-
-
- ///
- /// A strongly-typed resource class, for looking up localized strings, etc.
- ///
- // This class was auto-generated by the StronglyTypedResourceBuilder
- // class via a tool like ResGen or Visual Studio.
- // To add or remove a member, edit your .ResX file then rerun ResGen
- // with the /str option, or rebuild your VS project.
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")]
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
- internal class Resources {
-
- private static global::System.Resources.ResourceManager resourceMan;
-
- private static global::System.Globalization.CultureInfo resourceCulture;
-
- [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
- internal Resources() {
- }
-
- ///
- /// Returns the cached ResourceManager instance used by this class.
- ///
- [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
- internal static global::System.Resources.ResourceManager ResourceManager {
- get {
- if (object.ReferenceEquals(resourceMan, null)) {
- global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("ContosoExpenses.Properties.Resources", typeof(Resources).Assembly);
- resourceMan = temp;
- }
- return resourceMan;
- }
- }
-
- ///
- /// Overrides the current thread's CurrentUICulture property for all
- /// resource lookups using this strongly typed resource class.
- ///
- [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
- internal static global::System.Globalization.CultureInfo Culture {
- get {
- return resourceCulture;
- }
- set {
- resourceCulture = value;
- }
- }
- }
-}
diff --git a/Lab/Exercise5/02-End/ContosoExpenses/ContosoExpenses/Properties/Resources.resx b/Lab/Exercise5/02-End/ContosoExpenses/ContosoExpenses/Properties/Resources.resx
deleted file mode 100644
index af7dbeb..0000000
--- a/Lab/Exercise5/02-End/ContosoExpenses/ContosoExpenses/Properties/Resources.resx
+++ /dev/null
@@ -1,117 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- text/microsoft-resx
-
-
- 2.0
-
-
- System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
-
- System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
-
\ No newline at end of file
diff --git a/Lab/Exercise5/02-End/ContosoExpenses/ContosoExpenses/Properties/Settings.Designer.cs b/Lab/Exercise5/02-End/ContosoExpenses/ContosoExpenses/Properties/Settings.Designer.cs
deleted file mode 100644
index 8b6c6e7..0000000
--- a/Lab/Exercise5/02-End/ContosoExpenses/ContosoExpenses/Properties/Settings.Designer.cs
+++ /dev/null
@@ -1,26 +0,0 @@
-//------------------------------------------------------------------------------
-//
-// This code was generated by a tool.
-// Runtime Version:4.0.30319.42000
-//
-// Changes to this file may cause incorrect behavior and will be lost if
-// the code is regenerated.
-//
-//------------------------------------------------------------------------------
-
-namespace ContosoExpenses.Properties {
-
-
- [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.0.0.0")]
- internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
-
- private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
-
- public static Settings Default {
- get {
- return defaultInstance;
- }
- }
- }
-}
diff --git a/Lab/Exercise5/02-End/ContosoExpenses/ContosoExpenses/Properties/Settings.settings b/Lab/Exercise5/02-End/ContosoExpenses/ContosoExpenses/Properties/Settings.settings
deleted file mode 100644
index 033d7a5..0000000
--- a/Lab/Exercise5/02-End/ContosoExpenses/ContosoExpenses/Properties/Settings.settings
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/Lab/Exercise5/02-End/ContosoExpenses/ContosoExpenses/Services/DatabaseService.cs b/Lab/Exercise5/02-End/ContosoExpenses/ContosoExpenses/Services/DatabaseService.cs
deleted file mode 100644
index 764603b..0000000
--- a/Lab/Exercise5/02-End/ContosoExpenses/ContosoExpenses/Services/DatabaseService.cs
+++ /dev/null
@@ -1,112 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.IO;
-using System.Linq;
-using Bogus;
-using LiteDB;
-using ContosoExpenses.Models;
-
-namespace ContosoExpenses.Services
-{
- public class DatabaseService
- {
- readonly int numberOfEmployees = 10;
- readonly int numberOfExpenses = 5;
-
- string filePath = $"{Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData)}\\ExpenseIt\\data.db";
- string directoryPath = $"{Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData)}\\ExpenseIt\\";
-
- public Employee GetEmployee(int employeeId)
- {
- using (var connection = new LiteDatabase(filePath))
- {
- var employees = connection.GetCollection();
- return employees.FindById(employeeId);
- }
- }
-
- public List GetEmployees()
- {
- using (var connection = new LiteDatabase(filePath))
- {
- var employees = connection.GetCollection();
- return employees.FindAll().ToList();
- }
- }
-
- public List GetExpenses(int employeedId)
- {
- using (var connection = new LiteDatabase(filePath))
- {
- var expenses = connection.GetCollection();
- return expenses.Find(x => x.EmployeeId == employeedId).ToList();
- }
- }
-
- public void SaveExpense(Expense expense)
- {
- using (var connection = new LiteDatabase(filePath))
- {
- var expenses = connection.GetCollection();
- expenses.Insert(expense);
- }
- }
-
- public void InitializeDatabase()
- {
- if (!File.Exists(filePath))
- {
- Directory.CreateDirectory(directoryPath);
- }
-
- using (var connection = new LiteDatabase(filePath))
- {
- var employees = connection.GetCollection();
- var expenses = connection.GetCollection();
-
- int result = employees.Count();
- if (result == 0)
- {
- GenerateFakeData(numberOfEmployees, numberOfExpenses);
- }
- }
- }
-
- private void GenerateFakeData(int numberOfEmployees, int numberOfExpenses)
- {
- using (var connection = new LiteDatabase(filePath))
- {
- var employees = connection.GetCollection();
- var expenses = connection.GetCollection();
-
- for (int cont = 0; cont < numberOfEmployees; cont++)
- {
- var employee = new Faker()
- .RuleFor(x => x.FirstName, (f, u) => f.Name.FirstName())
- .RuleFor(x => x.LastName, (f, u) => f.Name.LastName())
- .RuleFor(x => x.Email, (f, u) => f.Internet.Email(u.FirstName, u.LastName, "contoso.com"))
- .Generate();
-
- int employeeId = employees.Insert(employee).AsInt32;
-
- for (int contExpenses = 0; contExpenses < numberOfExpenses; contExpenses++)
- {
- var expense = new Faker()
- .RuleFor(x => x.Description, (f, u) => f.Commerce.ProductName())
- .RuleFor(x => x.Type, (f, u) => f.Finance.TransactionType())
- .RuleFor(x => x.Cost, (f, u) => (double)f.Finance.Amount())
- .RuleFor(x => x.Address, (f, u) => f.Address.FullAddress())
- .RuleFor(x => x.City, (f, u) => f.Address.City())
- .RuleFor(x => x.Date, (f, u) => f.Date.Past())
- .Generate();
-
- expense.EmployeeId = employeeId;
-
- expenses.Insert(expense);
- }
- }
- }
-
- }
- }
-}
diff --git a/Lab/Exercise5/02-End/ContosoExpenses/ContosoExpenses/packages.config b/Lab/Exercise5/02-End/ContosoExpenses/ContosoExpenses/packages.config
deleted file mode 100644
index e45ff71..0000000
--- a/Lab/Exercise5/02-End/ContosoExpenses/ContosoExpenses/packages.config
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
-
-
-
-
-
\ No newline at end of file