Finished the APC table saving code. Fixed a bug with the row parsing engine.
This commit is contained in:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user