Removed a few unused columns and flags that didn't help improve the performance of the form or just made its code more cluttered. Created a separate method to handle calling the database writing code for the Sales Tables.
This commit is contained in:
@@ -32,10 +32,6 @@ namespace AdvertsingProfitControl
|
||||
//Flag showing whether or not the AdSpecialRow has been made in this session.
|
||||
private int _adSpecialIndex = -1;
|
||||
private readonly AdvertisingProfitControlTableHelper _tableHelperFunctions = new AdvertisingProfitControlTableHelper();
|
||||
//Set flags to indicate whether or not a DataGridView needs to be painted.
|
||||
private bool _projectionsRequirePainting;
|
||||
//Inventory never needs to be parsed on tab page change since no data gets copied over from the other tables.
|
||||
private bool _actualSalesRequiresPainting;
|
||||
|
||||
public NewAddRecord()
|
||||
{
|
||||
@@ -90,8 +86,6 @@ namespace AdvertsingProfitControl
|
||||
projectionsDataGridView.EditingControlShowing += DisplayAutoCompleteOnEditingControlShowing;
|
||||
inventoryDataGridView.EditingControlShowing += DisplayAutoCompleteOnEditingControlShowing;
|
||||
actualSalesDataGridView.EditingControlShowing += DisplayAutoCompleteOnEditingControlShowing;
|
||||
//Setup the event to handle painting the DataGridView on tab page change.
|
||||
mainTabControl.SelectedIndexChanged += PaintDataGridViewOnTabPageChange;
|
||||
//After all events have been set, construct the DataGridVeiws for use.
|
||||
ConstructApcDataGridViews();
|
||||
//Set-up events for the Invoice table.
|
||||
@@ -281,29 +275,6 @@ namespace AdvertsingProfitControl
|
||||
|
||||
#endregion
|
||||
|
||||
private void PaintDataGridViewOnTabPageChange(object sender, EventArgs e)
|
||||
{
|
||||
var helper = new AdvertisingProfitControlTableHelper();
|
||||
switch (mainTabControl.SelectedIndex)
|
||||
{
|
||||
case 0:
|
||||
if (_projectionsRequirePainting)
|
||||
{
|
||||
helper.PaintRowGroupsFromIndex(0, (DataGridView) mainTabControl.TabPages[0].Controls[0]);
|
||||
_projectionsRequirePainting = false;
|
||||
}
|
||||
break;
|
||||
//There is no need to deal with the inventory table here since no data is ever copied over beyond the ad item (or ad special).
|
||||
case 2:
|
||||
if (_actualSalesRequiresPainting)
|
||||
{
|
||||
helper.PaintRowGroupsFromIndex(0, (DataGridView)mainTabControl.TabPages[2].Controls[0]);
|
||||
_actualSalesRequiresPainting = false;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
#region APC DataGridView Events
|
||||
|
||||
/// <summary>
|
||||
@@ -315,22 +286,6 @@ namespace AdvertsingProfitControl
|
||||
private void DisplayRowNumbers(object sender, DataGridViewRowsAddedEventArgs e)
|
||||
{
|
||||
var table = ((DataGridView)sender);
|
||||
//Set a flag based on what tab page is currently being used to indicate whether or not a DataGridView needs painting.
|
||||
switch (mainTabControl.SelectedIndex)
|
||||
{
|
||||
case 0:
|
||||
_projectionsRequirePainting = false;
|
||||
_actualSalesRequiresPainting = true;
|
||||
break;
|
||||
case 1:
|
||||
_projectionsRequirePainting = true;
|
||||
_actualSalesRequiresPainting = true;
|
||||
break;
|
||||
case 2:
|
||||
_projectionsRequirePainting = true;
|
||||
_actualSalesRequiresPainting = false;
|
||||
break;
|
||||
}
|
||||
table.Rows[e.RowIndex].HeaderCell.Value = (e.RowIndex + 1).ToString();
|
||||
}
|
||||
|
||||
@@ -739,7 +694,7 @@ namespace AdvertsingProfitControl
|
||||
break;
|
||||
default:
|
||||
//Purely here for protection against parsing the Boolean columns by mistake.
|
||||
if (e.ColumnIndex >= (int) SalesTableColumns.IsAdSpecialRow) {return;}
|
||||
if (e.ColumnIndex == (int) SalesTableColumns.Id || e.ColumnIndex >= (int) SalesTableColumns.IsHeaderRow) {return;}
|
||||
//If the column is any other then check to see if the entered value can be parsed to a double (is a number), if not then throw an error to the user.
|
||||
if (double.TryParse(userInput, out parsedNumber))
|
||||
{
|
||||
@@ -860,31 +815,9 @@ namespace AdvertsingProfitControl
|
||||
case (int)SalesTableColumns.IsMemberRow:
|
||||
rowContents[i] = projectionsDataGridView.Rows[e.RowIndex].Cells[(int)SalesTableColumns.IsMemberRow].Value;
|
||||
break;
|
||||
case (int)SalesTableColumns.IsAdSpecialRow:
|
||||
//Determine if the current row is the special row.
|
||||
projectionsDataGridView.Rows[e.RowIndex].Cells[(int) SalesTableColumns.IsAdSpecialRow].Value =
|
||||
e.RowIndex == _adSpecialIndex;
|
||||
rowContents[i] = e.RowIndex == _adSpecialIndex;
|
||||
break;
|
||||
case (int)SalesTableColumns.IsAdSpecialMember:
|
||||
//Check if this is a member of the ad special group.
|
||||
if (_adSpecialIndex != -1)
|
||||
{
|
||||
projectionsDataGridView.Rows[e.RowIndex].Cells[(int) SalesTableColumns.IsAdSpecialMember
|
||||
].Value = e.RowIndex > _adSpecialIndex;
|
||||
rowContents[i] = e.RowIndex > _adSpecialIndex;
|
||||
}
|
||||
else
|
||||
{
|
||||
rowContents[i] = false;
|
||||
}
|
||||
break;
|
||||
case (int)SalesTableColumns.IsDirty:
|
||||
rowContents[i] = true;
|
||||
break;
|
||||
case (int)SalesTableColumns.IsInDatabase:
|
||||
rowContents[i] = false;
|
||||
break;
|
||||
default:
|
||||
rowContents[i] = "";
|
||||
break;
|
||||
@@ -907,32 +840,14 @@ namespace AdvertsingProfitControl
|
||||
projectionsDataGridView.Rows[e.RowIndex].Cells[i].EditedFormattedValue.ToString();
|
||||
break;
|
||||
case (int)SalesTableColumns.IsHeaderRow:
|
||||
rowContents[(int)InventoryTableColumns.IsHeaderRow] = projectionsDataGridView.Rows[e.RowIndex].Cells[(int)SalesTableColumns.IsHeaderRow].Value;
|
||||
rowContents[(int)InventoryTableColumns.IsHeaderRow] = projectionsDataGridView.Rows[e.RowIndex].Cells[i].Value;
|
||||
break;
|
||||
case (int)SalesTableColumns.IsMemberRow:
|
||||
rowContents[(int)InventoryTableColumns.IsMemberRow] = projectionsDataGridView.Rows[e.RowIndex].Cells[(int)SalesTableColumns.IsMemberRow].Value;
|
||||
break;
|
||||
case (int)SalesTableColumns.IsAdSpecialRow:
|
||||
//Determine if the current row is the special row.
|
||||
inventoryNewRow[(int)InventoryTableColumns.IsAdSpecialRow] = (e.RowIndex == _adSpecialIndex);
|
||||
break;
|
||||
case (int)SalesTableColumns.IsAdSpecialMember:
|
||||
//Check if this is a member of the ad special group.
|
||||
if (_adSpecialIndex != -1)
|
||||
{
|
||||
inventoryNewRow[(int)InventoryTableColumns.IsAdSpecialMember] = (e.RowIndex > _adSpecialIndex);
|
||||
}
|
||||
else
|
||||
{
|
||||
inventoryNewRow[(int)InventoryTableColumns.IsAdSpecialMember] = false;
|
||||
}
|
||||
rowContents[(int)InventoryTableColumns.IsMemberRow] = projectionsDataGridView.Rows[e.RowIndex].Cells[i].Value;
|
||||
break;
|
||||
case (int)SalesTableColumns.IsDirty:
|
||||
inventoryNewRow[(int)InventoryTableColumns.IsDirty] = true;
|
||||
break;
|
||||
case (int)SalesTableColumns.IsInDatabase:
|
||||
inventoryNewRow[(int) InventoryTableColumns.IsInDatabase] = false;
|
||||
break;
|
||||
default:
|
||||
if (i < (int) InventoryTableColumns.IsHeaderRow)
|
||||
{
|
||||
@@ -1113,7 +1028,7 @@ namespace AdvertsingProfitControl
|
||||
break;
|
||||
default:
|
||||
//Purely here for protection against parsing the Boolean columns by mistake.
|
||||
if (e.ColumnIndex >= (int)InventoryTableColumns.IsAdSpecialRow) { return; }
|
||||
if (e.ColumnIndex == (int)InventoryTableColumns.Id || e.ColumnIndex >= (int)InventoryTableColumns.IsHeaderRow) { return; }
|
||||
//This Reg-ex pattern will match any number followed by the word bin(s), to allow specifying the number of bins of product were ordered.
|
||||
var inventoryStringCheck = new Regex(@"^[0-9]{1,2} \bbin(s){0,1}\b", RegexOptions.IgnoreCase);
|
||||
|
||||
@@ -1215,30 +1130,9 @@ namespace AdvertsingProfitControl
|
||||
case (int)SalesTableColumns.IsMemberRow:
|
||||
rowContents[i] = projectionsDataGridView.Rows[e.RowIndex].Cells[(int)InventoryTableColumns.IsMemberRow].Value;
|
||||
break;
|
||||
case (int)SalesTableColumns.IsAdSpecialRow:
|
||||
//Determine if the current row is the special row.
|
||||
inventoryDataGridView.Rows[e.RowIndex].Cells[(int)InventoryTableColumns.IsAdSpecialRow].Value =
|
||||
e.RowIndex == _adSpecialIndex;
|
||||
rowContents[i] = e.RowIndex == _adSpecialIndex;
|
||||
break;
|
||||
case (int)SalesTableColumns.IsAdSpecialMember:
|
||||
//Check if this is a member of the ad special group.
|
||||
if (_adSpecialIndex != -1)
|
||||
{
|
||||
inventoryDataGridView.Rows[e.RowIndex].Cells[(int)InventoryTableColumns.IsAdSpecialMember].Value = e.RowIndex > _adSpecialIndex;
|
||||
rowContents[i] = e.RowIndex > _adSpecialIndex;
|
||||
}
|
||||
else
|
||||
{
|
||||
rowContents[i] = false;
|
||||
}
|
||||
break;
|
||||
case (int)SalesTableColumns.IsDirty:
|
||||
rowContents[i] = true;
|
||||
break;
|
||||
case (int)SalesTableColumns.IsInDatabase:
|
||||
rowContents[i] = false;
|
||||
break;
|
||||
default:
|
||||
rowContents[i] = "";
|
||||
break;
|
||||
@@ -1395,31 +1289,9 @@ namespace AdvertsingProfitControl
|
||||
case (int)SalesTableColumns.IsMemberRow:
|
||||
rowContents[i] = actualSalesDataGridView.Rows[e.RowIndex].Cells[(int)SalesTableColumns.IsMemberRow].Value;
|
||||
break;
|
||||
case (int)SalesTableColumns.IsAdSpecialRow:
|
||||
//Determine if the current row is the special row.
|
||||
actualSalesDataGridView.Rows[e.RowIndex].Cells[(int)SalesTableColumns.IsAdSpecialRow].Value =
|
||||
e.RowIndex == _adSpecialIndex;
|
||||
rowContents[i] = e.RowIndex == _adSpecialIndex;
|
||||
break;
|
||||
case (int)SalesTableColumns.IsAdSpecialMember:
|
||||
//Check if this is a member of the ad special group.
|
||||
if (_adSpecialIndex != -1)
|
||||
{
|
||||
actualSalesDataGridView.Rows[e.RowIndex].Cells[(int)SalesTableColumns.IsAdSpecialMember
|
||||
].Value = e.RowIndex > _adSpecialIndex;
|
||||
rowContents[i] = e.RowIndex > _adSpecialIndex;
|
||||
}
|
||||
else
|
||||
{
|
||||
rowContents[i] = false;
|
||||
}
|
||||
break;
|
||||
case (int)SalesTableColumns.IsDirty:
|
||||
rowContents[i] = true;
|
||||
break;
|
||||
case (int)SalesTableColumns.IsInDatabase:
|
||||
rowContents[i] = false;
|
||||
break;
|
||||
default:
|
||||
rowContents[i] = "";
|
||||
break;
|
||||
@@ -1444,27 +1316,9 @@ namespace AdvertsingProfitControl
|
||||
case (int)SalesTableColumns.IsMemberRow:
|
||||
rowContents[(int)InventoryTableColumns.IsMemberRow] = actualSalesDataGridView.Rows[e.RowIndex].Cells[(int)SalesTableColumns.IsMemberRow].Value;
|
||||
break;
|
||||
case (int)SalesTableColumns.IsAdSpecialRow:
|
||||
//Determine if the current row is the special row.
|
||||
inventoryNewRow[(int)InventoryTableColumns.IsAdSpecialRow] = e.RowIndex == _adSpecialIndex;
|
||||
break;
|
||||
case (int)SalesTableColumns.IsAdSpecialMember:
|
||||
//Check if this is a member of the ad special group.
|
||||
if (_adSpecialIndex != -1)
|
||||
{
|
||||
inventoryNewRow[(int) InventoryTableColumns.IsAdSpecialMember] = e.RowIndex > _adSpecialIndex;
|
||||
}
|
||||
else
|
||||
{
|
||||
inventoryNewRow[(int)InventoryTableColumns.IsAdSpecialMember] = false;
|
||||
}
|
||||
break;
|
||||
case (int)SalesTableColumns.IsDirty:
|
||||
inventoryNewRow[(int)InventoryTableColumns.IsDirty] = true;
|
||||
break;
|
||||
case (int)SalesTableColumns.IsInDatabase:
|
||||
inventoryNewRow[(int)InventoryTableColumns.IsInDatabase] = false;
|
||||
break;
|
||||
default:
|
||||
if (i > (int)InventoryTableColumns.AdItem && i < (int)InventoryTableColumns.IsHeaderRow || i == (int)InventoryTableColumns.Id)
|
||||
{
|
||||
@@ -1558,11 +1412,11 @@ namespace AdvertsingProfitControl
|
||||
string[] saleColumnNames =
|
||||
{
|
||||
"ID", "AdItem", "Sold", "SalePrice", "TotalSales", "Cost", "ProfitReturn",
|
||||
"TotalProfitReturn", "IsHeader", "IsMember", "IsAdSpecialRow", "IsAdSpecialMember", "IsDirty", "IsInDatabase"
|
||||
"TotalProfitReturn", "IsHeader", "IsMember", "IsDirty"
|
||||
};
|
||||
string[] inventoryColumnNames =
|
||||
{
|
||||
"ID", "AdItem", "BeginningInventory", "Received", "Total", "EndingInventory", "IsHeader", "IsMember", "IsAdSpecialRow", "IsAdSpecialMember", "IsDirty", "IsInDatabase"
|
||||
"ID", "AdItem", "BeginningInventory", "Received", "Total", "EndingInventory", "IsHeader", "IsMember", "IsDirty"
|
||||
};
|
||||
|
||||
foreach (var name in saleColumnNames)
|
||||
@@ -1766,10 +1620,6 @@ namespace AdvertsingProfitControl
|
||||
}
|
||||
#endregion
|
||||
|
||||
private void getCellValueDebugMainMenu_Click(object sender, EventArgs e)
|
||||
{
|
||||
}
|
||||
|
||||
private void AddRecordsButtonClick(object sender, EventArgs e)
|
||||
{
|
||||
//Make sure the mask in the text box is completed.
|
||||
@@ -1863,66 +1713,16 @@ namespace AdvertsingProfitControl
|
||||
//Create the cleaned table objects that will be sent to the database.
|
||||
DataTable trimmedTable;
|
||||
DataTable updateTable;
|
||||
DbWriterStatus dbWriterStatus;
|
||||
informationLabel.Text = @"Preparing data tables...";
|
||||
informationLabel.Text = @"Compressing data tables...";
|
||||
var operationStatus = ConstructCleanedSalesTable("Projections", dateId, out trimmedTable, out updateTable);
|
||||
switch (operationStatus)
|
||||
{
|
||||
case TrimmingOperationResult.NoChangesRequired:
|
||||
informationLabel.Text += Environment.NewLine + @"No changes for the Projections table detected.";
|
||||
break;
|
||||
case TrimmingOperationResult.CreatedNewInsertionTable:
|
||||
informationLabel.Text += Environment.NewLine + @"New table created.";
|
||||
dbWriterStatus = dbW.InsertIntoSalesTable(trimmedTable, dbT.DatabaseConnectionString);
|
||||
//Spin through the collection and update the affected rows.
|
||||
foreach (var rowIndex in dbWriterStatus.GetRowCollection())
|
||||
{
|
||||
projectionsDataGridView.Rows[rowIndex.Key - 1].Cells[(int)SalesTableColumns.Id].Value = rowIndex.Value;
|
||||
projectionsDataGridView.Rows[rowIndex.Key - 1].Cells[(int)SalesTableColumns.IsDirty].Value = false;
|
||||
projectionsDataGridView.Rows[rowIndex.Key - 1].Cells[(int)SalesTableColumns.IsInDatabase].Value = true;
|
||||
}
|
||||
break;
|
||||
case TrimmingOperationResult.CreatedUpdateTable:
|
||||
informationLabel.Text += Environment.NewLine + @"Updates required.";
|
||||
dbWriterStatus = dbW.UpdateSalesTable(updateTable, dbT.DatabaseConnectionString);
|
||||
//Spin through the collection and update the affected rows.
|
||||
foreach (var rowIndex in dbWriterStatus.GetRowCollection())
|
||||
{
|
||||
//Only reset the IsDirty value to false since the updates when through.
|
||||
projectionsDataGridView.Rows[rowIndex.Key - 1].Cells[(int)SalesTableColumns.IsDirty].Value = false;
|
||||
}
|
||||
break;
|
||||
case TrimmingOperationResult.CreatedNewInsertionAndUpdateTables:
|
||||
//Insert the new values...
|
||||
dbWriterStatus = dbW.InsertIntoSalesTable(trimmedTable, dbT.DatabaseConnectionString);
|
||||
//Spin through the collection and update the affected rows.
|
||||
foreach (var rowIndex in dbWriterStatus.GetRowCollection())
|
||||
{
|
||||
projectionsDataGridView.Rows[rowIndex.Key - 1].Cells[(int)SalesTableColumns.Id].Value = rowIndex.Value;
|
||||
projectionsDataGridView.Rows[rowIndex.Key - 1].Cells[(int)SalesTableColumns.IsDirty].Value = false;
|
||||
projectionsDataGridView.Rows[rowIndex.Key - 1].Cells[(int)SalesTableColumns.IsInDatabase].Value = true;
|
||||
}
|
||||
//... and update the existing values.
|
||||
dbWriterStatus = dbW.UpdateSalesTable(updateTable, dbT.DatabaseConnectionString);
|
||||
//Spin through the collection and update the affected rows.
|
||||
foreach (var rowIndex in dbWriterStatus.GetRowCollection())
|
||||
{
|
||||
//Only reset the IsDirty value to false since the updates when through.
|
||||
projectionsDataGridView.Rows[rowIndex.Key - 1].Cells[(int)SalesTableColumns.IsDirty].Value = false;
|
||||
}
|
||||
break;
|
||||
case TrimmingOperationResult.FailedToTrim:
|
||||
errorLabel.Text = @"Failed to trim.";
|
||||
informationLabel.Text = "";
|
||||
return;
|
||||
}
|
||||
ProcessTrimmingStatusResult(projectionsDataGridView, "Projections", operationStatus, trimmedTable, updateTable);
|
||||
//Create the transaction scope.
|
||||
//By default the TransactionScopeOption is "Required", so if an ambient transaction does not
|
||||
//exist then the new transaction that is made (in the first method) becomes the root transaction.
|
||||
//Transaction Scope: https://msdn.microsoft.com/en-us/library/ms172152.aspx
|
||||
}
|
||||
|
||||
#region APC Table Trimming
|
||||
#region Table Trimming Operations
|
||||
|
||||
private TrimmingOperationResult ConstructCleanedSalesTable(string tableName, int dateId, out DataTable insertNewTable, out DataTable updateExistingTable)
|
||||
{
|
||||
@@ -1978,7 +1778,6 @@ namespace AdvertsingProfitControl
|
||||
//Check to see if the current row is the ad special row.
|
||||
if (row.Index == _adSpecialIndex)
|
||||
{
|
||||
//LogConsole.WriteToLog(FrmLogConsole.Level.Verbose, "Ad Special Row found at index " + row.Index + ".");
|
||||
continue;
|
||||
}
|
||||
//Check to see if the row is dirty.
|
||||
@@ -2383,6 +2182,67 @@ namespace AdvertsingProfitControl
|
||||
}
|
||||
return TrimmingOperationResult.CreatedNewInsertionAndUpdateTables;
|
||||
}
|
||||
|
||||
private void ProcessTrimmingStatusResult(DataGridView dataGridView, string tableName, TrimmingOperationResult operationStatus, DataTable trimmedTable, DataTable updateTable)
|
||||
{
|
||||
//Create the database interaction objects.
|
||||
var dbT = new DatabaseTracker();
|
||||
var dbW = new DatabaseWriter(dbT.DatabaseConnectionString);
|
||||
DbWriterStatus dbWriterStatus;
|
||||
switch (operationStatus)
|
||||
{
|
||||
case TrimmingOperationResult.NoChangesRequired:
|
||||
informationLabel.Text += Environment.NewLine + @"No changes for the " + tableName + @" table detected.";
|
||||
break;
|
||||
case TrimmingOperationResult.CreatedNewInsertionTable:
|
||||
informationLabel.Text += Environment.NewLine + @"Inserting new changes to the " + tableName + @" table.";
|
||||
dbWriterStatus = dbW.InsertIntoSalesTable(trimmedTable, dbT.DatabaseConnectionString);
|
||||
//Spin through the collection and update the affected rows.
|
||||
foreach (var rowIndex in dbWriterStatus.GetRowCollection())
|
||||
{
|
||||
dataGridView.Rows[rowIndex.Key - 1].Cells[(int)SalesTableColumns.Id].Value = rowIndex.Value;
|
||||
dataGridView.Rows[rowIndex.Key - 1].Cells[(int)SalesTableColumns.IsDirty].Value = false;
|
||||
}
|
||||
informationLabel.Text += Environment.NewLine + tableName + @" table successfully added to the database.";
|
||||
break;
|
||||
case TrimmingOperationResult.CreatedUpdateTable:
|
||||
informationLabel.Text += Environment.NewLine + @"Updating changes made to the " + tableName + @" table.";
|
||||
dbWriterStatus = dbW.UpdateSalesTable(updateTable, dbT.DatabaseConnectionString);
|
||||
//Spin through the collection and update the affected rows.
|
||||
foreach (var rowIndex in dbWriterStatus.GetRowCollection())
|
||||
{
|
||||
//Only reset the IsDirty value to false since the updates when through.
|
||||
dataGridView.Rows[rowIndex.Key - 1].Cells[(int)SalesTableColumns.IsDirty].Value = false;
|
||||
}
|
||||
informationLabel.Text += Environment.NewLine + tableName + @" table successfully updated.";
|
||||
break;
|
||||
case TrimmingOperationResult.CreatedNewInsertionAndUpdateTables:
|
||||
//Insert the new values...
|
||||
informationLabel.Text += Environment.NewLine + @"Inserting new changes to the " + tableName + @" table.";
|
||||
dbWriterStatus = dbW.InsertIntoSalesTable(trimmedTable, dbT.DatabaseConnectionString);
|
||||
//Spin through the collection and update the affected rows.
|
||||
foreach (var rowIndex in dbWriterStatus.GetRowCollection())
|
||||
{
|
||||
dataGridView.Rows[rowIndex.Key - 1].Cells[(int)SalesTableColumns.Id].Value = rowIndex.Value;
|
||||
dataGridView.Rows[rowIndex.Key - 1].Cells[(int)SalesTableColumns.IsDirty].Value = false;
|
||||
}
|
||||
//... and update the existing values.
|
||||
informationLabel.Text += Environment.NewLine + @"Updating changes made to the " + tableName + @" table.";
|
||||
dbWriterStatus = dbW.UpdateSalesTable(updateTable, dbT.DatabaseConnectionString);
|
||||
//Spin through the collection and update the affected rows.
|
||||
foreach (var rowIndex in dbWriterStatus.GetRowCollection())
|
||||
{
|
||||
//Only reset the IsDirty value to false since the updates when through.
|
||||
dataGridView.Rows[rowIndex.Key - 1].Cells[(int)SalesTableColumns.IsDirty].Value = false;
|
||||
}
|
||||
informationLabel.Text += Environment.NewLine + @"All operations completed successfully.";
|
||||
break;
|
||||
case TrimmingOperationResult.FailedToTrim:
|
||||
errorLabel.Text = @"Failed to trim " + tableName + @".";
|
||||
informationLabel.Text = "";
|
||||
return;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user