First stages of a new logging system being put in place. Updated the group parsing engine for the Projections and Actual Sales tables, and removed the method. Fixed the issue where changes to groups didn't mark the record manipulation form as dirty.

This commit is contained in:
2017-09-18 11:36:23 -05:00
parent ac9f464cf3
commit de1ba4af10
12 changed files with 426 additions and 311 deletions
+37 -15
View File
@@ -520,11 +520,16 @@ namespace AdvertsingProfitControl
//Paint the rows to identify what group they belong to.
if (dataGridView != inventoryDataGridView)
{
TableGroupParser.PaintRowGroupsFromIndex(e.RowIndex, dataGridView);
//Paint the groups and check if the form should be marked as dirty.
if (TableGroupParser.PaintRowGroups(dataGridView, e.RowIndex))
{
_isFormDirty = true;
}
//TableGroupParser.PaintRowGroupsFromIndex(e.RowIndex, dataGridView);
}
else
{
TableGroupParser.PaintInventoryRowGroups(e.RowIndex, inventoryDataGridView, actualSalesDataGridView);
//TODO: Update Inventory table parser.
}
//Add in used Ad Items to the list.
if (userInput == string.Empty) return;
@@ -1014,17 +1019,25 @@ namespace AdvertsingProfitControl
return;
}
//Update the color coding of the other tables.
TableGroupParser.PaintRowGroupsFromIndex(e.RowIndex - 1, projectionsDataGridView);
//Paint the groups and check if the form should be marked as dirty.
if (TableGroupParser.PaintRowGroups(projectionsDataGridView, e.RowIndex, true))
{
_isFormDirty = true;
}
if (inventoryDataGridView.RowCount > e.RowIndex)
{
inventoryDataGridView.Rows[e.RowIndex].Cells[(int) TableGroupParser.InventoryTableColumns.AdItem].Value = userInput;
}
TableGroupParser.PaintInventoryRowGroups(e.RowIndex - 1, inventoryDataGridView, actualSalesDataGridView); //TODO:CHANGED .PaintRowGroupsFromIndex(e.RowIndex - 1, inventoryDataGridView);
TableGroupParser.PaintInventoryRowGroups(e.RowIndex - 1, inventoryDataGridView, projectionsDataGridView); //TODO:CHANGED .PaintRowGroupsFromIndex(e.RowIndex - 1, inventoryDataGridView);
if (actualSalesDataGridView.RowCount > e.RowIndex)
{
actualSalesDataGridView.Rows[e.RowIndex].Cells[(int) TableGroupParser.SalesTableColumns.AdItem].Value = userInput;
}
TableGroupParser.PaintRowGroupsFromIndex(e.RowIndex - 1, actualSalesDataGridView);
//Paint the groups and check if the form should be marked as dirty.
if (TableGroupParser.PaintRowGroups(actualSalesDataGridView, e.RowIndex, true))
{
_isFormDirty = true;
}
}
else
{
@@ -1392,7 +1405,7 @@ namespace AdvertsingProfitControl
projectionsDataGridView.RefreshEdit();
inventoryDataGridView.RefreshEdit();
actualSalesDataGridView.RefreshEdit();
TableGroupParser.PaintRowGroups(dataGridView);
TableGroupParser.PaintRowGroups(dataGridView, 0);
}
#endregion
@@ -1532,17 +1545,25 @@ namespace AdvertsingProfitControl
return;
}
//Update the color coding of the other tables.
TableGroupParser.PaintRowGroupsFromIndex(e.RowIndex - 1, projectionsDataGridView);
//Paint the groups and check if the form should be marked as dirty.
if (TableGroupParser.PaintRowGroups(projectionsDataGridView, e.RowIndex, true))
{
_isFormDirty = true;
}
if (inventoryDataGridView.RowCount > e.RowIndex)
{
inventoryDataGridView.Rows[e.RowIndex].Cells[(int)TableGroupParser.InventoryTableColumns.AdItem].Value = userInput;
}
TableGroupParser.PaintInventoryRowGroups(e.RowIndex - 1, inventoryDataGridView, actualSalesDataGridView); //TODO:CHANGE .PaintRowGroupsFromIndex(e.RowIndex - 1, inventoryDataGridView);
TableGroupParser.PaintInventoryRowGroups(e.RowIndex - 1, inventoryDataGridView, projectionsDataGridView); //TODO:CHANGE .PaintRowGroupsFromIndex(e.RowIndex - 1, inventoryDataGridView);
if (actualSalesDataGridView.RowCount > e.RowIndex)
{
actualSalesDataGridView.Rows[e.RowIndex].Cells[(int)TableGroupParser.SalesTableColumns.AdItem].Value = userInput;
}
TableGroupParser.PaintRowGroupsFromIndex(e.RowIndex - 1, actualSalesDataGridView);
//Paint the groups and check if the form should be marked as dirty.
if (TableGroupParser.PaintRowGroups(actualSalesDataGridView, e.RowIndex, true))
{
_isFormDirty = true;
}
}
else
{
@@ -1863,7 +1884,7 @@ out double beginningBinCount, out string newBinText))
projectionsDataGridView.RefreshEdit();
inventoryDataGridView.RefreshEdit();
actualSalesDataGridView.RefreshEdit();
TableGroupParser.PaintInventoryRowGroups(0, inventoryDataGridView, actualSalesDataGridView); //TODO: CHANEG.PaintRowGroups(dataGridView);
TableGroupParser.PaintInventoryRowGroups(0, inventoryDataGridView, projectionsDataGridView); //TODO: CHANEG.PaintRowGroups(dataGridView);
}
#endregion
@@ -2079,7 +2100,7 @@ out double beginningBinCount, out string newBinText))
projectionsDataGridView.RefreshEdit();
inventoryDataGridView.RefreshEdit();
actualSalesDataGridView.RefreshEdit();
TableGroupParser.PaintRowGroups(dataGridView);
TableGroupParser.PaintRowGroups(dataGridView, 0);
}
#endregion
@@ -2132,7 +2153,7 @@ out double beginningBinCount, out string newBinText))
Name = name,
HeaderText = TextFormat.AddSpacesToSentence(name, false),
ValueType = typeof(bool),
Visible = false,
//Visible = false,
SortMode = DataGridViewColumnSortMode.NotSortable
};
projectionsDataGridView.Columns.Add(column);
@@ -3282,9 +3303,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);
//Paint the groups and check if the form should be marked as dirty.
TableGroupParser.PaintRowGroups(projectionsDataGridView, 0, true);
TableGroupParser.PaintRowGroups(inventoryDataGridView, 0, true);
TableGroupParser.PaintRowGroups(actualSalesDataGridView, 0, true);
using (var scope = new TransactionScope())
{
SaveProjections(date);