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
+3 -2
View File
@@ -44,14 +44,15 @@ namespace AdvertsingProfitControl
{
return RowAttribute.NewRow;
}
//Determine the range to use during the looping process.
var headerCellIndex = row.Cells.Count == Enum.GetNames(typeof(SalesTableColumns)).Length ? (int)SalesTableColumns.IsHeaderRow : (int)InventoryTableColumns.IsHeaderRow;
var rowContents = new List<string>();
var rowAttribute = RowAttribute.MemberRow;
//Get the contents of the row that's being examined and add then to a List<string> array.
var i = 0;
foreach (DataGridViewCell cell in row.Cells)
{
if (cell.ColumnIndex >= (int) SalesTableColumns.IsHeaderRow || cell.ColumnIndex == 0) { i++; continue;}
if (cell.ColumnIndex >= headerCellIndex || cell.ColumnIndex == 0) { i++; continue;}
//Strip all whitespace characters from the cell, this includes vertical tabs, newlines, and any number of spaces.
var cellContentsStripped = new string(cell.EditedFormattedValue.ToString().Where(c => !char.IsWhiteSpace(c)).ToArray());
//Now remove all zeros, including any decimal points as these values are meaningless.