Finished the APC table saving code. Fixed a bug with the row parsing engine.

This commit is contained in:
2017-01-21 03:43:31 -06:00
parent 12239bce23
commit f9968942ea
5 changed files with 100 additions and 18 deletions
@@ -96,6 +96,29 @@ namespace AdvertsingProfitControl
dataGridView.Rows[i - 1].Cells[isMemberColumn].Value = false;
dataGridView.Rows[i - 1].DefaultCellStyle.BackColor = Color.White;
}
//Then check to see if the next row is a member row
rowStatus = parser.GetRowAttribute(dataGridView.Rows[i + 1]);
if (rowStatus == RowAttribute.MemberRow)
{
//Set the current row and check for changes.
if (!(bool)dataGridView.Rows[i].Cells[isHeaderColumn].EditedFormattedValue)
{
dataGridView.Rows[i].Cells[isDirtyColumn].Value = true;
dataGridView.Rows[i].HeaderCell.Style.BackColor = ApplicationColors.PendingEdit;
}
dataGridView.Rows[i].Cells[isHeaderColumn].Value = true;
dataGridView.Rows[i].Cells[isMemberColumn].Value = false;
dataGridView.Rows[i].DefaultCellStyle.BackColor = Color.LightGray;
//Set the next row as a member row.
if (!(bool)dataGridView.Rows[i + 1].Cells[isMemberColumn].EditedFormattedValue)
{
dataGridView.Rows[i + 1].Cells[isDirtyColumn].Value = true;
dataGridView.Rows[i + 1].HeaderCell.Style.BackColor = ApplicationColors.PendingEdit;
}
dataGridView.Rows[i + 1].Cells[isHeaderColumn].Value = false;
dataGridView.Rows[i + 1].Cells[isMemberColumn].Value = true;
dataGridView.Rows[i + 1].DefaultCellStyle.BackColor = Color.LightBlue;
}
//IF previous row is Incomplete, then call the stable PaintRowGroups function.
else if (rowStatus == RowAttribute.IncompleteRow)
{
@@ -108,11 +131,21 @@ namespace AdvertsingProfitControl
rowStatus = parser.GetRowAttribute(dataGridView.Rows[i + 1]);
if (rowStatus == RowAttribute.MemberRow)
{
//Set the previous row as a header row.
//Set the current row and check for changes.
if (!(bool)dataGridView.Rows[i].Cells[isHeaderColumn].EditedFormattedValue)
{
dataGridView.Rows[i].Cells[isDirtyColumn].Value = true;
dataGridView.Rows[i].HeaderCell.Style.BackColor = ApplicationColors.PendingEdit;
}
dataGridView.Rows[i].Cells[isHeaderColumn].Value = true;
dataGridView.Rows[i].Cells[isMemberColumn].Value = false;
dataGridView.Rows[i].DefaultCellStyle.BackColor = Color.LightGray;
//Set the next row as a member row.
if (!(bool)dataGridView.Rows[i + 1].Cells[isMemberColumn].EditedFormattedValue)
{
dataGridView.Rows[i + 1].Cells[isDirtyColumn].Value = true;
dataGridView.Rows[i + 1].HeaderCell.Style.BackColor = ApplicationColors.PendingEdit;
}
dataGridView.Rows[i + 1].Cells[isHeaderColumn].Value = false;
dataGridView.Rows[i + 1].Cells[isMemberColumn].Value = true;
dataGridView.Rows[i + 1].DefaultCellStyle.BackColor = Color.LightBlue;