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:
@@ -30,7 +30,7 @@ namespace AdvertsingProfitControl
|
||||
if(filterComboBox.Enabled == false) return;
|
||||
adItemsListView.Columns[0].Text = @"Current Ad Items (" + (filterComboBox.SelectedItem.ToString() == "All" ? "No Filter" : @"Filter " + filterComboBox.SelectedItem) + @"):";
|
||||
adItemsListView.Items.Clear();
|
||||
var db = new AdvertisingProfitControlModel();
|
||||
var db = new AdvertisingProfitControlDbContext();
|
||||
var adItems = db.AdItems.Select(x => x);
|
||||
foreach (var adItem in adItems)
|
||||
{
|
||||
@@ -92,7 +92,7 @@ namespace AdvertsingProfitControl
|
||||
adItemsListView.Items.Clear();
|
||||
filterComboBox.Items.Clear();
|
||||
filterComboBox.Items.Add("All");
|
||||
var db = new AdvertisingProfitControlModel();
|
||||
var db = new AdvertisingProfitControlDbContext();
|
||||
var adItems = db.AdItems.Select(x => x).OrderBy(x => x.Name);
|
||||
var adItemCount = 0;
|
||||
var numberFound = false;
|
||||
@@ -153,7 +153,7 @@ namespace AdvertsingProfitControl
|
||||
{
|
||||
var item = adItemsListView.SelectedItems[0];
|
||||
var oldAdItem = (AdItem)item.Tag;
|
||||
var db = new AdvertisingProfitControlModel();
|
||||
var db = new AdvertisingProfitControlDbContext();
|
||||
var adItemEntry = db.AdItems.Single(x => x.Id == oldAdItem.Id);
|
||||
//Check to see if the ad special is used by other tables.
|
||||
if (adItemEntry.ActualSales.Count > 0)
|
||||
@@ -208,7 +208,7 @@ namespace AdvertsingProfitControl
|
||||
|
||||
private void AddUpdateItem(object sender, EventArgs e)
|
||||
{
|
||||
var db = new AdvertisingProfitControlModel();
|
||||
var db = new AdvertisingProfitControlDbContext();
|
||||
if (!_isUpdating)
|
||||
{
|
||||
if (!db.AdItems.Any(x => x.Name == newItemTextBox.Text))
|
||||
|
||||
Reference in New Issue
Block a user