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:
@@ -50,7 +50,7 @@ namespace AdvertsingProfitControl
|
||||
|
||||
private void RegisterNewAdSpecial(object sender, EventArgs e)
|
||||
{
|
||||
var db = new AdvertisingProfitControlModel();
|
||||
var db = new AdvertisingProfitControlDbContext();
|
||||
if (!_isUpdating)
|
||||
{
|
||||
if (!db.AdSpecials.Any(x => x.Name == newAdSpecialTextBox.Text))
|
||||
@@ -100,7 +100,7 @@ namespace AdvertsingProfitControl
|
||||
private void RefreshAdSpecialListing()
|
||||
{
|
||||
adSpecialsListBox.Items.Clear();
|
||||
var db = new AdvertisingProfitControlModel();
|
||||
var db = new AdvertisingProfitControlDbContext();
|
||||
var adSpecials = db.AdSpecials.Select(x => x).OrderBy(x => x.Name);
|
||||
foreach (var adSpecial in adSpecials)
|
||||
{
|
||||
@@ -120,7 +120,7 @@ namespace AdvertsingProfitControl
|
||||
{
|
||||
var item = adSpecialsListBox.SelectedItems[0];
|
||||
var adSpecial = (AdSpecial) item.Tag;
|
||||
var db = new AdvertisingProfitControlModel();
|
||||
var db = new AdvertisingProfitControlDbContext();
|
||||
var ad = db.AdSpecials.Single(x => x.Id == adSpecial.Id);
|
||||
//Check to see if the ad special is used by other tables.
|
||||
if (ad.ActualSales.Count > 0)
|
||||
|
||||
Reference in New Issue
Block a user