Implemented database backups and restores into the AdvertisingProfitControlData DLL and added a form, DatabaseRecovery, to manage the backups and restores. Updated the installer to include the data DLL file into the install bundle.

This commit is contained in:
2017-06-23 03:12:51 -05:00
parent 308b60bd84
commit 12a6b36370
20 changed files with 5378 additions and 80 deletions
@@ -50,7 +50,7 @@ namespace AdvertsingProfitControl
private void RefreshSupplierListing()
{
suppliersListBox.Items.Clear();
var db = new AdvertisingProfitControlModel();
var db = new AdvertisingProfitControlDbContext();
var suppliers = db.Suppliers.Select(x => x).OrderBy(x => x.Name);
var supplierCount = 0;
foreach (var supplier in suppliers)
@@ -72,7 +72,7 @@ namespace AdvertsingProfitControl
private void registerSupplierButton_Click(object sender, EventArgs e)
{
var db = new AdvertisingProfitControlModel();
var db = new AdvertisingProfitControlDbContext();
if (!_isUpdating)
{
if (!db.Suppliers.Any(x => x.Name == newSupplierTextBox.Text))
@@ -123,7 +123,7 @@ namespace AdvertsingProfitControl
{
var item = suppliersListBox.SelectedItems[0];
var oldSupplier = (Supplier)item.Tag;
var db = new AdvertisingProfitControlModel();
var db = new AdvertisingProfitControlDbContext();
var supplier = db.Suppliers.Single(x => x.Id == oldSupplier.Id);
//Check to see if the ad special is used by other tables.
if (supplier.Invoices.Count > 0)