Removed the Invoice Net Amount Extended Retail column from the Invoice table DataGridViews. Fixed a crash bug on the main form caused by an empty department sales variable. Small refactoring on the main form's calculation methods.

This commit is contained in:
2017-04-17 02:01:31 -05:00
parent 61f369f7fe
commit c72fbf88cf
8 changed files with 81 additions and 47 deletions
@@ -69,6 +69,7 @@ namespace AdvertsingProfitControl
}
}
}
}
private void MoveOverButton_Click(object sender, EventArgs e)
@@ -776,5 +777,23 @@ namespace AdvertsingProfitControl
return dataTable;
}
private void button1_Click(object sender, EventArgs e)
{
var db = new AdvertisingProfitControlModel();
using (var scope = new TransactionScope())
{
var invoices = db.Invoices.Select(x => x);
foreach (var invoice in invoices)
{
invoice.InvoiceNetAmountAtCost = invoice.InvoiceNetAmount;
invoice.InvoiceNetAmount = null;
}
db.SaveChanges();
scope.Complete();
}
}
}
}