Added a temporary form to convert the old database format. Updated the row parsing engine to handle ad special rows more effectively. Fixed a few bugs with the parsing engine not flagging member rows as dirty. Upped the character limit of the ad item and supplier columns.
This commit is contained in:
@@ -721,21 +721,18 @@ namespace AdvertsingProfitControl
|
||||
e.Cancel = true; //Prevent the new row from being removed.
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
e.Cancel = true;
|
||||
}
|
||||
e.Cancel = true;
|
||||
}
|
||||
//Mark all rows under the row that just got deleted as dirty.
|
||||
for (var index = currentRowIndex; index < dataGridView.Rows.Count; index++)
|
||||
if (dataGridView.Rows.Count != inventoryDataGridView.Rows.Count ||
|
||||
dataGridView.Rows.Count != actualSalesDataGridView.Rows.Count) return;
|
||||
for (var index = currentRowIndex; currentRowIndex < dataGridView.Rows.Count; index++)
|
||||
{
|
||||
if (index == _adSpecialIndex + 1) continue;
|
||||
if (projectionsDataGridView.Rows[index].IsNewRow) continue;
|
||||
projectionsDataGridView.Rows[index].Cells[(int) SalesTableColumns.IsDirty].Value = true;
|
||||
projectionsDataGridView.Rows[index].Cells[(int)SalesTableColumns.IsDirty].Value = true;
|
||||
projectionsDataGridView.Rows[index].HeaderCell.Style.BackColor = ApplicationColors.PendingEdit;
|
||||
inventoryDataGridView.Rows[index].Cells[(int) InventoryTableColumns.IsDirty].Value = true;
|
||||
inventoryDataGridView.Rows[index].Cells[(int)InventoryTableColumns.IsDirty].Value = true;
|
||||
inventoryDataGridView.Rows[index].HeaderCell.Style.BackColor = ApplicationColors.PendingEdit;
|
||||
actualSalesDataGridView.Rows[index].Cells[(int) SalesTableColumns.IsDirty].Value = true;
|
||||
actualSalesDataGridView.Rows[index].Cells[(int)SalesTableColumns.IsDirty].Value = true;
|
||||
actualSalesDataGridView.Rows[index].HeaderCell.Style.BackColor = ApplicationColors.PendingEdit;
|
||||
}
|
||||
}
|
||||
@@ -1781,6 +1778,10 @@ namespace AdvertsingProfitControl
|
||||
{
|
||||
column.Visible = false;
|
||||
}
|
||||
if (name == "AdItem")
|
||||
{
|
||||
column.MaxInputLength = 64;
|
||||
}
|
||||
projectionsDataGridView.Columns.Add(column);
|
||||
}
|
||||
else
|
||||
@@ -1813,6 +1814,10 @@ namespace AdvertsingProfitControl
|
||||
{
|
||||
column.Visible = false;
|
||||
}
|
||||
if (name == "AdItem")
|
||||
{
|
||||
column.MaxInputLength = 64;
|
||||
}
|
||||
inventoryDataGridView.Columns.Add(column);
|
||||
}
|
||||
else
|
||||
@@ -1845,6 +1850,10 @@ namespace AdvertsingProfitControl
|
||||
{
|
||||
column.Visible = false;
|
||||
}
|
||||
if (name == "AdItem")
|
||||
{
|
||||
column.MaxInputLength = 64;
|
||||
}
|
||||
actualSalesDataGridView.Columns.Add(column);
|
||||
}
|
||||
else
|
||||
@@ -1883,7 +1892,11 @@ namespace AdvertsingProfitControl
|
||||
};
|
||||
if (name.Contains("ID"))
|
||||
{
|
||||
//column.Visible = false;
|
||||
column.Visible = false;
|
||||
}
|
||||
if (name == "Supplier")
|
||||
{
|
||||
column.MaxInputLength = 64;
|
||||
}
|
||||
invoicesDataGridView.Columns.Add(column);
|
||||
}
|
||||
@@ -1893,7 +1906,7 @@ namespace AdvertsingProfitControl
|
||||
{
|
||||
Name = name,
|
||||
ValueType = typeof(bool),
|
||||
//Visible = false,
|
||||
Visible = false,
|
||||
SortMode = DataGridViewColumnSortMode.NotSortable
|
||||
};
|
||||
invoicesDataGridView.Columns.Add(column);
|
||||
@@ -2405,7 +2418,7 @@ namespace AdvertsingProfitControl
|
||||
errorLabel.Text = @"Failed to get the date ID number, aborting load operation." + Environment.NewLine;
|
||||
return;
|
||||
}
|
||||
informationLabel.Text = @"Loading data for " + _currentActiveDate.ToString("d") + "." + Environment.NewLine;
|
||||
informationLabel.Text = @"Loading data for " + _currentActiveDate.ToString("d") + @"." + Environment.NewLine;
|
||||
var projections = databaseReader.ReturnProjectionsTable(dateId, databaseTracker.DatabaseConnectionString);
|
||||
var inventory = databaseReader.ReturnInventoryTable(dateId, databaseTracker.DatabaseConnectionString);
|
||||
var actualSales = databaseReader.ReturnActualSales(dateId, databaseTracker.DatabaseConnectionString);
|
||||
|
||||
Reference in New Issue
Block a user