GetAll()
+ {
+ throw new NotImplementedException();
+ }
+
+ public override Customer GetSingle(P pkValue)
+ {
+ throw new NotImplementedException();
+ }
+
+ public override void Update(Customer entity)
+ {
+ throw new NotImplementedException();
+ }
+ }
+}
diff --git a/LoggingClient/LoggingClient/ViewModel/CustomerViewModel.cs b/LoggingClient/LoggingClient/ViewModel/CustomerViewModel.cs
index 106408d..ab6255e 100755
--- a/LoggingClient/LoggingClient/ViewModel/CustomerViewModel.cs
+++ b/LoggingClient/LoggingClient/ViewModel/CustomerViewModel.cs
@@ -169,7 +169,15 @@ namespace LoggingClient.ViewModel
}
if (_LinqIsChecked)
{
- //TODO
+ try
+ {
+ var customerModelRepositoryLinq = new CustomerRepositoryLinq(TxtConnectionString);
+ Customers = customerModelRepositoryLinq.GetAll();
+ }
+ catch (Exception ex)
+ {
+ MessageBox.Show("Error occurred: " + ex.Message);
+ }
}
if (!_EfIsChecked && !_LinqIsChecked)
{
@@ -201,7 +209,16 @@ namespace LoggingClient.ViewModel
}
if (_LinqIsChecked)
{
- // TODO
+ try
+ {
+ var customerModelRepositoryLinq = new CustomerRepositoryLinq(TxtConnectionString);
+ customerModelRepositoryLinq.Add(NewCustomerEntry);
+ Customers = customerModelRepositoryLinq.GetAll();
+ }
+ catch (Exception ex)
+ {
+ MessageBox.Show("Error occurred: " + ex.Message);
+ }
}
if (!_EfIsChecked && !_LinqIsChecked)
{
@@ -232,6 +249,19 @@ namespace LoggingClient.ViewModel
MessageBox.Show("Error occurred: " + ex.Message);
}
}
+ if (_LinqIsChecked)
+ {
+ try
+ {
+ var customerModelRepositoryLinq = new CustomerRepositoryLinq(TxtConnectionString);
+ customerModelRepositoryLinq.Delete(MySelectedItem);
+ Customers = customerModelRepositoryLinq.GetAll();
+ }
+ catch (Exception ex)
+ {
+ MessageBox.Show("Error occurred: " + ex.Message);
+ }
+ }
if (!_EfIsChecked && !_LinqIsChecked)
{
try
@@ -248,15 +278,41 @@ namespace LoggingClient.ViewModel
}
private void UpdateData()
{
- try
+ if (_EfIsChecked)
{
- var customerModelRepository = new CustomerRepository(TxtConnectionString);
- customerModelRepository.Update(this.NewCustomerEntry);
- this.Customers = customerModelRepository.GetAll().ToList();
+ try
+ {
+ //DOTO
+ }
+ catch (Exception ex)
+ {
+ MessageBox.Show("Error occurred: " + ex.Message);
+ }
}
- catch (Exception ex)
+ if (_LinqIsChecked)
{
- MessageBox.Show("Error occurred: " + ex.Message);
+ try
+ {
+ //DOTO
+ }
+ catch (Exception ex)
+ {
+ MessageBox.Show("Error occurred: " + ex.Message);
+ }
+ }
+ if (!_EfIsChecked && !_LinqIsChecked)
+ {
+
+ try
+ {
+ var customerModelRepository = new CustomerRepository(TxtConnectionString);
+ customerModelRepository.Update(this.NewCustomerEntry);
+ this.Customers = customerModelRepository.GetAll().ToList();
+ }
+ catch (Exception ex)
+ {
+ MessageBox.Show("Error occurred: " + ex.Message);
+ }
}
}