Add and modify forms texted with real data. Fixed a few crash bugs and precision errors. Fixed the Actual Sales table in Access was missing a row. Add sample data to the database.
This commit is contained in:
@@ -1048,6 +1048,18 @@ namespace AdvertsingProfitControl
|
||||
rowContents[i] = projectionsDataGridView.Rows[e.RowIndex].Cells[i].EditedFormattedValue.ToString();
|
||||
}
|
||||
break;
|
||||
case (int)SalesTableColumns.ProfitReturn:
|
||||
//IF the Cost cell is empty then place 0.00 into the array as a place holder value (assuming this row is a HeaderRow).
|
||||
if (projectionsDataGridView.Rows[e.RowIndex].Cells[i].EditedFormattedValue.ToString() == "")
|
||||
{
|
||||
rowContents[i] = "";
|
||||
}
|
||||
//ELSE place the value from the Projections table into the array, since Cost can be determined before actual data is used.
|
||||
else
|
||||
{
|
||||
rowContents[i] = projectionsDataGridView.Rows[e.RowIndex].Cells[i].EditedFormattedValue.ToString();
|
||||
}
|
||||
break;
|
||||
case (int)SalesTableColumns.IsDirty:
|
||||
rowContents[i] = true;
|
||||
break;
|
||||
@@ -1576,6 +1588,9 @@ namespace AdvertsingProfitControl
|
||||
case (int)SalesTableColumns.Cost:
|
||||
rowContents[i] = actualSalesDataGridView.Rows[e.RowIndex].Cells[i].EditedFormattedValue.ToString();
|
||||
break;
|
||||
case (int)SalesTableColumns.ProfitReturn:
|
||||
rowContents[i] = projectionsDataGridView.Rows[e.RowIndex].Cells[i].EditedFormattedValue.ToString();
|
||||
break;
|
||||
case (int)SalesTableColumns.IsDirty:
|
||||
rowContents[i] = true;
|
||||
break;
|
||||
@@ -1731,7 +1746,7 @@ namespace AdvertsingProfitControl
|
||||
};
|
||||
if (name.Contains("ID"))
|
||||
{
|
||||
//column.Visible = false;
|
||||
column.Visible = false;
|
||||
}
|
||||
projectionsDataGridView.Columns.Add(column);
|
||||
}
|
||||
@@ -1742,7 +1757,7 @@ namespace AdvertsingProfitControl
|
||||
Name = name,
|
||||
HeaderText = TextFormat.AddSpacesToSentence(name, false),
|
||||
ValueType = typeof(bool),
|
||||
//Visible = false,
|
||||
Visible = false,
|
||||
SortMode = DataGridViewColumnSortMode.NotSortable
|
||||
};
|
||||
projectionsDataGridView.Columns.Add(column);
|
||||
@@ -1761,6 +1776,10 @@ namespace AdvertsingProfitControl
|
||||
SortMode = DataGridViewColumnSortMode.NotSortable,
|
||||
MaxInputLength = 20
|
||||
};
|
||||
if (name.Contains("ID"))
|
||||
{
|
||||
column.Visible = false;
|
||||
}
|
||||
inventoryDataGridView.Columns.Add(column);
|
||||
}
|
||||
else
|
||||
@@ -1770,7 +1789,7 @@ namespace AdvertsingProfitControl
|
||||
Name = name,
|
||||
HeaderText = TextFormat.AddSpacesToSentence(name, false),
|
||||
ValueType = typeof(bool),
|
||||
//Visible = false,
|
||||
Visible = false,
|
||||
SortMode = DataGridViewColumnSortMode.NotSortable
|
||||
};
|
||||
inventoryDataGridView.Columns.Add(column);
|
||||
@@ -1789,6 +1808,10 @@ namespace AdvertsingProfitControl
|
||||
SortMode = DataGridViewColumnSortMode.NotSortable,
|
||||
MaxInputLength = 20
|
||||
};
|
||||
if (name.Contains("ID"))
|
||||
{
|
||||
column.Visible = false;
|
||||
}
|
||||
actualSalesDataGridView.Columns.Add(column);
|
||||
}
|
||||
else
|
||||
@@ -1798,7 +1821,7 @@ namespace AdvertsingProfitControl
|
||||
Name = name,
|
||||
HeaderText = TextFormat.AddSpacesToSentence(name, false),
|
||||
ValueType = typeof(bool),
|
||||
//Visible = false,
|
||||
Visible = false,
|
||||
SortMode = DataGridViewColumnSortMode.NotSortable
|
||||
};
|
||||
actualSalesDataGridView.Columns.Add(column);
|
||||
@@ -1827,7 +1850,7 @@ namespace AdvertsingProfitControl
|
||||
};
|
||||
if (name.Contains("ID"))
|
||||
{
|
||||
//column.Visible = false;
|
||||
column.Visible = false;
|
||||
}
|
||||
invoicesDataGridView.Columns.Add(column);
|
||||
}
|
||||
@@ -1837,7 +1860,7 @@ namespace AdvertsingProfitControl
|
||||
{
|
||||
Name = name,
|
||||
ValueType = typeof(bool),
|
||||
//Visible = false,
|
||||
Visible = false,
|
||||
SortMode = DataGridViewColumnSortMode.NotSortable
|
||||
};
|
||||
invoicesDataGridView.Columns.Add(column);
|
||||
@@ -2450,7 +2473,7 @@ namespace AdvertsingProfitControl
|
||||
continue;
|
||||
}
|
||||
//Check to see if the row is dirty.
|
||||
if (!(bool)row.Cells[(int)SalesTableColumns.IsDirty].Value)
|
||||
if (!(bool)row.Cells[(int)SalesTableColumns.IsDirty].EditedFormattedValue)
|
||||
{
|
||||
//If it is not then continue on to the next row.
|
||||
continue;
|
||||
@@ -2476,11 +2499,11 @@ namespace AdvertsingProfitControl
|
||||
}
|
||||
//Determine the row's attribute.
|
||||
var rowAttribute = 0; //Zero (0) means no grouping, its not a header nor a member.
|
||||
if ((bool)row.Cells[(int)SalesTableColumns.IsHeaderRow].Value && !(bool)row.Cells[(int)SalesTableColumns.IsMemberRow].Value)
|
||||
if ((bool)row.Cells[(int)SalesTableColumns.IsHeaderRow].EditedFormattedValue && !(bool)row.Cells[(int)SalesTableColumns.IsMemberRow].EditedFormattedValue)
|
||||
{
|
||||
rowAttribute = 1;
|
||||
}
|
||||
else if ((bool)row.Cells[(int)SalesTableColumns.IsMemberRow].Value && !(bool)row.Cells[(int)SalesTableColumns.IsHeaderRow].Value)
|
||||
else if ((bool)row.Cells[(int)SalesTableColumns.IsMemberRow].EditedFormattedValue && !(bool)row.Cells[(int)SalesTableColumns.IsHeaderRow].EditedFormattedValue)
|
||||
{
|
||||
rowAttribute = 2;
|
||||
}
|
||||
@@ -2607,7 +2630,7 @@ namespace AdvertsingProfitControl
|
||||
continue;
|
||||
}
|
||||
//Check to see if the row is dirty.
|
||||
if (!(bool)row.Cells[(int)InventoryTableColumns.IsDirty].Value)
|
||||
if (!(bool)row.Cells[(int)InventoryTableColumns.IsDirty].EditedFormattedValue)
|
||||
{
|
||||
//If it is not then continue on to the next row.
|
||||
continue;
|
||||
@@ -2632,11 +2655,11 @@ namespace AdvertsingProfitControl
|
||||
}
|
||||
//Determine the row's attribute.
|
||||
var rowAttribute = 0; //Zero (0) means no grouping, its not a header nor a member.
|
||||
if ((bool)row.Cells[(int)InventoryTableColumns.IsHeaderRow].Value && !(bool)row.Cells[(int)InventoryTableColumns.IsMemberRow].Value)
|
||||
if ((bool)row.Cells[(int)InventoryTableColumns.IsHeaderRow].EditedFormattedValue && !(bool)row.Cells[(int)InventoryTableColumns.IsMemberRow].EditedFormattedValue)
|
||||
{
|
||||
rowAttribute = 1;
|
||||
}
|
||||
else if ((bool)row.Cells[(int)InventoryTableColumns.IsMemberRow].Value && !(bool)row.Cells[(int)InventoryTableColumns.IsHeaderRow].Value)
|
||||
else if ((bool)row.Cells[(int)InventoryTableColumns.IsMemberRow].EditedFormattedValue && !(bool)row.Cells[(int)InventoryTableColumns.IsHeaderRow].EditedFormattedValue)
|
||||
{
|
||||
rowAttribute = 2;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user