Updated the behavior of the Inventory data table to reflect the row attributes of the Actual Sales table. Minor tweaks to the Manage Ad Items form.

This commit is contained in:
2017-07-14 18:23:00 -05:00
parent 3b36476a6c
commit ac9f464cf3
6 changed files with 350 additions and 49 deletions
+15 -4
View File
@@ -518,7 +518,14 @@ namespace AdvertsingProfitControl
}
var userInput = dataGridView.Rows[e.RowIndex].Cells[adItemIndex].EditedFormattedValue.ToString().Trim();
//Paint the rows to identify what group they belong to.
TableGroupParser.PaintRowGroupsFromIndex(e.RowIndex, dataGridView);
if (dataGridView != inventoryDataGridView)
{
TableGroupParser.PaintRowGroupsFromIndex(e.RowIndex, dataGridView);
}
else
{
TableGroupParser.PaintInventoryRowGroups(e.RowIndex, inventoryDataGridView, actualSalesDataGridView);
}
//Add in used Ad Items to the list.
if (userInput == string.Empty) return;
//Clear the old ad item out of the used ad item collection.
@@ -1012,7 +1019,7 @@ namespace AdvertsingProfitControl
{
inventoryDataGridView.Rows[e.RowIndex].Cells[(int) TableGroupParser.InventoryTableColumns.AdItem].Value = userInput;
}
TableGroupParser.PaintRowGroupsFromIndex(e.RowIndex - 1, inventoryDataGridView);
TableGroupParser.PaintInventoryRowGroups(e.RowIndex - 1, inventoryDataGridView, actualSalesDataGridView); //TODO:CHANGED .PaintRowGroupsFromIndex(e.RowIndex - 1, inventoryDataGridView);
if (actualSalesDataGridView.RowCount > e.RowIndex)
{
actualSalesDataGridView.Rows[e.RowIndex].Cells[(int) TableGroupParser.SalesTableColumns.AdItem].Value = userInput;
@@ -1530,7 +1537,7 @@ namespace AdvertsingProfitControl
{
inventoryDataGridView.Rows[e.RowIndex].Cells[(int)TableGroupParser.InventoryTableColumns.AdItem].Value = userInput;
}
TableGroupParser.PaintRowGroupsFromIndex(e.RowIndex - 1, inventoryDataGridView);
TableGroupParser.PaintInventoryRowGroups(e.RowIndex - 1, inventoryDataGridView, actualSalesDataGridView); //TODO:CHANGE .PaintRowGroupsFromIndex(e.RowIndex - 1, inventoryDataGridView);
if (actualSalesDataGridView.RowCount > e.RowIndex)
{
actualSalesDataGridView.Rows[e.RowIndex].Cells[(int)TableGroupParser.SalesTableColumns.AdItem].Value = userInput;
@@ -1856,7 +1863,7 @@ out double beginningBinCount, out string newBinText))
projectionsDataGridView.RefreshEdit();
inventoryDataGridView.RefreshEdit();
actualSalesDataGridView.RefreshEdit();
TableGroupParser.PaintRowGroups(dataGridView);
TableGroupParser.PaintInventoryRowGroups(0, inventoryDataGridView, actualSalesDataGridView); //TODO: CHANEG.PaintRowGroups(dataGridView);
}
#endregion
@@ -3274,6 +3281,10 @@ out double beginningBinCount, out string newBinText))
try
{
//Force update all the data tables.
//TableGroupParser.PaintRowGroupsFromIndex(0, projectionsDataGridView);
//TableGroupParser.PaintRowGroupsFromIndex(0, inventoryDataGridView);
//TableGroupParser.PaintRowGroupsFromIndex(0, actualSalesDataGridView);
using (var scope = new TransactionScope())
{
SaveProjections(date);