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:
@@ -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();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user