Modify record now fills in used ad items on data load. Fixed a bug where changing the ad special group name would mark the other table's ad special row as pending edit. Removed marking the ad special row as dirty, only its members are marked as such; this goes for color coding the heard cells too.
This commit is contained in:
Binary file not shown.
@@ -769,7 +769,9 @@ namespace AdvertsingProfitControl
|
|||||||
{
|
{
|
||||||
if (!projectionsDataGridView.Rows[index].IsNewRow)
|
if (!projectionsDataGridView.Rows[index].IsNewRow)
|
||||||
{
|
{
|
||||||
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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (index < actualSalesDataGridView.RowCount)
|
if (index < actualSalesDataGridView.RowCount)
|
||||||
@@ -777,19 +779,27 @@ namespace AdvertsingProfitControl
|
|||||||
if (!actualSalesDataGridView.Rows[index].IsNewRow)
|
if (!actualSalesDataGridView.Rows[index].IsNewRow)
|
||||||
{
|
{
|
||||||
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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (index < inventoryDataGridView.RowCount)
|
if (index < inventoryDataGridView.RowCount)
|
||||||
{
|
{
|
||||||
if (!inventoryDataGridView.Rows[index].IsNewRow)
|
if (!inventoryDataGridView.Rows[index].IsNewRow)
|
||||||
{
|
{
|
||||||
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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
_usedAdItems[_adSpecialIndex == -1 || e.RowIndex < _adSpecialIndex ? 0 : 1].Remove(_beginningCellValue);
|
else
|
||||||
dataGridView.Rows[e.RowIndex].Cells[(int) SalesTableColumns.IsDirty].Value = true;
|
{
|
||||||
|
_usedAdItems[_adSpecialIndex == -1 || e.RowIndex < _adSpecialIndex ? 0 : 1].Remove(_beginningCellValue);
|
||||||
|
dataGridView.Rows[e.RowIndex].Cells[(int) SalesTableColumns.IsDirty].Value = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else if (userInput != _beginningCellValue)
|
else if (userInput != _beginningCellValue)
|
||||||
{
|
{
|
||||||
@@ -969,8 +979,17 @@ namespace AdvertsingProfitControl
|
|||||||
{
|
{
|
||||||
var adItemText = projectionsDataGridView.Rows[e.RowIndex].Cells[adItemIndex].EditedFormattedValue.ToString();
|
var adItemText = projectionsDataGridView.Rows[e.RowIndex].Cells[adItemIndex].EditedFormattedValue.ToString();
|
||||||
actualSalesDataGridView.Rows[e.RowIndex].Cells[adItemIndex].Value = adItemText;
|
actualSalesDataGridView.Rows[e.RowIndex].Cells[adItemIndex].Value = adItemText;
|
||||||
|
if (e.RowIndex != _adSpecialIndex)
|
||||||
|
{
|
||||||
|
actualSalesDataGridView.Rows[e.RowIndex].Cells[(int)SalesTableColumns.IsDirty].Value = true;
|
||||||
|
actualSalesDataGridView.Rows[e.RowIndex].HeaderCell.Style.BackColor = ApplicationColors.PendingEdit;
|
||||||
|
}
|
||||||
inventoryDataGridView.Rows[e.RowIndex].Cells[adItemIndex].Value = adItemText;
|
inventoryDataGridView.Rows[e.RowIndex].Cells[adItemIndex].Value = adItemText;
|
||||||
projectionsDataGridView.RefreshEdit();
|
if (e.RowIndex != _adSpecialIndex)
|
||||||
|
{
|
||||||
|
inventoryDataGridView.Rows[e.RowIndex].Cells[(int)InventoryTableColumns.IsDirty].Value = true;
|
||||||
|
inventoryDataGridView.Rows[e.RowIndex].HeaderCell.Style.BackColor = ApplicationColors.PendingEdit;
|
||||||
|
}
|
||||||
//Remove the last ad item from the UsedAdItem array, the new one will be added in the OnRowLeave event handler.
|
//Remove the last ad item from the UsedAdItem array, the new one will be added in the OnRowLeave event handler.
|
||||||
if (_adSpecialIndex == -1 || e.RowIndex < _adSpecialIndex)
|
if (_adSpecialIndex == -1 || e.RowIndex < _adSpecialIndex)
|
||||||
{
|
{
|
||||||
@@ -1175,7 +1194,9 @@ namespace AdvertsingProfitControl
|
|||||||
var parser = new RowParsing();
|
var parser = new RowParsing();
|
||||||
if (parser.CheckForGroupKeyWord(userInput) == "NoGroupFound")
|
if (parser.CheckForGroupKeyWord(userInput) == "NoGroupFound")
|
||||||
{
|
{
|
||||||
MessageBox.Show(@"The Ad Special row's column one (1) cannot be changed. You must delete this row by clicking on the header cell and pressing 'Delete'.", @"Invalid Operation on Ad Special Row", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
MessageBox.Show(
|
||||||
|
@"The Ad Special row's column one (1) cannot be changed. You must delete this row by clicking on the header cell and pressing 'Delete'.",
|
||||||
|
@"Invalid Operation on Ad Special Row", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||||
dataGridView.Rows[e.RowIndex].Cells[e.ColumnIndex].Value = _beginningCellValue;
|
dataGridView.Rows[e.RowIndex].Cells[e.ColumnIndex].Value = _beginningCellValue;
|
||||||
dataGridView.RefreshEdit();
|
dataGridView.RefreshEdit();
|
||||||
return;
|
return;
|
||||||
@@ -1189,6 +1210,8 @@ namespace AdvertsingProfitControl
|
|||||||
if (!projectionsDataGridView.Rows[index].IsNewRow)
|
if (!projectionsDataGridView.Rows[index].IsNewRow)
|
||||||
{
|
{
|
||||||
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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (index < actualSalesDataGridView.RowCount)
|
if (index < actualSalesDataGridView.RowCount)
|
||||||
@@ -1196,19 +1219,27 @@ namespace AdvertsingProfitControl
|
|||||||
if (!actualSalesDataGridView.Rows[index].IsNewRow)
|
if (!actualSalesDataGridView.Rows[index].IsNewRow)
|
||||||
{
|
{
|
||||||
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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (index < inventoryDataGridView.RowCount)
|
if (index < inventoryDataGridView.RowCount)
|
||||||
{
|
{
|
||||||
if (!inventoryDataGridView.Rows[index].IsNewRow)
|
if (!inventoryDataGridView.Rows[index].IsNewRow)
|
||||||
{
|
{
|
||||||
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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
_usedAdItems[_adSpecialIndex == -1 || e.RowIndex < _adSpecialIndex ? 0 : 1].Remove(_beginningCellValue);
|
else
|
||||||
dataGridView.Rows[e.RowIndex].Cells[(int) InventoryTableColumns.IsDirty].Value = true;
|
{
|
||||||
|
_usedAdItems[_adSpecialIndex == -1 || e.RowIndex < _adSpecialIndex ? 0 : 1].Remove(_beginningCellValue);
|
||||||
|
dataGridView.Rows[e.RowIndex].Cells[(int) InventoryTableColumns.IsDirty].Value = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else if (userInput != _beginningCellValue)
|
else if (userInput != _beginningCellValue)
|
||||||
{
|
{
|
||||||
@@ -1319,8 +1350,17 @@ namespace AdvertsingProfitControl
|
|||||||
{
|
{
|
||||||
var adItemText = inventoryDataGridView.Rows[e.RowIndex].Cells[adItemIndex].EditedFormattedValue.ToString();
|
var adItemText = inventoryDataGridView.Rows[e.RowIndex].Cells[adItemIndex].EditedFormattedValue.ToString();
|
||||||
projectionsDataGridView.Rows[e.RowIndex].Cells[adItemIndex].Value = adItemText;
|
projectionsDataGridView.Rows[e.RowIndex].Cells[adItemIndex].Value = adItemText;
|
||||||
|
if (e.RowIndex != _adSpecialIndex)
|
||||||
|
{
|
||||||
|
projectionsDataGridView.Rows[e.RowIndex].Cells[(int)SalesTableColumns.IsDirty].Value = true;
|
||||||
|
projectionsDataGridView.Rows[e.RowIndex].HeaderCell.Style.BackColor = ApplicationColors.PendingEdit;
|
||||||
|
}
|
||||||
actualSalesDataGridView.Rows[e.RowIndex].Cells[adItemIndex].Value = adItemText;
|
actualSalesDataGridView.Rows[e.RowIndex].Cells[adItemIndex].Value = adItemText;
|
||||||
//inventoryDataGridView.RefreshEdit();
|
if (e.RowIndex != _adSpecialIndex)
|
||||||
|
{
|
||||||
|
actualSalesDataGridView.Rows[e.RowIndex].Cells[(int)SalesTableColumns.IsDirty].Value = true;
|
||||||
|
actualSalesDataGridView.Rows[e.RowIndex].HeaderCell.Style.BackColor = ApplicationColors.PendingEdit;
|
||||||
|
}
|
||||||
//Remove the last ad item from the UsedAdItem array, the new one will be added in the OnRowLeave event handler.
|
//Remove the last ad item from the UsedAdItem array, the new one will be added in the OnRowLeave event handler.
|
||||||
if (_adSpecialIndex == -1 || e.RowIndex < _adSpecialIndex)
|
if (_adSpecialIndex == -1 || e.RowIndex < _adSpecialIndex)
|
||||||
{
|
{
|
||||||
@@ -1330,7 +1370,6 @@ namespace AdvertsingProfitControl
|
|||||||
{
|
{
|
||||||
_usedAdItems[1].RemoveAll(I => I.Equals(_beginningCellValue, StringComparison.OrdinalIgnoreCase));
|
_usedAdItems[1].RemoveAll(I => I.Equals(_beginningCellValue, StringComparison.OrdinalIgnoreCase));
|
||||||
}
|
}
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1476,8 +1515,17 @@ namespace AdvertsingProfitControl
|
|||||||
{
|
{
|
||||||
var adItemText = actualSalesDataGridView.Rows[e.RowIndex].Cells[adItemIndex].EditedFormattedValue.ToString();
|
var adItemText = actualSalesDataGridView.Rows[e.RowIndex].Cells[adItemIndex].EditedFormattedValue.ToString();
|
||||||
projectionsDataGridView.Rows[e.RowIndex].Cells[adItemIndex].Value = adItemText;
|
projectionsDataGridView.Rows[e.RowIndex].Cells[adItemIndex].Value = adItemText;
|
||||||
|
if (e.RowIndex != _adSpecialIndex)
|
||||||
|
{
|
||||||
|
projectionsDataGridView.Rows[e.RowIndex].Cells[(int)SalesTableColumns.IsDirty].Value = true;
|
||||||
|
projectionsDataGridView.Rows[e.RowIndex].HeaderCell.Style.BackColor = ApplicationColors.PendingEdit;
|
||||||
|
}
|
||||||
inventoryDataGridView.Rows[e.RowIndex].Cells[adItemIndex].Value = adItemText;
|
inventoryDataGridView.Rows[e.RowIndex].Cells[adItemIndex].Value = adItemText;
|
||||||
//projectionsDataGridView.RefreshEdit();
|
if (e.RowIndex != _adSpecialIndex)
|
||||||
|
{
|
||||||
|
inventoryDataGridView.Rows[e.RowIndex].Cells[(int)InventoryTableColumns.IsDirty].Value = true;
|
||||||
|
inventoryDataGridView.Rows[e.RowIndex].HeaderCell.Style.BackColor = ApplicationColors.PendingEdit;
|
||||||
|
}
|
||||||
//Remove the last ad item from the UsedAdItem array, the new one will be added in the OnRowLeave event handler.
|
//Remove the last ad item from the UsedAdItem array, the new one will be added in the OnRowLeave event handler.
|
||||||
if (_adSpecialIndex == -1 || e.RowIndex < _adSpecialIndex)
|
if (_adSpecialIndex == -1 || e.RowIndex < _adSpecialIndex)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -810,27 +810,37 @@ namespace AdvertsingProfitControl
|
|||||||
{
|
{
|
||||||
if (!projectionsDataGridView.Rows[index].IsNewRow)
|
if (!projectionsDataGridView.Rows[index].IsNewRow)
|
||||||
{
|
{
|
||||||
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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (index < actualSalesDataGridView.RowCount)
|
if (index < actualSalesDataGridView.RowCount)
|
||||||
{
|
{
|
||||||
if (!actualSalesDataGridView.Rows[index].IsNewRow)
|
if (!actualSalesDataGridView.Rows[index].IsNewRow)
|
||||||
{
|
{
|
||||||
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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (index < inventoryDataGridView.RowCount)
|
if (index < inventoryDataGridView.RowCount)
|
||||||
{
|
{
|
||||||
if (!inventoryDataGridView.Rows[index].IsNewRow)
|
if (!inventoryDataGridView.Rows[index].IsNewRow)
|
||||||
{
|
{
|
||||||
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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
_usedAdItems[_adSpecialIndex == -1 || e.RowIndex < _adSpecialIndex ? 0 : 1].Remove(_beginningCellValue);
|
else
|
||||||
dataGridView.Rows[e.RowIndex].Cells[(int)SalesTableColumns.IsDirty].Value = true;
|
{
|
||||||
|
_usedAdItems[_adSpecialIndex == -1 || e.RowIndex < _adSpecialIndex ? 0 : 1].Remove(_beginningCellValue);
|
||||||
|
dataGridView.Rows[e.RowIndex].Cells[(int)SalesTableColumns.IsDirty].Value = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else if (userInput != _beginningCellValue)
|
else if (userInput != _beginningCellValue)
|
||||||
{
|
{
|
||||||
@@ -1017,11 +1027,17 @@ namespace AdvertsingProfitControl
|
|||||||
{
|
{
|
||||||
var adItemText = projectionsDataGridView.Rows[e.RowIndex].Cells[adItemIndex].EditedFormattedValue.ToString();
|
var adItemText = projectionsDataGridView.Rows[e.RowIndex].Cells[adItemIndex].EditedFormattedValue.ToString();
|
||||||
actualSalesDataGridView.Rows[e.RowIndex].Cells[adItemIndex].Value = adItemText;
|
actualSalesDataGridView.Rows[e.RowIndex].Cells[adItemIndex].Value = adItemText;
|
||||||
actualSalesDataGridView.Rows[e.RowIndex].Cells[(int) SalesTableColumns.IsDirty].Value = true;
|
if (e.RowIndex != _adSpecialIndex)
|
||||||
actualSalesDataGridView.Rows[e.RowIndex].HeaderCell.Style.BackColor = ApplicationColors.PendingEdit;
|
{
|
||||||
|
actualSalesDataGridView.Rows[e.RowIndex].Cells[(int) SalesTableColumns.IsDirty].Value = true;
|
||||||
|
actualSalesDataGridView.Rows[e.RowIndex].HeaderCell.Style.BackColor = ApplicationColors.PendingEdit;
|
||||||
|
}
|
||||||
inventoryDataGridView.Rows[e.RowIndex].Cells[adItemIndex].Value = adItemText;
|
inventoryDataGridView.Rows[e.RowIndex].Cells[adItemIndex].Value = adItemText;
|
||||||
inventoryDataGridView.Rows[e.RowIndex].Cells[(int) InventoryTableColumns.IsDirty].Value = true;
|
if (e.RowIndex != _adSpecialIndex)
|
||||||
inventoryDataGridView.Rows[e.RowIndex].HeaderCell.Style.BackColor = ApplicationColors.PendingEdit;
|
{
|
||||||
|
inventoryDataGridView.Rows[e.RowIndex].Cells[(int) InventoryTableColumns.IsDirty].Value = true;
|
||||||
|
inventoryDataGridView.Rows[e.RowIndex].HeaderCell.Style.BackColor = ApplicationColors.PendingEdit;
|
||||||
|
}
|
||||||
projectionsDataGridView.RefreshEdit();
|
projectionsDataGridView.RefreshEdit();
|
||||||
//Remove the last ad item from the UsedAdItem array, the new one will be added in the OnRowLeave event handler.
|
//Remove the last ad item from the UsedAdItem array, the new one will be added in the OnRowLeave event handler.
|
||||||
if (_adSpecialIndex == -1 || e.RowIndex < _adSpecialIndex)
|
if (_adSpecialIndex == -1 || e.RowIndex < _adSpecialIndex)
|
||||||
@@ -1232,7 +1248,9 @@ namespace AdvertsingProfitControl
|
|||||||
var parser = new RowParsing();
|
var parser = new RowParsing();
|
||||||
if (parser.CheckForGroupKeyWord(userInput) == "NoGroupFound")
|
if (parser.CheckForGroupKeyWord(userInput) == "NoGroupFound")
|
||||||
{
|
{
|
||||||
MessageBox.Show(@"The Ad Special row's column one (1) cannot be changed. You must delete this row by clicking on the header cell and pressing 'Delete'.", @"Invalid Operation on Ad Special Row", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
MessageBox.Show(
|
||||||
|
@"The Ad Special row's column one (1) cannot be changed. You must delete this row by clicking on the header cell and pressing 'Delete'.",
|
||||||
|
@"Invalid Operation on Ad Special Row", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||||
dataGridView.Rows[e.RowIndex].Cells[e.ColumnIndex].Value = _beginningCellValue;
|
dataGridView.Rows[e.RowIndex].Cells[e.ColumnIndex].Value = _beginningCellValue;
|
||||||
dataGridView.RefreshEdit();
|
dataGridView.RefreshEdit();
|
||||||
return;
|
return;
|
||||||
@@ -1245,27 +1263,37 @@ namespace AdvertsingProfitControl
|
|||||||
{
|
{
|
||||||
if (!projectionsDataGridView.Rows[index].IsNewRow)
|
if (!projectionsDataGridView.Rows[index].IsNewRow)
|
||||||
{
|
{
|
||||||
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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (index < actualSalesDataGridView.RowCount)
|
if (index < actualSalesDataGridView.RowCount)
|
||||||
{
|
{
|
||||||
if (!actualSalesDataGridView.Rows[index].IsNewRow)
|
if (!actualSalesDataGridView.Rows[index].IsNewRow)
|
||||||
{
|
{
|
||||||
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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (index < inventoryDataGridView.RowCount)
|
if (index < inventoryDataGridView.RowCount)
|
||||||
{
|
{
|
||||||
if (!inventoryDataGridView.Rows[index].IsNewRow)
|
if (!inventoryDataGridView.Rows[index].IsNewRow)
|
||||||
{
|
{
|
||||||
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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
_usedAdItems[_adSpecialIndex == -1 || e.RowIndex < _adSpecialIndex ? 0 : 1].Remove(_beginningCellValue);
|
else
|
||||||
dataGridView.Rows[e.RowIndex].Cells[(int)InventoryTableColumns.IsDirty].Value = true;
|
{
|
||||||
|
_usedAdItems[_adSpecialIndex == -1 || e.RowIndex < _adSpecialIndex ? 0 : 1].Remove(_beginningCellValue);
|
||||||
|
dataGridView.Rows[e.RowIndex].Cells[(int)InventoryTableColumns.IsDirty].Value = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else if (userInput != _beginningCellValue)
|
else if (userInput != _beginningCellValue)
|
||||||
{
|
{
|
||||||
@@ -1379,12 +1407,17 @@ namespace AdvertsingProfitControl
|
|||||||
{
|
{
|
||||||
var adItemText = inventoryDataGridView.Rows[e.RowIndex].Cells[adItemIndex].EditedFormattedValue.ToString();
|
var adItemText = inventoryDataGridView.Rows[e.RowIndex].Cells[adItemIndex].EditedFormattedValue.ToString();
|
||||||
projectionsDataGridView.Rows[e.RowIndex].Cells[adItemIndex].Value = adItemText;
|
projectionsDataGridView.Rows[e.RowIndex].Cells[adItemIndex].Value = adItemText;
|
||||||
projectionsDataGridView.Rows[e.RowIndex].Cells[(int) SalesTableColumns.IsDirty].Value = true;
|
if (e.RowIndex != _adSpecialIndex)
|
||||||
projectionsDataGridView.Rows[e.RowIndex].HeaderCell.Style.BackColor = ApplicationColors.PendingEdit;
|
{
|
||||||
|
projectionsDataGridView.Rows[e.RowIndex].Cells[(int) SalesTableColumns.IsDirty].Value = true;
|
||||||
|
projectionsDataGridView.Rows[e.RowIndex].HeaderCell.Style.BackColor = ApplicationColors.PendingEdit;
|
||||||
|
}
|
||||||
actualSalesDataGridView.Rows[e.RowIndex].Cells[adItemIndex].Value = adItemText;
|
actualSalesDataGridView.Rows[e.RowIndex].Cells[adItemIndex].Value = adItemText;
|
||||||
actualSalesDataGridView.Rows[e.RowIndex].Cells[(int) SalesTableColumns.IsDirty].Value = true;
|
if (e.RowIndex != _adSpecialIndex)
|
||||||
actualSalesDataGridView.Rows[e.RowIndex].HeaderCell.Style.BackColor = ApplicationColors.PendingEdit;
|
{
|
||||||
//inventoryDataGridView.RefreshEdit();
|
actualSalesDataGridView.Rows[e.RowIndex].Cells[(int) SalesTableColumns.IsDirty].Value = true;
|
||||||
|
actualSalesDataGridView.Rows[e.RowIndex].HeaderCell.Style.BackColor = ApplicationColors.PendingEdit;
|
||||||
|
}
|
||||||
//Remove the last ad item from the UsedAdItem array, the new one will be added in the OnRowLeave event handler.
|
//Remove the last ad item from the UsedAdItem array, the new one will be added in the OnRowLeave event handler.
|
||||||
if (_adSpecialIndex == -1 || e.RowIndex < _adSpecialIndex)
|
if (_adSpecialIndex == -1 || e.RowIndex < _adSpecialIndex)
|
||||||
{
|
{
|
||||||
@@ -1540,11 +1573,17 @@ namespace AdvertsingProfitControl
|
|||||||
{
|
{
|
||||||
var adItemText = actualSalesDataGridView.Rows[e.RowIndex].Cells[adItemIndex].EditedFormattedValue.ToString();
|
var adItemText = actualSalesDataGridView.Rows[e.RowIndex].Cells[adItemIndex].EditedFormattedValue.ToString();
|
||||||
projectionsDataGridView.Rows[e.RowIndex].Cells[adItemIndex].Value = adItemText;
|
projectionsDataGridView.Rows[e.RowIndex].Cells[adItemIndex].Value = adItemText;
|
||||||
projectionsDataGridView.Rows[e.RowIndex].Cells[(int) SalesTableColumns.IsDirty].Value = true;
|
if (e.RowIndex != _adSpecialIndex)
|
||||||
projectionsDataGridView.Rows[e.RowIndex].HeaderCell.Style.BackColor = ApplicationColors.PendingEdit;
|
{
|
||||||
|
projectionsDataGridView.Rows[e.RowIndex].Cells[(int) SalesTableColumns.IsDirty].Value = true;
|
||||||
|
projectionsDataGridView.Rows[e.RowIndex].HeaderCell.Style.BackColor = ApplicationColors.PendingEdit;
|
||||||
|
}
|
||||||
inventoryDataGridView.Rows[e.RowIndex].Cells[adItemIndex].Value = adItemText;
|
inventoryDataGridView.Rows[e.RowIndex].Cells[adItemIndex].Value = adItemText;
|
||||||
inventoryDataGridView.Rows[e.RowIndex].Cells[(int) InventoryTableColumns.IsDirty].Value = true;
|
if (e.RowIndex != _adSpecialIndex)
|
||||||
inventoryDataGridView.Rows[e.RowIndex].HeaderCell.Style.BackColor = ApplicationColors.PendingEdit;
|
{
|
||||||
|
inventoryDataGridView.Rows[e.RowIndex].Cells[(int) InventoryTableColumns.IsDirty].Value = true;
|
||||||
|
inventoryDataGridView.Rows[e.RowIndex].HeaderCell.Style.BackColor = ApplicationColors.PendingEdit;
|
||||||
|
}
|
||||||
//projectionsDataGridView.RefreshEdit();
|
//projectionsDataGridView.RefreshEdit();
|
||||||
//Remove the last ad item from the UsedAdItem array, the new one will be added in the OnRowLeave event handler.
|
//Remove the last ad item from the UsedAdItem array, the new one will be added in the OnRowLeave event handler.
|
||||||
if (_adSpecialIndex == -1 || e.RowIndex < _adSpecialIndex)
|
if (_adSpecialIndex == -1 || e.RowIndex < _adSpecialIndex)
|
||||||
@@ -2217,6 +2256,9 @@ namespace AdvertsingProfitControl
|
|||||||
_beginningCellValue = "";
|
_beginningCellValue = "";
|
||||||
//Reset the form's dirty flag
|
//Reset the form's dirty flag
|
||||||
_isFormDirty = false;
|
_isFormDirty = false;
|
||||||
|
//Clear the used ad items
|
||||||
|
_usedAdItems[0].Clear(); //regular ad items (section 1)
|
||||||
|
_usedAdItems[1].Clear(); //ad special items (section 2)
|
||||||
//Clear invoices
|
//Clear invoices
|
||||||
invoicesDataGridView.Rows.Clear();
|
invoicesDataGridView.Rows.Clear();
|
||||||
//Clear comments
|
//Clear comments
|
||||||
@@ -2447,19 +2489,33 @@ namespace AdvertsingProfitControl
|
|||||||
//Check the group it is part of if any.
|
//Check the group it is part of if any.
|
||||||
if (cellIndex == 9)
|
if (cellIndex == 9)
|
||||||
{
|
{
|
||||||
if (projections.Rows[rowIndex].ItemArray[cellIndex].ToString() != "0" && _adSpecialIndex == -1)
|
//Check to see if this row belongs to an ad special group.
|
||||||
|
if (projections.Rows[rowIndex].ItemArray[cellIndex].ToString() != "0")
|
||||||
{
|
{
|
||||||
var databaseTracker = new DatabaseTracker();
|
//If so add the ad item in it to section two (2) of the used ad item array.
|
||||||
var databaseReader = new DatabaseReader();
|
_usedAdItems[1].Add(projections.Rows[rowIndex].ItemArray[1].ToString());
|
||||||
var groupName =
|
//If the ad special index is not set, then create the ad special row with the human friendly group name.
|
||||||
databaseReader.ReturnGroupNameFromGroupId(
|
if (_adSpecialIndex == -1)
|
||||||
projections.Rows[rowIndex].ItemArray[cellIndex].ToString(),
|
{
|
||||||
databaseTracker.DatabaseConnectionString);
|
var databaseTracker = new DatabaseTracker();
|
||||||
var adSpecialRow = new DataGridViewRow();
|
var databaseReader = new DatabaseReader();
|
||||||
projectionsDataGridView.Rows.Add(adSpecialRow);
|
var groupName =
|
||||||
projectionsDataGridView.Rows[rowIndex].Cells[1].Value = groupName;
|
databaseReader.ReturnGroupNameFromGroupId(
|
||||||
projectionsDataGridView.Rows[rowIndex].DefaultCellStyle.BackColor = ApplicationColors.AdSpecial;
|
projections.Rows[rowIndex].ItemArray[cellIndex].ToString(),
|
||||||
_adSpecialIndex = rowIndex;
|
databaseTracker.DatabaseConnectionString);
|
||||||
|
var adSpecialRow = new DataGridViewRow();
|
||||||
|
projectionsDataGridView.Rows.Add(adSpecialRow);
|
||||||
|
projectionsDataGridView.Rows[rowIndex].Cells[1].Value = groupName;
|
||||||
|
projectionsDataGridView.Rows[rowIndex].DefaultCellStyle.BackColor =
|
||||||
|
ApplicationColors.AdSpecial;
|
||||||
|
_adSpecialIndex = rowIndex;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
//The ad item belongs in section one (1) of the used ad item array.
|
||||||
|
_usedAdItems[0].Add(projections.Rows[rowIndex].ItemArray[1].ToString());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,7 +14,7 @@
|
|||||||
<dsig:Transform Algorithm="urn:schemas-microsoft-com:HashTransforms.Identity" />
|
<dsig:Transform Algorithm="urn:schemas-microsoft-com:HashTransforms.Identity" />
|
||||||
</dsig:Transforms>
|
</dsig:Transforms>
|
||||||
<dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha256" />
|
<dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha256" />
|
||||||
<dsig:DigestValue>zpbkgJk14ECDIZQitxLLt8pDxjsgaGNLCsn6A15FHiw=</dsig:DigestValue>
|
<dsig:DigestValue>ib1gNsn2WoDzAPiOU+0/4RFlwIEfmJtvgCPloir4KFA=</dsig:DigestValue>
|
||||||
</hash>
|
</hash>
|
||||||
</dependentAssembly>
|
</dependentAssembly>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|||||||
@@ -43,14 +43,14 @@
|
|||||||
</dependentAssembly>
|
</dependentAssembly>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<dependentAssembly dependencyType="install" allowDelayedBinding="true" codebase="AdvertsingProfitControl.exe" size="3606528">
|
<dependentAssembly dependencyType="install" allowDelayedBinding="true" codebase="AdvertsingProfitControl.exe" size="3607040">
|
||||||
<assemblyIdentity name="AdvertsingProfitControl" version="0.9.5.2" language="neutral" processorArchitecture="amd64" />
|
<assemblyIdentity name="AdvertsingProfitControl" version="0.9.5.2" language="neutral" processorArchitecture="amd64" />
|
||||||
<hash>
|
<hash>
|
||||||
<dsig:Transforms>
|
<dsig:Transforms>
|
||||||
<dsig:Transform Algorithm="urn:schemas-microsoft-com:HashTransforms.Identity" />
|
<dsig:Transform Algorithm="urn:schemas-microsoft-com:HashTransforms.Identity" />
|
||||||
</dsig:Transforms>
|
</dsig:Transforms>
|
||||||
<dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha256" />
|
<dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha256" />
|
||||||
<dsig:DigestValue>RfwzuWZMEhfrUq7aBd3p9sX+V5RWL5yDo9XNd2Uj/JM=</dsig:DigestValue>
|
<dsig:DigestValue>cTFWoKFn2+4/0r/55ub0w4SG/Rc39J/A3gn6JBlTdZU=</dsig:DigestValue>
|
||||||
</hash>
|
</hash>
|
||||||
</dependentAssembly>
|
</dependentAssembly>
|
||||||
</dependency>
|
</dependency>
|
||||||
@@ -93,7 +93,7 @@
|
|||||||
<dsig:Transform Algorithm="urn:schemas-microsoft-com:HashTransforms.Identity" />
|
<dsig:Transform Algorithm="urn:schemas-microsoft-com:HashTransforms.Identity" />
|
||||||
</dsig:Transforms>
|
</dsig:Transforms>
|
||||||
<dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha256" />
|
<dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha256" />
|
||||||
<dsig:DigestValue>dJHxM6HPIKo4c5VqxwCZb6aI2vGij+MP5mUPlilWJ/A=</dsig:DigestValue>
|
<dsig:DigestValue>oAigmBR/53icZZvL5j6Qt5ZBgYe6Mu1htzSdYejMGRo=</dsig:DigestValue>
|
||||||
</hash>
|
</hash>
|
||||||
</file>
|
</file>
|
||||||
<file name="Stretched Logo Collection.ico" size="370070">
|
<file name="Stretched Logo Collection.ico" size="370070">
|
||||||
|
|||||||
Reference in New Issue
Block a user